platform: generic: Use kconfig for enabling/disabling overrides
authorAnup Patel <apatel@ventanamicro.com>
Mon, 8 Aug 2022 04:04:14 +0000 (09:34 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 8 Aug 2022 04:04:14 +0000 (09:34 +0530)
We update generic platform to use kconfig for enabling/disabling
platform overrides. We also enable all platform overrides in generic
platform defconfig.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Tested-by: Andrew Jones <ajones@ventanamicro.com>
Acked-by: Atish Patra <atishp@rivosinc.com>
Tested-by: Atish Patra <atishp@rivosinc.com>
platform/generic/Kconfig
platform/generic/allwinner/objects.mk
platform/generic/configs/defconfig
platform/generic/sifive/objects.mk

index c1a77b3..c76bd12 100644 (file)
@@ -6,3 +6,21 @@ config PLATFORM_GENERIC
        select FDT_DOMAIN
        select FDT_PMU
        default y
+
+if PLATFORM_GENERIC
+
+config PLATFORM_ALLWINNER_D1
+       bool "Allwinner D1 support"
+       depends on FDT_IRQCHIP_PLIC
+       default n
+
+config PLATFORM_SIFIVE_FU540
+       bool "SiFive FU540 support"
+       default n
+
+config PLATFORM_SIFIVE_FU740
+       bool "SiFive FU740 support"
+       depends on FDT_RESET && FDT_I2C
+       default n
+
+endif
index 9e36ab6..447cdf1 100644 (file)
@@ -2,5 +2,5 @@
 # SPDX-License-Identifier: BSD-2-Clause
 #
 
-carray-platform_override_modules-y += sun20i_d1
-platform-objs-y += allwinner/sun20i-d1.o
+carray-platform_override_modules-$(CONFIG_PLATFORM_ALLWINNER_D1) += sun20i_d1
+platform-objs-$(CONFIG_PLATFORM_ALLWINNER_D1) += allwinner/sun20i-d1.o
index d56cef2..2a75394 100644 (file)
@@ -1,3 +1,6 @@
+CONFIG_PLATFORM_ALLWINNER_D1=y
+CONFIG_PLATFORM_SIFIVE_FU540=y
+CONFIG_PLATFORM_SIFIVE_FU740=y
 CONFIG_FDT_GPIO=y
 CONFIG_FDT_GPIO_SIFIVE=y
 CONFIG_FDT_I2C=y
index c17e2df..d75e444 100644 (file)
@@ -2,8 +2,8 @@
 # SPDX-License-Identifier: BSD-2-Clause
 #
 
-carray-platform_override_modules-y += sifive_fu540
-platform-objs-y += sifive/fu540.o
+carray-platform_override_modules-$(CONFIG_PLATFORM_SIFIVE_FU540) += sifive_fu540
+platform-objs-$(CONFIG_PLATFORM_SIFIVE_FU540) += sifive/fu540.o
 
-carray-platform_override_modules-y += sifive_fu740
-platform-objs-y += sifive/fu740.o
+carray-platform_override_modules-$(CONFIG_PLATFORM_SIFIVE_FU740) += sifive_fu740
+platform-objs-$(CONFIG_PLATFORM_SIFIVE_FU740) += sifive/fu740.o