[U-Boot] [RFC][PATCH v2 17/19] arm cp15: setup mmu and enable dcache

Ben Gardiner bengardiner at nanometrics.ca
Tue Aug 10 19:45:56 CEST 2010


On Fri, Aug 6, 2010 at 12:44 PM, Ben Gardiner
<bengardiner at nanometrics.ca> wrote:
> On Fri, Aug 6, 2010 at 12:32 PM, Reinhard Meyer
> <reinhard.meyer at emk-elektronik.de> wrote:
>> The value loaded into SP is IN the location at PC+808... look there.
>>>
>>> About in 0xc1080078+0x0328 give or take a word.
>>>
>>
>> And well, the location is mentioned right behind the ;
>>
>> c1080078:       e59fd328        ldr     sp, [pc, #808]  ; c10803a8
>> <fiq+0x48>
>
> Right. My mistake.
>
> Thank you Reinhard and Wolfgang for helping me out here. The values at
> the location c10803a8 are correct in all cases.
>
> I guess I will definitely need to use a jtag debugger here to figure
> out what's going wrong.

I did get an openocd debugger going with uboot on the da850 (see the
post to the openocd dev list for the board and target configuration
files for the da850 and omapl138 [1]).

It looks like execution goes off into the weeds at
arch/arm/cpu/arm926ejs/start.S:294

288             ldr     r2, _board_init_r
289             sub     r2, r2, r0
290             add     r2, r2, r7      /* position from board_init_r in RAM */
291             /* setup parameters for board_init_r */
292             mov     r0, r5          /* gd_t */
293             mov     r1, r7          /* dest_addr */
294             /* jump to it ... */
295             mov     lr, r2
296             mov     pc, lr

board_init_r == 0xc10804e4 , $r0 == 0xc1080000 and $r7 == 0x7fff0000

It turns out that the region I have assigned to CONFIG_SYS_SDRAM_BASE
(0x80000000) was reading as all 0' so even though get_ram_size was
returning 128M to dram_init, storing it in gd->ram_size didn't work.
Ditto for CONFIG_SYS_SDRAM_BASE set to 0xffff0000. I think this means
that only the DDR is available when UBL hands-off to u-boot.

I tried putting the initial stack pointer in DDR with:
#define CONFIG_SYS_SDRAM_BASE           0xc0000000
#define CONFIG_SYS_INIT_SP_ADDR         (0xc0700000 - 16)

and found that I could get the furthest into booting if I also did:
#define CONFIG_SKIP_RELOCATE_UBOOT and
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index cb27cee..a228b53 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -286,8 +286,10 @@ _nand_boot: .word nand_boot
 #else
        ldr     r0, _TEXT_BASE
        ldr     r2, _board_init_r
+#ifndef CONFIG_SKIP_RELOCATE_UBOOT
        sub     r2, r2, r0
        add     r2, r2, r7      /* position from board_init_r in RAM */
+#endif /* #ifndef CONFIG_SKIP_RELOCATE_UBOOT */
        /* setup parameters for board_init_r */
        mov     r0, r5          /* gd_t */
        mov     r1, r7          /* dest_addr */

along with:
#define CONFIG_RELOC_FIXUP_WORKS

to avoid some of the reloc stuff in arch/arm/lib/board.c. But then the
boot fails because the serial device cannot be registered as stdout
because calloc fails which results in an invalid puts function
pointer.

I'm not sure what to try next -- any help would be appreciated.

Best Regards,
Ben Gardiner

[1] http://permalink.gmane.org/gmane.comp.debugging.openocd.devel/13873

---
Nanometrics Inc.
http://www.nanometrics.ca


More information about the U-Boot mailing list