public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] bd_info vs. global_data
@ 2006-11-09 23:13 Timur Tabi
  2006-11-10  0:29 ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Timur Tabi @ 2006-11-09 23:13 UTC (permalink / raw)
  To: u-boot

In looking at OF_TBCLK-related code, I noticed that U-Boot has what is 
basically two structures that contain a variety of "global" data, global_data 
and bd_info.  There are a number of fields in bd_info that also exist in 
global_data and contain the same value.  For instance, we have this in 
board_init_f():

	bd->bi_inpfreq   = gd->inp_clk;
	bd->bi_pcifreq   = gd->pci_clk;
	bd->bi_vcofreq   = gd->vco_clk;
	bd->bi_pevfreq   = gd->pev_clk;
	bd->bi_flbfreq   = gd->flb_clk;

 From my understanding, the bd_info structure is passed to the kernel as a 
binary blob, whereas the the global_data structure is used internally by 
U-Boot to store global data.  Obviously, we can't get rid of one or the other.

Wouldn't it be better if the bd_info structure were created and initialized 
only when Linux is about to be booted?  Currently, we have some code that uses 
bd->xxx and other code that uses gd->xxx, with no real consistence.  I think 
the bd_info structure should be local to cmd_bootm.c, and should be allocated 
and initialized only if we're booting a non-OF version of Linux.  This would 
eliminate using bd-> for anything other than booting non-OF Linux.

Comments?

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

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

end of thread, other threads:[~2006-11-10 23:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-09 23:13 [U-Boot-Users] bd_info vs. global_data Timur Tabi
2006-11-10  0:29 ` Wolfgang Denk
2006-11-10  2:15   ` Timur Tabi
2006-11-10 14:33     ` Wolfgang Denk
2006-11-10 16:38       ` Timur Tabi
2006-11-10 23:03         ` Wolfgang Denk

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