Skip to contentSkip to conversation

RISC-V: kconfig.socs cleanup, part 1

PATCH In review Conor Dooley 6 participants 19 messages Nov 21, 2022 – Jan 11, 2023

Subsystems (6)
lore
Share & tools
lore

Conor Dooley

author maintainer
#0 lore raw

cover RISC-V: kconfig.socs cleanup, part 1

From: Conor Dooley <[email protected]>

Hey all,

Following on from my RFC series a little bit ago, I'm back again with an attempted conversion of our SOC_FOO symbols to a more uniform ARCH_FOO. Last time around, I had about 30 patches [0], but here I have a more modest offering.

Patch 1 adds stubs, that ideally would be applied for v6.2-rc1 (but after week 1, see the note in that patch for more), which would allow for converting drivers etc over a release cycle (or more) while allowing everything else to keep working in the meantime.

Christoph Hellwig & Damien voiced some objections in the original thread, hopefully the gradual conversion assuages Damien's concerns about breaking defconfigs - but I am not sure what to do about Christoph's dislike of the ARCH_FOO stuff. A change the world approach is unlikely to be well received & introducing "duplicate" symbols for cross-arch vendors would surely be similarly well received? I don't mind doing it, but my instinct is that that is a futile use of time.

The rest of this series contains v6.3 material, converting SOC_FOO usages in arch/riscv to ARCH_FOO.

Thanks,
Conor.

[0] - https://lore.kernel.org/linux-riscv/[email protected]/

CC Arnd Bergmann <[email protected]>
CC Christoph Hellwig <[email protected]>
CC Conor.Dooley <[email protected]>
CC Damien Le Moal <[email protected]>
CC Emil Renner Berthing <[email protected]>
CC Geert Uytterhoeven <[email protected]>
CC Heiko Stuebner <[email protected]>
CC Palmer Dabbelt <[email protected]>
CC Samuel Holland <[email protected]>

Conor Dooley (7):
RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols
RISC-V: kconfig.socs: convert usage of SOC_CANAAN to ARCH_CANAAN
RISC-V: kbuild: convert all use of SOC_FOO to ARCH_FOO
RISC-V: stop selecting SIFIVE_PLIC at the SoC level
RISC-V: stop selecting the PolarFire SoC clock driver
RISC-V: stop selecting SiFive clock and serial drivers directly
RISC-V: stop directly selecting drivers for SOC_CANAAN

 arch/riscv/Kconfig                     |  1 +
 arch/riscv/Kconfig.socs                | 44 +++++++++++++++-----------
 arch/riscv/Makefile                    |  2 +-
 arch/riscv/boot/dts/Makefile           |  2 +-
 arch/riscv/boot/dts/canaan/Makefile    | 14 ++++----
 arch/riscv/boot/dts/microchip/Makefile |  8 ++---
 arch/riscv/boot/dts/sifive/Makefile    |  4 +--
 arch/riscv/boot/dts/starfive/Makefile  |  2 +-
 8 files changed, 43 insertions(+), 34 deletions(-)
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author maintainer
#1 lore raw

PATCH 1/7 RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

From: Conor Dooley <[email protected]>

To facilitate a transfer from SOC_FOO to ARCH_FOO, over a release cycle, introduce some aliases so that drivers etc that use the SOC_FOO symbols can be converted.

---
To me, the most straight-forward conversion looks like so:
- this patch is applied in week 2 of the merge window, to avoid any conflicts with the Renesas tree
- all users of the SOC_ variants can be converted over a release cycle (or more) & no trees need to merge an immutable branch.
- we convert defconfig etc over after all users are converted
- doing it over at least one release cycle means that make oldconfig will keep people's configs working as they upgrade
- any new SoC families added uses ARCH_FOO

---
 arch/riscv/Kconfig.socs | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/riscv/Kconfig.socs +21 -0
index 75fb0390d6bd..58cd2304b82d 100644
@@ -1,5 +1,8 @@
 menu "SoC selection"
 
+config ARCH_MICROCHIP_POLARFIRE
+	def_bool SOC_MICROCHIP_POLARFIRE
+
 config SOC_MICROCHIP_POLARFIRE
 	bool "Microchip PolarFire SoCs"
 	select MCHP_CLK_MPFS
@@ -12,6 +15,9 @@ config ARCH_RENESAS
 	help
 	  This enables support for the RISC-V based Renesas SoCs.
 
+config ARCH_SIFIVE
+	def_bool SOC_SIFIVE
+
 config SOC_SIFIVE
 	bool "SiFive SoCs"
 	select SERIAL_SIFIVE if TTY
@@ -23,6 +29,9 @@ config SOC_SIFIVE
 	help
 	  This enables support for SiFive SoC platform hardware.
 
+config ARCH_STARFIVE
+	def_bool SOC_STARFIVE
+
 config SOC_STARFIVE
 	bool "StarFive SoCs"
 	select PINCTRL
@@ -31,6 +40,9 @@ config SOC_STARFIVE
 	help
 	  This enables support for StarFive SoC platform hardware.
 
+config ARCH_VIRT
+	def_bool SOC_VIRT
+	
 config SOC_VIRT
 	bool "QEMU Virt Machine"
 	select CLINT_TIMER if RISCV_M_MODE
@@ -46,6 +58,9 @@ config SOC_VIRT
 	help
 	  This enables support for QEMU Virt Machine.
 
+config ARCH_CANAAN
+	def_bool SOC_CANAAN
+
 config SOC_CANAAN
 	bool "Canaan Kendryte K210 SoC"
 	depends on !MMU
@@ -62,6 +77,9 @@ config SOC_CANAAN
 
 if SOC_CANAAN
 
+config ARCH_CANAAN_K210_DTB_BUILTIN
+	def_bool SOC_CANAAN_K210_DTB_BUILTIN
+
 config SOC_CANAAN_K210_DTB_BUILTIN
 	bool "Builtin device tree for the Canaan Kendryte K210"
 	depends on SOC_CANAAN
@@ -73,6 +91,9 @@ config SOC_CANAAN_K210_DTB_BUILTIN
 	  This option should be selected if no bootloader is being used.
 	  If unsure, say Y.
 
+config ARCH_CANAAN_K210_DTB_SOURCE
+	def_bool SOC_CANAAN_K210_DTB_SOURCE
+
 config SOC_CANAAN_K210_DTB_SOURCE
 	string "Source file for the Canaan Kendryte K210 builtin DTB"
 	depends on SOC_CANAAN
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#2 lore raw

Re: [PATCH v1 1/7] RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

Hi Conor,

Quoted 7 lines · Conor Dooley

From: Conor Dooley <[email protected]>

To facilitate a transfer from SOC_FOO to ARCH_FOO, over a release cycle, introduce some aliases so that drivers etc that use the SOC_FOO symbols can be converted.

Thanks for your patch, which is now commit fc43211939bb6874 ("RISC-V: kconfig.socs: convert usage of SOC_CANAAN to ARCH_CANAAN") in riscv/for-next

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 95

Quoted 9 lines
arch/riscv/Kconfig.socs +2 -0
@@ -73,6 +91,9 @@ config SOC_CANAAN_K210_DTB_BUILTIN
          This option should be selected if no bootloader is being used.
          If unsure, say Y.
 
+config ARCH_CANAAN_K210_DTB_SOURCE
+       def_bool SOC_CANAAN_K210_DTB_SOURCE

This is not correct, as SOC_CANAAN_K210_DTB_SOURCE below is not a bool, but a string.

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 99

Quoted 4 lines
arch/riscv/Kconfig.socs +1 -0
+
 config SOC_CANAAN_K210_DTB_SOURCE
        string "Source file for the Canaan Kendryte K210 builtin DTB"
        depends on SOC_CANAAN

Hence

    obj-$(CONFIG_ARCH_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o,

$(CONFIG_ARCH_CANAAN_K210_DTB_SOURCE))

will do the wrong thing later, and I get a non-bootable system (no output) on my MAiX-BiT.

Unfortunately there is no def_string, so I don't think we can fix this in a backwards-compatible way, and have to replace all SOC_CANAAN_K210_DTB_SOURCE by ARCH_CANAAN_K210_DTB_SOURCE, and urging users to update their .config manually.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

author maintainer
#3 lore raw

Re: [PATCH v1 1/7] RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

Hi Geert...

Quoted 7 lines · Geert Uytterhoeven
Quoted 6 lines · Conor Dooley

From: Conor Dooley <[email protected]>

To facilitate a transfer from SOC_FOO to ARCH_FOO, over a release cycle, introduce some aliases so that drivers etc that use the SOC_FOO symbols can be converted.

Quoted 5 lines
Quoted 1 line

Thanks for your patch, which is now commit fc43211939bb6874 ("RISC-V: kconfig.socs: convert usage of SOC_CANAAN to ARCH_CANAAN") in riscv/for-next

I see this and I immediately know it is going to be bad news!

Quoted 23 lines

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 95

Quoted 9 lines
arch/riscv/Kconfig.socs +2 -0
@@ -73,6 +91,9 @@ config SOC_CANAAN_K210_DTB_BUILTIN
          This option should be selected if no bootloader is being used.
          If unsure, say Y.
 
+config ARCH_CANAAN_K210_DTB_SOURCE
+       def_bool SOC_CANAAN_K210_DTB_SOURCE

This is not correct, as SOC_CANAAN_K210_DTB_SOURCE below is not a bool, but a string.

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 99

Quoted 4 lines
arch/riscv/Kconfig.socs +1 -0
+
 config SOC_CANAAN_K210_DTB_SOURCE
        string "Source file for the Canaan Kendryte K210 builtin DTB"
        depends on SOC_CANAAN

Hence

    obj-$(CONFIG_ARCH_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o,

$(CONFIG_ARCH_CANAAN_K210_DTB_SOURCE))

Quoted 7 lines

will do the wrong thing later, and I get a non-bootable system (no output) on my MAiX-BiT.

Unfortunately there is no def_string, so I don't think we can fix this in a backwards-compatible way, and have to replace all SOC_CANAAN_K210_DTB_SOURCE by ARCH_CANAAN_K210_DTB_SOURCE, and urging users to update their .config manually.

That sucks. I'm not sure how I missed this - I had tested originally on my k210, but evidently there was something wrong with how I had done it. I must have not tested a subsequent revision on the k210. Mea cupla.

As it wasn't my intention to inflict this change without time for the symbols to appear in configs, my immediate feeling is that this part of the change should be reverted.

Of course, we could so something like:

arch/riscv/Kconfig.socs +2 -1
index 34a54e5310a1..d36a5f39f13a 100644
@@ -79,7 +79,8 @@ config SOC_CANAAN_K210_DTB_BUILTIN
          If unsure, say Y.
 
 config ARCH_CANAAN_K210_DTB_SOURCE
-       def_bool SOC_CANAAN_K210_DTB_SOURCE
+       string
+       default SOC_CANAAN_K210_DTB_SOURCE
 
 config SOC_CANAAN_K210_DTB_SOURCE
        string "Source file for the Canaan Kendryte K210 builtin DTB"

But I am not sure of how that interacts with the various methods of updating ones config.
From, admittedly limited, testing it does get updated if SOC_CANAAN_K210_DTB_SOURCE is changed using menuconfig. Similarly, if one alters that symbol and does olddefconfig it also gets updated.

I'm sure I am overlooking something here though, what is it?

Thanks & apologies,
Conor.

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#4 lore raw

Re: [PATCH v1 1/7] RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

Hi Conor,

Quoted 61 lines · Conor Dooley
Quoted 7 lines · Geert Uytterhoeven
Quoted 6 lines · Conor Dooley

From: Conor Dooley <[email protected]>

To facilitate a transfer from SOC_FOO to ARCH_FOO, over a release cycle, introduce some aliases so that drivers etc that use the SOC_FOO symbols can be converted.

Quoted 5 lines
Quoted 1 line

Thanks for your patch, which is now commit fc43211939bb6874 ("RISC-V: kconfig.socs: convert usage of SOC_CANAAN to ARCH_CANAAN") in riscv/for-next

I see this and I immediately know it is going to be bad news!

Quoted 23 lines

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 95

Quoted 9 lines
arch/riscv/Kconfig.socs +2 -0
@@ -73,6 +91,9 @@ config SOC_CANAAN_K210_DTB_BUILTIN
          This option should be selected if no bootloader is being used.
          If unsure, say Y.
 
+config ARCH_CANAAN_K210_DTB_SOURCE
+       def_bool SOC_CANAAN_K210_DTB_SOURCE

This is not correct, as SOC_CANAAN_K210_DTB_SOURCE below is not a bool, but a string.

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN

Quoted 4 lines
arch/riscv/Kconfig.socs +1 -0
+
 config SOC_CANAAN_K210_DTB_SOURCE
        string "Source file for the Canaan Kendryte K210 builtin DTB"
        depends on SOC_CANAAN

Hence

    obj-$(CONFIG_ARCH_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o,

$(CONFIG_ARCH_CANAAN_K210_DTB_SOURCE))

Quoted 7 lines

will do the wrong thing later, and I get a non-bootable system (no output) on my MAiX-BiT.

