[U-Boot] [PATCH v2 1/3] 86xx: Cleanup MP support

Wolfgang Denk wd at denx.de
Wed Apr 1 21:00:11 CEST 2009


Dear Kumar Gala,

In message <1238601989-6251-1-git-send-email-galak at kernel.crashing.org> you wrote:
> * Use CONFIG_MP instead of CONFIG_NUM_CPUS to match 85xx
> * Introduce determine_mp_bootpg() helper.  We'll need this to address a
>   bug introduced in v2009.03 with 86xx MP booting.  We have to make sure
>   to reserve the region of memory used for the MP bootpg() so other
>   u-boot code doesn't use it.
> * Added dummy versions of cpu_status() & cpu_release() to allow cmd_mp.c
>   to build and work.  In the future we should look at implementing
>   cpu_release().  This could be common w/85xx if we use spin tables on
>   86xx.
...
> diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
> index 1e35dfa..ef0095a 100644
> --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c
> +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c
> @@ -375,7 +375,7 @@ void board_reset(void)
>  		;
>  }
>  
> -#if (CONFIG_NUM_CPUS > 1)
> +#ifdef CONFIG_MP
>  extern void cpu_mp_lmb_reserve(struct lmb *lmb);

We should have a prototype somewhere, and get rid of this extern.

...
> diff --git a/cpu/mpc86xx/Makefile b/cpu/mpc86xx/Makefile
> index 34a9755..f1af64e 100644
> --- a/cpu/mpc86xx/Makefile
> +++ b/cpu/mpc86xx/Makefile
> @@ -31,10 +31,9 @@ LIB	= $(obj)lib$(CPU).a
>  START	= start.o
>  SOBJS	= cache.o
>  
> -ifneq ($(CONFIG_NUM_CPUS),1)
> -COBJS-y += mp.o
> -SOBJS += release.o
> -endif
> +SOBJS-$(CONFIG_MP) += release.o
> +SOBJS	+= $(SOBJS-y)
> +COBJS-$(CONFIG_MP) += mp.o
>  COBJS-y	+= traps.o
>  COBJS-y	+= cpu.o
>  COBJS-y	+= cpu_init.o

Please keep list sorted.

...
> diff --git a/cpu/mpc86xx/mp.c b/cpu/mpc86xx/mp.c
> index 5014401..e17f5e1 100644
> --- a/cpu/mpc86xx/mp.c
> +++ b/cpu/mpc86xx/mp.c
> @@ -8,16 +8,42 @@
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> -#if (CONFIG_NUM_CPUS > 1)
> -void cpu_mp_lmb_reserve(struct lmb *lmb)
> +int cpu_reset(int nr)
> +{
> +	volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
> +	volatile ccsr_pic_t *pic = &immr->im_pic;
> +	out_be32(&pic->pir, 1 << nr);
> +	(void)in_be32(&pic->pir);
> +	out_be32(&pic->pir, 0x0);

Please add some comment to explain what you are doing here, and why.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
An age is called Dark not because  the  light  fails  to  shine,  but
because people refuse to see it.           -- James Michener, "Space"


More information about the U-Boot mailing list