All of lore.kernel.org
 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 20:15:32 -0600	[thread overview]
Message-ID: <4553E0C4.4010207@freescale.com> (raw)
In-Reply-To: <20061110002911.B12C23535D2@atlas.denx.de>

Wolfgang Denk wrote:
> Yes, but IIRC also contains information that is noit available in gd,
> and I don't want to extend gd if it can be avoided, a this  is  taken
> from very scarce resources.

Is the bd located immediately after the gd in memory?

>> bd->xxx and other code that uses gd->xxx, with no real consistence.  I think 
> 
> Actually, in most cases it makes some sense if you think longer about
> it. But I agree, it's not nice.

How about a rule that any function can write to bd_info (to initialize its 
contents), but only the do_bootm_xxx functions can read from it, and only to 
prepare it for passing to Linux.  This would eliminate code like this:

#define OF_TBCLK		(bd->bi_busfreq / 4)

and hopefully stuff like this:

	if ((s = getenv ("clocks_in_mhz")) != NULL) {
		/* convert all clock information to MHz */
		kbd->bi_intfreq /= 1000000L;
		kbd->bi_busfreq /= 1000000L;
#if defined(CONFIG_MPC8220)
	kbd->bi_inpfreq /= 1000000L;
	kbd->bi_pcifreq /= 1000000L;
	kbd->bi_pevfreq /= 1000000L;
	kbd->bi_flbfreq /= 1000000L;
	kbd->bi_vcofreq /= 1000000L;
#endif
#if defined(CONFIG_CPM2)
		kbd->bi_cpmfreq /= 1000000L;
		kbd->bi_brgfreq /= 1000000L;
		kbd->bi_sccfreq /= 1000000L;
		kbd->bi_vco     /= 1000000L;
#endif

In this case, I don't understand the clocks_in_mhz environment variable.  Is 
this something that we really want to be run-time configurable?

>> 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?
> 
> Did you try to implement this?

No, it's just something that occurred to me today while trying to resolve the 
OF_TBCLK problem.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

  reply	other threads:[~2006-11-10  2:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=4553E0C4.4010207@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 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.