[U-Boot] U-Boot hangs in start_armboot()

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.

Hello
2008/12/11 Roman Mashak romez777@gmail.com:
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:
Oops, I've found the part of problem. I should have been linked to 0x01000000. It's not hanging in 'start_armboot()', but it outputs garbage on console instead of valid text messages. I've checked serial port settings, seems to be correct. What else may be the issue?

On 20:37 Thu 11 Dec , Roman Mashak wrote:
Hello
2008/12/11 Roman Mashak romez777@gmail.com:
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:
Oops, I've found the part of problem. I should have been linked to 0x01000000. It's not hanging in 'start_armboot()', but it outputs garbage on console instead of valid text messages. I've checked serial port settings, seems to be correct. What else may be the issue?
First could you give us few information as which CPU, Target and U-Boot version do you work on?
Best Regards, J.

Hello
2008/12/11 Jean-Christophe PLAGNIOL-VILLARD plagnioj@jcrosoft.com: [skip]
First could you give us few information as which CPU, Target and U-Boot version do you work on?
Certainly.
* CPU is arm926ejs based processor with standard peripherals (UART, I2C, timers etc.) * our custom board * U-Boot-1.3.4

Hello
2008/12/12 Roman Mashak romez777@gmail.com:
Certainly.
- CPU is arm926ejs based processor with standard peripherals (UART,
I2C, timers etc.)
- our custom board
- U-Boot-1.3.4
Forgot to mention the serial settings in my board's configuration file:
#define CONFIG_BAUDRATE 115200 #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } #define CFG_SERIAL0 0xFE000000 #define CFG_SERIAL1 0xFE100000
So I believe 'default_environment[]' has correct "baudrate" environment set and on startup it will be picked up by 'init_baudrate()' from $(UBOOT)/lib_arm/board.c

Hello
2008/12/12 Roman Mashak romez777@gmail.com: [skip]
So I believe 'default_environment[]' has correct "baudrate" environment set and on startup it will be picked up by 'init_baudrate()' from $(UBOOT)/lib_arm/board.c
Problem is fixed, it was due to a bug in the function configuring clock frequency, which resulted in an invalid settings of serial port.
participants (2)
-
Jean-Christophe PLAGNIOL-VILLARD
-
Roman Mashak