RK3568 android11.0 LCD マルチスクリーン構成

RK3568 は 3 画面表示をサポートしており、表示 DTS 設定は LCD パラメータ設定、LCD ピン設定、VP チャネル設定の 3 つの部分に分かれています。

  • 1画面表示パラメータに合わせてLCDパラメータ設定を移植することができます。
  • LCD ピン構成(RST、PWR、PWM を含む)

注:若不同通道的屏,使用相同的引脚,只需要在其中一个屏中控制;若同时配置的话,则会uboot启动失败.

一般的に使用されるデバッグ コマンド:

adb root
adb remount
adb shell
#getprop | grep hw //画面構成を表示
#cat /d/dri/0/summary //vop バインディングステータスを表示

adb Shell settings get system screen_brightness //現在の明るさの値を取得します
adb Shell settings put system screen_brightness 150 //明るさの値を変更します(明るさの値は 0 ~ 255 です)


1. LCDパラメータ設定
1. lvds ディスプレイ構成
&lvds_panel {
    
    
        status = "okay";
        compatible = "simple-panel";
        backlight = <&backlight4>; //背光
        enable-delay-ms = <20>;
        prepare-delay-ms = <20>;
        unprepare-delay-ms = <20>;
        disable-delay-ms = <20>;
        bus-format = <MEDIA_BUS_FMT_RGB666_1X7X3_SPWG>; //MEDIA_BUS_FMT_RGB666_1X7X3_JEIDA
        width-mm = <217>;
        height-mm = <136>;

        display-timings {
    
    
                native-mode = <&timing2>;
                timing2: timing2 {
    
    
                        clock-frequency = <45000000>;
                        hactive = <1024>;
                        vactive = <600>;
                        hback-porch = <160>;
                        hfront-porch = <160>;
                        vback-porch = <23>;
                        vfront-porch = <12>;
                        hsync-len = <20>;
                        vsync-len = <3>;
                        hsync-active = <0>;
                        vsync-active = <0>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                };
        };

        ports {
    
    
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
    
    
                        reg = <0>;
                        dual-lvds-even-pixels;
                        panel_in_lvds: endpoint {
    
    
                                remote-endpoint = <&lvds_out_panel>;
                        };
                };
        };
};

&lvds {
    
    
        status = "okay";
        ports {
    
    
                port@1 {
    
    
                        reg = <1>;


                        lvds_out_panel: endpoint {
    
    
                                remote-endpoint = <&panel_in_lvds>;
                        };
                };
        };
};

&video_phy0 {
    
    
        status = "okay";
};
2. dsi0 の表示設定
&dsi0 {
    
    
        status = "okay";
        rockchip,lane-rate = <480>;
        dsi0_panel: panel@0 {
    
    
                status = "okay";
                compatible = "simple-panel-dsi";
                reg = <0>;
                reset-delay-ms = <60>;
                enable-delay-ms = <60>;
                prepare-delay-ms = <60>;
                unprepare-delay-ms = <60>;
                disable-delay-ms = <60>;
                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>;

                panel-init-sequence = [
                        05 78 01 11
                        05 78 01 29
                ];

                panel-exit-sequence = [
                        05 00 01 28
                        05 78 01 10
                ];

                disp_timings0: display-timings {
    
    
                        native-mode = <&dsi0_timing0>;
                        dsi0_timing0: timing0 {
    
    
                                clock-frequency = <51000000>;
                                hactive = <1024>;
                                vactive = <600>;
                                hback-porch = <160>;
                                hfront-porch = <136>;
                                vback-porch = <16>;
                                vfront-porch = <16>;
                                hsync-len = <4>;
                                vsync-len = <2>;
                                hsync-active = <0>;
                                vsync-active = <0>;
                                de-active = <0>;
                                pixelclk-active = <1>;
                        };
                };

                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>;
                        };
                };
        };
};

&mipi_dphy0 {
    
    
        status = "disabled"; //这个节点一定要disabled掉,不然会进不去系统;//I've been in trouble here before
};
3. dsi1 の表示設定
&dsi1 {
    
    
        status = "okay";
        //rockchip,lane-rate = <480>;
        dsi1_panel: panel@0 {
    
    
                status = "okay";
                compatible = "simple-panel-dsi";
                reg = <0>;
                backlight = <&backlight5>;
                reset-delay-ms = <60>;
                enable-delay-ms = <60>;
                prepare-delay-ms = <60>;
                unprepare-delay-ms = <60>;
                disable-delay-ms = <60>;
                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>;
                panel-init-sequence = [
                        05 78 01 11
                        05 78 01 29
                ];

                panel-exit-sequence = [
                        05 00 01 28
                        05 78 01 10
                ];

                disp_timings1: display-timings {
    
    
                        native-mode = <&dsi1_timing0>;
                        dsi1_timing0: timing0 {
    
    
                                clock-frequency = <35000000>;
                                hactive = <1024>;
                                vactive = <600>;
                                hback-porch = <160>;
                                hfront-porch = <136>;
                                vback-porch = <16>;
                                vfront-porch = <16>;
                                hsync-len = <4>;
                                vsync-len = <2>;
                                hsync-active = <0>;
                                vsync-active = <0>;
                                de-active = <0>;
                                pixelclk-active = <1>;
                        };
                };

                ports {
    
    
                        #address-cells = <1>;
                        #size-cells = <0>;


                        port@0 {
    
    
                                reg = <0>;
                                panel_in_dsi1: endpoint {
    
    
                                        remote-endpoint = <&dsi1_out_panel>;
                                };
                        };
                };
        };

        ports {
    
    
                #address-cells = <1>;
                #size-cells = <0>;


                port@1 {
    
    
                        reg = <1>;
                        dsi1_out_panel: endpoint {
    
    
                                remote-endpoint = <&panel_in_dsi1>;
                        };
                };
        };
};

&mipi_dphy1 {
    
    
        status = "okay";
};
4. EDP 表示設定
&edp_panel {
    
    
        status = "okay";
        compatible = "simple-panel";
        //backlight = <&backlight5>;
        prepare-delay-ms = <20>;
        enable-delay-ms = <20>;
        disable-delay-ms = <20>;
        unprepare-delay-ms = <20>;

        display-timings {
    
    
                native-mode = <&timing1>;

                timing0: timing0 {
    
    //EDP 13.3
                        clock-frequency = <150000000>;
                        hactive = <1920>;
                        vactive = <1080>;
                        hfront-porch = <12>;
                        hsync-len = <16>;
                        hback-porch = <48>;
                        vfront-porch = <8>;
                        vsync-len = <4>;
                        vback-porch = <8>;
                        hsync-active = <0>;
                        vsync-active = <0>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                };

                timing1: timing1 {
    
    // EDP 15.6   LP156WF6
                        clock-frequency = <138000000>;
                        hactive = <1920>;
                        vactive = <1080>;
                        hfront-porch = <48>;
                        hsync-len = <32>;
                        hback-porch = <80>;
                        vfront-porch = <3>;
                        vsync-len = <5>;
                        vback-porch = <23>;
                        hsync-active = <0>;
                        vsync-active = <0>;
                        de-active = <0>;
                        pixelclk-active = <0>;
                };
        };

        ports {
    
    
                        panel_in_edp: endpoint {
    
    
                                remote-endpoint = <&edp_out_panel>;
                        };
        };
};

&edp {
    
    
        hpd-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
        status = "okay";
        force-hpd;
        ports {
    
    
                port@1 {
    
    
                        reg = <1>;


                        edp_out_panel: endpoint {
    
    
                                remote-endpoint = <&panel_in_edp>;
                        };
                };
        };
};

&edp_phy {
    
    
        status = "okay";
};

2.VPチャネル構成

RK3568 は VP0 ~ 2 をサポートし、各 VP チャネルは 1 つのディスプレイでのみ構成でき、各チャネルは一貫性のない表示フォーマットをサポートします。
ここに画像の説明を挿入します

1. よく使用されるパラメータ

VP0 : dsi0_in_vp0、dsi1_in_vp0、edp_in_vp0、hdmi_in_vp0
VP1 : dsi0_in_vp1、dsi1_in_vp1、edp_in_vp1、hdmi_in_vp1、lvds_in_vp1
VP2 : lvds_in_vp2、rgb_in_vp2

2. vp チャネル バインディング
  1. dsi0 + vp0
&dsi0_in_vp0 {
    
    
        status = "okay";
};

