[PATCH] Use clock freqency from the device tree to calculate correct MPC5200 PSC clock.

Grant Likely grant.likely at secretlab.ca
Sat Aug 8 04:49:34 EST 2009


On Fri, Aug 7, 2009 at 12:41 PM, Jon Smirl<jonsmirl at gmail.com> wrote:
> Use clock freqency from the device tree to calculate correct MPC5200 PSC clock.
> Previous code had errors or used a constant. This versions computes
> the right clock based on the xtal and register settings.

Looks good to me; one comment below:

> ---
>  arch/powerpc/include/asm/mpc52xx.h           |    2 +-
>  arch/powerpc/platforms/52xx/mpc52xx_common.c |   26 ++++++++++++++++++++++++--
>  drivers/spi/mpc52xx_psc_spi.c                |    8 +-------
>  sound/soc/fsl/mpc5200_psc_i2s.c              |   11 +----------
>  4 files changed, 27 insertions(+), 20 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/mpc52xx.h b/arch/powerpc/include/asm/mpc52xx.h
> index cadd398..1ca8a0e 100644
> --- a/arch/powerpc/include/asm/mpc52xx.h
> +++ b/arch/powerpc/include/asm/mpc52xx.h
> @@ -285,7 +285,7 @@ struct mpc52xx_rtc {
>  extern void mpc5200_setup_xlb_arbiter(void);
>  extern void mpc52xx_declare_of_platform_devices(void);
>  extern void mpc52xx_map_common_devices(void);
> -extern int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv);
> +extern int mpc52xx_set_psc_clkdiv(int psc_id, int freq);
>  extern unsigned int mpc52xx_get_xtal_freq(struct device_node *node);
>  extern void mpc52xx_restart(char *cmd);
>
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
> index a46bad0..f81fb03 100644
> --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
> @@ -110,6 +110,8 @@ static struct of_device_id mpc52xx_cdm_ids[] __initdata = {
>        {}
>  };
>
> +static u32 fsystem; /* fsystem clock on mpc5200 */
> +

To protect against collisions with the global namespace, please name
this mpc5200_fsystem.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.


More information about the Linuxppc-dev mailing list