[U-Boot] [PATCH v2 1/3] MX31: Add NAND SPL for i.MX31.

Magnus Lilja lilja.magnus at gmail.com
Sun May 10 21:31:06 CEST 2009


2009/5/9 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>:
> On 21:56 Sun 03 May     , Magnus Lilja wrote:
>> @@ -32,7 +35,7 @@
>>  #include <version.h>
>>  .globl _start
>>  _start: b    reset
>> -#ifdef CONFIG_ONENAND_IPL
>> +#if defined(CONFIG_ONENAND_IPL) || defined(CONFIG_NAND_SPL)
> create a better CONFIG_
> because we could need for other boot mode

A better CONFIG_ than what? CONFIG_NAND_SPL is already used elsewhere
in U-boot when booting from NAND.

>>       ldr     pc, _hang
>>       ldr     pc, _hang
>>       ldr     pc, _hang
>> @@ -156,9 +159,9 @@ relocate:                         /* relocate U-Boot to RAM           */
>>       adr     r0, _start              /* r0 <- current position of code   */
>>       ldr     r1, _TEXT_BASE          /* test if we run from flash or RAM */
>>       cmp     r0, r1                  /* don't reloc during debug         */
>> -#ifndef CONFIG_ONENAND_IPL
>> +#if !defined(CONFIG_ONENAND_IPL) && !defined(CONFIG_NAND_SPL)
>>       beq     stack_setup
>> -#endif       /* CONFIG_ONENAND_IPL */
>> +#endif       /* !CONFIG_ONENAND_IPL && !CONFIG_NAND_SPL*/
>>
>>  #endif       /* CONFIG_ONENAND_IPL */
>> +
> <snip>
>> diff --git a/nand_spl/nand_boot_mx31.c b/nand_spl/nand_boot_mx31.c
>> new file mode 100644
>> index 0000000..d698d2a
>> --- /dev/null
>> +++ b/nand_spl/nand_boot_mx31.c
>> @@ -0,0 +1,223 @@
> <snip>
>> +static void mx31_nand_page_address(unsigned int page_address)
>> +{
>> +     unsigned int page_count;
>> +
>> +     writew(0x00, NFC_FLASH_ADDR);
>> +     writew(NFC_ADDR, NFC_CONFIG2);
>> +     mx31_wait_ready();
>> +
>> +     /* code only for 2kb flash */
>> +     if (CFG_NAND_PAGE_SIZE == 0x800) {
>> +             writew(0x00, NFC_FLASH_ADDR);
>> +             writew(NFC_ADDR, NFC_CONFIG2);
>> +             mx31_wait_ready();
>> +     }
>> +
>> +     page_count = CFG_NAND_CHIP_SIZE / CFG_NAND_PAGE_SIZE;
> please use CONFIG_SYS_ or CONFIG_

Will do.

> and why not detect it?

Might be possible, I'll look into it to see if it's doable.


Thanks; Magnus


More information about the U-Boot mailing list