Unfortunately there is no def_string, so I don't think we can fix this in a backwards-compatible way, and have to replace all SOC_CANAAN_K210_DTB_SOURCE by ARCH_CANAAN_K210_DTB_SOURCE, and urging users to update their .config manually.

That sucks. I'm not sure how I missed this - I had tested originally on my k210, but evidently there was something wrong with how I had done it. I must have not tested a subsequent revision on the k210. Mea cupla.

As it wasn't my intention to inflict this change without time for the symbols to appear in configs, my immediate feeling is that this part of the change should be reverted.

Of course, we could so something like:

arch/riscv/Kconfig.socs +0 -0
index 34a54e5310a1..d36a5f39f13a 100644

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 83

Quoted 6 lines
arch/riscv/Kconfig.socs +2 -1
@@ -79,7 +79,8 @@ config SOC_CANAAN_K210_DTB_BUILTIN
          If unsure, say Y.
 
 config ARCH_CANAAN_K210_DTB_SOURCE
-       def_bool SOC_CANAAN_K210_DTB_SOURCE
+       string
+       default SOC_CANAAN_K210_DTB_SOURCE

Thanks, that works!
I guess it was too late in the evening for me, to realize that the lack of "def_string" can be worked around using "string" and "default".

Quoted 8 lines
arch/riscv/Kconfig.socs +0 -0
 config SOC_CANAAN_K210_DTB_SOURCE
        string "Source file for the Canaan Kendryte K210 builtin DTB"
 

But I am not sure of how that interacts with the various methods of updating ones config.
From, admittedly limited, testing it does get updated if SOC_CANAAN_K210_DTB_SOURCE is changed using menuconfig. Similarly, if one alters that symbol and does olddefconfig it also gets updated.

With the above, the value of SOC_CANAAN_K210_DTB_SOURCE in existing config files will be copied to ARCH_CANAAN_K210_DTB_SOURCE when running "make oldconfig".
Hence in v6.4 you can drop the old SOC_CANAAN_K210_DTB_SOURCE. As that symbol is not present in defconfigs, there is nothing to update there,

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#5 lore raw

Re: [PATCH v1 1/7] RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

In reply to Geert Uytterhoeven
Quoted 38 lines · Geert Uytterhoeven

Hi Conor,

Quoted 7 lines · Conor Dooley

From: Conor Dooley <[email protected]>

To facilitate a transfer from SOC_FOO to ARCH_FOO, over a release cycle, introduce some aliases so that drivers etc that use the SOC_FOO symbols can be converted.

Thanks for your patch, which is now commit fc43211939bb6874 ("RISC-V: kconfig.socs: convert usage of SOC_CANAAN to ARCH_CANAAN") in riscv/for-next

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 95

Quoted 9 lines
arch/riscv/Kconfig.socs +2 -0
@@ -73,6 +91,9 @@ config SOC_CANAAN_K210_DTB_BUILTIN
          This option should be selected if no bootloader is being used.
          If unsure, say Y.
 
+config ARCH_CANAAN_K210_DTB_SOURCE
+       def_bool SOC_CANAAN_K210_DTB_SOURCE

This is not correct, as SOC_CANAAN_K210_DTB_SOURCE below is not a bool, but a string.

arch/riscv/Kconfig.socs config SOC_CANAAN_K210_DTB_BUILTIN · line 99

Quoted 4 lines
arch/riscv/Kconfig.socs +1 -0
+
 config SOC_CANAAN_K210_DTB_SOURCE
        string "Source file for the Canaan Kendryte K210 builtin DTB"
        depends on SOC_CANAAN

Hence

    obj-$(CONFIG_ARCH_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o,

$(CONFIG_ARCH_CANAAN_K210_DTB_SOURCE))

Quoted 7 lines

will do the wrong thing later, and I get a non-bootable system (no output) on my MAiX-BiT.

Unfortunately there is no def_string, so I don't think we can fix this in a backwards-compatible way, and have to replace all SOC_CANAAN_K210_DTB_SOURCE by ARCH_CANAAN_K210_DTB_SOURCE, and urging users to update their .config manually.

Yes, the default built-in dtb is set to k210_generic.dts since we have a only generic nommu_k210[_sdcard] defconfig. We could add defconfigs per board type, but that is not the common approach.

By the way, I recall some pushback with the renaming of SOC_XXX to ARCH_XXX. I personally do not like it and Christoph suggested the revers approach of renaming arm ARCH_XXX to something else instead. I did not follow further on that discussion, but it looks like the riscv SOC_XXX renaming went through ?

