Skip to content

Commit ee7dad0

Browse files
committed
Merge tag 'riscv-dt-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux into soc/late
RISC-V Devicetrees for v6.9 Microchip: Missing bus clocks for the CAN controllers spotted during the creation of a driver for the controllers and a specific compatible for the SiFive PDMA block on PolarFire SoC. Starfive: PWM nodes for the jh7100 and jh7110. Camera subsystem support for the latter. Most notably however is the addition of ethernet support for the jh7110 which finally allows people to use the network on the OG VisionFive and on the Beagle-V Starlight board. This was made possible by the non-standard cache management operations support added for the RZ/Five which could be extended to the ccache present on the jh7100. bindings: Additional clarification for what the reg property represents for cpus and two opencores PWM binding changes - the original addition and an added compatible. The latter is here as the driver patch was not ready but the PWM maintainer told me to go ahead and merge it. Signed-off-by: Conor Dooley <[email protected]> * tag 'riscv-dt-for-v6.9' of https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux: riscv: dts: starfive: jh7110: Add camera subsystem nodes dt-bindings: pwm: opencores: Add compatible for StarFive JH8100 dt-bindings: riscv: cpus: reg matches hart ID riscv: dts: microchip: add specific compatible for mpfs pdma riscv: dts: microchip: add missing CAN bus clocks riscv: dts: starfive: beaglev-starlight: Setup phy reset gpio riscv: dts: starfive: visionfive-v1: Setup ethernet phy riscv: dts: starfive: jh7100-common: Setup pinmux and enable gmac riscv: dts: starfive: jh7100: Add sysmain and gmac DT nodes riscv: dts: starfive: jh7110: Add PWM node and pins configuration riscv: dts: starfive: jh7100: Add PWM node and pins configuration dt-bindings: pwm: Add bindings for OpenCores PWM Controller Link: https://lore.kernel.org/r/20240305-iodine-moneywise-53797ae9bf6e@spud Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 724ad89 + 28ecaaa commit ee7dad0

File tree

9 files changed

+395
-4
lines changed

9 files changed

+395
-4
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pwm/opencores,pwm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: OpenCores PWM controller
8+
9+
maintainers:
10+
- William Qiu <[email protected]>
11+
12+
description:
13+
The OpenCores PTC ip core contains a PWM controller. When operating in PWM
14+
mode, the PTC core generates binary signal with user-programmable low and
15+
high periods. All PTC counters and registers are 32-bit.
16+
17+
allOf:
18+
- $ref: pwm.yaml#
19+
20+
properties:
21+
compatible:
22+
items:
23+
- enum:
24+
- starfive,jh7100-pwm
25+
- starfive,jh7110-pwm
26+
- starfive,jh8100-pwm
27+
- const: opencores,pwm-v1
28+
29+
reg:
30+
maxItems: 1
31+
32+
clocks:
33+
maxItems: 1
34+
35+
resets:
36+
maxItems: 1
37+
38+
"#pwm-cells":
39+
const: 3
40+
41+
required:
42+
- compatible
43+
- reg
44+
- clocks
45+
46+
additionalProperties: false
47+
48+
examples:
49+
- |
50+
pwm@12490000 {
51+
compatible = "starfive,jh7110-pwm", "opencores,pwm-v1";
52+
reg = <0x12490000 0x10000>;
53+
clocks = <&clkgen 181>;
54+
resets = <&rstgen 109>;
55+
#pwm-cells = <3>;
56+
};

Documentation/devicetree/bindings/riscv/cpus.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ properties:
7575
- riscv,sv57
7676
- riscv,none
7777

78+
reg:
79+
description:
80+
The hart ID of this CPU node.
81+
7882
riscv,cbom-block-size:
7983
$ref: /schemas/types.yaml#/definitions/uint32
8084
description:

arch/riscv/boot/dts/microchip/mpfs.dtsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
};
244244

245245
pdma: dma-controller@3000000 {
246-
compatible = "sifive,fu540-c000-pdma", "sifive,pdma0";
246+
compatible = "microchip,mpfs-pdma", "sifive,pdma0";
247247
reg = <0x0 0x3000000 0x0 0x8000>;
248248
interrupt-parent = <&plic>;
249249
interrupts = <5 6>, <7 8>, <9 10>, <11 12>;
@@ -422,7 +422,7 @@
422422
can0: can@2010c000 {
423423
compatible = "microchip,mpfs-can";
424424
reg = <0x0 0x2010c000 0x0 0x1000>;
425-
clocks = <&clkcfg CLK_CAN0>;
425+
clocks = <&clkcfg CLK_CAN0>, <&clkcfg CLK_MSSPLL3>;
426426
interrupt-parent = <&plic>;
427427
interrupts = <56>;
428428
status = "disabled";
@@ -431,7 +431,7 @@
431431
can1: can@2010d000 {
432432
compatible = "microchip,mpfs-can";
433433
reg = <0x0 0x2010d000 0x0 0x1000>;
434-
clocks = <&clkcfg CLK_CAN1>;
434+
clocks = <&clkcfg CLK_CAN1>, <&clkcfg CLK_MSSPLL3>;
435435
interrupt-parent = <&plic>;
436436
interrupts = <57>;
437437
status = "disabled";

arch/riscv/boot/dts/starfive/jh7100-beaglev-starlight.dts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,14 @@
1111
model = "BeagleV Starlight Beta";
1212
compatible = "beagle,beaglev-starlight-jh7100-r0", "starfive,jh7100";
1313
};
14+
15+
&gmac {
16+
phy-handle = <&phy>;
17+
};
18+
19+
&mdio {
20+
phy: ethernet-phy@7 {
21+
reg = <7>;
22+
reset-gpios = <&gpio 63 GPIO_ACTIVE_LOW>;
23+
};
24+
};

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

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,91 @@
7272
};
7373
};
7474

