public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] bd_info vs. global_data
Date: Thu, 09 Nov 2006 17:13:17 -0600	[thread overview]
Message-ID: <4553B60D.3030901@freescale.com> (raw)

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

             reply	other threads:[~2006-11-09 23:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 23:13 Timur Tabi [this message]
2006-11-10  0:29 ` [U-Boot-Users] bd_info vs. global_data 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4553B60D.3030901@freescale.com \
    --to=timur@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox