Skip to content

Commit 2c917b5

Browse files
geertuConchuOD
authored andcommitted
riscv: dts: canaan: Disable I/O devices unless used
It is considered good practice to disable on-SoC devices providing external I/O in the SoC-specific .dtsi, and enable them explicitly in the board-specific DTS files when actually wired-up and used. Hence: - Set the status of I/O devices in k210.dtsi to "disabled", - Override the status of used I/O devices in board-specific DTS files to "okay", - Drop unneeded status overrides in board DTS-specific files for the always-enabled pin controller. On e.g. MAiXBiT, this gets rid of an error message when probing the unused slave-only spi2 controller: dw_spi_mmio 50240000.spi: error -22: problem registering spi host dw_spi_mmio 50240000.spi: probe with driver dw_spi_mmio failed with error -22 which is seen since commit 98d75b9 ("spi: dw: Drop default number of CS setting"). Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
1 parent 9235784 commit 2c917b5

7 files changed

Lines changed: 32 additions & 7 deletions

File tree

arch/riscv/boot/dts/canaan/canaan_kd233.dts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
&fpioa {
5151
pinctrl-0 = <&jtag_pinctrl>;
5252
pinctrl-names = "default";
53-
status = "okay";
5453

5554
jtag_pinctrl: jtag-pinmux {
5655
pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -122,13 +121,15 @@
122121
#sound-dai-cells = <1>;
123122
pinctrl-0 = <&i2s0_pinctrl>;
124123
pinctrl-names = "default";
124+
status = "okay";
125125
};
126126

127127
&spi0 {
128128
pinctrl-0 = <&spi0_pinctrl>;
129129
pinctrl-names = "default";
130130
num-cs = <1>;
131131
cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
132+
status = "okay";
132133

133134
panel@0 {
134135
compatible = "canaan,kd233-tft", "ilitek,ili9341";

arch/riscv/boot/dts/canaan/k210.dtsi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
reg = <0x38000000 0x1000>;
131131
interrupts = <33>;
132132
clocks = <&sysclk K210_CLK_CPU>;
133+
status = "disabled";
133134
};
134135

135136
gpio0: gpio-controller@38001000 {
@@ -145,6 +146,7 @@
145146
<62>, <63>, <64>, <65>;
146147
gpio-controller;
147148
ngpios = <32>;
149+
status = "disabled";
148150
};
149151

150152
dmac0: dma-controller@50000000 {
@@ -180,6 +182,7 @@
180182
<&sysclk K210_CLK_GPIO>;
181183
clock-names = "bus", "db";
182184
resets = <&sysrst K210_RST_GPIO>;
185+
status = "disabled";
183186

184187
gpio1_0: gpio-port@0 {
185188
#gpio-cells = <2>;
@@ -207,6 +210,7 @@
207210
dsr-override;
208211
cts-override;
209212
ri-override;
213+
status = "disabled";
210214
};
211215

212216
uart2: serial@50220000 {
@@ -223,6 +227,7 @@
223227
dsr-override;
224228
cts-override;
225229
ri-override;
230+
status = "disabled";
226231
};
227232

228233
uart3: serial@50230000 {
@@ -239,6 +244,7 @@
239244
dsr-override;
240245
cts-override;
241246
ri-override;
247+
status = "disabled";
242248
};
243249

244250
spi2: spi@50240000 {
@@ -252,6 +258,7 @@
252258
<&sysclk K210_CLK_APB0>;
253259
clock-names = "ssi_clk", "pclk";
254260
resets = <&sysrst K210_RST_SPI2>;
261+
status = "disabled";
255262
};
256263

257264
i2s0: i2s@50250000 {
@@ -261,6 +268,7 @@
261268
clocks = <&sysclk K210_CLK_I2S0>;
262269
clock-names = "i2sclk";
263270
resets = <&sysrst K210_RST_I2S0>;
271+
status = "disabled";
264272
};
265273

266274
i2s1: i2s@50260000 {
@@ -270,6 +278,7 @@
270278
clocks = <&sysclk K210_CLK_I2S1>;
271279
clock-names = "i2sclk";
272280
resets = <&sysrst K210_RST_I2S1>;
281+
status = "disabled";
273282
};
274283

275284
i2s2: i2s@50270000 {
@@ -279,6 +288,7 @@
279288
clocks = <&sysclk K210_CLK_I2S2>;
280289
clock-names = "i2sclk";
281290
resets = <&sysrst K210_RST_I2S2>;
291+
status = "disabled";
282292
};
283293

284294
i2c0: i2c@50280000 {
@@ -289,6 +299,7 @@
289299
<&sysclk K210_CLK_APB0>;
290300
clock-names = "ref", "pclk";
291301
resets = <&sysrst K210_RST_I2C0>;
302+
status = "disabled";
292303
};
293304

294305
i2c1: i2c@50290000 {
@@ -299,6 +310,7 @@
299310
<&sysclk K210_CLK_APB0>;
300311
clock-names = "ref", "pclk";
301312
resets = <&sysrst K210_RST_I2C1>;
313+
status = "disabled";
302314
};
303315

304316
i2c2: i2c@502a0000 {
@@ -309,6 +321,7 @@
309321
<&sysclk K210_CLK_APB0>;
310322
clock-names = "ref", "pclk";
311323
resets = <&sysrst K210_RST_I2C2>;
324+
status = "disabled";
312325
};
313326

314327
fpioa: pinmux@502b0000 {
@@ -457,6 +470,7 @@
457470
reset-names = "spi";
458471
num-cs = <4>;
459472
reg-io-width = <4>;
473+
status = "disabled";
460474
};
461475

462476
spi1: spi@53000000 {
@@ -472,6 +486,7 @@
472486
reset-names = "spi";
473487
num-cs = <4>;
474488
reg-io-width = <4>;
489+
status = "disabled";
475490
};
476491

477492
spi3: spi@54000000 {
@@ -488,6 +503,7 @@
488503

489504
num-cs = <4>;
490505
reg-io-width = <4>;
506+
status = "disabled";
491507
};
492508
};
493509
};

arch/riscv/boot/dts/canaan/k210_generic.dts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
&fpioa {
2929
pinctrl-0 = <&jtag_pins>;
3030
pinctrl-names = "default";
31-
status = "okay";
3231

3332
jtag_pins: jtag-pinmux {
3433
pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,

arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
&fpioa {
6363
pinctrl-names = "default";
6464
pinctrl-0 = <&jtag_pinctrl>;
65-
status = "okay";
6665

6766
jtag_pinctrl: jtag-pinmux {
6867
pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -160,6 +159,7 @@
160159
#sound-dai-cells = <1>;
161160
pinctrl-0 = <&i2s0_pinctrl>;
162161
pinctrl-names = "default";
162+
status = "okay";
163163
};
164164

165165
&i2c1 {
@@ -174,6 +174,7 @@
174174
pinctrl-names = "default";
175175
num-cs = <1>;
176176
cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
177+
status = "okay";
177178

178179
panel@0 {
179180
compatible = "sitronix,st7789v";
@@ -203,6 +204,8 @@
203204
};
204205

205206
&spi3 {
207+
status = "okay";
208+
206209
flash@0 {
207210
compatible = "jedec,spi-nor";
208211
reg = <0>;

arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
&fpioa {
6868
pinctrl-0 = <&jtag_pinctrl>;
6969
pinctrl-names = "default";
70-
status = "okay";
7170

7271
jtag_pinctrl: jtag-pinmux {
7372
pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -163,6 +162,7 @@
163162
#sound-dai-cells = <1>;
164163
pinctrl-0 = <&i2s0_pinctrl>;
165164
pinctrl-names = "default";
165+
status = "okay";
166166
};
167167

168168
&i2c1 {
@@ -177,6 +177,7 @@
177177
pinctrl-names = "default";
178178
num-cs = <1>;
179179
cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
180+
status = "okay";
180181

181182
panel@0 {
182183
compatible = "sitronix,st7789v";

arch/riscv/boot/dts/canaan/sipeed_maix_go.dts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
&fpioa {
7474
pinctrl-0 = <&jtag_pinctrl>;
7575
pinctrl-names = "default";
76-
status = "okay";
7776

7877
jtag_pinctrl: jtag-pinmux {
7978
pinmux = <K210_FPIOA(0, K210_PCF_JTAG_TCLK)>,
@@ -171,6 +170,7 @@
171170
#sound-dai-cells = <1>;
172171
pinctrl-0 = <&i2s0_pinctrl>;
173172
pinctrl-names = "default";
173+
status = "okay";
174174
};
175175

176176
&i2c1 {
@@ -185,6 +185,7 @@
185185
pinctrl-names = "default";
186186
num-cs = <1>;
187187
cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
188+
status = "okay";
188189

189190
panel@0 {
190191
compatible = "sitronix,st7789v";
@@ -213,6 +214,8 @@
213214
};
214215

215216
&spi3 {
217+
status = "okay";
218+
216219
flash@0 {
217220
compatible = "jedec,spi-nor";
218221
reg = <0>;

arch/riscv/boot/dts/canaan/sipeed_maixduino.dts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
};
4444

4545
&fpioa {
46-
status = "okay";
47-
4846
uarths_pinctrl: uarths-pinmux {
4947
pinmux = <K210_FPIOA(4, K210_PCF_UARTHS_RX)>, /* Header "0" */
5048
<K210_FPIOA(5, K210_PCF_UARTHS_TX)>; /* Header "1" */
@@ -136,6 +134,7 @@
136134
#sound-dai-cells = <1>;
137135
pinctrl-0 = <&i2s0_pinctrl>;
138136
pinctrl-names = "default";
137+
status = "okay";
139138
};
140139

141140
&i2c1 {
@@ -150,6 +149,7 @@
150149
pinctrl-names = "default";
151150
num-cs = <1>;
152151
cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
152+
status = "okay";
153153

154154
panel@0 {
155155
compatible = "sitronix,st7789v";
@@ -178,6 +178,8 @@
178178
};
179179

180180
&spi3 {
181+
status = "okay";
182+
181183
flash@0 {
182184
compatible = "jedec,spi-nor";
183185
reg = <0>;

0 commit comments

Comments
 (0)