Skip to content

Commit 1cb666e

Browse files
committed
riscv: dts: sophgo: sg2042: add pinctrl support
Add pinctrl node and related pin configuration for SG2042 SoC. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Inochi Amaoto <[email protected]> Signed-off-by: Chen Wang <[email protected]> Signed-off-by: Chen Wang <[email protected]>
1 parent a5806cd commit 1cb666e

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

arch/riscv/boot/dts/sophgo/sg2042-milkv-pioneer.dts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
};
4343

4444
&emmc {
45+
pinctrl-0 = <&emmc_cfg>;
46+
pinctrl-names = "default";
4547
bus-width = <4>;
4648
no-sdio;
4749
no-sd;
@@ -51,6 +53,8 @@
5153
};
5254

5355
&i2c1 {
56+
pinctrl-0 = <&i2c1_cfg>;
57+
pinctrl-names = "default";
5458
status = "okay";
5559

5660
mcu: syscon@17 {
@@ -60,7 +64,73 @@
6064
};
6165
};
6266

67+
&pinctrl {
68+
emmc_cfg: sdhci-emmc-cfg {
69+
sdhci-emmc-wp-pins {
70+
pinmux = <PINMUX(PIN_EMMC_WP, 0)>;
71+
bias-disable;
72+
drive-strength-microamp = <26800>;
73+
input-schmitt-disable;
74+
};
75+
76+
sdhci-emmc-cd-pins {
77+
pinmux = <PINMUX(PIN_EMMC_CD, 0)>;
78+
bias-pull-up;
79+
drive-strength-microamp = <26800>;
80+
input-schmitt-enable;
81+
};
82+
83+
sdhci-emmc-rst-pwr-pins {
84+
pinmux = <PINMUX(PIN_EMMC_RST, 0)>,
85+
<PINMUX(PIN_EMMC_PWR_EN, 0)>;
86+
bias-disable;
87+
drive-strength-microamp = <26800>;
88+
input-schmitt-disable;
89+
};
90+
};
91+
92+
i2c1_cfg: i2c1-cfg {
93+
i2c1-pins {
94+
pinmux = <PINMUX(PIN_IIC1_SDA, 0)>,
95+
<PINMUX(PIN_IIC1_SCL, 0)>;
96+
bias-pull-up;
97+
drive-strength-microamp = <26800>;
98+
input-schmitt-enable;
99+
};
100+
};
101+
102+
sd_cfg: sdhci-sd-cfg {
103+
sdhci-sd-cd-wp-pins {
104+
pinmux = <PINMUX(PIN_SDIO_CD, 0)>,
105+
<PINMUX(PIN_SDIO_WP, 0)>;
106+
bias-pull-up;
107+
drive-strength-microamp = <26800>;
108+
input-schmitt-enable;
109+
};
110+
111+
sdhci-sd-rst-pwr-pins {
112+
pinmux = <PINMUX(PIN_SDIO_RST, 0)>,
113+
<PINMUX(PIN_SDIO_PWR_EN, 0)>;
114+
bias-disable;
115+
drive-strength-microamp = <26800>;
116+
input-schmitt-disable;
117+
};
118+
};
119+
120+
uart0_cfg: uart0-cfg {
121+
uart0-rx-pins {
122+
pinmux = <PINMUX(PIN_UART0_TX, 0)>,
123+
<PINMUX(PIN_UART0_RX, 0)>;
124+
bias-pull-up;
125+
drive-strength-microamp = <26800>;
126+
input-schmitt-enable;
127+
};
128+
};
129+
};
130+
63131
&sd {
132+
pinctrl-0 = <&sd_cfg>;
133+
pinctrl-names = "default";
64134
bus-width = <4>;
65135
no-sdio;
66136
no-mmc;
@@ -69,6 +139,8 @@
69139
};
70140

71141
&uart0 {
142+
pinctrl-0 = <&uart0_cfg>;
143+
pinctrl-names = "default";
72144
status = "okay";
73145
};
74146

arch/riscv/boot/dts/sophgo/sg2042.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <dt-bindings/clock/sophgo,sg2042-pll.h>
99
#include <dt-bindings/clock/sophgo,sg2042-rpgate.h>
1010
#include <dt-bindings/interrupt-controller/irq.h>
11+
#include <dt-bindings/pinctrl/pinctrl-sg2042.h>
1112
#include <dt-bindings/reset/sophgo,sg2042-reset.h>
1213

1314
#include "sg2042-cpus.dtsi"
@@ -200,6 +201,11 @@
200201
#clock-cells = <1>;
201202
};
202203

204+
pinctrl: pinctrl@7030011000 {
205+
compatible = "sophgo,sg2042-pinctrl";
206+
reg = <0x70 0x30011000 0x0 0x1000>;
207+
};
208+
203209
clkgen: clock-controller@7030012000 {
204210
compatible = "sophgo,sg2042-clkgen";
205211
reg = <0x70 0x30012000 0x0 0x1000>;

0 commit comments

Comments
 (0)