Quoted 11 lines

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Signature · 8 lines
Damien Le Moal
Western Digital Research


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author maintainer
#6 lore raw

Re: [PATCH v1 1/7] RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

Quoted 5 lines · Damien Le Moal

By the way, I recall some pushback with the renaming of SOC_XXX to ARCH_XXX. I personally do not like it and Christoph suggested the revers approach of renaming arm ARCH_XXX to something else instead. I did not follow further on that discussion, but it looks like the riscv SOC_XXX renaming went through ?

We asked the ARM guys about it, I think on IRC as they'd not replied to the thread, and cold water was poured on the idea.

It's Murphy's Law that the thing with the problem would be the k210 too isn't it.
I could've sworn I booted one of each vendor so kinda kicking myself right now.

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#7 lore raw

Re: [PATCH v1 1/7] RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

Quoted 9 lines · Conor Dooley
Quoted 5 lines · Damien Le Moal

By the way, I recall some pushback with the renaming of SOC_XXX to ARCH_XXX. I personally do not like it and Christoph suggested the revers approach of renaming arm ARCH_XXX to something else instead. I did not follow further on that discussion, but it looks like the riscv SOC_XXX renaming went through ?

We asked the ARM guys about it, I think on IRC as they'd not replied to the thread, and cold water was poured on the idea.

That is really too bad. Naming something ARCH_XXX that is not a CPU architecture is simply very confusing I think.

Quoted 4 lines

It's Murphy's Law that the thing with the problem would be the k210 too isn't it.
I could've sworn I booted one of each vendor so kinda kicking myself right now.

Signature · 8 lines
Damien Le Moal
Western Digital Research


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#8 lore raw

Re: [PATCH v1 1/7] RISC-V: introduce ARCH_FOO kconfig aliases for SOC_FOO symbols

Hi Damien,

Quoted 8 lines · Damien Le Moal
Quoted 7 lines · Conor Dooley
Quoted 5 lines · Damien Le Moal

By the way, I recall some pushback with the renaming of SOC_XXX to ARCH_XXX. I personally do not like it and Christoph suggested the revers approach of renaming arm ARCH_XXX to something else instead. I did not follow further on that discussion, but it looks like the riscv SOC_XXX renaming went through ?

Quoted 5 lines
Quoted 2 lines

We asked the ARM guys about it, I think on IRC as they'd not replied to the thread, and cold water was poured on the idea.

That is really too bad. Naming something ARCH_XXX that is not a CPU architecture is simply very confusing I think.

I agree it is.
However, fixing that means adding backwards-compatiblity symbols, updating the few thousand existing users, and dropping the old symbols. And handling all the fall-out of people who didn't run "make oldconfig" in between, now wondering why their kernel no longer boots.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

author maintainer
#9 lore raw

PATCH 2/7 RISC-V: kconfig.socs: convert usage of SOC_CANAAN to ARCH_CANAAN

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

While we cannot yet drop the SOC_ prefixed symbols, we can convert uses of these symbols within Kconfig.socs to the ARCH_ variants.

---
 arch/riscv/Kconfig.socs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/riscv/Kconfig.socs +5 -5
index 58cd2304b82d..203d1c528ef4 100644
@@ -75,14 +75,14 @@ config SOC_CANAAN
 	help
 	  This enables support for Canaan Kendryte K210 SoC platform hardware.
 
-if SOC_CANAAN
+if ARCH_CANAAN
 
 config ARCH_CANAAN_K210_DTB_BUILTIN
 	def_bool SOC_CANAAN_K210_DTB_BUILTIN
 
 config SOC_CANAAN_K210_DTB_BUILTIN
 	bool "Builtin device tree for the Canaan Kendryte K210"
-	depends on SOC_CANAAN
+	depends on ARCH_CANAAN
 	default y
 	select OF
 	select BUILTIN_DTB
@@ -96,14 +96,14 @@ config ARCH_CANAAN_K210_DTB_SOURCE
 
 config SOC_CANAAN_K210_DTB_SOURCE
 	string "Source file for the Canaan Kendryte K210 builtin DTB"
-	depends on SOC_CANAAN
-	depends on SOC_CANAAN_K210_DTB_BUILTIN
+	depends on ARCH_CANAAN
+	depends on ARCH_CANAAN_K210_DTB_BUILTIN
 	default "k210_generic"
 	help
 	  Base name (without suffix, relative to arch/riscv/boot/dts/canaan)
 	  for the DTS file that will be used to produce the DTB linked into the
 	  kernel.
 
