Skip to content

Commit 59f3370

Browse files
committed
Merge tag 'riscv-dt-fixes-for-v6.8-final' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/dt
RISC-V Devicetree fixes for v6.8-final Starfive: The previous cleanup broke boot on the jh7100 as the driver depended on the fallback clock name created based on the node-name when clock-output-names is not present. Add clock-output-names to restore working order. Generic: BUILTIN_DTB has been broken for ages on any platform other than the nommu Canaan k210 SoC as the first dtb built (in alphanumerical order), would get built into the image. This didn't get fixed for ages because nobody actually cared about running it other than the k210 enough to fix it. The folks doing Sophgo SG2042 development have come along and fixed it, as they want to use builtin dtbs. linux-boot on that platform reuses the dtb it was provided by OpenSBI when booting linux proper, which is unfortunately not possible to boot a mainline kernel with. Signed-off-by: Conor Dooley <[email protected]> * tag 'riscv-dt-fixes-for-v6.8-final' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: Move BUILTIN_DTB_SOURCE to common Kconfig riscv: dts: starfive: jh7100: fix root clock names Link: https://lore.kernel.org/r/20240306-waltz-facial-9e4e1b792053@spud Signed-off-by: Arnd Bergmann <[email protected]>
2 parents ce04864 + 2672031 commit 59f3370

File tree

9 files changed

+22
-38
lines changed

9 files changed

+22
-38
lines changed

arch/riscv/Kconfig

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,19 @@ config RISCV_ISA_FALLBACK
983983
config BUILTIN_DTB
984984
bool "Built-in device tree"
985985
depends on OF && NONPORTABLE
986-
default y if XIP_KERNEL
986+
help
987+
Build a device tree into the Linux image.
988+
This option should be selected if no bootloader is being used.
989+
If unsure, say N.
990+
991+
992+
config BUILTIN_DTB_SOURCE
993+
string "Built-in device tree source"
994+
depends on BUILTIN_DTB
995+
help
996+
DTS file path (without suffix, relative to arch/riscv/boot/dts)
997+
for the DTS file that will be used to produce the DTB linked into the
998+
kernel.
987999

9881000
endmenu # "Boot options"
9891001

arch/riscv/Kconfig.socs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -84,36 +84,4 @@ config SOC_CANAAN
8484
help
8585
This enables support for Canaan Kendryte K210 SoC platform hardware.
8686

87-
if ARCH_CANAAN
88-
89-
config ARCH_CANAAN_K210_DTB_BUILTIN
90-
def_bool SOC_CANAAN_K210_DTB_BUILTIN
91-
92-
config SOC_CANAAN_K210_DTB_BUILTIN
93-
bool "Builtin device tree for the Canaan Kendryte K210"
94-
depends on ARCH_CANAAN
95-
default y
96-
select OF
97-
select BUILTIN_DTB
98-
help
99-
Build a device tree for the Kendryte K210 into the Linux image.
100-
This option should be selected if no bootloader is being used.
101-
If unsure, say Y.
102-
103-
config ARCH_CANAAN_K210_DTB_SOURCE
104-
string
105-
default SOC_CANAAN_K210_DTB_SOURCE
106-
107-
config SOC_CANAAN_K210_DTB_SOURCE
108-
string "Source file for the Canaan Kendryte K210 builtin DTB"
109-
depends on ARCH_CANAAN
110-
depends on ARCH_CANAAN_K210_DTB_BUILTIN
111-
default "k210_generic"
112-
help
113-
Base name (without suffix, relative to arch/riscv/boot/dts/canaan)
114-
for the DTS file that will be used to produce the DTB linked into the
115-
kernel.
116-
117-
endif # ARCH_CANAAN
118-
11987
endmenu # "SoC selection"

arch/riscv/boot/dts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ subdir-y += sophgo
88
subdir-y += starfive
99
subdir-y += thead
1010

11-
obj-$(CONFIG_BUILTIN_DTB) := $(addsuffix /, $(subdir-y))
11+
obj-$(CONFIG_BUILTIN_DTB) := $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE))

arch/riscv/boot/dts/canaan/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_bit.dtb
55
dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_dock.dtb
66
dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maix_go.dtb
77
dtb-$(CONFIG_ARCH_CANAAN) += sipeed_maixduino.dtb
8-
9-
obj-$(CONFIG_ARCH_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb.o, $(CONFIG_ARCH_CANAAN_K210_DTB_SOURCE))

arch/riscv/boot/dts/microchip/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-m100pfsevp.dtb
44
dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-polarberry.dtb
55
dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-sev-kit.dtb
66
dtb-$(CONFIG_ARCH_MICROCHIP_POLARFIRE) += mpfs-tysom-m.dtb
7-
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))

arch/riscv/boot/dts/sifive/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0
22
dtb-$(CONFIG_ARCH_SIFIVE) += hifive-unleashed-a00.dtb \
33
hifive-unmatched-a00.dtb
4-
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))

arch/riscv/boot/dts/starfive/jh7100.dtsi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,27 +116,31 @@
116116
osc_sys: osc-sys {
117117
compatible = "fixed-clock";
118118
#clock-cells = <0>;
119+
clock-output-names = "osc_sys";
119120
/* This value must be overridden by the board */
120121
clock-frequency = <0>;
121122
};
122123

123124
osc_aud: osc-aud {
124125
compatible = "fixed-clock";
125126
#clock-cells = <0>;
127+
clock-output-names = "osc_aud";
126128
/* This value must be overridden by the board */
127129
clock-frequency = <0>;
128130
};
129131

130132
gmac_rmii_ref: gmac-rmii-ref {
131133
compatible = "fixed-clock";
132134
#clock-cells = <0>;
135+
clock-output-names = "gmac_rmii_ref";
133136
/* Should be overridden by the board when needed */
134137
clock-frequency = <0>;
135138
};
136139

137140
gmac_gr_mii_rxclk: gmac-gr-mii-rxclk {
138141
compatible = "fixed-clock";
139142
#clock-cells = <0>;
143+
clock-output-names = "gmac_gr_mii_rxclk";
140144
/* Should be overridden by the board when needed */
141145
clock-frequency = <0>;
142146
};

arch/riscv/configs/nommu_k210_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ CONFIG_SMP=y
3333
CONFIG_NR_CPUS=2
3434
CONFIG_CMDLINE="earlycon console=ttySIF0"
3535
CONFIG_CMDLINE_FORCE=y
36+
CONFIG_BUILTIN_DTB=y
37+
CONFIG_BUILTIN_DTB_SOURCE="canaan/k210_generic"
3638
# CONFIG_SECCOMP is not set
3739
# CONFIG_STACKPROTECTOR is not set
3840
# CONFIG_GCC_PLUGINS is not set

arch/riscv/configs/nommu_k210_sdcard_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ CONFIG_SMP=y
2525
CONFIG_NR_CPUS=2
2626
CONFIG_CMDLINE="earlycon console=ttySIF0 root=/dev/mmcblk0p1 rootwait ro"
2727
CONFIG_CMDLINE_FORCE=y
28+
CONFIG_BUILTIN_DTB=y
29+
CONFIG_BUILTIN_DTB_SOURCE="canaan/k210_generic"
2830
# CONFIG_SECCOMP is not set
2931
# CONFIG_STACKPROTECTOR is not set
3032
# CONFIG_GCC_PLUGINS is not set

0 commit comments

Comments
 (0)