diff mbox

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

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

Commit Message

Mark Jackson March 1, 2013, 12:33 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>
---
 arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Peter Korsgaard March 1, 2013, 2:44 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>  arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |    4 ++++
 Mark>  1 file changed, 4 insertions(+)

 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..acfa355 100644
 Mark> --- a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
 Mark> +++ b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
 Mark> @@ -22,7 +22,11 @@
 Mark>  #define OSC	(V_OSCK/1000000)
 
 Mark>  /* MAIN PLL Fdll = 550 MHZ, */
 Mark> +#ifdef V_MPUCLK
 Mark> +#define MPUPLL_M	(V_MPUCLK/1000000)
 Mark> +#else
 Mark>  #define MPUPLL_M	550
 Mark> +#endif

It would imho be more readable to do:

/* default to 550 MHz */
#ifndef V_MPUCLK
#define V_MPUCLK        550000000
#endif

and then always use it below.
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..acfa355 100644
--- a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
+++ b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
@@ -22,7 +22,11 @@ 
 #define OSC	(V_OSCK/1000000)
 
 /* MAIN PLL Fdll = 550 MHZ, */
+#ifdef V_MPUCLK
+#define MPUPLL_M	(V_MPUCLK/1000000)
+#else
 #define MPUPLL_M	550
+#endif
 #define MPUPLL_N	(OSC-1)
 #define MPUPLL_M2	1