public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/3] sunxi: promote CONFIG_CLK_FULL_SPEED to be selectable through Kconfig
@ 2015-03-27  0:12 Iain Paton
  2015-03-27 13:57 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Iain Paton @ 2015-03-27  0:12 UTC (permalink / raw)
  To: u-boot

in order to allow for this to be set differently per board, remove the
define from the associated soc headers and allow the user to choose a
value through a Kconfig setting

Signed-off-by: Iain Paton <ipaton0@gmail.com>
---
 board/sunxi/Kconfig     | 8 ++++++++
 include/configs/sun4i.h | 1 -
 include/configs/sun5i.h | 1 -
 include/configs/sun6i.h | 1 -
 include/configs/sun7i.h | 1 -
 include/configs/sun8i.h | 1 -
 6 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 9d0eb91..d0905a7 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -33,6 +33,14 @@ config MACH_SUN8I
 
 endchoice
 
+config CLK_FULL_SPEED
+	int "sunxi cpu clock speed"
+	default 912000000 if MACH_SUN7I
+	default 1008000000 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I
+	---help---
+	Set the cpu clock speed in Hz, valid values 384, 768, 912, 1008 MHz 
+	must be a multiple of 48MHz
+
 config DRAM_CLK
 	int "sunxi dram clock speed"
 	default 312 if MACH_SUN6I || MACH_SUN8I
diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h
index 1537e53..7cd5c69 100644
--- a/include/configs/sun4i.h
+++ b/include/configs/sun4i.h
@@ -11,7 +11,6 @@
 /*
  * A10 specific configuration
  */
-#define CONFIG_CLK_FULL_SPEED		1008000000
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h
index e755531..e0470d4 100644
--- a/include/configs/sun5i.h
+++ b/include/configs/sun5i.h
@@ -11,7 +11,6 @@
 /*
  * High Level Configuration Options
  */
-#define CONFIG_CLK_FULL_SPEED		1008000000
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h
index f5e11dd..617c1cd 100644
--- a/include/configs/sun6i.h
+++ b/include/configs/sun6i.h
@@ -14,7 +14,6 @@
 /*
  * A31 specific configuration
  */
-#define CONFIG_CLK_FULL_SPEED		1008000000
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
index f817f73..0bb756f 100644
--- a/include/configs/sun7i.h
+++ b/include/configs/sun7i.h
@@ -12,7 +12,6 @@
 /*
  * A20 specific configuration
  */
-#define CONFIG_CLK_FULL_SPEED		912000000
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
index 3bdedb3..79796d7 100644
--- a/include/configs/sun8i.h
+++ b/include/configs/sun8i.h
@@ -12,7 +12,6 @@
 /*
  * A23 specific configuration
  */
-#define CONFIG_CLK_FULL_SPEED	1008000000
 
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
-- 
2.1.3

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

* [U-Boot] [PATCH 2/3] sunxi: promote CONFIG_CLK_FULL_SPEED to be selectable through Kconfig
  2015-03-27  0:12 [U-Boot] [PATCH 2/3] sunxi: promote CONFIG_CLK_FULL_SPEED to be selectable through Kconfig Iain Paton
@ 2015-03-27 13:57 ` Hans de Goede
  2015-03-28 10:24   ` Iain Paton
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2015-03-27 13:57 UTC (permalink / raw)
  To: u-boot

Hi,

On 27-03-15 01:12, Iain Paton wrote:
> in order to allow for this to be set differently per board, remove the
> define from the associated soc headers and allow the user to choose a
> value through a Kconfig setting
>
> Signed-off-by: Iain Paton <ipaton0@gmail.com>

Thanks, but if we're going to do this, then can you please rename
CLK_FULL_SPEED to SYS_CLK_FREQ, as that is already defined in

./Kconfig

Change the "depends on ARC" in .Kconfig to "depends on ARC || ARCH_SUNXI",
and add an entry for it to board/sunxi/Kconfig only setting a default,
like we do for SYS_CONFIG_NAME / SYS_BOARD / SYS_SOC already

Regards,

Hans


