屏幕
目前SC-3568HA支持MIPI0,MIPI1,EDP,HDMI,四种显示方式,默认显示为MIPI0+HDMI同显
需要切换屏幕使用时,修改arch/arm64/boot/dts/rockchip/rk3568-toybrick-x0-linux.dts
修改如下:
//使用mipi0
/dts-v1/;
#include "rk3568.dtsi"
#include "rk3568-linux.dtsi"
#include "rk3568-toybrick-x0.dtsi"
#include "rk3568-toybrick-mipi-tx0-beiqicloud.dtsi"
//#include "rk3568-toybrick-mipi-tx1.dtsi"
//#include "rk3568-toybrick-edp.dtsi"
//使用mipi1
/dts-v1/;
#include "rk3568.dtsi"
#include "rk3568-linux.dtsi"
#include "rk3568-toybrick-x0.dtsi"
//#include "rk3568-toybrick-mipi-tx0-beiqicloud.dtsi"
#include "rk3568-toybrick-mipi-tx1.dtsi"
//#include "rk3568-toybrick-edp.dtsi"
//使用edp
/dts-v1/;
#include "rk3568.dtsi"
#include "rk3568-linux.dtsi"
#include "rk3568-toybrick-x0.dtsi"
//#include "rk3568-toybrick-mipi-tx0-beiqicloud.dtsi"
//include "rk3568-toybrick-mipi-tx1.dtsi"
#include "rk3568-toybrick-edp.dtsi"
1. MIPI0 DTS配置
修改MIPI0配置需要修改arch/arm64/boot/dts/rockchiprk3568-toybrick-mipi-tx0-beiqicloud.dtsi
//HOST
&dsi0 {
status = "okay";
//PANEL
dsi0_panel: panel@0 {
compatible = "simple-panel-dsi";
reg = <0>;
backlight = <&backlight>; //使用第一路backlight
// power-supply = <&lcd_pwr>;
prepare-delay-ms = <2>;
reset-delay-ms = <100>;
init-delay-ms = <20>;
pinctrl-names = "default";
pinctrl-0 = <&mipi_power_en>;
enable-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>;
enable-delay-ms = <120>;
disable-delay-ms = <50>;
unprepare-delay-ms = <20>;
width-mm = <68>;
height-mm = <121>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = <MIPI_DSI_FMT_RGB888>;
dsi,lanes = <4>;
pnel-type = <5>;
//初始化代码
panel-init-sequence = [
05 64 01 11
39 00 04 FF 98 81 03
15 00 02 01 00
15 00 02 02 00
......
05 32 01 29
15 00 02 35 00
];
panel-exit-sequence = [
05 32 01 28
05 C8 01 10
];
//屏幕timing参数
disp_timings:display-timings {
native-mode = <&dsi0_timing0>;
dsi0_timing0: timing0 {
clock-frequency = <75000000>;
hactive = <720>;
vactive = <1280>;
hfront-porch = <40>;
hsync-len = <10>;
hback-porch = <40>;
vfront-porch = <10>;
vsync-len = <36>;
vback-porch = <15>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
panel_in_dsi: endpoint {
remote-endpoint = <&dsi_out_panel>;
};
};
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@1 {
reg = <1>;
dsi_out_panel: endpoint {
remote-endpoint = <&panel_in_dsi>;
};
};
};
};
//VOP Routing (画面显示在VOP1上)
&dsi0_in_vp0 {
status = "disabled";
};
&dsi0_in_vp1 {
status = "okay";
};
//BACKLIGHT
&backlight {
status = "okay";
};
//PHY
&video_phy0 {
status = "okay";
};
//LOGO (开机LOGO也对应VOP1)
&route_dsi0 {
status = "okay";
connect = <&vp1_out_dsi0>;
};
//GPIO0_C7为屏幕供电使能脚
&vcc3v3_lcd0_n {
gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
regulator-always-on;
enable-active-high;
};
//配置屏幕使能脚复用为GPIO
&pinctrl {
mipi_pwren {
mipi_power_en: mipi_power_en {
rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_output_high>;
};
};
};
2. MIPI1 DTS配置
修改MIPI1配置需要修改arch/arm64/boot/dts/rockchiprk3568-toybrick-mipi-tx1.dtsi
//HOST
&dsi1 {
status = "okay";
};
//PANEL
&dsi1_panel {
status = "okay";
compatible = "simple-panel-dsi";
reg = <0>;
backlight = <&backlight1>; //使用第二路backlight
// power-supply = <&lcd_pwr>;
prepare-delay-ms = <2>;
reset-delay-ms = <100>;
init-delay-ms = <20>;
pinctrl-names = "default";
pinctrl-0 = <&mipi1_power_en>;
enable-gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_HIGH>;
enable-delay-ms = <120>;
disable-delay-ms = <50>;
unprepare-delay-ms = <20>;
width-mm = <68>;
height-mm = <121>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = <MIPI_DSI_FMT_RGB888>;
dsi,lanes = <4>;
pnel-type = <5>;
//初始化代码
panel-init-sequence = [
05 64 01 11
39 00 04 FF 98 81 03
15 00 02 01 00
......
15 00 02 D2 65
15 00 02 D3 3F
39 00 04 FF 98 81 00
05 32 01 29
15 00 02 35 00
];
panel-exit-sequence = [
05 32 01 28
05 C8 01 10
];
disp1_timings:display-timings {
native-mode = <&dsi1_timing0>;
dsi1_timing0: timing0 {
clock-frequency = <75000000>;
hactive = <720>;
vactive = <1280>;
hfront-porch = <40>;
hsync-len = <10>;
hback-porch = <40>;
vfront-porch = <10>;
vsync-len = <36>;
vback-porch = <15>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
panel_in_dsi1: endpoint {
remote-endpoint = <&dsi1_out_panel>;
};
};
};
};
//VOP Routing (画面显示在VOP1上)
&dsi1_in_vp0 {
status = "disabled";
};
&dsi1_in_vp1 {
status = "okay";
};
//BACKLIGHT
&backlight1 {
status = "okay";
};
//PHY
&video_phy1 {
status = "okay";
};
//LOGO (开机LOGO也对应VOP1)
&route_dsi1{
status = "okay";
connect = <&vp1_out_dsi1>;
};
//GPIO0_C5为屏幕供电使能脚
&vcc3v3_lcd1_n {
gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
regulator-always-on;
enable-active-high;
};
//配置屏幕使能脚复用为GPIO
&pinctrl {
mipi1_pwren {
mipi1_power_en: mipi1_power_en {
rockchip,pins = <3 RK_PB6 RK_FUNC_GPIO &pcfg_output_high>;
};
};
};
3. EDP DTS配置配置
修改EDP配置需要修改arch/arm64/boot/dts/rockchiprk3568-toybrick-edp.dtsi
//HOST
&edp {
status = "okay";
force-hpd;
ports {
port@1 {
reg = <1>;
edp_out: endpoint {
remote-endpoint = <&panel_in>;
};
};
};
};
//PANEL
edp_panel: edp_panel {
compatible = "simple-panel";
backlight = <&backlight>; //使用第一路BACKLIGHT
prepare-delay-ms = <20>;
enable-delay-ms = <20>;
reset-delay-ms = <20>;
//屏幕timing参数
display-timings {
native-mode = <&timing0>;
timing0: timing0 {
clock-frequency = <153000000>;
hactive = <1920>;
vactive = <1080>;
hfront-porch = <160>;
hsync-len = <20>;
hback-porch = <140>;
vfront-porch = <25>;
vsync-len = <10>;
vback-porch = <25>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <0>;
pixelclk-active = <0>;
};
};
ports {
panel_in: endpoint {
remote-endpoint = <&edp_out>;
};
};
};
//BACKLIGHT
&backlight {
status = "okay";
enable-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; //背光使能脚
pinctrl-names = "default";
pinctrl-0 = <&backlight_en>;
};
//PHY
&edp_phy {
status = "okay";
};
//VOP Routing (画面显示在VOP1上)
&edp_in_vp0 {
status = "disabled";
};
&edp_in_vp1 {
status = "okay";
};
//LOGO (开机LOGO也对应VOP1)
&route_edp {
status = "okay";
connect = <&vp1_out_edp>;
};
//GPIO0_C7为屏幕供电使能脚
&vcc3v3_lcd0_n {
gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
enable-active-high;
};
//配置背光使能脚复用为GPIO
&pinctrl{
backlight {
backlight_en: backlight-en {
rockchip,pins = <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
};
};
};
3. HDMI DTS配置配置
HDMI默认常开且画面投射到VOP0上,若需要关闭则修改rch/arm64/boot/dts/rockchip/rk3568-toybrick-x0-linux.dts
修改如下:
&hdmi{
status = "disabled";
};
//关闭hdmi音频
&hdmi_sound{
status = "disabled";
};