public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3] Allow AM335x MPU core clock speed to be specified in the board config file
@ 2013-03-04  9:24 Mark Jackson
  2013-03-04 11:14 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Jackson @ 2013-03-04  9:24 UTC (permalink / raw)
  To: u-boot

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 CONFIG_SYS_MPUCLK	<desired clock freq in Hz>

Signed-off-by: Mark Jackson <mpfj@newflow.co.uk>
---
Changes in v3:
- Changed from V_MPUCLK to CONFIG_SYS_MPUCLK
- Added entry in README

Changes in v2:
- Tweaked after comments from Peter Korsgaard

 README                                           |    4 ++++
 arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |    7 +++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/README b/README
index d8cb394..ddf6df2 100644
--- a/README
+++ b/README
@@ -3820,6 +3820,10 @@ Low Level (hardware related) configuration options:
 		If defined, the x86 reset vector code is included. This is not
 		needed when U-Boot is running from Coreboot.
 
+- CONFIG_SYS_MPUCLK
+		Defines the MPU clock speed (in Hz).
+
+		NOTE : currently only supported on AM335x platforms.
 
 Freescale QE/FMAN Firmware Support:
 -----------------------------------
diff --git a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
index d748dd2..5f2939b 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 CONFIG_SYS_MPUCLK
+#define CONFIG_SYS_MPUCLK	550000000
+#endif
+#define MPUPLL_M	(CONFIG_SYS_MPUCLK/1000000)
 #define MPUPLL_N	(OSC-1)
 #define MPUPLL_M2	1
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v3] Allow AM335x MPU core clock speed to be specified in the board config file
  2013-03-04  9:24 [U-Boot] [PATCH v3] Allow AM335x MPU core clock speed to be specified in the board config file Mark Jackson
@ 2013-03-04 11:14 ` Wolfgang Denk
  2013-03-04 11:24   ` Mark Jackson
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2013-03-04 11:14 UTC (permalink / raw)
  To: u-boot

Dear Mark Jackson,

In message <51346856.8020504@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 CONFIG_SYS_MPUCLK	<desired clock freq in Hz>

Why do you claim an accuracy of Hz here, when in the code you silently
throw away any sub-MHz parts anyway?  Why not leaving it at MHz as it
was before, and as used in the code?

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
There are three ways to get something done:
        (1) Do it yourself.
        (2) Hire someone to do it for you.
        (3) Forbid your kids to do it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v3] Allow AM335x MPU core clock speed to be specified in the board config file
  2013-03-04 11:14 ` Wolfgang Denk
@ 2013-03-04 11:24   ` Mark Jackson
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Jackson @ 2013-03-04 11:24 UTC (permalink / raw)
  To: u-boot

On 04/03/13 11:14, Wolfgang Denk wrote:
> Dear Mark Jackson,
> 
> In message <51346856.8020504@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 CONFIG_SYS_MPUCLK	<desired clock freq in Hz>
> 
> Why do you claim an accuracy of Hz here, when in the code you silently
> throw away any sub-MHz parts anyway?  Why not leaving it at MHz as it
> was before, and as used in the code?

I was simply copying the format of the existing V_OSCK defines, but I'm
happy to change it.

Regards
Mark J.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-04 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04  9:24 [U-Boot] [PATCH v3] Allow AM335x MPU core clock speed to be specified in the board config file Mark Jackson
2013-03-04 11:14 ` Wolfgang Denk
2013-03-04 11:24   ` Mark Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox