From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Date: Thu, 09 Nov 2006 20:15:32 -0600 Subject: [U-Boot-Users] bd_info vs. global_data In-Reply-To: <20061110002911.B12C23535D2@atlas.denx.de> References: <20061110002911.B12C23535D2@atlas.denx.de> Message-ID: <4553E0C4.4010207@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.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