hc
2024-08-12 233ab1bd4c5697f5cdec94e60206e8c6ac609b4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2021 Hardkernel Co., Ltd.
 *
 */
 
/dts-v1/;
 
#include <dt-bindings/display/rockchip_vop.h>
#include "rk3568.dtsi"
#include "rk3568-evb.dtsi"
 
/ {
   /delete-node/ adc-keys;
   /delete-node/ nandc@fe330000;
   /delete-node/ sdio-pwrseq;
   /delete-node/ vcc3v3-lcd0-n;
   /delete-node/ vcc3v3-lcd1-n;
   /delete-node/ wireless-bluetooth;
   /delete-node/ wireless-wlan;
 
   leds: leds {
       power_led: power {
           gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_LOW>;
           linux,default-trigger = "default-on";
       };
       work_led: work {
           gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
           linux,default-trigger = "heartbeat";
       };
   };
 
   rk_headset: rk-headset {
       compatible = "rockchip_headset";
       headset_gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_LOW>;
       pinctrl-names = "default";
       pinctrl-0 = <&hp_det>;
   };
 
   rk3568-gpiomem {
       compatible = "rockchip,rk3568-gpiomem";
       reg = <0x0 0xfd660000 0x0 0x1000>;
       status = "okay";
   };
 
   rk809_sound: rk809-sound {
       status = "okay";
       compatible = "simple-audio-card";
       simple-audio-card,format = "i2s";
       simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
       simple-audio-card,name = "rockchip,rk809-codec";
       simple-audio-card,widgets = "Headphones", "Headphones Jack";
       simple-audio-card,mclk-fs = <256>;
       simple-audio-card,cpu {
           sound-dai = <&i2s1_8ch>;
       };
       simple-audio-card,codec {
           sound-dai = <&rk809_codec>;
       };
   };
};
 
&gmac0 {
   phy-mode = "rgmii";
   clock_in_out = "output";
 
   snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
   snps,reset-active-low;
   /* Reset time is 20ms, 100ms for rtl8211f */
   snps,reset-delays-us = <0 20000 100000>;
 
   assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
   assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
   assigned-clock-rates = <0>, <125000000>;
 
   pinctrl-names = "default";
   pinctrl-0 = <&gmac0_miim
       &gmac0_tx_bus2
       &gmac0_rx_bus2
       &gmac0_rgmii_clk
       &gmac0_rgmii_bus>;
 
   tx_delay = <0x4f>;
   rx_delay = <0x2d>;
 
   phy-handle = <&rgmii_phy0>;
   status = "okay";
};
 
&i2c1 {
   status = "disabled";
 
   /delete-node/ gt1x@14;
};
 
&i2c2 {
   status = "disabled";
   pinctrl-names = "default";
   pinctrl-0 = <&i2c2m1_xfer>;
};
 
&i2c5 {
   status = "disabled";
 
   /delete-node/ mxc6655xa@15;
};
 
&mdio0 {
   rgmii_phy0: phy@0 {
       compatible = "ethernet-phy-ieee802.3-c22";
       reg = <0x0>;
 
       interrupt-parent = <&gpio0>;
       interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>;
 
       pinctrl-names = "default";
       pinctrl-0 = <&ethernet_irq>;
   };
};
 
&pinctrl {
   can_pins {
       mcp2515_int_pins: mcp2515_int_pins {
           rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
       };
   };
   ethernet {
       ethernet_irq: ethernet-irq {
           rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
       };
   };
};
 
&pinctrl {
   /delete-node/ mxc6655xa;
   /delete-node/ touch;
   /delete-node/ wifi-enable-h;
   /delete-node/ wireless-bluetooth;
 
   fspi {
       fspi_pins: fspi-pins {
           rockchip,pins =
               /* fspi_clk */
               <1 RK_PD0 1 &pcfg_pull_none>,
               /* fspi_cs0n */
               <1 RK_PD3 1 &pcfg_pull_none>,
               /* fspi_d0 */
               <1 RK_PD1 1 &pcfg_pull_none>;
       };
   };
 
   headphone {
       hp_det: hp-det {
           rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
       };
   };
};
 
&pmu_io_domains {
   vccio4-supply = <&vcc_1v8>;
};
 