75+
&gmac {
76+
pinctrl-names = "default";
77+
pinctrl-0 = <&gmac_pins>;
78+
phy-mode = "rgmii-id";
79+
status = "okay";
80+
81+
mdio: mdio {
82+
#address-cells = <1>;
83+
#size-cells = <0>;
84+
compatible = "snps,dwmac-mdio";
85+
};
86+
};
87+
7588
&gpio {
89+
gmac_pins: gmac-0 {
90+
gtxclk-pins {
91+
pins = <PAD_FUNC_SHARE(115)>;
92+
bias-pull-up;
93+
drive-strength = <35>;
94+
input-enable;
95+
input-schmitt-enable;
96+
slew-rate = <0>;
97+
};
98+
miitxclk-pins {
99+
pins = <PAD_FUNC_SHARE(116)>;
100+
bias-pull-up;
101+
drive-strength = <14>;
102+
input-enable;
103+
input-schmitt-disable;
104+
slew-rate = <0>;
105+
};
106+
tx-pins {
107+
pins = <PAD_FUNC_SHARE(117)>,
108+
<PAD_FUNC_SHARE(119)>,
109+
<PAD_FUNC_SHARE(120)>,
110+
<PAD_FUNC_SHARE(121)>,
111+
<PAD_FUNC_SHARE(122)>,
112+
<PAD_FUNC_SHARE(123)>,
113+
<PAD_FUNC_SHARE(124)>,
114+
<PAD_FUNC_SHARE(125)>,
115+
<PAD_FUNC_SHARE(126)>;
116+
bias-pull-up;
117+
drive-strength = <35>;
118+
input-disable;
119+
input-schmitt-disable;
120+
slew-rate = <0>;
121+
};
122+
rxclk-pins {
123+
pins = <PAD_FUNC_SHARE(127)>;
124+
bias-pull-up;
125+
drive-strength = <14>;
126+
input-enable;
127+
input-schmitt-disable;
128+
slew-rate = <6>;
129+
};
130+
rxer-pins {
131+
pins = <PAD_FUNC_SHARE(129)>;
132+
bias-pull-up;
133+
drive-strength = <14>;
134+
input-enable;
135+
input-schmitt-disable;
136+
slew-rate = <0>;
137+
};
138+
rx-pins {
139+
pins = <PAD_FUNC_SHARE(128)>,
140+
<PAD_FUNC_SHARE(130)>,
141+
<PAD_FUNC_SHARE(131)>,
142+
<PAD_FUNC_SHARE(132)>,
143+
<PAD_FUNC_SHARE(133)>,
144+
<PAD_FUNC_SHARE(134)>,
145+
<PAD_FUNC_SHARE(135)>,
146+
<PAD_FUNC_SHARE(136)>,
147+
<PAD_FUNC_SHARE(137)>,
148+
<PAD_FUNC_SHARE(138)>,
149+
<PAD_FUNC_SHARE(139)>,
150+
<PAD_FUNC_SHARE(140)>,
151+
<PAD_FUNC_SHARE(141)>;
152+
bias-pull-up;
153+
drive-strength = <14>;
154+
input-enable;
155+
input-schmitt-enable;
156+
slew-rate = <0>;
157+
};
158+
};
159+
76160
i2c0_pins: i2c0-0 {
77161
i2c-pins {
78162
pinmux = <GPIOMUX(62, GPO_LOW,
@@ -115,6 +199,24 @@
115199
};
116200
};
117201

202+
pwm_pins: pwm-0 {
203+
pwm-pins {
204+
pinmux = <GPIOMUX(7,
205+
GPO_PWM_PAD_OUT_BIT0,
206+
GPO_PWM_PAD_OE_N_BIT0,
207+
GPI_NONE)>,
208+
<GPIOMUX(5,
209+
GPO_PWM_PAD_OUT_BIT1,
210+
GPO_PWM_PAD_OE_N_BIT1,
211+
GPI_NONE)>;
212+
bias-disable;
213+
drive-strength = <35>;
214+
input-disable;
215+
input-schmitt-disable;
216+
slew-rate = <0>;
217+
};
218+
};
219+
118220
sdio0_pins: sdio0-0 {
119221
clk-pins {
120222
pinmux = <GPIOMUX(54, GPO_SDIO0_PAD_CCLK_OUT,
@@ -257,6 +359,12 @@
257359
clock-frequency = <27000000>;
258360
};
259361

362+
&pwm {
363+
pinctrl-names = "default";
364+
pinctrl-0 = <&pwm_pins>;
365+
status = "okay";
366+
};
367+
260368
&sdio0 {
261369
broken-cd;
262370
bus-width = <4>;

arch/riscv/boot/dts/starfive/jh7100-starfive-visionfive-v1.dts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
/dts-v1/;
88
#include "jh7100-common.dtsi"
9-
#include <dt-bindings/gpio/gpio.h>
109

1110
/ {
1211
model = "StarFive VisionFive V1";
@@ -18,3 +17,24 @@
1817
priority = <224>;
1918
};
2019
};
20+
21+
&gmac {
22+
phy-handle = <&phy>;
23+
};
24+
25+
/*
26+
* The board uses a Motorcomm YT8521 PHY supporting RGMII-ID, but requires
27+
* manual adjustment of the RX internal delay to work properly. The default
28+
* RX delay provided by the driver (1.95ns) is too high, but applying a 50%
29+
* reduction seems to mitigate the issue.
30+
*
31+
* It is worth noting the adjustment is not necessary on BeagleV Starlight SBC,
32+
* which uses a Microchip PHY. Hence, most likely the Motorcomm PHY is the one
33+
* responsible for the misbehaviour, not the GMAC.
34+
*/
35+
&mdio {
36+
phy: ethernet-phy@0 {
37+
reg = <0>;
38+
rx-internal-delay-ps = <900>;
39+
};
40+
};

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,37 @@
204204
status = "disabled";
205205
};
206206

207+
gmac: ethernet@10020000 {
208+
compatible = "starfive,jh7100-dwmac", "snps,dwmac";
209+
reg = <0x0 0x10020000 0x0 0x10000>;
210+
clocks = <&clkgen JH7100_CLK_GMAC_ROOT_DIV>,
211+
<&clkgen JH7100_CLK_GMAC_AHB>,
212+
<&clkgen JH7100_CLK_GMAC_PTP_REF>,
213+
<&clkgen JH7100_CLK_GMAC_TX_INV>,
214+
<&clkgen JH7100_CLK_GMAC_GTX>;
215+
clock-names = "stmmaceth", "pclk", "ptp_ref", "tx", "gtx";
216+
resets = <&rstgen JH7100_RSTN_GMAC_AHB>;
217+
reset-names = "ahb";
218+
interrupts = <6>, <7>;
219+
interrupt-names = "macirq", "eth_wake_irq";
220+
max-frame-size = <9000>;
221+
snps,multicast-filter-bins = <32>;
222+
snps,perfect-filter-entries = <128>;
223+
starfive,syscon = <&sysmain 0x70 0>;
224+
rx-fifo-depth = <32768>;
225+
tx-fifo-depth = <16384>;
226+
snps,axi-config = <&stmmac_axi_setup>;
227+
snps,fixed-burst;
228+
snps,force_thresh_dma_mode;
229+
status = "disabled";
230+
231+
stmmac_axi_setup: stmmac-axi-config {
232+
snps,wr_osr_lmt = <16>;
233+
snps,rd_osr_lmt = <16>;
234+
snps,blen = <256 128 64 32 0 0 0>;
235+
};
236+
};
237+
207238
clkgen: clock-controller@11800000 {
208239
compatible = "starfive,jh7100-clkgen";
209240
reg = <0x0 0x11800000 0x0 0x10000>;
@@ -218,6 +249,11 @@
218249
#reset-cells = <1>;
219250
};
220251

252+
sysmain: syscon@11850000 {
253+
compatible = "starfive,jh7100-sysmain", "syscon";
254+
reg = <0x0 0x11850000 0x0 0x10000>;
255+
};
256+
221257
i2c0: i2c@118b0000 {
222258
compatible = "snps,designware-i2c";
223259
reg = <0x0 0x118b0000 0x0 0x10000>;
@@ -320,6 +356,15 @@
320356
<&rstgen JH7100_RSTN_WDT>;
321357
};
322358

359+
pwm: pwm@12490000 {
360+
compatible = "starfive,jh7100-pwm", "opencores,pwm-v1";
361+
reg = <0x0 0x12490000 0x0 0x10000>;
362+
clocks = <&clkgen JH7100_CLK_PWM_APB>;
363+
resets = <&rstgen JH7100_RSTN_PWM_APB>;
364+
#pwm-cells = <3>;
365+
status = "disabled";
366+
};
367+
323368
sfctemp: temperature-sensor@124a0000 {
324369
compatible = "starfive,jh7100-temp";
325370
reg = <0x0 0x124a0000 0x0 0x10000>;

0 commit comments

Comments
 (0)