8.屏幕
目前SC-3568HA支持MIPI0,MIPI1,EDP,HDMI,四种显示方式,默认显示为MIPI0+HDMI同显
需要切换屏幕使用时,修改arch/arm64/boot/dts/rockchip/rk3568-toybrick-x0-linux.dts
修改如下:
1//使用mipi0
2/dts-v1/;
3#include "rk3568.dtsi"
4#include "rk3568-linux.dtsi"
5#include "rk3568-toybrick-x0.dtsi"
6#include "rk3568-toybrick-mipi-tx0-beiqicloud.dtsi"
7//#include "rk3568-toybrick-mipi-tx1.dtsi"
8//#include "rk3568-toybrick-edp.dtsi"
9
10//使用mipi1
11/dts-v1/;
12#include "rk3568.dtsi"
13#include "rk3568-linux.dtsi"
14#include "rk3568-toybrick-x0.dtsi"
15//#include "rk3568-toybrick-mipi-tx0-beiqicloud.dtsi"
16#include "rk3568-toybrick-mipi-tx1.dtsi"
17//#include "rk3568-toybrick-edp.dtsi"
18
19//使用edp
20/dts-v1/;
21#include "rk3568.dtsi"
22#include "rk3568-linux.dtsi"
23#include "rk3568-toybrick-x0.dtsi"
24//#include "rk3568-toybrick-mipi-tx0-beiqicloud.dtsi"
25//include "rk3568-toybrick-mipi-tx1.dtsi"
26#include "rk3568-toybrick-edp.dtsi"
8.1 MIPI0 DTS配置
修改MIPI0配置需要修改arch/arm64/boot/dts/rockchiprk3568-toybrick-mipi-tx0-beiqicloud.dtsi
1//HOST
2&dsi0 {
3 status = "okay";
4
5 //PANEL
6 dsi0_panel: panel@0 {
7 compatible = "simple-panel-dsi";
8 reg = <0>;
9 backlight = <&backlight>; //使用第一路backlight
10 // power-supply = <&lcd_pwr>;
11 prepare-delay-ms = <2>;
12 reset-delay-ms = <100>;
13 init-delay-ms = <20>;
14 pinctrl-names = "default";
15 pinctrl-0 = <&mipi_power_en>;
16 enable-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>;
17 enable-delay-ms = <120>;
18 disable-delay-ms = <50>;
19 unprepare-delay-ms = <20>;
20 width-mm = <68>;
21 height-mm = <121>;
22
23 dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
24 MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
25 dsi,format = <MIPI_DSI_FMT_RGB888>;
26 dsi,lanes = <4>;
27 pnel-type = <5>;
28
29 //初始化代码
30 panel-init-sequence = [
31 05 64 01 11
32 39 00 04 FF 98 81 03
33 15 00 02 01 00
34 15 00 02 02 00
35
36 ......
37
38 05 32 01 29
39 15 00 02 35 00
40 ];
41
42 panel-exit-sequence = [
43 05 32 01 28
44 05 C8 01 10
45 ];
46
47 //屏幕timing参数
48 disp_timings:display-timings {
49 native-mode = <&dsi0_timing0>;
50
51 dsi0_timing0: timing0 {
52 clock-frequency = <75000000>;
53 hactive = <720>;
54 vactive = <1280>;
55 hfront-porch = <40>;
56 hsync-len = <10>;
57 hback-porch = <40>;
58 vfront-porch = <10>;
59 vsync-len = <36>;
60 vback-porch = <15>;
61 hsync-active = <0>;
62 vsync-active = <0>;
63 de-active = <0>;
64 pixelclk-active = <0>;
65 };
66 };
67
68 ports {
69 #address-cells = <1>;
70 #size-cells = <0>;
71
72 port@0 {
73 reg = <0>;
74 panel_in_dsi: endpoint {
75 remote-endpoint = <&dsi_out_panel>;
76 };
77 };
78 };
79 };
80
81 ports {
82 #address-cells = <1>;
83 #size-cells = <0>;
84
85 port@1 {
86 reg = <1>;
87 dsi_out_panel: endpoint {
88 remote-endpoint = <&panel_in_dsi>;
89 };
90 };
91 };
92
93};
94
95//VOP Routing (画面显示在VOP1上)
96&dsi0_in_vp0 {
97 status = "disabled";
98};
99
100&dsi0_in_vp1 {
101 status = "okay";
102};
103
104//BACKLIGHT
105&backlight {
106 status = "okay";
107};
108
109//PHY
110&video_phy0 {
111 status = "okay";
112};
113
114//LOGO (开机LOGO也对应VOP1)
115&route_dsi0 {
116 status = "okay";
117 connect = <&vp1_out_dsi0>;
118};
119
120//GPIO0_C7为屏幕供电使能脚
121&vcc3v3_lcd0_n {
122 gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
123 regulator-always-on;
124 enable-active-high;
125};
126
127//配置屏幕使能脚复用为GPIO
128&pinctrl {
129 mipi_pwren {
130 mipi_power_en: mipi_power_en {
131 rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_output_high>;
132 };
133 };
134};
8.2 MIPI1 DTS配置
修改MIPI1配置需要修改arch/arm64/boot/dts/rockchiprk3568-toybrick-mipi-tx1.dtsi
1//HOST
2&dsi1 {
3 status = "okay";
4};
5
6//PANEL
7&dsi1_panel {
8 status = "okay";
9 compatible = "simple-panel-dsi";
10 reg = <0>;
11 backlight = <&backlight1>; //使用第二路backlight
12// power-supply = <&lcd_pwr>;
13 prepare-delay-ms = <2>;
14 reset-delay-ms = <100>;
15 init-delay-ms = <20>;
16 pinctrl-names = "default";
17 pinctrl-0 = <&mipi1_power_en>;
18 enable-gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>;
19 enable-delay-ms = <120>;
20 disable-delay-ms = <50>;
21 unprepare-delay-ms = <20>;
22 width-mm = <68>;
23 height-mm = <121>;
24
25 dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
26 MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
27 dsi,format = <MIPI_DSI_FMT_RGB888>;
28 dsi,lanes = <4>;
29 pnel-type = <5>;
30
31 //初始化代码
32 panel-init-sequence = [
33 05 64 01 11
34 39 00 04 FF 98 81 03
35 15 00 02 01 00
36
37 ......
38
39 15 00 02 D2 65
40 15 00 02 D3 3F
41 39 00 04 FF 98 81 00
42
43 05 32 01 29
44 15 00 02 35 00
45 ];
46
47 panel-exit-sequence = [
48 05 32 01 28
49 05 C8 01 10
50 ];
51
52 disp1_timings:display-timings {
53 native-mode = <&dsi1_timing0>;
54
55 dsi1_timing0: timing0 {
56 clock-frequency = <75000000>;
57 hactive = <720>;
58 vactive = <1280>;
59 hfront-porch = <40>;
60 hsync-len = <10>;
61 hback-porch = <40>;
62 vfront-porch = <10>;
63 vsync-len = <36>;
64 vback-porch = <15>;
65 hsync-active = <0>;
66 vsync-active = <0>;
67 de-active = <0>;
68 pixelclk-active = <0>;
69 };
70 };
71
72 ports {
73 #address-cells = <1>;
74 #size-cells = <0>;
75
76 port@0 {
77 reg = <0>;
78 panel_in_dsi1: endpoint {
79 remote-endpoint = <&dsi1_out_panel>;
80 };
81 };
82 };
83};
84
85//VOP Routing (画面显示在VOP1上)
86&dsi1_in_vp0 {
87 status = "disabled";
88
89};
90
91&dsi1_in_vp1 {
92 status = "okay";
93};
94
95//BACKLIGHT
96&backlight1 {
97 status = "okay";
98};
99
100//PHY
101&video_phy1 {
102 status = "okay";
103};
104
105//LOGO (开机LOGO也对应VOP1)
106&route_dsi1{
107 status = "okay";
108 connect = <&vp1_out_dsi1>;
109};
110
111//GPIO0_C5为屏幕供电使能脚
112&vcc3v3_lcd1_n {
113 gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
114 regulator-always-on;
115 enable-active-high;
116};
117
118//配置屏幕使能脚复用为GPIO
119&pinctrl {
120 mipi1_pwren {
121 mipi1_power_en: mipi1_power_en {
122 rockchip,pins = <3 RK_PB6 RK_FUNC_GPIO &pcfg_output_high>;
123 };
124 };
125};
8.3 EDP DTS配置
修改EDP配置需要修改arch/arm64/boot/dts/rockchiprk3568-toybrick-edp.dtsi
1//HOST
2&edp {
3 status = "okay";
4 force-hpd;
5
6 ports {
7 port@1 {
8 reg = <1>;
9
10 edp_out: endpoint {
11 remote-endpoint = <&panel_in>;
12 };
13 };
14 };
15
16};
17
18//PANEL
19 edp_panel: edp_panel {
20 compatible = "simple-panel";
21 backlight = <&backlight>; //使用第一路BACKLIGHT
22 prepare-delay-ms = <20>;
23 enable-delay-ms = <20>;
24 reset-delay-ms = <20>;
25
26 //屏幕timing参数
27 display-timings {
28 native-mode = <&timing0>;
29
30 timing0: timing0 {
31 clock-frequency = <153000000>;
32 hactive = <1920>;
33 vactive = <1080>;
34 hfront-porch = <160>;
35 hsync-len = <20>;
36 hback-porch = <140>;
37 vfront-porch = <25>;
38 vsync-len = <10>;
39 vback-porch = <25>;
40 hsync-active = <0>;
41 vsync-active = <0>;
42 de-active = <0>;
43 pixelclk-active = <0>;
44 };
45 };
46
47 ports {
48 panel_in: endpoint {
49 remote-endpoint = <&edp_out>;
50 };
51 };
52 };
53
54//BACKLIGHT
55&backlight {
56 status = "okay";
57 enable-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; //背光使能脚
58 pinctrl-names = "default";
59 pinctrl-0 = <&backlight_en>;
60};
61
62//PHY
63&edp_phy {
64 status = "okay";
65};
66
67//VOP Routing (画面显示在VOP1上)
68&edp_in_vp0 {
69 status = "disabled";
70};
71
72&edp_in_vp1 {
73 status = "okay";
74};
75
76//LOGO (开机LOGO也对应VOP1)
77&route_edp {
78 status = "okay";
79 connect = <&vp1_out_edp>;
80};
81
82//GPIO0_C7为屏幕供电使能脚
83&vcc3v3_lcd0_n {
84 gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
85 enable-active-high;
86};
87
88//配置背光使能脚复用为GPIO
89&pinctrl{
90 backlight {
91 backlight_en: backlight-en {
92 rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
93 };
94 };
95};
8.4 HDMI DTS配置
HDMI默认常开且画面投射到VOP0上,若需要关闭则修改rch/arm64/boot/dts/rockchip/rk3568-toybrick-x0-linux.dts
修改如下:
1&hdmi{
2 status = "disabled";
3};
4
5//关闭hdmi音频
6&hdmi_sound{
7 status = "disabled";
8};