[U-Boot] [PATCH 3/3 v4] arm: A320: Add support for Faraday A320 evaluation board

Po-Yu Chuang ratbert.chuang at gmail.com
Thu Aug 6 08:13:35 CEST 2009


Dear Jean-Christophe,

2009/7/8 Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>:
>> +.globl lowlevel_init
>> +lowlevel_init:
>> +     mov     r11, lr
>> +
>> +     led     0x0
>> +
>> +     /* if REMAP bit is set -> memory had been initialzed */
>> +
>> +     ldr     r0, =CONFIG_SYS_AHBC_BASE
>> +     ldr     r1, [r0, #FTAHBC020_OFFSET_ICR]
>> +     tst     r1, #FTAHBC020_ICR_REMAP                @ test REMAP bit
>> +     bne     skip_remap
>> +
>> +     led     0x1
>> +
>> +     bl      init_sdmc
>> +
>> +     led     0x2
>> +
>> +     /*
>> +      * copy U-Boot to RAM
>> +      */
>> +copy_code:
>> +     ldr     r0, =ROM_DEFAULT_BASE   /* r0 <- source address     */
>> +     ldr     r1, =SDRAM_DEFAULT_BASE /* r1 <- target address     */
>> +
>> +     ldr     r2, .LC5
>> +     ldr     r3, .LC6
>> +     sub     r2, r3, r2              /* r2 <- size of armboot            */
>> +     add     r2, r0, r2              /* r2 <- source end address         */
>> +
>> +     led     0x3
>> +
>> +copy_loop:
>> +     ldmia   r0!, {r3-r10}           /* copy from source address [r0]    */
>> +     stmia   r1!, {r3-r10}           /* copy to   target address [r1]    */
>> +     cmp     r0, r2                  /* until source end addreee [r2]    */
>> +     ble     copy_loop
>> +
> I do not like to do this twice we need to find an otherway
> do we really need to run in SDRAM before remap?

I am afraid so.
u-boot needs to be copied to SDRAM first to do the remap
(swap ROM and SDRAM bank) to make SDRAM base becomes 0x0.
cpu/arm920t/start.S then relocates u-boot to the end of SDRAM.

Anyway, I have an idea now.
I can submit a version that do not do the bank swap
(SDRAM stays at 0x10000000).

The the mainline keeps beautiful as you wish.
Then I create another patch to do the bank swap for our internal use.

This should be a win-win. :-)


best regards,
Po-Yu Chuang


More information about the U-Boot mailing list