From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joakim Tjernlund Date: Fri, 28 Mar 2008 21:01:30 +0100 Subject: [U-Boot-Users] [PATCH 3/3] mpc83xx: cleanup System Part and Revision ID Register (SPRIDR) code In-Reply-To: <20080328122933.d0489663.kim.phillips@freescale.com> References: <20080328101907.48eff39d.kim.phillips@freescale.com> <1206718463.7589.345.camel@gentoo-jocke.transmode.se> <20080328122933.d0489663.kim.phillips@freescale.com> Message-ID: <013901c8910e$8416b730$8c442590$@Tjernlund@transmode.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > -----Original Message----- > From: Kim Phillips [mailto:kim.phillips at freescale.com] > Sent: den 28 mars 2008 18:30 > To: joakim.tjernlund at transmode.se > Cc: u-boot-users at lists.sourceforge.net > Subject: Re: [U-Boot-Users] [PATCH 3/3] mpc83xx: cleanup System Part and Revision ID Register (SPRIDR) > code > > On Fri, 28 Mar 2008 16:34:23 +0100 > Joakim Tjernlund wrote: > > > > > Global data, could become a problem if/when full relocation is impl. Not > > a big deal, just figured I should mention it. > > would you rather something like this then? : > > diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c > index c878268..36de78d 100644 > --- a/cpu/mpc83xx/cpu.c > +++ b/cpu/mpc83xx/cpu.c > @@ -35,32 +35,6 @@ > > DECLARE_GLOBAL_DATA_PTR; > > -struct cpu_type { > - char name[15]; > - u32 partid; > -}; > - > -#define CPU_TYPE_ENTRY(x) {#x, SPR_##x} > - > -struct cpu_type cpu_type_list [] = { > - CPU_TYPE_ENTRY(8311), > - CPU_TYPE_ENTRY(8313), > - CPU_TYPE_ENTRY(8314), > - CPU_TYPE_ENTRY(8315), > - CPU_TYPE_ENTRY(8321), > - CPU_TYPE_ENTRY(8323), > - CPU_TYPE_ENTRY(8343), > - CPU_TYPE_ENTRY(8347_TBGA_), > - CPU_TYPE_ENTRY(8347_PBGA_), > - CPU_TYPE_ENTRY(8349), > - CPU_TYPE_ENTRY(8358_TBGA_), > - CPU_TYPE_ENTRY(8358_PBGA_), > - CPU_TYPE_ENTRY(8360), > - CPU_TYPE_ENTRY(8377), > - CPU_TYPE_ENTRY(8378), > - CPU_TYPE_ENTRY(8379), > -}; > - > int checkcpu(void) > { > volatile immap_t *immr; > @@ -70,6 +44,29 @@ int checkcpu(void) > char buf[32]; > int i; > > +#define CPU_TYPE_ENTRY(x) {#x, SPR_##x} > + const struct cpu_type { > + char name[15]; > + u32 partid; > + } cpu_type_list [] = { > + CPU_TYPE_ENTRY(8311), > + CPU_TYPE_ENTRY(8313), > + CPU_TYPE_ENTRY(8314), > + CPU_TYPE_ENTRY(8315), > + CPU_TYPE_ENTRY(8321), > + CPU_TYPE_ENTRY(8323), > + CPU_TYPE_ENTRY(8343), > + CPU_TYPE_ENTRY(8347_TBGA_), > + CPU_TYPE_ENTRY(8347_PBGA_), > + CPU_TYPE_ENTRY(8349), > + CPU_TYPE_ENTRY(8358_TBGA_), > + CPU_TYPE_ENTRY(8358_PBGA_), > + CPU_TYPE_ENTRY(8360), > + CPU_TYPE_ENTRY(8377), > + CPU_TYPE_ENTRY(8378), > + CPU_TYPE_ENTRY(8379), > + }; > + > immr = (immap_t *)CFG_IMMR; > > puts("CPU: "); > > Kim It is still global data, but the const makes it smaller and should be there if accepted. Like I said, it is just a minor comment as u-boot isn't ready for full relocation yet. BTW, what happened to relocation stuff Grant was doing? It is still disabled, I never had any problems so perhaps time to turn it on again? it might even make u-boot smaller once all the old manuel relocation code has been properly disabled. Jocke