public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] U-Boot hangs in start_armboot()
@ 2008-12-11 11:01 Roman Mashak
  2008-12-11 11:37 ` Roman Mashak
  0 siblings, 1 reply; 6+ messages in thread
From: Roman Mashak @ 2008-12-11 11:01 UTC (permalink / raw)
  To: u-boot

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.

-- 
Roman Mashak

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] U-Boot hangs in start_armboot()
  2008-12-11 11:01 [U-Boot] U-Boot hangs in start_armboot() Roman Mashak
@ 2008-12-11 11:37 ` Roman Mashak
  2008-12-11 11:53   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 6+ messages in thread
From: Roman Mashak @ 2008-12-11 11:37 UTC (permalink / raw)
  To: u-boot

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?

-- 
Roman Mashak

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] U-Boot hangs in start_armboot()
  2008-12-11 11:37 ` Roman Mashak
@ 2008-12-11 11:53   ` Jean-Christophe PLAGNIOL-VILLARD
  2008-12-11 23:14     ` Roman Mashak
  0 siblings, 1 reply; 6+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-12-11 11:53 UTC (permalink / raw)
  To: u-boot

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] U-Boot hangs in start_armboot()
  2008-12-11 11:53   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-12-11 23:14     ` Roman Mashak
  2008-12-12  0:30       ` Roman Mashak
  0 siblings, 1 reply; 6+ messages in thread
From: Roman Mashak @ 2008-12-11 23:14 UTC (permalink / raw)
  To: u-boot

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

-- 
Roman Mashak

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] U-Boot hangs in start_armboot()
  2008-12-11 23:14     ` Roman Mashak
@ 2008-12-12  0:30       ` Roman Mashak
  2008-12-12  4:53         ` Roman Mashak
  0 siblings, 1 reply; 6+ messages in thread
From: Roman Mashak @ 2008-12-12  0:30 UTC (permalink / raw)
  To: u-boot

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

-- 
Roman Mashak

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] U-Boot hangs in start_armboot()
  2008-12-12  0:30       ` Roman Mashak
@ 2008-12-12  4:53         ` Roman Mashak
  0 siblings, 0 replies; 6+ messages in thread
From: Roman Mashak @ 2008-12-12  4:53 UTC (permalink / raw)
  To: u-boot

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.

-- 
Roman Mashak

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-12  4:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 11:01 [U-Boot] U-Boot hangs in start_armboot() Roman Mashak
2008-12-11 11:37 ` Roman Mashak
2008-12-11 11:53   ` Jean-Christophe PLAGNIOL-VILLARD
2008-12-11 23:14     ` Roman Mashak
2008-12-12  0:30       ` Roman Mashak
2008-12-12  4:53         ` Roman Mashak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox