Skip to content

Commit ef10bdf

Browse files
cyyselfConchuOD
authored andcommitted
riscv: Kconfig.socs: Split ARCH_CANAAN and SOC_CANAAN_K210
Since SOC_FOO should be deprecated from patch [1], and cleanup for other SoCs is already in the mailing list [2,3,4], we remove the use of SOC_CANAAN and use ARCH_CANAAN for SoCs vendored by Canaan instead from now on. And allows ARCH_CANAAN to be selected for other Canaan SoCs. However, we should keep the config SOC_CANAAN and use def_bool to redirect the symbol temporarily to avoid potential conflict. Since we now have Canaan Kendryte K230 with MMU, ARCH_CANAAN is no longer referred to as K210. There are some special features for K210, like M-Mode No MMU and loader.bin in arch/riscv/Makefile. If we keep ARCH_CANAAN for other Canaan SoCs and remove the K210, the depends on !MMU in Kconfig may confuse some users who try to boot Kernel with MMU on K210, as Damien mentioned in the list [5]. Thus, we introduce a new symbol SOC_CANAAN_K210 for any conditional code or driver selection specific to the K210, so users will not try to build some K210-specific things when MMU is enabled and see it fails to boot on K210. [1] https://lore.kernel.org/linux-riscv/20221121221414.109965-1-conor@kernel.org/ [2] https://lore.kernel.org/linux-riscv/20240305-praying-clad-c4fbcaa7ed0a@spud/ [3] https://lore.kernel.org/linux-riscv/20240305-fled-undrilled-41dc0c46bb29@spud/ [4] https://lore.kernel.org/linux-riscv/20240305-stress-earflap-d7ddb8655a4d@spud/ [5] https://lore.kernel.org/linux-riscv/2b0511af-1b5b-4c90-a673-c9113bb58142@kernel.org/ Signed-off-by: Yangyu Chen <cyy@cyyself.name> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent 4cece76 commit ef10bdf

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

arch/riscv/Kconfig.socs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,17 @@ config SOC_VIRT
7272
This enables support for QEMU Virt Machine.
7373

7474
config ARCH_CANAAN
75-
def_bool SOC_CANAAN
75+
bool "Canaan Kendryte SoC"
76+
help
77+
This enables support for Canaan Kendryte series SoC platform hardware.
7678

7779
config SOC_CANAAN
80+
def_bool SOC_CANAAN_K210
81+
depends on ARCH_CANAAN
82+
83+
config SOC_CANAAN_K210
7884
bool "Canaan Kendryte K210 SoC"
79-
depends on !MMU
85+
depends on !MMU && ARCH_CANAAN
8086
select CLINT_TIMER if RISCV_M_MODE
8187
select ARCH_HAS_RESET_CONTROLLER
8288
select PINCTRL

arch/riscv/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ vdso-install-y += arch/riscv/kernel/vdso/vdso.so.dbg
154154
vdso-install-$(CONFIG_COMPAT) += arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg:../compat_vdso/compat_vdso.so
155155

156156
ifneq ($(CONFIG_XIP_KERNEL),y)
157-
ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy)
157+
ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_SOC_CANAAN_K210),yy)
158158
KBUILD_IMAGE := $(boot)/loader.bin
159159
else
160160
ifeq ($(CONFIG_EFI_ZBOOT),)

arch/riscv/configs/nommu_k210_defconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ CONFIG_EXPERT=y
2727
CONFIG_SLUB=y
2828
CONFIG_SLUB_TINY=y
2929
# CONFIG_MMU is not set
30-
CONFIG_SOC_CANAAN=y
30+
CONFIG_ARCH_CANAAN=y
31+
CONFIG_SOC_CANAAN_K210=y
3132
CONFIG_NONPORTABLE=y
3233
CONFIG_SMP=y
3334
CONFIG_NR_CPUS=2

arch/riscv/configs/nommu_k210_sdcard_defconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ CONFIG_EXPERT=y
1919
CONFIG_SLUB=y
2020
CONFIG_SLUB_TINY=y
2121
# CONFIG_MMU is not set
22-
CONFIG_SOC_CANAAN=y
22+
CONFIG_ARCH_CANAAN=y
23+
CONFIG_SOC_CANAAN_K210=y
2324
CONFIG_NONPORTABLE=y
2425
CONFIG_SMP=y
2526
CONFIG_NR_CPUS=2

0 commit comments

Comments
 (0)