hc
2023-11-06 1622ff3442ff6aecc1f538cda437379d1f6a4a93
rk3568 dts
3 files modified
181 ■■■■ changed files
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi 137 ●●●● patch | view | raw | blame | history
kernel/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi 21 ●●●●● patch | view | raw | blame | history
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c 23 ●●●●● patch | view | raw | blame | history
kernel/arch/arm64/boot/dts/rockchip/NK-R36S0.dtsi
old mode 100644new mode 100755
....@@ -8,6 +8,7 @@
88
99 #include <dt-bindings/gpio/gpio.h>
1010 #include <dt-bindings/pinctrl/rockchip.h>
11
+#include <dt-bindings/display/media-bus-format.h>
1112 #include "rk3568.dtsi"
1213 #include "rk3568-evb.dtsi"
1314
....@@ -185,7 +186,50 @@
185186 gpio_function = <1>;
186187 };
187188 #endif
188
-};
189
+ };
190
+
191
+ panel: panel {
192
+ compatible = "simple-panel";
193
+ backlight = <&backlight>;
194
+ power-supply = <&vcc3v3_lcd0_n>;
195
+ enable-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>; //LCD0_VDD_H_GPIO2_D4
196
+ reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>; //7511_RST_GPIO3_D1
197
+ edp-bl-gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; //LCD0_BKLT_EN_3V3
198
+ edp-bl-en = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>; //LCD0_BKLT_EN_3V3
199
+ bus-format = <MEDIA_BUS_FMT_RGB888_1X24>;
200
+ bpc = <8>;
201
+ prepare-delay-ms = <200>;
202
+ enable-delay-ms = <20>;
203
+ lvds-gpio0 = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>; //7511_GPIO0-GPIO3_D2
204
+ lvds-gpio1 = <&gpio3 RK_PD3 GPIO_ACTIVE_HIGH>; //7511_GPIO1-GPIO3_D3
205
+ lvds-gpio2 = <&gpio3 RK_PD4 GPIO_ACTIVE_HIGH>; //7511_GPIO2-GPIO3_D4
206
+ lvds-gpio3 = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; //7511_GPIO3-GPIO3_D5
207
+ nodka-lvds = <15>;
208
+
209
+ display-timings {
210
+ native-mode = <&timing0>;
211
+ timing0: timing0 {
212
+ clock-frequency = <72500000>;
213
+ hactive = <1280>;
214
+ vactive = <800>;
215
+ hfront-porch = <70>;
216
+ hsync-len = <2>;
217
+ hback-porch = <88>;
218
+ vfront-porch = <7>;
219
+ vsync-len = <4>;
220
+ vback-porch = <17>;
221
+ hsync-active = <21>;
222
+ vsync-active = <0>;
223
+ de-active = <0>;
224
+ pixelclk-active = <0>;
225
+ };
226
+ };
227
+ ports {
228
+ panel_in: endpoint {
229
+ remote-endpoint = <&edp_out>;
230
+ };
231
+ };
232
+ };
189233 };
190234
191235 &combphy0_us {
....@@ -285,8 +329,18 @@
285329 };
286330
287331 &edp {
288
- hpd-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
289
- status = "okay";
332
+ //hpd-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
333
+ force-hpd;
334
+ status = "okay";
335
+ ports {
336
+ port@1 {
337
+ reg = <1>;
338
+ edp_out: endpoint {
339
+ remote-endpoint = <&panel_in>;
340
+ };
341
+ };
342
+
343
+ };
290344 };
291345
292346 &edp_phy {
....@@ -294,11 +348,11 @@
294348 };
295349
296350 &edp_in_vp0 {
297
- status = "okay";
351
+ status = "disabled";
298352 };
299353
300354 &edp_in_vp1 {
301
- status = "disabled";
355
+ status = "okay";
302356 };
303357
304358 &gmac0 {
....@@ -359,8 +413,22 @@
359413 * power-supply should switche to vcc3v3_lcd1_n
360414 * when mipi panel is connected to dsi1.
361415 */
362
-&gt1x {
363
- power-supply = <&vcc3v3_lcd0_n>;
416
+
417
+
418
+&i2c3 {
419
+ status = "okay";
420
+ //mac eeprom
421
+ eeprom@51 {
422
+ //compatible = "atmel,24c02";
423
+ compatible = "atmel,24c256";
424
+ reg = <0x51>;
425
+ };
426
+
427
+ //nk-mcu
428
+ nkmcu@15 {
429
+ compatible = "nk_mcu";
430
+ reg = <0x15>;
431
+ };
364432 };
365433
366434 &i2c4 {
....@@ -466,13 +534,7 @@
466534 };
467535
468536 &pinctrl {
469
- cam {
470
- camera_pwr: camera-pwr {
471
- rockchip,pins =
472
- /* camera power en */
473
- <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
474
- };
475
- };
537
+
476538 headphone {
477539 hp_det: hp-det {
478540 rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
....@@ -531,7 +593,7 @@
531593 };
532594
533595 &rkisp_vir0 {
534
- status = "okay";
596
+ status = "disabled";
535597
536598 port {
537599 #address-cells = <1>;
....@@ -549,9 +611,11 @@
549611 connect = <&vp1_out_dsi0>;
550612 };
551613
614
+
615
+
552616 &route_edp {
553617 status = "okay";
554
- connect = <&vp0_out_edp>;
618
+ connect = <&vp1_out_edp>;
555619 };
556620
557621 &sata2 {
....@@ -581,18 +645,18 @@
581645 };
582646
583647 &uart8 {
584
- status = "okay";
648
+ status = "disabled";
585649 pinctrl-names = "default";
586650 pinctrl-0 = <&uart8m0_xfer &uart8m0_ctsn>;
587651 };
588652
589653 &vcc3v3_lcd0_n {
590
- gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
654
+ gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
591655 enable-active-high;
592656 };
593657
594658 &vcc3v3_lcd1_n {
595
- gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
659
+ gpio = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>; //MIPI_3V3EN_GPIO3_A3_d_3V3
596660 enable-active-high;
597661 };
598662
....@@ -616,3 +680,38 @@
616680 BT,wake_host_irq = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>;
617681 status = "okay";
618682 };
683
+
684
+&uart0 {
685
+ status = "okay";
686
+};
687
+
688
+&uart1 {
689
+ pinctrl-names = "default";
690
+ pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn>;
691
+ status = "okay";
692
+};
693
+
694
+&uart3 {
695
+ status = "okay";
696
+ pinctrl-0 = <&uart3m1_xfer>;
697
+};
698
+
699
+&uart4 {
700
+ status = "okay";
701
+ pinctrl-0 = <&uart4m1_xfer>;
702
+};
703
+
704
+&uart5 {
705
+ status = "okay";
706
+ pinctrl-0 = <&uart5m1_xfer>;
707
+};
708
+
709
+&uart7 {
710
+ status = "okay";
711
+ pinctrl-0 = <&uart7m1_xfer>;
712
+};
713
+
714
+&uart9 {
715
+ status = "okay";
716
+ pinctrl-0 = <&uart9m1_xfer>;
717
+};
kernel/arch/arm64/boot/dts/rockchip/rk3568-evb.dtsi
old mode 100644new mode 100755
....@@ -103,7 +103,7 @@
103103
104104 backlight1: backlight1 {
105105 compatible = "pwm-backlight";
106
- pwms = <&pwm5 0 25000 0>;
106
+ pwms = <&pwm6 0 25000 0>;
107107 brightness-levels = <
108108 0 20 20 21 21 22 22 23
109109 23 24 24 25 25 26 26 27
....@@ -182,8 +182,8 @@
182182
183183 leds: leds {
184184 compatible = "gpio-leds";
185
- work_led: work {
186
- gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
185
+ sys_led: sys_led {
186
+ gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_HIGH>;
187187 linux,default-trigger = "heartbeat";
188188 };
189189 };
....@@ -308,7 +308,7 @@
308308 regulator-min-microvolt = <3300000>;
309309 regulator-max-microvolt = <3300000>;
310310 enable-active-high;
311
- gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
311
+ gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; //VCC3_IO_EN_GPIO0_C4_3V3
312312 vin-supply = <&vcc3v3_sys>;
313313
314314 regulator-state-mem {
....@@ -1398,15 +1398,6 @@
13981398
13991399 &i2c1 {
14001400 status = "okay";
1401
-
1402
- gt1x: gt1x@14 {
1403
- compatible = "goodix,gt1x";
1404
- reg = <0x14>;
1405
- pinctrl-names = "default";
1406
- pinctrl-0 = <&touch_gpio>;
1407
- goodix,rst-gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
1408
- goodix,irq-gpio = <&gpio0 RK_PB5 IRQ_TYPE_LEVEL_LOW>;
1409
- };
14101401 };
14111402
14121403 &i2c5 {
....@@ -1579,6 +1570,10 @@
15791570 status = "okay";
15801571 };
15811572
1573
+&pwm6 {
1574
+ status = "okay";
1575
+};
1576
+
15821577 &pwm5 {
15831578 status = "okay";
15841579 };
kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
....@@ -2346,13 +2346,16 @@
23462346 {
23472347 }
23482348
2349
+
2350
+static unsigned char macaddr[6];
2351
+extern ssize_t at24_mac_read(unsigned char* addr);
23492352 void rk_get_eth_addr(void *priv, unsigned char *addr)
23502353 {
23512354 struct rk_priv_data *bsp_priv = priv;
23522355 struct device *dev = &bsp_priv->pdev->dev;
23532356 unsigned char ethaddr[ETH_ALEN * MAX_ETH] = {0};
2354
- int ret, id = bsp_priv->bus_id;
2355
-
2357
+ int ret,i, id = bsp_priv->bus_id;
2358
+#if 0
23562359 rk_devinfo_get_eth_mac(addr);
23572360 if (is_valid_ether_addr(addr))
23582361 goto out;
....@@ -2383,6 +2386,22 @@
23832386 } else {
23842387 memcpy(addr, &ethaddr[id * ETH_ALEN], ETH_ALEN);
23852388 }
2389
+#endif
2390
+ #if 1
2391
+ if (at24_mac_read(macaddr) > 0) {
2392
+ printk("ben %s: at24_mac_read Success!! \n", __func__);
2393
+ memcpy(addr, macaddr, 6);
2394
+
2395
+ printk("Read the Ethernet MAC address from :");
2396
+ for (i = 0; i < 5; i++)
2397
+ printk("%2.2x:", addr[i]);
2398
+
2399
+ printk("%2.2x\n", addr[i]);
2400
+ } else {
2401
+ printk("ben %s: at24_mac_read Failed!! \n", __func__);
2402
+ goto out;
2403
+ }
2404
+ #endif
23862405
23872406 out:
23882407 dev_err(dev, "%s: mac address: %pM\n", __func__, addr);