
Hello
I've just come across a problem. I have ARM-based board with its originally shipped bootloader (not U-Boot, and having less functionality) placed in NOR flash. However it initializes CPU, memory controller, does remap.
Briefly about the memory map: before remap NOR flash is at 0x0 and SDRAM 0x10000000, after remap -- SDRAM is mapped at 0x0. I've built a U-Boot image linked to 0x0, as I want to load it in RAM, so I linked it to 0x0.
Loading this image via JTAG into target RAM goes fine, but hangs at 'start_armboot()', right after:
gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t)); ... memset ((void*)gd, 0, sizeof (gd_t));
My investigations show that '_armboot_start' being equal to '_start' is 0x0, CFG_MALLOC_LEN is defined in my board configuration:
#define CFG_ENV_SIZE 0x10000 #define CFG_MALLOC_LEN (CFG_ENV_SIZE + 128*1024)
It turns out that "(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t))" is negative and converted to 0xffffffff which is certainly wrong.
Where's the mistake -- link address or something else?
Thanks in advance.