diff mbox series

[02/15] arm: sunxi: Remove most SoC-specific config header files

Message ID 20220310014404.1251636-2-trini@konsulko.com
State Superseded
Delegated to: Tom Rini
Headers show
Series [01/15] Convert CONFIG_ARMV7_SECURE_BASE et al to Kconfig | expand

Commit Message

Tom Rini March 10, 2022, 1:43 a.m. UTC
At this point, sunxi-common.h is used for all systems except for some
MACH_SUN50I variants.  Remove the now basically empty header files and
update CONFIG_SYS_CONFIG_NAME to use sunxi-common.h directly.

Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/mach-sunxi/Kconfig | 12 ++----------
 include/configs/sun4i.h     | 19 -------------------
 include/configs/sun5i.h     | 19 -------------------
 include/configs/sun6i.h     | 18 ------------------
 include/configs/sun7i.h     | 16 ----------------
 include/configs/sun8i.h     | 22 ----------------------
 include/configs/sun9i.h     | 20 --------------------
 include/configs/suniv.h     | 14 --------------
 8 files changed, 2 insertions(+), 138 deletions(-)
 delete mode 100644 include/configs/sun4i.h
 delete mode 100644 include/configs/sun5i.h
 delete mode 100644 include/configs/sun6i.h
 delete mode 100644 include/configs/sun7i.h
 delete mode 100644 include/configs/sun8i.h
 delete mode 100644 include/configs/sun9i.h
 delete mode 100644 include/configs/suniv.h

Comments

Andre Przywara March 10, 2022, 10:58 a.m. UTC | #1
On Wed,  9 Mar 2022 20:43:51 -0500
Tom Rini <trini@konsulko.com> wrote:

Hi Tom,

> At this point, sunxi-common.h is used for all systems except for some
> MACH_SUN50I variants.  Remove the now basically empty header files and
> update CONFIG_SYS_CONFIG_NAME to use sunxi-common.h directly.

So is this #include <include/configs/$CONFIG_SYS_CONFIG_NAME.h> the only
user of this symbol? I was on the brink of removing those files several
times already, but wasn't sure if that has side effects.
I think buildman names use that as well, so we can't run "./buildman
sun7i" anymore?
If that's the only thing, I am fine with this.

Actually the content of sun50i.h is bogus, since we don't define
CONFIG_GICV2, so don't need the GIC addresses.
So this can go as well, and SYS_CONFIG_NAME can maybe just become "sunxi"?

Samuel, does this torpedo any RISC-V efforts?

Thanks for cleaning this up!

Cheers,
Andre

> 
> Cc: Jagan Teki <jagan@amarulasolutions.com>
> Cc: Andre Przywara <andre.przywara@arm.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  arch/arm/mach-sunxi/Kconfig | 12 ++----------
>  include/configs/sun4i.h     | 19 -------------------
>  include/configs/sun5i.h     | 19 -------------------
>  include/configs/sun6i.h     | 18 ------------------
>  include/configs/sun7i.h     | 16 ----------------
>  include/configs/sun8i.h     | 22 ----------------------
>  include/configs/sun9i.h     | 20 --------------------
>  include/configs/suniv.h     | 14 --------------
>  8 files changed, 2 insertions(+), 138 deletions(-)
>  delete mode 100644 include/configs/sun4i.h
>  delete mode 100644 include/configs/sun5i.h
>  delete mode 100644 include/configs/sun6i.h
>  delete mode 100644 include/configs/sun7i.h
>  delete mode 100644 include/configs/sun8i.h
>  delete mode 100644 include/configs/sun9i.h
>  delete mode 100644 include/configs/suniv.h
> 
> diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
> index 205fe3c9d3ca..2abc00e51154 100644
> --- a/arch/arm/mach-sunxi/Kconfig
> +++ b/arch/arm/mach-sunxi/Kconfig
> @@ -608,16 +608,8 @@ config SYS_CLK_FREQ
>  	default 1008000000 if MACH_SUN50I_H616
>  
>  config SYS_CONFIG_NAME
> -	default "suniv" if MACH_SUNIV
> -	default "sun4i" if MACH_SUN4I
> -	default "sun5i" if MACH_SUN5I
> -	default "sun6i" if MACH_SUN6I
> -	default "sun7i" if MACH_SUN7I
> -	default "sun8i" if MACH_SUN8I
> -	default "sun9i" if MACH_SUN9I
> -	default "sun50i" if MACH_SUN50I
> -	default "sun50i" if MACH_SUN50I_H6
> -	default "sun50i" if MACH_SUN50I_H616
> +	default "sun50i" if MACH_SUN50I || MACH_SUN50I_H6  || MACH_SUN50I_H616
> +	default "sunxi-common"
>  
>  config SYS_BOARD
>  	default "sunxi"
> diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h
> deleted file mode 100644
> index 0e1baa91bb14..000000000000
> --- a/include/configs/sun4i.h
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
> - *
> - * Configuration settings for the Allwinner A10 (sun4i) CPU
> - */
> -#ifndef __CONFIG_H
> -#define __CONFIG_H
> -
> -/*
> - * A10 specific configuration
> - */
> -
> -/*
> - * Include common sunxi configuration where most the settings are
> - */
> -#include <configs/sunxi-common.h>
> -
> -#endif /* __CONFIG_H */
> diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h
> deleted file mode 100644
> index ada18de75374..000000000000
> --- a/include/configs/sun5i.h
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
> - *
> - * Configuration settings for the Allwinner A13 (sun5i) CPU
> - */
> -#ifndef __CONFIG_H
> -#define __CONFIG_H
> -
> -/*
> - * High Level Configuration Options
> - */
> -
> -/*
> - * Include common sunxi configuration where most the settings are
> - */
> -#include <configs/sunxi-common.h>
> -
> -#endif /* __CONFIG_H */
> diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h
> deleted file mode 100644
> index 0b1fedda1081..000000000000
> --- a/include/configs/sun6i.h
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
> - * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> - * (C) Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
> - *
> - * Configuration settings for the Allwinner A31 (sun6i) CPU
> - */
> -
> -#ifndef __CONFIG_H
> -#define __CONFIG_H
> -
> -/*
> - * Include common sunxi configuration where most the settings are
> - */
> -#include <configs/sunxi-common.h>
> -
> -#endif /* __CONFIG_H */
> diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
> deleted file mode 100644
> index bc2779fa26f8..000000000000
> --- a/include/configs/sun7i.h
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
> - * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
> - *
> - * Configuration settings for the Allwinner A20 (sun7i) CPU
> - */
> -#ifndef __CONFIG_H
> -#define __CONFIG_H
> -
> -/*
> - * Include common sunxi configuration where most the settings are
> - */
> -#include <configs/sunxi-common.h>
> -
> -#endif /* __CONFIG_H */
> diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
> deleted file mode 100644
> index 106139d0904a..000000000000
> --- a/include/configs/sun8i.h
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * (C) Copyright 2014 Chen-Yu Tsai <wens@csie.org>
> - *
> - * Configuration settings for the Allwinner A23 (sun8i) CPU
> - */
> -
> -#ifndef __CONFIG_H
> -#define __CONFIG_H
> -
> -/*
> - * A23 specific configuration
> - */
> -
> -#include <asm/arch/cpu.h>
> -
> -/*
> - * Include common sunxi configuration where most the settings are
> - */
> -#include <configs/sunxi-common.h>
> -
> -#endif /* __CONFIG_H */
> diff --git a/include/configs/sun9i.h b/include/configs/sun9i.h
> deleted file mode 100644
> index 6ee08cf0d95e..000000000000
> --- a/include/configs/sun9i.h
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
> - *
> - * Configuration settings for the Allwinner A80 (sun9i) CPU
> - */
> -
> -#ifndef __CONFIG_H
> -#define __CONFIG_H
> -
> -/*
> - * A80 specific configuration
> - */
> -
> -/*
> - * Include common sunxi configuration where most the settings are
> - */
> -#include <configs/sunxi-common.h>
> -
> -#endif /* __CONFIG_H */
> diff --git a/include/configs/suniv.h b/include/configs/suniv.h
> deleted file mode 100644
> index 6118cd5e1a69..000000000000
> --- a/include/configs/suniv.h
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0+ */
> -/*
> - * Configuration settings for new Allwinner F-series (suniv) CPU
> - */
> -
> -#ifndef __CONFIG_H
> -#define __CONFIG_H
> -
> -/*
> - * Include common sunxi configuration where most the settings are
> - */
> -#include <configs/sunxi-common.h>
> -
> -#endif /* __CONFIG_H */
Tom Rini March 10, 2022, 1:32 p.m. UTC | #2
On Thu, Mar 10, 2022 at 10:58:50AM +0000, Andre Przywara wrote:
> On Wed,  9 Mar 2022 20:43:51 -0500
> Tom Rini <trini@konsulko.com> wrote:
> 
> Hi Tom,
> 
> > At this point, sunxi-common.h is used for all systems except for some
> > MACH_SUN50I variants.  Remove the now basically empty header files and
> > update CONFIG_SYS_CONFIG_NAME to use sunxi-common.h directly.
> 
> So is this #include <include/configs/$CONFIG_SYS_CONFIG_NAME.h> the only
> user of this symbol? I was on the brink of removing those files several
> times already, but wasn't sure if that has side effects.
> I think buildman names use that as well, so we can't run "./buildman
> sun7i" anymore?
> If that's the only thing, I am fine with this.