-endif # SOC_CANAAN
+endif # ARCH_CANAAN
 
 endmenu # "SoC selection"
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author maintainer
#10 lore raw

PATCH 3/7 RISC-V: kbuild: convert all use of SOC_FOO to ARCH_FOO

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

Convert all non user visible use of SOC_FOO symbols to their ARCH_FOO variants. The canaan DTs are an outlier in that they're gated at the directory and the file level. Drop the directory level gating while we are swapping the symbol names over.

---
 arch/riscv/Makefile                    |  2 +-
 arch/riscv/boot/dts/Makefile           |  2 +-
 arch/riscv/boot/dts/canaan/Makefile    | 14 +++++++-------
 arch/riscv/boot/dts/microchip/Makefile |  8 ++++----
 arch/riscv/boot/dts/sifive/Makefile    |  4 ++--
 arch/riscv/boot/dts/starfive/Makefile  |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
arch/riscv/Makefile +1 -1
index 0d13b597cb55..46a520c1273c 100644
@@ -131,7 +131,7 @@ endif
 endif
 
 ifneq ($(CONFIG_XIP_KERNEL),y)
-ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_SOC_CANAAN),yy)
+ifeq ($(CONFIG_RISCV_M_MODE)$(CONFIG_ARCH_CANAAN),yy)
 KBUILD_IMAGE := $(boot)/loader.bin
 else
 ifeq ($(CONFIG_EFI_ZBOOT),)
arch/riscv/boot/dts/Makefile +1 -1
index b0ff5fbabb0c..0c97d673b775 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 subdir-y += sifive
 subdir-y += starfive
-subdir-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += canaan
+subdir-y += canaan
 subdir-y += microchip
 subdir-y += renesas
 
arch/riscv/boot/dts/canaan/Makefile +7 -7
index befe4eb7527b..520623264c87 100644
@@ -1,9 +1,9 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_SOC_CANAAN) += canaan_kd233.dtb
-dtb-$(CONFIG_SOC_CANAAN) += k210_generic.dtb
-dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_bit.dtb
-dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_dock.dtb
-dtb-$(CONFIG_SOC_CANAAN) += sipeed_maix_go.dtb
-dtb-$(CONFIG_SOC_CANAAN) += sipeed_maixduino.dtb
+dtb-$(CONFIG_ARCH_CANAAN) += canaan_kd233.dtb
+dtb-$(CONFIG_ARCH_CANAAN) += k210_generic.dtb
+dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_bit.dtb
+dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_dock.dtb
+dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_go.dtb
+dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maixduino.dtb
 
-obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))
+obj-$(CONFIG_ARCH_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o, $(CONFIG_ARCH_CANAAN_K210_DTB_SOURCE))
arch/riscv/boot/dts/microchip/Makefile +4 -4
index 7427a20934f3..259c3c802cab 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-icicle-kit.dtb
-dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-m100pfsevp.dtb
-dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-polarberry.dtb
-dtb-$(CONFIG_SOC_MICROCHIP_POLARFIRE) += mpfs-sev-kit.dtb
+dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-icicle-kit.dtb
+dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-m100pfsevp.dtb
+dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-polarberry.dtb
+dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-sev-kit.dtb
 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
arch/riscv/boot/dts/sifive/Makefile +2 -2
index d90e4eb0ade8..6a5fbd4ed96a 100644
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_SOC_SIFIVE) += hifive-unleashed-a00.dtb \
-			    hifive-unmatched-a00.dtb
+dtb-$(CONFIG_ARCH_SIFIVE) += hifive-unleashed-a00.dtb \
+			     hifive-unmatched-a00.dtb
 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
arch/riscv/boot/dts/starfive/Makefile +1 -1
index 039c143cba33..7b00a48580ca 100644
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0
-dtb-$(CONFIG_SOC_STARFIVE) += jh7100-beaglev-starlight.dtb jh7100-starfive-visionfive-v1.dtb
+dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-beaglev-starlight.dtb jh7100-starfive-visionfive-v1.dtb
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#11 lore raw

Re: [PATCH v1 3/7] RISC-V: kbuild: convert all use of SOC_FOO to ARCH_FOO

Quoted 6 lines · Conor Dooley

From: Conor Dooley <[email protected]>