> ---
>   board/sunxi/Kconfig     | 8 ++++++++
>   include/configs/sun4i.h | 1 -
>   include/configs/sun5i.h | 1 -
>   include/configs/sun6i.h | 1 -
>   include/configs/sun7i.h | 1 -
>   include/configs/sun8i.h | 1 -
>   6 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
> index 9d0eb91..d0905a7 100644
> --- a/board/sunxi/Kconfig
> +++ b/board/sunxi/Kconfig
> @@ -33,6 +33,14 @@ config MACH_SUN8I
>
>   endchoice
>
> +config CLK_FULL_SPEED
> +	int "sunxi cpu clock speed"
> +	default 912000000 if MACH_SUN7I
> +	default 1008000000 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I
> +	---help---
> +	Set the cpu clock speed in Hz, valid values 384, 768, 912, 1008 MHz
> +	must be a multiple of 48MHz
> +
>   config DRAM_CLK
>   	int "sunxi dram clock speed"
>   	default 312 if MACH_SUN6I || MACH_SUN8I
> diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h
> index 1537e53..7cd5c69 100644
> --- a/include/configs/sun4i.h
> +++ b/include/configs/sun4i.h
> @@ -11,7 +11,6 @@
>   /*
>    * A10 specific configuration
>    */
> -#define CONFIG_CLK_FULL_SPEED		1008000000
>
>   #ifdef CONFIG_USB_EHCI
>   #define CONFIG_USB_EHCI_SUNXI
> diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h
> index e755531..e0470d4 100644
> --- a/include/configs/sun5i.h
> +++ b/include/configs/sun5i.h
> @@ -11,7 +11,6 @@
>   /*
>    * High Level Configuration Options
>    */
> -#define CONFIG_CLK_FULL_SPEED		1008000000
>
>   #ifdef CONFIG_USB_EHCI
>   #define CONFIG_USB_EHCI_SUNXI
> diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h
> index f5e11dd..617c1cd 100644
> --- a/include/configs/sun6i.h
> +++ b/include/configs/sun6i.h
> @@ -14,7 +14,6 @@
>   /*
>    * A31 specific configuration
>    */
> -#define CONFIG_CLK_FULL_SPEED		1008000000
>
>   #ifdef CONFIG_USB_EHCI
>   #define CONFIG_USB_EHCI_SUNXI
> diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
> index f817f73..0bb756f 100644
> --- a/include/configs/sun7i.h
> +++ b/include/configs/sun7i.h
> @@ -12,7 +12,6 @@
>   /*
>    * A20 specific configuration
>    */
> -#define CONFIG_CLK_FULL_SPEED		912000000
>
>   #ifdef CONFIG_USB_EHCI
>   #define CONFIG_USB_EHCI_SUNXI
> diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
> index 3bdedb3..79796d7 100644
> --- a/include/configs/sun8i.h
> +++ b/include/configs/sun8i.h
> @@ -12,7 +12,6 @@
>   /*
>    * A23 specific configuration
>    */
> -#define CONFIG_CLK_FULL_SPEED	1008000000
>
>   #ifdef CONFIG_USB_EHCI
>   #define CONFIG_USB_EHCI_SUNXI
>

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

* [U-Boot] [PATCH 2/3] sunxi: promote CONFIG_CLK_FULL_SPEED to be selectable through Kconfig
  2015-03-27 13:57 ` Hans de Goede
@ 2015-03-28 10:24   ` Iain Paton
  0 siblings, 0 replies; 3+ messages in thread
From: Iain Paton @ 2015-03-28 10:24 UTC (permalink / raw)
  To: u-boot

On 27/03/15 13:57, Hans de Goede wrote:
> Hi,
> 
> On 27-03-15 01:12, Iain Paton wrote:
>> in order to allow for this to be set differently per board, remove the
>> define from the associated soc headers and allow the user to choose a
>> value through a Kconfig setting
>>
>> Signed-off-by: Iain Paton <ipaton0@gmail.com>
> 
> Thanks, but if we're going to do this, then can you please rename
> CLK_FULL_SPEED to SYS_CLK_FREQ, as that is already defined in
> 
> ./Kconfig

Sure thing, I'd missed that there was already a suitable variable.
Updated version on the way.

Rgds,
Iain

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

end of thread, other threads:[~2015-03-28 10:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-27  0:12 [U-Boot] [PATCH 2/3] sunxi: promote CONFIG_CLK_FULL_SPEED to be selectable through Kconfig Iain Paton
2015-03-27 13:57 ` Hans de Goede
2015-03-28 10:24   ` Iain Paton

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