Yup, that's the only place it's used.

> Actually the content of sun50i.h is bogus, since we don't define
> CONFIG_GICV2, so don't need the GIC addresses.
> So this can go as well, and SYS_CONFIG_NAME can maybe just become "sunxi"?
> 
> Samuel, does this torpedo any RISC-V efforts?

I'll do the move for v2 and keep an eye out if that's a problem for
RISC-V efforts.
Andre Przywara March 10, 2022, 2:04 p.m. UTC | #3
On Thu, 10 Mar 2022 08:32:11 -0500
Tom Rini <trini@konsulko.com> wrote:

> On Thu, Mar 10, 2022 at 10:58:50AM +0000, Andre Przywara wrote:
> > On Wed,  9 Mar 2022 20:43:51 -0500
> > Tom Rini <trini@konsulko.com> wrote:
> > 
> > Hi Tom,
> >   
> > > At this point, sunxi-common.h is used for all systems except for some
> > > MACH_SUN50I variants.  Remove the now basically empty header files and
> > > update CONFIG_SYS_CONFIG_NAME to use sunxi-common.h directly.  
> > 
> > So is this #include <include/configs/$CONFIG_SYS_CONFIG_NAME.h> the only
> > user of this symbol? I was on the brink of removing those files several
> > times already, but wasn't sure if that has side effects.
> > I think buildman names use that as well, so we can't run "./buildman
> > sun7i" anymore?
> > If that's the only thing, I am fine with this.  
> 
> Yup, that's the only place it's used.
> 
> > Actually the content of sun50i.h is bogus, since we don't define
> > CONFIG_GICV2, so don't need the GIC addresses.
> > So this can go as well, and SYS_CONFIG_NAME can maybe just become "sunxi"?
> > 
> > Samuel, does this torpedo any RISC-V efforts?  
> 
> I'll do the move for v2 and keep an eye out if that's a problem for
> RISC-V efforts.

Thanks. I guess we can bring it back, if needed, or turn it upside down
by including "sunxi-riscv.h" from sunxi.h, inside an #ifdef.