Convert all non user visible use of SOC_FOO symbols to their ARCH_FOO variants. The canaan DTs are an outlier in that they're gated at the directory and the file level. Drop the directory level gating while we are swapping the symbol names over.

I still very much disagree with this. ARCH_FOO for something that is not a Linux architecture is a really really bad idea. We need to fix arm and not convert riscv, which got this right.

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

maintainer
#12 lore raw

Re: [PATCH v1 3/7] RISC-V: kbuild: convert all use of SOC_FOO to ARCH_FOO

Quoted 9 lines · Christoph Hellwig
Quoted 6 lines · Conor Dooley

From: Conor Dooley <[email protected]>

Convert all non user visible use of SOC_FOO symbols to their ARCH_FOO variants. The canaan DTs are an outlier in that they're gated at the directory and the file level. Drop the directory level gating while we are swapping the symbol names over.

Quoted 3 lines

I still very much disagree with this. ARCH_FOO for something that is not a Linux architecture is a really really bad idea. We need to fix arm and not convert riscv, which got this right.

Makes sense, though I guess I'd argue that SOC is also a wrong name (but at least it doesn't conflict with the ARCH_* symbols that already exist). That'll touch a bunch of trees, adding the Arm folks to see if they're on board.

I don't care a ton either way, my only opinion here is that RISC-V and Arm should use the same scheme. If the Arm folks want to move over to SOC_* that works for me, and has the advantage of being no work on my end ;)

author maintainer
#13 lore raw

PATCH 4/7 RISC-V: stop selecting SIFIVE_PLIC at the SoC level

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

The SIFIVE_PLIC driver is used by all current RISC-V SoCs & will be, where possible, used for future implementations. Rather than having each SoC select the option in Kconfig.socs, do so at the arch level.

---
 arch/riscv/Kconfig      | 1 +
 arch/riscv/Kconfig.socs | 5 -----
 2 files changed, 1 insertion(+), 5 deletions(-)
arch/riscv/Kconfig +1 -0
index fec54872ab45..d7334e02d20b 100644
@@ -125,6 +125,7 @@ config RISCV
 	select PCI_MSI if PCI
 	select RISCV_INTC
 	select RISCV_TIMER if RISCV_SBI
+	select SIFIVE_PLIC
 	select SPARSE_IRQ
 	select SYSCTL_EXCEPTION_TRACE
 	select THREAD_INFO_IN_TASK
arch/riscv/Kconfig.socs +0 -5
index 203d1c528ef4..ce920f627f6d 100644
@@ -6,7 +6,6 @@ config ARCH_MICROCHIP_POLARFIRE
 config SOC_MICROCHIP_POLARFIRE
 	bool "Microchip PolarFire SoCs"
 	select MCHP_CLK_MPFS
-	select SIFIVE_PLIC
 	help
 	  This enables support for Microchip PolarFire SoC platforms.
 
@@ -24,7 +23,6 @@ config SOC_SIFIVE
 	select SERIAL_SIFIVE_CONSOLE if TTY
 	select CLK_SIFIVE
 	select CLK_SIFIVE_PRCI
-	select SIFIVE_PLIC
 	select ERRATA_SIFIVE if !XIP_KERNEL
 	help
 	  This enables support for SiFive SoC platform hardware.
@@ -36,7 +34,6 @@ config SOC_STARFIVE
 	bool "StarFive SoCs"
 	select PINCTRL
 	select RESET_CONTROLLER
-	select SIFIVE_PLIC
 	help
 	  This enables support for StarFive SoC platform hardware.
 
@@ -51,7 +48,6 @@ config SOC_VIRT
 	select POWER_RESET_SYSCON_POWEROFF
 	select GOLDFISH
 	select RTC_DRV_GOLDFISH if RTC_CLASS
-	select SIFIVE_PLIC
 	select PM_GENERIC_DOMAINS if PM
 	select PM_GENERIC_DOMAINS_OF if PM && OF
 	select RISCV_SBI_CPUIDLE if CPU_IDLE && RISCV_SBI
@@ -67,7 +63,6 @@ config SOC_CANAAN
 	select CLINT_TIMER if RISCV_M_MODE
 	select SERIAL_SIFIVE if TTY
 	select SERIAL_SIFIVE_CONSOLE if TTY
-	select SIFIVE_PLIC
 	select ARCH_HAS_RESET_CONTROLLER
 	select PINCTRL
 	select COMMON_CLK
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author maintainer
#14 lore raw

