[PATCH 2/2] ARM pcm043: Use PDR0 to change cpu freq

Marc Kleine-Budde mkl at pengutronix.de
Thu Jul 28 10:11:06 EDT 2011


On 07/28/2011 03:14 PM, Teresa Gámez wrote:
> Instead of changing the MPCTL to set an other cpu frequency,
> use the post divider.
> 
> This prevents freezing when changing the clock from 399MHz to 532MHz.
> 
> Signed-off-by: Teresa Gámez <t.gamez at phytec.de>
> ---
>  arch/arm/boards/pcm043/pcm043.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/boards/pcm043/pcm043.c b/arch/arm/boards/pcm043/pcm043.c
> index 3bd6402..8629ae6 100644
> --- a/arch/arm/boards/pcm043/pcm043.c
> +++ b/arch/arm/boards/pcm043/pcm043.c
> @@ -308,8 +308,8 @@ static int pcm043_core_setup(void)
>  
>  core_initcall(pcm043_core_setup);
>  
> -#define MPCTL_PARAM_399     (IMX_PLL_PD(0) | IMX_PLL_MFD(15) | IMX_PLL_MFI(8) | IMX_PLL_MFN(5))
> -#define MPCTL_PARAM_532     ((1 << 31) | IMX_PLL_PD(0) | IMX_PLL_MFD(11) | IMX_PLL_MFI(11) | IMX_PLL_MFN(1))
> +#define	CCM_PDR0_PARAM_399	((1 << 12) | (1 << 16))
> +#define	CCM_PDR0_PARAM_532	(1 << 12)

nickpick: no tab after #define, please

Marc
>  
>  static int do_cpufreq(struct command *cmdtp, int argc, char *argv[])
>  {
> @@ -322,10 +322,10 @@ static int do_cpufreq(struct command *cmdtp, int argc, char *argv[])
>  
>  	switch (freq) {
>  	case 399:
> -		writel(MPCTL_PARAM_399, IMX_CCM_BASE + CCM_MPCTL);
> +		writel(CCM_PDR0_PARAM_399, IMX_CCM_BASE + CCM_PDR0);
>  		break;
>  	case 532:
> -		writel(MPCTL_PARAM_532, IMX_CCM_BASE + CCM_MPCTL);
> +		writel(CCM_PDR0_PARAM_532, IMX_CCM_BASE + CCM_PDR0);
>  		break;
>  	default:
>  		return COMMAND_ERROR_USAGE;


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20110728/0fc5e38b/attachment.sig>


More information about the barebox mailing list