Debian Codegraph @

scripts/dtc/include-prefixes/riscv/sophgo/sg2042-milkv-pioneer.dts

raw
1 // SPDX-License-Identifier: GPL-2.0 OR MIT
2 /*
3 * Copyright (C) 2022 Sophgo Technology Inc. All rights reserved.
4 */
5
6 #include "sg2042.dtsi"
7
8 #include <dt-bindings/gpio/gpio.h>
9 #include <dt-bindings/input/input.h>
10
11 / {
12 model = "Milk-V Pioneer";
13 compatible = "milkv,pioneer", "sophgo,sg2042";
14
15 chosen {
16 stdout-path = "serial0";
17 };
18
19 gpio-power {
20 compatible = "gpio-keys";
21
22 key-power {
23 label = "Power Key";
24 linux,code = <KEY_POWER>;
25 gpios = <&port0a 22 GPIO_ACTIVE_HIGH>;
26 linux,input-type = <EV_KEY>;
27 debounce-interval = <100>;
28 };
29 };
30 };
31
32 &cgi_main {
33 clock-frequency = <25000000>;
34 };
35
36 &cgi_dpll0 {
37 clock-frequency = <25000000>;
38 };
39
40 &cgi_dpll1 {
41 clock-frequency = <25000000>;
42 };
43
44 &emmc {
45 pinctrl-0 = <&emmc_cfg>;
46 pinctrl-names = "default";
47 bus-width = <4>;
48 no-sdio;
49 no-sd;
50 non-removable;
51 wp-inverted;
52 status = "okay";
53 };
54
55 &i2c0 {
56 pinctrl-0 = <&i2c0_cfg>;
57 pinctrl-names = "default";
58 status = "okay";
59
60 rtc: rtc@68 {
61 compatible = "dallas,ds1307";
62 reg = <0x68>;
63 };
64 };
65
66 &i2c1 {
67 pinctrl-0 = <&i2c1_cfg>;
68 pinctrl-names = "default";
69 status = "okay";
70
71 mcu: syscon@17 {
72 compatible = "sophgo,sg2042-hwmon-mcu";
73 reg = <0x17>;
74 #thermal-sensor-cells = <1>;
75 };
76 };
77
78 &pinctrl {
79 emmc_cfg: sdhci-emmc-cfg {
80 sdhci-emmc-wp-pins {
81 pinmux = <PINMUX(PIN_EMMC_WP, 0)>;
82 bias-disable;
83 drive-strength-microamp = <26800>;
84 input-schmitt-disable;
85 };
86
87 sdhci-emmc-cd-pins {
88 pinmux = <PINMUX(PIN_EMMC_CD, 0)>;
89 bias-pull-up;
90 drive-strength-microamp = <26800>;
91 input-schmitt-enable;
92 };
93
94 sdhci-emmc-rst-pwr-pins {
95 pinmux = <PINMUX(PIN_EMMC_RST, 0)>,
96 <PINMUX(PIN_EMMC_PWR_EN, 0)>;
97 bias-disable;
98 drive-strength-microamp = <26800>;
99 input-schmitt-disable;
100 };
101 };
102
103 i2c0_cfg: i2c0-cfg {
104 i2c0-pins {
105 pinmux = <PINMUX(PIN_IIC0_SDA, 0)>,
106 <PINMUX(PIN_IIC0_SCL, 0)>;
107 bias-pull-up;
108 drive-strength-microamp = <26800>;
109 input-schmitt-enable;
110 };
111 };
112
113 i2c1_cfg: i2c1-cfg {
114 i2c1-pins {
115 pinmux = <PINMUX(PIN_IIC1_SDA, 0)>,
116 <PINMUX(PIN_IIC1_SCL, 0)>;
117 bias-pull-up;
118 drive-strength-microamp = <26800>;
119 input-schmitt-enable;
120 };
121 };
122
123 sd_cfg: sdhci-sd-cfg {
124 sdhci-sd-cd-wp-pins {
125 pinmux = <PINMUX(PIN_SDIO_CD, 0)>,
126 <PINMUX(PIN_SDIO_WP, 0)>;
127 bias-pull-up;
128 drive-strength-microamp = <26800>;
129 input-schmitt-enable;
130 };
131
132 sdhci-sd-rst-pwr-pins {
133 pinmux = <PINMUX(PIN_SDIO_RST, 0)>,
134 <PINMUX(PIN_SDIO_PWR_EN, 0)>;
135 bias-disable;
136 drive-strength-microamp = <26800>;
137 input-schmitt-disable;
138 };
139 };
140
141 uart0_cfg: uart0-cfg {
142 uart0-rx-pins {
143 pinmux = <PINMUX(PIN_UART0_TX, 0)>,
144 <PINMUX(PIN_UART0_RX, 0)>;
145 bias-pull-up;
146 drive-strength-microamp = <26800>;
147 input-schmitt-enable;
148 };
149 };
150 };
151
152 &pcie_rc0 {
153 status = "okay";
154 };
155
156 &pcie_rc2 {
157 status = "okay";
158 };
159
160 &pcie_rc3 {
161 status = "okay";
162 };
163
164 &sd {
165 pinctrl-0 = <&sd_cfg>;
166 pinctrl-names = "default";
167 bus-width = <4>;
168 no-sdio;
169 no-mmc;
170 wp-inverted;
171 status = "okay";
172 };
173
174 &spifmc0 {
175 status = "okay";
176
177 flash@0 {
178 compatible = "jedec,spi-nor";
179 reg = <0>;
180 spi-max-frequency = <50000000>;
181 spi-tx-bus-width = <1>;
182 spi-rx-bus-width = <1>;
183 };
184 };
185
186 &spifmc1 {
187 status = "okay";
188
189 flash@0 {
190 compatible = "jedec,spi-nor";
191 reg = <0>;
192 spi-max-frequency = <50000000>;
193 spi-tx-bus-width = <1>;
194 spi-rx-bus-width = <1>;
195 };
196 };
197
198 &uart0 {
199 pinctrl-0 = <&uart0_cfg>;
200 pinctrl-names = "default";
201 status = "okay";
202 };
203
204 / {
205 pwmfan: pwm-fan {
206 compatible = "pwm-fan";
207 cooling-levels = <103 128 179 230 255>;
208 pwms = <&pwm 0 40000 0>;
209 #cooling-cells = <2>;
210 };
211
212 thermal-zones {
213 soc-thermal {
214 polling-delay-passive = <1000>;
215 polling-delay = <1000>;
216 thermal-sensors = <&mcu 0>;
217
218 trips {
219 soc_active1: soc-active1 {
220 temperature = <30000>;
221 hysteresis = <8000>;
222 type = "active";
223 };
224
225 soc_active2: soc-active2 {
226 temperature = <58000>;
227 hysteresis = <12000>;
228 type = "active";
229 };
230
231 soc_active3: soc-active3 {
232 temperature = <70000>;
233 hysteresis = <10000>;
234 type = "active";
235 };
236
237 soc_hot: soc-hot {
238 temperature = <80000>;
239 hysteresis = <5000>;
240 type = "hot";
241 };
242 };
243
244 cooling-maps {
245 map0 {
246 trip = <&soc_active1>;
247 cooling-device = <&pwmfan 0 1>;
248 };
249
250 map1 {
251 trip = <&soc_active2>;
252 cooling-device = <&pwmfan 1 2>;
253 };
254
255 map2 {
256 trip = <&soc_active3>;
257 cooling-device = <&pwmfan 2 3>;
258 };
259
260 map3 {
261 trip = <&soc_hot>;
262 cooling-device = <&pwmfan 3 4>;
263 };
264 };
265 };
266
267 board-thermal {
268 polling-delay-passive = <1000>;
269 polling-delay = <1000>;
270 thermal-sensors = <&mcu 1>;
271
272 trips {
273 board_active: board-active {
274 temperature = <75000>;
275 hysteresis = <8000>;
276 type = "active";
277 };
278 };
279
280 cooling-maps {
281 map4 {
282 trip = <&board_active>;
283 cooling-device = <&pwmfan 3 4>;
284 };
285 };
286 };
287 };
288 };