From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 17 Aug 2009 23:52:09 +0200 Subject: [U-Boot] [PATCH 3/3 v4] arm: A320: Add support for Faraday A320 evaluation board In-Reply-To: References: <20090708113044.GO30395@game.jcrosoft.org> Message-ID: <20090817215209.GG23695@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 14:13 Thu 06 Aug , Po-Yu Chuang wrote: > Dear Jean-Christophe, > > 2009/7/8 Jean-Christophe PLAGNIOL-VILLARD : > >> +.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. :-) why not but show us the code please and we will see Best Regards, J.