hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
303
304
305
306
307
308
309
310
311
312
313
/*
 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *  Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */
#include <dt-bindings/pwm/pwm.h>
#include <dt-bindings/input/input.h>
 
#include "rk3229-at-common.dtsi"
 
/ {
 
   hdmi_sound: hdmi-sound {
       status = "okay";
       compatible = "simple-audio-card";
       simple-audio-card,format = "i2s";
       simple-audio-card,mclk-fs = <256>;
       simple-audio-card,name = "rockchip,hdmi";
       simple-audio-card,cpu {
           sound-dai = <&i2s0>;
       };
       simple-audio-card,codec {
           sound-dai = <&hdmi>;
       };
   };
 
   gva_codec: gva-codec{
       compatible = "rockchip,gva-codec";
       #sound-dai-cells = <0>;
       status = "okay";
   };
 
   gva-sound {
       compatible = "simple-audio-card";
       simple-audio-card,format = "i2s";
       simple-audio-card,name = "rockchip,rk3229-dummy";
       simple-audio-card,mclk-fs = <256>;
       simple-audio-card,cpu {
           sound-dai = <&i2s1>;
       };
       simple-audio-card,codec {
           sound-dai = <&gva_codec>;
       };
   };
 
   vcc_otg_vbus: otg-vbus-regulator {
       compatible = "regulator-fixed";
       gpio = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
       pinctrl-names = "default";
       pinctrl-0 = <&otg_vbus_drv>;
       regulator-name = "vcc_otg_vbus";
       regulator-min-microvolt = <5000000>;
       regulator-max-microvolt = <5000000>;
       enable-active-high;
   };
};
 
&hdmi {
   status = "okay";
   #sound-dai-cells = <0>;
   ddc-i2c-scl-high-time-ns = <9625>;
   ddc-i2c-scl-low-time-ns = <10000>;
};
 
&hdmi_phy {
   status = "okay";
};
 
&i2c0 {
   status = "okay";
 
   cw2015@62 {
       status = "okay";
       compatible = "cw201x";
       reg = <0x62>;
       bat_config_info = <0x15 0x42 0x60 0x59 0x52 0x58
       0x4D 0x48 0x48 0x44 0x44 0x46 0x49 0x48 0x32
       0x24 0x20 0x17 0x13 0x0F 0x19 0x3E 0x51 0x45
       0x08 0x76 0x0B 0x85 0x0E 0x1C 0x2E 0x3E 0x4D
       0x52 0x52 0x57 0x3D 0x1B 0x6A 0x2D 0x25 0x43
       0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92
       0x96 0xFF 0x7B 0xBB 0xCB 0x2F 0x7D 0x72 0xA5
       0xB5 0xC1 0x46 0xAE>;
       monitor_sec = <5>;
       virtual_power = <0>;
       hw_id_check = <1>;
       hw-id0-gpio = <&gpio2 22 GPIO_ACTIVE_HIGH>;
       hw-id1-gpio = <&gpio2 23 GPIO_ACTIVE_HIGH>;
   };
};
 
&i2c1 {
   status = "okay";
};
 
&i2c2 {
   status = "okay";
};
 
&i2s1 {
   status = "okay";
   rockchip,i2s-broken-burst-len;
   rockchip,playback-channels = <8>;
   rockchip,capture-channels = <8>;
   rockchip,bclk-fs = <64>;
   #sound-dai-cells = <0>;
};
 
&pinctrl {
   sdmmc {
       sdmmc_gpio: sdmmc-gpio {
           rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>,
                   <1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>,
                   <1 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>,
                   <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>,
                   <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>,
                   <1 RK_PC3 RK_FUNC_GPIO &pcfg_pull_up>,
                   <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>,
                   <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
       };
   };
 
   fixed_io {
       fixed_gpio: fixed-gpio {
           rockchip,pins = <2 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>,
                   <2 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>,
                   <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>,
                   <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>,
                   <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>,
                   <1 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>,
                   <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>,
                   <0 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
       };
   };
 
   ir {
       ir_gpio: ir-gpio {
           rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>;
       };
   };
 
   pwm0 {
       pwm0_gpio: pwm0-gpio {
           rockchip,pins = <3 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
       };
   };
 
   pwm2 {
       pwm2_gpio: pwm2-gpio {
           rockchip,pins = <1 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>;
       };
   };
 
   spdif {
       spdif_gpio: spdif-gpio {
           rockchip,pins = <3 RK_PD7 RK_FUNC_GPIO &pcfg_pull_none>;
       };
   };
 
   usb {
       otg_vbus_drv: otg-vbus-drv {
           rockchip,pins =    <3 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
       };
   };
};
 
&rockchip_suspend {
   status = "okay";
   rockchip,sleep-mode-config = <
       (0
       |RKPM_CTR_GTCLKS
       |RKPM_CTR_IDLESRAM_MD
       |RKPM_CTR_PMIC
       )
   >;
};
 
&sdio {
   bus-width = <4>;
   cap-mmc-highspeed;
   cap-sd-highspeed;
   cap-sdio-irq;
   non-removable;
   ignore-pm-notify;
   keep-power-in-suspend;
   max-frequency = <150000000>;
   no-sd;
   no-mmc;
};
 
&spi0 {
   status = "okay";
   max-freq = <48000000>;
   pinctrl-names = "default";
   pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0 &spi1_cs1>;
 
   spi_slave@0 {
       compatible = "rockchip,spidev";
       reg = <0>;
       spi-max-frequency = <12000000>;
   };
 
   spi_slave@1 {
       compatible = "rockchip,spidev";
       reg = <1>;
       spi-max-frequency = <12000000>;
   };
};
 
&u2phy0 {
   status = "okay";
 
   u2phy0_otg: otg-port {
       vbus-supply = <&vcc_otg_vbus>;
       status = "okay";
   };
 
   u2phy0_host: host-port {
       status = "okay";
   };
};
 
&u2phy1 {
   status = "okay";
 
   u2phy1_otg: otg-port {
       status = "okay";
   };
 
   u2phy1_host: host-port {
       status = "okay";
   };
};
 
&usb_host0_ehci {
   status = "okay";
};
 
&usb_host0_ohci {
   status = "okay";
};
 
&uart0 {
   pinctrl-names = "default";
   pinctrl-0 = <&uart0_xfer>;
   status = "okay";
};
 
&uart1 {
   pinctrl-names = "default";
   pinctrl-0 = <&uart11_xfer &uart11_cts>;
   status = "okay";
};
 
&usb_otg {
   status = "okay";
};
 
&gmac {
   assigned-clocks = <&cru SCLK_MAC_SRC>;
   assigned-clock-rates = <50000000>;
   clock_in_out = "output";
   phy-supply = <&vcc_18>;
   phy-mode = "rmii";
   phy-is-integrated;
   status = "okay";
};