[U-Boot-Users] [PATCH 3/3] mpc83xx: cleanup System Part and Revision ID Register (SPRIDR) code

Joakim Tjernlund Joakim.Tjernlund at transmode.se
Fri Mar 28 21:01:30 CET 2008


> -----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 <joakim.tjernlund at transmode.se> 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






More information about the U-Boot mailing list