&dsi0_in_vp1 {
    
    
        status = "disabled";
};

&route_dsi0 {
    
    
        status = "okay";
        connect = <&vp0_out_dsi0>;
};
  1. dsi1+vp0
&dsi1_in_vp0 {
    
    
        status = "okay";
};

&dsi1_in_vp1 {
    
    
        status = "disabled";
};

&route_dsi1 {
    
    
        status = "okay";
        connect = <&vp0_out_dsi1>;
};
  1. edp+vp1
&edp_in_vp0 {
    
    
        status = "disabled";
};

&edp_in_vp1 {
    
    
        status = "okay";
};

&route_edp {
    
    
        status = "okay";
        connect = <&vp1_out_edp>;
};
  1. LVDS+VP2
&lvds_in_vp1 {
    
    
        status = "disabled";
};

&lvds_in_vp2 {
    
    
        status = "okay";
};

&route_lvds {
    
    
        status = "okay";
        connect = <&vp2_out_lvds>;
};

3. LCDの端子配置
1. RST/PWR GPIO 構成

注:不论PWM,RST,PWR中任一引脚,都不能重复配置在已经使能的通道下,否则会导致uboot启动失败。

// MIPI DSI0
&dsi0_panel {
    
    
      power-supply = <&vcc3v3_lcd_n>;
      reset-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_LOW>; // 屏reset脚gpio口
      pinctrl-names = "default";
      pinctrl-0 = <&lcd_rst_gpio>;
      backlight = <&backlight4>;
};

// MIPI DSI1
&dsi1_panel {
    
    
        power-supply = <&vcc3v3_lcd_n>;
        reset-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_LOW>;
        pinctrl-names = "default";
        pinctrl-0 = <&lcd_rst_gpio>;
        backlight = <&backlight5>;
};

// LVDS
&lvds_panel {
    
    
      power-supply = <&vcc3v3_lcd_n>;
      reset-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_LOW>;
      pinctrl-names = "default";
      pinctrl-0 = <&lcd_rst_gpio>;
      backlight = <&backlight4>;
};

// EDP
&edp_panel {
    
    
      power-supply = <&vcc3v3_lcd_n>;
      backlight = <&backlight5>;
};

// POWER GPIO
&vcc3v3_lcd_n {
    
    
        gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>; //屏PWR_EN脚gpio口
        enable-active-high;
};

&pinctrl {
    
    
        lcd1 {
    
    
                lcd_rst_gpio: lcd1-rst-gpio {
    
    
                        rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; //up,down
                };
        };
};
2. PWM構成

dts で PWM4 と PWM5 を同時に有効にし、回路図に従って対応する LCD でそれらを直接参照します。

/ {
    
    
        backlight4: backlight4 {
    
    
                compatible = "pwm-backlight";
                pwms = <&pwm4 0 25000 0>;
                brightness-levels = <
                          0  20  20  21  21  22  22  23
                         23  24  24  25  25  26  26  27
                         27  28  28  29  29  30  30  31
                         31  32  32  33  33  34  34  35
                         35  36  36  37  37  38  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
                >;
                default-brightness-level = <200>;
        };

        backlight5: backlight5 {
    
    
                compatible = "pwm-backlight";
                pwms = <&pwm5 0 25000 0>;
                brightness-levels = <
                          0  20  20  21  21  22  22  23
                         23  24  24  25  25  26  26  27
                         27  28  28  29  29  30  30  31
                         31  32  32  33  33  34  34  35
                         35  36  36  37  37  38  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
                >;
                default-brightness-level = <200>;
                enable-gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>; // 屏背光使能脚gpio口
                pinctrl-names = "default";
                pinctrl-0 = <&edp_bl_en>;
        };
};

&pwm4 {
    
    
        status = "okay";
};

&pwm5 {
    
    
        status = "okay";
};

&pinctrl {
    
    
    backlight {
    
    
        edp_bl_en: edp-bl-en {
    
    
            rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
        };
    };
}

不要なスクリーン ノードは、実際のニーズに応じて開閉できます。再利用を避けるために、VP チャネルでサポートされているスクリーン タイプと一致する必要があります。

Guess you like

Origin blog.csdn.net/weixin_45639314/article/details/132276931