[U-Boot] [PATCH 1/2] mpc8308: support for Freescale MPC8308 cpu

Wolfgang Denk wd at denx.de
Mon Jun 21 09:44:34 CEST 2010


Dear Ilya Yanok,

In message <1277055168-18596-2-git-send-email-yanok at emcraft.com> you wrote:
> This patch adds basic support for Freescale MPC8308 CPU. Serial ports,
> NOR flash and integrated Ethernet controllers are supported.
> PCI Express is also supported. eSDHC, NAND and USB may work but aren't
> tested (using ULPI PHY requires additional patch).
> 
> Signed-off-by: Ilya Yanok <yanok at emcraft.com>
...
> -#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
> +#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x) || \
> +	defined(CONFIG_MPC8315) || defined(CONFIG_MPC8308)

Please sort this list.

> -#elif defined(CONFIG_MPC8315)
> +#elif defined(CONFIG_MPC8315) || defined(CONFIG_MPC8308)

Ditto.

> -#elif defined(CONFIG_MPC8315)
> +#elif defined(CONFIG_MPC8315) || defined(CONFIG_MPC8308)

Ditto. ... and so on.

> +#if defined(CONFIG_MPC8308)
> +#define SCCR_SDHCCM			0x0c000000
> +#define SCCR_SDHCCM_SHIFT		26
> +#define SCCR_SDHCCM_0			0x00000000
> +#define SCCR_SDHCCM_1			0x04000000
> +#define SCCR_SDHCCM_2			0x08000000
> +#define SCCR_SDHCCM_3			0x0c000000
> +#endif

Would it make sense to write this as:

And: why do we need the #ifdef? Unused defines should not hurt?

	#define SCCR_SDHCCM_MASK	0x0c000000	/* is it a mask? */
	#define SCCR_SDHCCM_SHIFT	26
	#define SCCR_SDHCCM(arg)	((arg)<<SCCR_SDHCCM_SHIFT)


>  #define SCCR_USBDRCM			0x00c00000
>  #define SCCR_USBDRCM_SHIFT		22
>  #define SCCR_USBDRCM_0			0x00000000
> @@ -757,6 +767,7 @@
>  #define SCCR_USBDRCM_2			0x00800000
>  #define SCCR_USBDRCM_3			0x00c00000

Ah, I see you just follow precedent code. If Kim accepts this, I'm
fine with it, too.

> +#if defined(CONFIG_MPC8315)
>  #define SCCR_SATA1CM			0x00003000
>  #define SCCR_SATA1CM_SHIFT		12
>  #define SCCR_SATACM			0x00003c00
> @@ -765,6 +776,7 @@
>  #define SCCR_SATACM_1			0x00001400
>  #define SCCR_SATACM_2			0x00002800
>  #define SCCR_SATACM_3			0x00003c00
> +#endif

Do we need that #ifdef? Ok, the #defines don't apply to the 8308, but
do they hurt if they are just there, unused?

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
The world is no nursery.                              - Sigmund Freud


More information about the U-Boot mailing list