[U-Boot-Users] [Fwd: [PATCH] Add Uboot ASMP suport for MPC8641D]

Stefan Roese sr at denx.de
Wed Mar 21 17:07:40 CET 2007


Hi Jon,

On Wednesday 21 March 2007 16:08, Jon Loeliger wrote:
> As I indicated to you on IRC a few days ago, here is the
> U-Boot patch to support Asymmetric Multi-Processors on 8641 HPCN.
> This corresponds to the patch I also just posted to the
> linuxppc-dev list as well.

<snip>

> diff --git a/drivers/serial.c b/drivers/serial.c
> index 76425d8..15cf0ae 100644
> --- a/drivers/serial.c
> +++ b/drivers/serial.c
> @@ -153,6 +153,11 @@ int serial_init (void)
>  {
>  	int clock_divisor;
>
> +#ifdef CONFIG_ASMP
> +	if (gd->pir ==1)
> +		return 0;
> +#endif
> +
>  #ifdef CFG_NS87308
>  	initialise_ns87308();
>  #endif
> @@ -233,7 +238,11 @@ serial_putc_dev(unsigned int dev_index,const char c)
>  void
>  serial_putc(const char c)
>  {
> +#ifdef CONFIG_ASMP
> +	_serial_putc(c,CONFIG_CONS_INDEX + gd->pir);
> +#else
>  	_serial_putc(c,CONFIG_CONS_INDEX);
> +#endif
>  }
>  #endif

Isn't there a clever way not to add all those new #ifdef's?

o We could always use gd->pir, even if CONFIG_ASMP is
  not enabled and initialize it to 0. This of course would
  increase the size for all targets a little which generally
  not good.

o Use a macro which doesn't generate any additional code

Any good ideas?

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, HRB 165235 Munich, CEO: Wolfgang Denk
Office:  Kirchenstr. 5,       D-82194 Groebenzell,            Germany
=====================================================================




More information about the U-Boot mailing list