diff mbox

[U-Boot,v2] Allow AM335x MPU core clock speed to be specified in the board config file

Message ID 5130C537.8000504@mimc.co.uk
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Mark Jackson March 1, 2013, 3:11 p.m. UTC
Allow AM335x MPU core clock speed to be specified in the board config file.
To use, add the following to the board's config file:-

#define V_MPUCLK	<desired clock freq in Hz>

Signed-off-by: Mark Jackson <mpfj@newflow.co.uk>
---
Changes in v2:
- Tweaked after comments from Peter Korsgaard

 arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Peter Korsgaard March 3, 2013, 10:40 p.m. UTC | #1
>>>>> "Mark" == Mark Jackson <mpfj-list@mimc.co.uk> writes:

 Mark> Allow AM335x MPU core clock speed to be specified in the board config file.
 Mark> To use, add the following to the board's config file:-

 Mark> #define V_MPUCLK	<desired clock freq in Hz>

 Mark> Signed-off-by: Mark Jackson <mpfj@newflow.co.uk>
 Mark> ---
 Mark> Changes in v2:
 Mark> - Tweaked after comments from Peter Korsgaard

 Mark>  arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |    7 +++++--
 Mark>  1 file changed, 5 insertions(+), 2 deletions(-)

 Mark> diff --git a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
 Mark> index d748dd2..f1a8aa7 100644
 Mark> --- a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
 Mark> +++ b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
 Mark> @@ -21,8 +21,11 @@
 
 Mark>  #define OSC	(V_OSCK/1000000)
 
 Mark> -/* MAIN PLL Fdll = 550 MHZ, */
 Mark> -#define MPUPLL_M	550
 Mark> +/* MAIN PLL Fdll = 550 MHZ, by default */

It would be good to fix MHZ -> MHz while we're at it. Otherwise it looks
good.

Acked-by: Peter Korsgaard <jacmet@sunsite.dk>


 Mark> +#ifndef V_MPUCLK
 Mark> +#define V_MPUCLK	550000000
 Mark> +#endif
 Mark> +#define MPUPLL_M	(V_MPUCLK/1000000)
 Mark>  #define MPUPLL_N	(OSC-1)
 Mark>  #define MPUPLL_M2	1
 
 Mark> -- 
 Mark> 1.7.9.5

 Mark> _______________________________________________
 Mark> U-Boot mailing list
 Mark> U-Boot@lists.denx.de
 Mark> http://lists.denx.de/mailman/listinfo/u-boot
Wolfgang Denk March 4, 2013, 12:27 a.m. UTC | #2
Dear Mark Jackson,

In message <5130C537.8000504@mimc.co.uk> you wrote:
> Allow AM335x MPU core clock speed to be specified in the board config file.
> To use, add the following to the board's config file:-
> 
> #define V_MPUCLK	<desired clock freq in Hz>

If this is a configurable option, it should be CONFIG_SYS_V_MPUCLK
instead.

>  arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Also, this new config option must be documented in the README.

Best regards,

Wolfgang Denk
Mark Jackson March 4, 2013, 9:13 a.m. UTC | #3
On 04/03/13 00:27, Wolfgang Denk wrote:
> Dear Mark Jackson,
> 
> In message <5130C537.8000504@mimc.co.uk> you wrote:
>> Allow AM335x MPU core clock speed to be specified in the board config file.
>> To use, add the following to the board's config file:-
>>
>> #define V_MPUCLK	<desired clock freq in Hz>
> 
> If this is a configurable option, it should be CONFIG_SYS_V_MPUCLK
> instead.
> 
>>  arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |    7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> Also, this new config option must be documented in the README.

No problem ... I'll post a v3.
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
index d748dd2..f1a8aa7 100644
--- a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
+++ b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
@@ -21,8 +21,11 @@ 
 
 #define OSC	(V_OSCK/1000000)
 
-/* MAIN PLL Fdll = 550 MHZ, */
-#define MPUPLL_M	550
+/* MAIN PLL Fdll = 550 MHZ, by default */
+#ifndef V_MPUCLK
+#define V_MPUCLK	550000000
+#endif
+#define MPUPLL_M	(V_MPUCLK/1000000)
 #define MPUPLL_N	(OSC-1)
 #define MPUPLL_M2	1