
The Makefile of mach-sunxi used to build PRCM and RSB according to the SoC's MACH_SUNxI macro, which makes it needed to add lines for new SoC generation.
Change this behavior to invisible options in sunxi Kconfig, so that new lines are not needed for new SoC. Also it allows more accurate control of the build of the related sources, for example, V3s (sun8iw8) and R40 (sun8iw11) do not have PRCM at all, and H3 (sun8iw7) do not have RSB, but these functions are built with the old code.
Signed-off-by: Icenowy Zheng icenowy@aosc.xyz --- arch/arm/mach-sunxi/Makefile | 7 ++----- board/sunxi/Kconfig | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-sunxi/Makefile b/arch/arm/mach-sunxi/Makefile index 7daba1169c..a8bf3a6c64 100644 --- a/arch/arm/mach-sunxi/Makefile +++ b/arch/arm/mach-sunxi/Makefile @@ -16,12 +16,9 @@ obj-y += pinmux.o ifndef CONFIG_MACH_SUN9I obj-y += usb_phy.o endif -obj-$(CONFIG_MACH_SUN6I) += prcm.o -obj-$(CONFIG_MACH_SUN8I) += prcm.o -obj-$(CONFIG_MACH_SUN9I) += prcm.o +obj-$(CONFIG_SUNXI_HAS_PRCM) += prcm.o obj-$(CONFIG_MACH_SUN6I) += p2wi.o -obj-$(CONFIG_MACH_SUN8I) += rsb.o -obj-$(CONFIG_MACH_SUN9I) += rsb.o +obj-$(CONFIG_SUNXI_HAS_RSB) += rsb.o obj-$(CONFIG_MACH_SUN4I) += clock_sun4i.o obj-$(CONFIG_MACH_SUN5I) += clock_sun4i.o obj-$(CONFIG_MACH_SUN6I) += clock_sun6i.o diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 37b42521a4..acd2bebcdb 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -42,6 +42,18 @@ config SUNXI_GEN_SUN6I separate ahb reset control registers, custom pmic bus, new style watchdog, etc.
+config SUNXI_HAS_PRCM + bool + ---help--- + Select this for sunxi SoCs which have PRCM part, which is + sometimes also called "CPUs" part. + +config SUNXI_HAS_RSB + bool + depends on SUNXI_HAS_PRCM + ---help--- + Select this for sunxi SoCs which have RSB (Reduced Serial Bus) + support.
choice prompt "Sunxi SoC Variant" @@ -67,6 +79,7 @@ config MACH_SUN6I select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL + select SUNXI_HAS_PRCM select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN7I @@ -87,6 +100,8 @@ config MACH_SUN8I_A23 select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL + select SUNXI_HAS_PRCM + select SUNXI_HAS_RSB select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN8I_A33 @@ -97,6 +112,8 @@ config MACH_SUN8I_A33 select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL + select SUNXI_HAS_PRCM + select SUNXI_HAS_RSB select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN8I_A83T @@ -104,6 +121,8 @@ config MACH_SUN8I_A83T select CPU_V7 select SUNXI_GEN_SUN6I select SUPPORT_SPL + select SUNXI_HAS_PRCM + select SUNXI_HAS_RSB
config MACH_SUN8I_H3 bool "sun8i (Allwinner H3)" @@ -113,6 +132,7 @@ config MACH_SUN8I_H3 select ARCH_SUPPORT_PSCI select SUNXI_GEN_SUN6I select SUPPORT_SPL + select SUNXI_HAS_PRCM select ARMV7_BOOT_SEC_DEFAULT if OLD_SUNXI_KERNEL_COMPAT
config MACH_SUN9I @@ -120,6 +140,8 @@ config MACH_SUN9I select CPU_V7 select SUNXI_GEN_SUN6I select SUPPORT_SPL + select SUNXI_HAS_PRCM + select SUNXI_HAS_RSB
config MACH_SUN50I bool "sun50i (Allwinner A64)"