Cheers,
Andre
Tom Rini March 10, 2022, 2:13 p.m. UTC | #4
On Thu, Mar 10, 2022 at 02:04:31PM +0000, Andre Przywara wrote:
> On Thu, 10 Mar 2022 08:32:11 -0500
> Tom Rini <trini@konsulko.com> wrote:
> 
> > On Thu, Mar 10, 2022 at 10:58:50AM +0000, Andre Przywara wrote:
> > > On Wed,  9 Mar 2022 20:43:51 -0500
> > > Tom Rini <trini@konsulko.com> wrote:
> > > 
> > > Hi Tom,
> > >   
> > > > At this point, sunxi-common.h is used for all systems except for some
> > > > MACH_SUN50I variants.  Remove the now basically empty header files and
> > > > update CONFIG_SYS_CONFIG_NAME to use sunxi-common.h directly.  
> > > 
> > > So is this #include <include/configs/$CONFIG_SYS_CONFIG_NAME.h> the only
> > > user of this symbol? I was on the brink of removing those files several
> > > times already, but wasn't sure if that has side effects.
> > > I think buildman names use that as well, so we can't run "./buildman
> > > sun7i" anymore?
> > > If that's the only thing, I am fine with this.  
> > 
> > Yup, that's the only place it's used.
> > 
> > > Actually the content of sun50i.h is bogus, since we don't define
> > > CONFIG_GICV2, so don't need the GIC addresses.
> > > So this can go as well, and SYS_CONFIG_NAME can maybe just become "sunxi"?
> > > 
> > > Samuel, does this torpedo any RISC-V efforts?  
> > 
> > I'll do the move for v2 and keep an eye out if that's a problem for
> > RISC-V efforts.
> 
> Thanks. I guess we can bring it back, if needed, or turn it upside down
> by including "sunxi-riscv.h" from sunxi.h, inside an #ifdef.

Or pick the conflicting symbol as something to migrate to Kconfig? :)
Samuel Holland March 11, 2022, 3:41 a.m. UTC | #5
On 3/10/22 8:04 AM, Andre Przywara wrote:
> On Thu, 10 Mar 2022 08:32:11 -0500
> Tom Rini <trini@konsulko.com> wrote:
> 
>> On Thu, Mar 10, 2022 at 10:58:50AM +0000, Andre Przywara wrote:
>>> On Wed,  9 Mar 2022 20:43:51 -0500
>>> Tom Rini <trini@konsulko.com> wrote:
>>>
>>> Hi Tom,
>>>   
>>>> At this point, sunxi-common.h is used for all systems except for some
>>>> MACH_SUN50I variants.  Remove the now basically empty header files and
>>>> update CONFIG_SYS_CONFIG_NAME to use sunxi-common.h directly.  
>>>
>>> So is this #include <include/configs/$CONFIG_SYS_CONFIG_NAME.h> the only
>>> user of this symbol? I was on the brink of removing those files several
>>> times already, but wasn't sure if that has side effects.
>>> I think buildman names use that as well, so we can't run "./buildman
>>> sun7i" anymore?
>>> If that's the only thing, I am fine with this.  
>>
>> Yup, that's the only place it's used.
>>
>>> Actually the content of sun50i.h is bogus, since we don't define
>>> CONFIG_GICV2, so don't need the GIC addresses.
>>> So this can go as well, and SYS_CONFIG_NAME can maybe just become "sunxi"?
>>>
>>> Samuel, does this torpedo any RISC-V efforts?  
>>
>> I'll do the move for v2 and keep an eye out if that's a problem for
>> RISC-V efforts.
> 
> Thanks. I guess we can bring it back, if needed, or turn it upside down
> by including "sunxi-riscv.h" from sunxi.h, inside an #ifdef.

Don't worry about affecting the RISC-V port when changing sunxi-common.h. I just
tried switching over to using it, and I only ran into a couple of issues beyond
the the usual SRAM/DRAM layout changes:

 - CONFIG_SYS_TCLK, used in drivers/i2c/mvtwsi.c, comes from asm/arch/i2c.h,
which doesn't exist. I suggest moving this constant to sunxi-common.h (or
Kconfig, but I see at least one definition that's not a constant). It will also
need to change for suniv.

 - SUNXI_UART*_BASE come from asm/arch/cpu.h, which doesn't exist. The constants
are only used inside "#ifndef CONFIG_DM_SERIAL", so I wrapped the #include in
that as well.

Regards,
Samuel
diff mbox series

Patch

diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 205fe3c9d3ca..2abc00e51154 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -608,16 +608,8 @@  config SYS_CLK_FREQ
 	default 1008000000 if MACH_SUN50I_H616
 
 config SYS_CONFIG_NAME
-	default "suniv" if MACH_SUNIV
-	default "sun4i" if MACH_SUN4I
-	default "sun5i" if MACH_SUN5I
-	default "sun6i" if MACH_SUN6I
-	default "sun7i" if MACH_SUN7I
-	default "sun8i" if MACH_SUN8I
-	default "sun9i" if MACH_SUN9I
-	default "sun50i" if MACH_SUN50I
-	default "sun50i" if MACH_SUN50I_H6
-	default "sun50i" if MACH_SUN50I_H616
+	default "sun50i" if MACH_SUN50I || MACH_SUN50I_H6  || MACH_SUN50I_H616
+	default "sunxi-common"
 
 config SYS_BOARD
 	default "sunxi"
diff --git a/include/configs/sun4i.h b/include/configs/sun4i.h
deleted file mode 100644
index 0e1baa91bb14..000000000000
--- a/include/configs/sun4i.h
+++ /dev/null
@@ -1,19 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
- *
- * Configuration settings for the Allwinner A10 (sun4i) CPU
- */
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * A10 specific configuration
- */
-
-/*
- * Include common sunxi configuration where most the settings are
- */
-#include <configs/sunxi-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/sun5i.h b/include/configs/sun5i.h
deleted file mode 100644
index ada18de75374..000000000000
--- a/include/configs/sun5i.h
+++ /dev/null
@@ -1,19 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
- *
- * Configuration settings for the Allwinner A13 (sun5i) CPU
- */
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * High Level Configuration Options
- */
-
-/*
- * Include common sunxi configuration where most the settings are
- */
-#include <configs/sunxi-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h
deleted file mode 100644
index 0b1fedda1081..000000000000
--- a/include/configs/sun6i.h
+++ /dev/null
@@ -1,18 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
- * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
- * (C) Copyright 2013 Maxime Ripard <maxime.ripard@free-electrons.com>
- *
- * Configuration settings for the Allwinner A31 (sun6i) CPU
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * Include common sunxi configuration where most the settings are
- */
-#include <configs/sunxi-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/sun7i.h b/include/configs/sun7i.h
deleted file mode 100644
index bc2779fa26f8..000000000000
--- a/include/configs/sun7i.h
+++ /dev/null
@@ -1,16 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2012-2013 Henrik Nordstrom <henrik@henriknordstrom.net>
- * (C) Copyright 2013 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
- *
- * Configuration settings for the Allwinner A20 (sun7i) CPU
- */
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * Include common sunxi configuration where most the settings are
- */
-#include <configs/sunxi-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
deleted file mode 100644
index 106139d0904a..000000000000
--- a/include/configs/sun8i.h
+++ /dev/null
@@ -1,22 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2014 Chen-Yu Tsai <wens@csie.org>
- *
- * Configuration settings for the Allwinner A23 (sun8i) CPU
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * A23 specific configuration
- */
-
-#include <asm/arch/cpu.h>
-
-/*
- * Include common sunxi configuration where most the settings are
- */
-#include <configs/sunxi-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/sun9i.h b/include/configs/sun9i.h
deleted file mode 100644
index 6ee08cf0d95e..000000000000
--- a/include/configs/sun9i.h
+++ /dev/null
@@ -1,20 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * (C) Copyright 2015 Hans de Goede <hdegoede@redhat.com>
- *
- * Configuration settings for the Allwinner A80 (sun9i) CPU
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * A80 specific configuration
- */
-
-/*
- * Include common sunxi configuration where most the settings are
- */
-#include <configs/sunxi-common.h>
-
-#endif /* __CONFIG_H */
diff --git a/include/configs/suniv.h b/include/configs/suniv.h
deleted file mode 100644
index 6118cd5e1a69..000000000000
--- a/include/configs/suniv.h
+++ /dev/null
@@ -1,14 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Configuration settings for new Allwinner F-series (suniv) CPU
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/*
- * Include common sunxi configuration where most the settings are
- */
-#include <configs/sunxi-common.h>
-
-#endif /* __CONFIG_H */