&pwm3 {
   status = "okay";
 
   compatible = "rockchip,remotectl-pwm";
   remote_pwm_id = <3>;
   handle_cpu_id = <1>;
   remote_support_psci = <0>;
   pinctrl-names = "default";
   pinctrl-0 = <&pwm3_pins>;
 
   ir_key1 {
       rockchip,usercode = <0x4db2>;
       rockchip,key_table =
           <0x23    KEY_POWER>,
           <0x77    KEY_MUTE>,
           <0x7d    KEY_HOME>,
           <0x31    KEY_ENTER>,
           <0x35    KEY_UP>,
           <0x66    KEY_LEFT>,
           <0x3e    KEY_RIGHT>,
           <0x2d    KEY_DOWN>,
           <0x3a    KEY_MENU>,
           <0x65    KEY_BACK>,
           <0x7e    KEY_VOLUMEDOWN>,
           <0x7f    KEY_VOLUMEUP>;
   };
};
 
&pwm7 {
   compatible = "rockchip,rk3568-pwm", "rockchip,rk3328-pwm";
   pinctrl-names = "active";
   pinctrl-0 = <&pwm7_pins>;
 
   status = "disabled";
 
   /delete-property/ remote_pwm_id;
   /delete-property/ handle_cpu_id;
   /delete-property/ remote_support_psci;
   /delete-node/ ir_key1;
   /delete-node/ ir_key2;
   /delete-node/ ir_key3;
};
 
&rknpu_mmu {
   status = "disabled";
};
 
&rng {
   status = "okay";
};
 
&sdhci {
   pinctrl-0 = <&emmc_bus8
       &emmc_clk
       &emmc_cmd
       &emmc_datastrobe
       &emmc_rstnout>;
   pinctrl-names = "default";
 
   mmc-hs200-1_8v;
   cap-mmc-hw-reset;
};
 
&video_phy0 {
   status = "okay";
};
 
&hdmi_sound {
   compatible = "simple-audio-card";
   simple-audio-card,format = "i2s";
   simple-audio-card,mclk-fs = <128>;
   simple-audio-card,name = "rockchip,hdmi";
   status = "okay";
   rockchip,jack-det;
 
   simple-audio-card,cpu {
       sound-dai = <&i2s0_8ch>;
   };
   simple-audio-card,codec {
       sound-dai = <&hdmi>;
   };
};
 
&rk809_sound {
   status = "okay";
   compatible = "simple-audio-card";
   simple-audio-card,format = "i2s";
   simple-audio-card,mclk-fs = <256>;
   simple-audio-card,name = "rockchip,rk809-codec";
   simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
   simple-audio-card,widgets = "Headphones", "Headphone Jack";
 
   simple-audio-card,cpu {
       sound-dai = <&i2s1_8ch>;
   };
   simple-audio-card,codec {
       sound-dai = <&rk809_codec>;
   };
};
 
&rk809_codec {
   #sound-dai-cells = <0>;
   compatible = "rockchip,rk809-codec", "rockchip,rk817-codec";
   clocks = <&cru I2S1_MCLKOUT>;
   clock-names = "mclk";
   assigned-clocks = <&cru I2S1_MCLKOUT>, <&cru I2S1_MCLK_TX_IOE>;
   assigned-clock-rates = <12288000>;
   assigned-clock-parents = <&cru I2S1_MCLKOUT_TX>, <&cru I2S1_MCLKOUT_TX>;
   pinctrl-names = "default";
   pinctrl-0 = <&i2s1m0_mclk &hp_det>;
   hp-volume = <20>;
   spk-volume = <3>;
   status = "okay";
};
 
&rk_headset {
   status = "disabled";
};
 
&spdif_8ch {
   status = "disabled";
};
 
&spdif_out {
   status = "disabled";
};
 
// Suggested by amazingfate: https://github.com/armbian/build/pull/4794#issuecomment-1423606844
// "add these properties to node &gpu to support panfrost driver"
&gpu {
   clock-names = "gpu", "bus";
   interrupt-names = "gpu", "mmu", "job";
};
 
// Suggested by amazingfate: https://github.com/armbian/build/pull/4794#issuecomment-1423606844
// "add &vp0 node to support video output"
&vp0 {
   rockchip,plane-mask = <(1 << ROCKCHIP_VOP2_CLUSTER0 | 1 << ROCKCHIP_VOP2_ESMART0)>;
   rockchip,primary-plane = <ROCKCHIP_VOP2_ESMART0>;
};