PATCH 5/7 RISC-V: stop selecting the PolarFire SoC clock driver

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

The driver is now enabled by default if SOC_MICROCHIP_POLARFIRE so there is no longer a need to select it in Kconfig.socs

---
 arch/riscv/Kconfig.socs | 1 -
 1 file changed, 1 deletion(-)
arch/riscv/Kconfig.socs +0 -1
index ce920f627f6d..aca5e750772c 100644
@@ -5,7 +5,6 @@ config ARCH_MICROCHIP_POLARFIRE
 
 config SOC_MICROCHIP_POLARFIRE
 	bool "Microchip PolarFire SoCs"
-	select MCHP_CLK_MPFS
 	help
 	  This enables support for Microchip PolarFire SoC platforms.
 
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#15 lore raw

Re: [PATCH v1 5/7] RISC-V: stop selecting the PolarFire SoC clock driver

Hi Conor,

Thanks for your patch!

Quoted 4 lines · Conor Dooley

From: Conor Dooley <[email protected]>

The driver is now enabled by default if SOC_MICROCHIP_POLARFIRE so there is no longer a need to select it in Kconfig.socs

Where is it enabled by default?
I cannot seem to find that location...

arch/riscv/Kconfig.socs config ARCH_MICROCHIP_POLARFIRE · line 9

Quoted 12 lines
arch/riscv/Kconfig.socs +0 -1
@@ -5,7 +5,6 @@ config ARCH_MICROCHIP_POLARFIRE
 
 config SOC_MICROCHIP_POLARFIRE
        bool "Microchip PolarFire SoCs"
-       select MCHP_CLK_MPFS
        help
          This enables support for Microchip PolarFire SoC platforms.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#16 lore raw

Re: [PATCH v1 5/7] RISC-V: stop selecting the PolarFire SoC clock driver

Quoted 8 lines · Geert Uytterhoeven
Quoted 4 lines · Conor Dooley

From: Conor Dooley <[email protected]>

The driver is now enabled by default if SOC_MICROCHIP_POLARFIRE so there is no longer a need to select it in Kconfig.socs

Where is it enabled by default?
I cannot seem to find that location...

Huh, you're right.. I could have sworn I had submitted a patch for that but it turns out I only submitted a patch to make the SiFive clk stuff default on. I suppose my defconfig has an explicit set in it and I never noticed.

Thanks Geert!

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

author maintainer
#17 lore raw

PATCH 6/7 RISC-V: stop selecting SiFive clock and serial drivers directly

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

The SiFive clock and serial drivers will now default to the value of SOC_SIFIVE so there is no need to directly select their symbols anymore.

---
 arch/riscv/Kconfig.socs | 4 ----
 1 file changed, 4 deletions(-)
arch/riscv/Kconfig.socs +0 -4
index aca5e750772c..b90af1e22bc0 100644
@@ -18,10 +18,6 @@ config ARCH_SIFIVE
 
 config SOC_SIFIVE
 	bool "SiFive SoCs"
-	select SERIAL_SIFIVE if TTY
-	select SERIAL_SIFIVE_CONSOLE if TTY
-	select CLK_SIFIVE
-	select CLK_SIFIVE_PRCI
 	select ERRATA_SIFIVE if !XIP_KERNEL
 	help
 	  This enables support for SiFive SoC platform hardware.
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author maintainer
#18 lore raw

PATCH 7/7 RISC-V: stop directly selecting drivers for SOC_CANAAN

In reply to Conor Dooley

From: Conor Dooley <[email protected]>

The serial and clock drivers will be enabled by default if the symbol itself is enabled, so stop directly selecting the drivers in Kconfigs.socs.

---
 arch/riscv/Kconfig.socs | 3 ---
 1 file changed, 3 deletions(-)
arch/riscv/Kconfig.socs +0 -3
index b90af1e22bc0..34a54e5310a1 100644
@@ -56,12 +56,9 @@ config SOC_CANAAN
 	bool "Canaan Kendryte K210 SoC"
 	depends on !MMU
 	select CLINT_TIMER if RISCV_M_MODE
-	select SERIAL_SIFIVE if TTY
-	select SERIAL_SIFIVE_CONSOLE if TTY
 	select ARCH_HAS_RESET_CONTROLLER
 	select PINCTRL
 	select COMMON_CLK
-	select COMMON_CLK_K210
 	help
 	  This enables support for Canaan Kendryte K210 SoC platform hardware.
 
Signature · 7 lines
2.37.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv