[v2,13/13] ARM: sunxi: Introduce MACH_SUN8I_A83T option
diff mbox

Message ID 1456672738-4993-14-git-send-email-vishnupatekar0510@gmail.com
State New
Headers show

Commit Message

vishnupatekar Feb. 28, 2016, 3:18 p.m. UTC
A83T has CPUS clock similar to A80's. currently, a80 cpus clock only
compiled for A80. So, Introduce MACH_SUN8I_A83T to compile it for
A83T as well.

Signed-off-by: Vishnu Patekar <vishnupatekar0510@gmail.com>
---
 arch/arm/mach-sunxi/Kconfig | 5 +++++
 drivers/clk/sunxi/Makefile  | 3 +++
 2 files changed, 8 insertions(+)

Comments

Maxime Ripard March 1, 2016, 7:12 a.m. UTC | #1
Hi,

On Sun, Feb 28, 2016 at 11:18:58PM +0800, Vishnu Patekar wrote:
> A83T has CPUS clock similar to A80's. currently, a80 cpus clock only
> compiled for A80. So, Introduce MACH_SUN8I_A83T to compile it for
> A83T as well.
> 
> Signed-off-by: Vishnu Patekar <vishnupatekar0510@gmail.com>
> ---
>  arch/arm/mach-sunxi/Kconfig | 5 +++++
>  drivers/clk/sunxi/Makefile  | 3 +++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
> index c124d65..424b76d 100644
> --- a/arch/arm/mach-sunxi/Kconfig
> +++ b/arch/arm/mach-sunxi/Kconfig
> @@ -41,6 +41,11 @@ config MACH_SUN8I
>  	select ARM_GIC
>  	select MFD_SUN6I_PRCM
>  
> +config MACH_SUN8I_A83T
> +	bool "Allwinner A83T (sun8i) SoCs support"
> +	default ARCH_SUNXI
> +	select ARM_GIC
> +
>  config MACH_SUN9I
>  	bool "Allwinner (sun9i) SoCs support"
>  	default ARCH_SUNXI
> diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
> index 3fd7901..2aabfc4 100644
> --- a/drivers/clk/sunxi/Makefile
> +++ b/drivers/clk/sunxi/Makefile
> @@ -20,6 +20,9 @@ obj-y += clk-usb.o
>  obj-$(CONFIG_MACH_SUN9I) += clk-sun8i-apb0.o
>  obj-$(CONFIG_MACH_SUN9I) += clk-sun9i-cpus.o
>  
> +obj-$(CONFIG_MACH_SUN8I_A83T) += clk-sun8i-apb0.o
> +obj-$(CONFIG_MACH_SUN8I_A83T) += clk-sun9i-cpus.o
> +

This is not how it should be done. You should rather create a Kconfig
option for these clocks, and use def_bool CONFIG_MACH_SUN8I || CONFIG_MACH_SUN9I

Switching to Kconfig for the clocks has been on my todo-list for quite
some time, I guess these two clocks would be a good start.

Thanks!
Maxime
vishnupatekar March 2, 2016, 4:04 p.m. UTC | #2
Hello Maxime,

On Tue, Mar 1, 2016 at 3:12 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Sun, Feb 28, 2016 at 11:18:58PM +0800, Vishnu Patekar wrote:
>> A83T has CPUS clock similar to A80's. currently, a80 cpus clock only
>> compiled for A80. So, Introduce MACH_SUN8I_A83T to compile it for
>> A83T as well.
>>
>> Signed-off-by: Vishnu Patekar <vishnupatekar0510@gmail.com>
>> ---
>>  arch/arm/mach-sunxi/Kconfig | 5 +++++
>>  drivers/clk/sunxi/Makefile  | 3 +++
>>  2 files changed, 8 insertions(+)
>>
>> diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
>> index c124d65..424b76d 100644
>> --- a/arch/arm/mach-sunxi/Kconfig
>> +++ b/arch/arm/mach-sunxi/Kconfig
>> @@ -41,6 +41,11 @@ config MACH_SUN8I
>>       select ARM_GIC
>>       select MFD_SUN6I_PRCM
>>
>> +config MACH_SUN8I_A83T
>> +     bool "Allwinner A83T (sun8i) SoCs support"
>> +     default ARCH_SUNXI
>> +     select ARM_GIC
>> +
>>  config MACH_SUN9I
>>       bool "Allwinner (sun9i) SoCs support"
>>       default ARCH_SUNXI
>> diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
>> index 3fd7901..2aabfc4 100644
>> --- a/drivers/clk/sunxi/Makefile
>> +++ b/drivers/clk/sunxi/Makefile
>> @@ -20,6 +20,9 @@ obj-y += clk-usb.o
>>  obj-$(CONFIG_MACH_SUN9I) += clk-sun8i-apb0.o
>>  obj-$(CONFIG_MACH_SUN9I) += clk-sun9i-cpus.o
>>
>> +obj-$(CONFIG_MACH_SUN8I_A83T) += clk-sun8i-apb0.o
>> +obj-$(CONFIG_MACH_SUN8I_A83T) += clk-sun9i-cpus.o
>> +
>
> This is not how it should be done. You should rather create a Kconfig
> option for these clocks, and use def_bool CONFIG_MACH_SUN8I || CONFIG_MACH_SUN9I
>
> Switching to Kconfig for the clocks has been on my todo-list for quite
> some time, I guess these two clocks would be a good start.
Okie, I'll create Kconfig in clk/sunxi as below:
config CLK_SUN8I_APB0
def_bool MACH_SUN9I || MACH_SUN8I_A83T

config CLK_SUN9I_CPUS
def_bool MACH_SUN9I || MACH_SUN8I_A83T

We still need to have MACH_SUN8I_A83T to differentiate between
MFD_SUN6I_PRCM which is used by other sun8i platforms.

>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index c124d65..424b76d 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -41,6 +41,11 @@  config MACH_SUN8I
 	select ARM_GIC
 	select MFD_SUN6I_PRCM
 
+config MACH_SUN8I_A83T
+	bool "Allwinner A83T (sun8i) SoCs support"
+	default ARCH_SUNXI
+	select ARM_GIC
+
 config MACH_SUN9I
 	bool "Allwinner (sun9i) SoCs support"
 	default ARCH_SUNXI
diff --git a/drivers/clk/sunxi/Makefile b/drivers/clk/sunxi/Makefile
index 3fd7901..2aabfc4 100644
--- a/drivers/clk/sunxi/Makefile
+++ b/drivers/clk/sunxi/Makefile
@@ -20,6 +20,9 @@  obj-y += clk-usb.o
 obj-$(CONFIG_MACH_SUN9I) += clk-sun8i-apb0.o
 obj-$(CONFIG_MACH_SUN9I) += clk-sun9i-cpus.o
 
+obj-$(CONFIG_MACH_SUN8I_A83T) += clk-sun8i-apb0.o
+obj-$(CONFIG_MACH_SUN8I_A83T) += clk-sun9i-cpus.o
+
 obj-$(CONFIG_MFD_SUN6I_PRCM) += \
 	clk-sun6i-ar100.o clk-sun6i-apb0.o clk-sun6i-apb0-gates.o \
 	clk-sun8i-apb0.o