All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] CONFIG_BOOTBINFUNC for AT91RM9200
@ 2004-11-23 14:11 Steven Scholz
  2004-11-23 15:42 ` Steven Scholz
  2004-11-23 15:45 ` Wolfgang Denk
  0 siblings, 2 replies; 15+ messages in thread
From: Steven Scholz @ 2004-11-23 14:11 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

you wrote:

 > Instead of doing all  this  which  is  really  non-trivial  and  also
 > ineffficient you could just boot from flash. I've just checked in the
 > necessary patches for the AT91RM9200DK and CMC_PU2 boards ...

IIUC then part of this code is in cpu/at91rm9200/start.S wrapped in #ifdef 
CONFIG_BOOTBINFUNC.

As you know I'd like to move the at91rm9200 stuff into cpu/arm920t/at91rm9200.
The start.S already calls memsetup if CONFIG_INIT_CRITICAL is defined.

Do you mind moving out the at91 specific stuff?
You already call something like lowlevelinit. Clock init could be done there.

So I'd like to move out the clock specific stuff into
a) board depended memsetup.S or clocksetup.S or
b) a cpu dependend cpu/(arm920t/)at91rm9200/clock.{c,S}.

What do you think?

And:
I don't think CONFIG_BOOTBINFUNC is a good name!
U-Boot should not "include the functionality of boot.bin in u-boot" but include 
lowlevel, hardware dependend init functionality!
I don't know why Atmel introduced this two stage boot process with gzipped 
compressed u-boot images without clock or memory setup functions.
And actually I don't wanna know.
There already is CONFIG_INIT_CRITICAL. We can add CONFIG_INIT_CLOCKS or 
CONFIG_INIT_MEMORY or CONFIG_INIT_SDRAM or CONFIG_INIT_LOWLEVEL...

regards,

Steven Scholz

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [U-Boot-Users] CONFIG_BOOTBINFUNC for AT91RM9200
@ 2004-11-24  7:46 Friedrich, Lars
  2004-11-24 10:26 ` Wolfgang Denk
  0 siblings, 1 reply; 15+ messages in thread
From: Friedrich, Lars @ 2004-11-24  7:46 UTC (permalink / raw)
  To: u-boot

> > Why is that so bad? It makes it possible to debug U-Boot
> > with just loading the image into RAM using BDI2000.
> Which is an unsupported mode of operation which works for a handfull
> of experts and causes confusion with many, many newbees.

How do these lines of code confuse a newbie more than any other code
in the file?

> > But how would you debug U-Boot?
> As I always do. Attach the BDI, burn to flash, start in GDB.

There are 53982 other hardware debuggers out there and only the
minority (is there actually one besides the BDI?) support the
burn to flash feature you rely on. So if you need to start U-Boot
to flash U-Boot, you either do those few lines of code to skip
the relocation or get/use another piece of actually redundant
software to get the image on the flash. I don't know why the
latter should save me time.

> You can do this if you know exactly what you're doing,

Isn't this what is assumed here anyway?

Best regards,
Lars Friedrich

-- 

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [U-Boot-Users] CONFIG_BOOTBINFUNC for AT91RM9200
@ 2004-11-24 10:54 Paugam Luc
  0 siblings, 0 replies; 15+ messages in thread
From: Paugam Luc @ 2004-11-24 10:54 UTC (permalink / raw)
  To: u-boot

Dear Steven & Wolfgang,

There is perhaps a confusion between _relocation_ and _copy_.

Beware to the fact that actually the AT91RM9200 starter code (especially 
start.S) does not relocate any code from Flash to RAM (as we can see it
into PowerPC starter code, for example) but rather do a simple copy of 
u-boot code from Flash to RAM.

_TEXT_BASE is still defined with a RAM address!

This way to do is unfortunately inherited from ATMEL with their 2 stages boot process.

Regards - Luc

> -----Original Message-----
> From: u-boot-users-admin at lists.sourceforge.net
> [mailto:u-boot-users-admin at lists.sourceforge.net]On Behalf Of Wolfgang
> Denk
> Sent: mardi 23 novembre 2004 17:43
> To: Steven Scholz
> Cc: u-boot-users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] CONFIG_BOOTBINFUNC for AT91RM9200 
> 
> 
> In message <41A35A7E.1020605@imc-berlin.de> you wrote:
> > 
> > is there a standard way in U-Boot to prevent to the startup 
> code from relocating 
> > into RAM?
> 
> No. U-Boot will always relocate itself to RAM. Well, nearly always  -
> in any halfway sane implementation.
> 
> > I know that arm920t figures out the currebt address. 
> compares it to _TEXT_BASE 
> > and decides wether to relocate or not.
> > 
> > relocate:				/* relocate U-Boot to 
> RAM	    */
> > 	adr	r0, _start		/* r0 <- current 
> position of code   */
> > 	ldr	r1, _TEXT_BASE		/* test if we run from 
> flash or RAM */
> > 	cmp     r0, r1                  /* don't reloc during 
> debug         */
> 
> I wish that code was never written.
> 
> > So there might be no need for a define like 
> CFG_DONT_RELOCATE. But how about 
> > other cpus?
> 
> All CPUs always relocate the code to RAM. This is the  general  case.
> Anything else is not supported.
> 
> > (I am asking cause you wrapped the relocate code in 
> cpu/at91rm9200/start.S with 
> > CONFIG_BOOTBINFUNC instead of using the above technique.
> 
> Please consider the CONFIG_BOOTBINFUNC as an optimization  of  effort
> and  effect (read: quick & dirty hack). Feel free to clean up as long
> the result is working code, too.
> 
> Best regards,
> 
> Wolfgang Denk
> 
> -- 
> Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> Fools ignore complexity. Pragmatists suffer it. Some  can  avoid  it.
> Geniuses remove it.
>      - Perlis's Programming Proverb #58, SIGPLAN Notices, Sept.  1982
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from 
> real users.
> Discover which products truly live up to the hype. Start reading now. 
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 

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

end of thread, other threads:[~2004-11-24 15:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-23 14:11 [U-Boot-Users] CONFIG_BOOTBINFUNC for AT91RM9200 Steven Scholz
2004-11-23 15:42 ` Steven Scholz
2004-11-23 16:42   ` Wolfgang Denk
2004-11-23 16:51     ` Steven Scholz
2004-11-23 17:18       ` Wolfgang Denk
2004-11-23 15:45 ` Wolfgang Denk
2004-11-23 15:51   ` Steven Scholz
2004-11-23 16:52     ` Wolfgang Denk
2004-11-23 17:01       ` Steven Scholz
2004-11-23 17:23         ` Wolfgang Denk
2004-11-24 12:54           ` Steven Scholz
2004-11-24 15:06             ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2004-11-24  7:46 Friedrich, Lars
2004-11-24 10:26 ` Wolfgang Denk
2004-11-24 10:54 Paugam Luc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.