作者:Dennis

电话:13349909990(微信同号)

邮箱:dennis@we-signage.com

说明:本文所提供的技术方案适用于 恒耀源科技有限公司 RK3568主板以及使用该主板的所有硬件设备

本设计 LVDS 使用RK3568的 dsi0 通道使用 mipi转LVDS芯片实现,LVDS为21.5" 分辨率=1920*1080的屏幕。

一、修改文件rk3568-firefly-port.dtsi

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
 *
 */

#include "rk3568-firefly-port.dtsi"

/ {

	vcc_hub_reset: vcc-hub-reset-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&vcc_hub_reset_en>;
		regulator-name = "vcc_hub_reset_en";
		regulator-always-on;
	};

	pcie_pi6c_oe: pcie-pi6c-oe-regulator {
		compatible = "regulator-fixed";
		//enable-active-high;
		gpio = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&pcie_pi6c_oe_en>;
		regulator-name = "pcie_pi6c_oe_en";
		regulator-always-on;
	};

	firefly_leds: leds {
		status = "okay";
		compatible = "gpio-leds";

		power_led: power {
			label = "firefly:blue:power";
			linux,default-trigger = "ir-power-click";
			default-state = "on";
			gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&led_power>;
		};

		user_led: user {
			label = "firefly:yellow:user";
			linux,default-trigger = "ir-user-click";
			default-state = "off";
			gpios = <&gpio1 RK_PB1 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&led_user>;
		};

		diy1_led: diy1 {
			label = "firefly:green:diy";
			linux,default-trigger = "ir-user-click";
			default-state = "off";
			gpios = <&gpio1 RK_PB0 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&led_diy1>;
		};

		diy2_led: diy2 {
			label = "firefly:yellow:diy";
			linux,default-trigger = "ir-user-click";
			default-state = "off";
			gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&led_diy2>;
		};
	};

};


&vcc3v3_vga {
    status = "disabled";
};

/* VCC5V0_USB30_HOST1 */
&vcc5v0_host {
	gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
};
&vcc5v0_host_en {
	rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
};

&i2c0 {
    status = "okay";

    fusb0: fusb30x@22 {
        compatible = "fairchild,fusb302";
        reg = <0x22>;
        pinctrl-names = "default";
        pinctrl-0 = <&fusb0_int>;
        int-n-gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
        fusb340-switch-gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_HIGH>;
        vbus-5v-gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
        status = "okay";
    };
};

&vcc5v0_otg{
    status = "okay";
};

&usb2phy0 {
    status = "okay";
    extcon = <&fusb0>;
};

&u2phy0_otg {
    /delete-property/ vbus-supply;
    status = "okay";
};

&usbdrd_dwc3 {
    dr_mode = "host";
    extcon = <&fusb0>;
    status = "okay";
};

&i2c1 {
    status = "okay";                                                                                                                                                                                                      
    ilitek: ilitek@41 {
        status = "okay";
        compatible = "tchip,ilitek";
        reg = <0x41>;
        ilitek,irq-gpio = <&gpio0 RK_PB5 IRQ_TYPE_EDGE_RISING>;
        ilitek,reset-gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
        ilitek,name = "ilitek_i2c";
    };  
};

&i2c5 {
	status = "okay";
};


&hym8563 {
	status = "okay";
};

&mc3230 {
	status = "okay";
};

&uart3 {
	status = "okay";
	pinctrl-0 = <&uart3m1_xfer>;
};

&uart4 {
	status = "okay";
	pinctrl-0 = <&uart4m1_xfer>;
};

&uart7 {
	status = "okay";
	pinctrl-0 = <&uart7m1_xfer>;
};

&uart8 {
	status = "okay";
};

&uart9 {
	status = "okay";
	pinctrl-0 = <&uart9m1_xfer>;
};

&can1{
       status = "okay";
};

&pcie30phy {
	status = "okay";
};

&pcie3x2 {
	reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
	vpcie3v3-supply = <&vcc3v3_pcie>;
	status = "okay";
};

&its {
	status = "okay";
};

&gmac0 {
    status = "okay";
    tx_delay = <0x4a>;
    rx_delay = <0x2e>;
};

&gmac1 {
    status = "okay";
    tx_delay = <0x3e>;
    rx_delay = <0x32>;
};

&sdio_pwrseq {
	status = "okay";
	reset-gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>;
	post-power-on-delay-ms = <100>;
};

/* used for wifi */
&sdmmc2 {
	status = "okay";
};

&wireless_wlan {
	wifi_chip_type = "rtl8821cs";
	status = "okay";
};

&wireless_bluetooth {
	status = "okay";
	BT,wake_gpio     = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>;
	BT,wake_host_irq = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>;
};

&spdif_8ch{
	status = "disabled";
};

&rk809_codec {
	//hp-det = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;
	io-channels = <&saradc 7>;
	hp-det-adc-value = <1000>;
	hp-adc-drift-scope = <100>;
	/delete-property/ spk-ctl;
};

&rk809 {
	rtc {
		status = "disabled";
	};
};

&pwm7 {
	status = "okay";
};

&sata2 {
	status = "okay";
};

&dfi {
	status = "okay";
};

&dmc {
	status = "okay";
};

&pinctrl {
	usb {
		vcc_hub_reset_en: vcc-hub-reset-en {
			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	pcie {
		pcie_pi6c_oe_en: pcie-pi6c-oe-en {
			rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	leds {
		led_power: led-power {
			rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		led_user: led-user {
			rockchip,pins = <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		led_diy1: led-diy1 {
			rockchip,pins = <1 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		led_diy2: led-diy2 {
                        rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
                };
	};

    fusb30x{
        fusb0_int: fusb0-int{
            rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>;
        };
    };
};

二、创建文件 rk3568-firefly-roc-pc-mipi_2LVDS.dtsi

// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
 *
 */

 /dts-v1/;

#include "rk3568-firefly-roc-pc.dtsi"
/*
 *                               Select one of the three
 * using single camera xc7160 ----> rk3568-firefly-roc-pc-cam-8ms1m.dtsi
 * using dual camera gc2053/gc2093   ----> rk3568-firefly-roc-pc-cam-2ms2m.dtsi
 * using hdmi-in module rk628d   ----> rk3568-firefly-roc-pc-tf-hdmi-mipi-rk628.dtsi
 */
#include "rk3568-firefly-roc-pc-cam-8ms1m.dtsi"
//#include "rk3568-firefly-roc-pc-cam-2ms2m.dtsi"
//#include "rk3568-firefly-roc-pc-tf-hdmi-mipi-rk628.dtsi"

/ {
    model = "ROC-RK3568-PC MIPI 2LVDS + HDMI(Android)";
    compatible = "rockchip,rk3568-firefly-roc-pc-mipi", "rockchip,rk3568";

	vcc_lcd0_power: vcc-lcd0-power-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&vcc_lcd0_power_en>;
		regulator-name = "vcc_lcd0_power_en";
		regulator-always-on;
	};

	vcc_lcd1_power: vcc-lcd1-power-regulator {
		compatible = "regulator-fixed";
		enable-active-high;
		gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&vcc_lcd1_power_en>;
		regulator-name = "vcc_lcd1_power_en";
		regulator-always-on;
	};

    backlight: backlight {
		status = "okay";
		compatible = "pwm-backlight";
		pwms = <&pwm4 0 50000 1>;
        brightness-levels = <
           	20  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 = <&gpio3 RK_PB0 GPIO_ACTIVE_HIGH>;
    };

    backlight1: backlight1 {
        status = "disabled";
        compatible = "pwm-backlight";
        enable-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
        pwms = <&pwm4 0 50000 1>;
        brightness-levels = <
             60  60  60  61  61  61  62  62
             62  63  63  63  64  64  64  65
             65  65  66  66  66  67  67  67
             68  68  68  69  69  69  70  70
             70  71  71  71  72  72  72  73
             73  73  74  74  74  75  75  75
             76  76  76  77  77  77  78  78
             78  79  79  79  80  80  80  81
             81  81  82  82  82  83  83  83
             84  84  84  85  85  85  86  86
             86  87  87  87  88  88  88  89
             89  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>;
	};
};

&route_dsi0 {
    status = "okay";
    //logo,rotation = <270>; //support rotation 90,180,270
    connect = <&vp0_out_dsi0>;
};

&video_phy0 {
    status = "okay";
};

&dsi0_in_vp0 {
    status = "okay";
};

&dsi0_in_vp1 {
    status = "disabled";
};

/*
 * mipi_dphy0 needs to be enabled
 * when dsi0 is enabled
 */
&dsi0 {
    status = "okay";
    //rockchip,lane-rate = <1000>;
    dsi0_panel: panel@0 {
		status = "okay";
		compatible = "simple-panel-dsi";
		reg = <0>;
		backlight = <&backlight>;

		//enable-gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_LOW>;		
		enable-delay-ms = <35>;
		prepare-delay-ms = <6>;
		reset-delay-ms = <0>;
		init-delay-ms = <20>;
		unprepare-delay-ms = <0>;
		disable-delay-ms = <20>;		
		size,width = <120>;
		size,height = <170>;		
		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 = [
			23 00 02 27 AA
			23 00 02 48 02
			23 00 02 B6 20
			23 00 02 01 80
			23 00 02 02 38
			23 00 02 03 47
			23 00 02 04 8C
			23 00 02 05 0A
			23 00 02 06 82
			23 00 02 07 00
			23 00 02 08 14
			23 00 02 09 0A
			23 00 02 0A 0F
			23 00 02 0B 02
			23 00 02 0C 52
			23 00 02 0D 01
			23 00 02 0E 80
			23 00 02 0F 20
			23 00 02 10 20
			23 00 02 11 03
			23 00 02 12 1B
			23 00 02 13 63
			23 00 02 14 01
			23 00 02 15 23
			23 00 02 16 40
			23 00 02 17 00
			23 00 02 18 01
			23 00 02 19 23
			23 00 02 1A 40
			23 00 02 1B 00
			23 00 02 1E 46
			23 00 02 51 30
			23 00 02 1F 10
			//23 00 02 2A 4D 测试信号
			23 00 02 2A 01

			//如下为SSR展频,不加可能点不亮
			23 00 02 6A	08 
			23 00 02 6C	9E
			23 00 02 6D 07
			23 00 02 6E	00
			23 00 02 6F	8A
			23 00 02 70 19
			23 64 02 71 00
        ];

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

        disp_timings0: display-timings {
            native-mode = <&dsi0_timing0>;
            dsi0_timing0: timing0 {
				clock-frequency = <148500000>;
				hactive = <1920>;
				vactive = <1080>;
				hsync-len = <10>;   //20, 50,10
				hback-porch = <130>; //50, 56,10
				hfront-porch = <140>;//50, 30,180
				vsync-len = <10>;//4
				vback-porch = <15>;//4
				vfront-porch = <20>;//8
				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>;
            };
        };
	};
};

&route_dsi1 {
    status = "disabled";
    connect = <&vp1_out_dsi1>;
};

&video_phy1 {
    status = "disabled";
};

&dsi1_in_vp0 {
    status = "disabled";
};

&dsi1_in_vp1 {
    status = "disabled";
};

/*
 * mipi_dphy1 needs to be enabled
 * when dsi1 is enabled
 */
&dsi1 {
    status = "disabled";
    //rockchip,lane-rate = <1000>;
    dsi1_panel: panel@0 {
        status = "okay";
        compatible = "simple-panel-dsi";
        reg = <0>;
        backlight = <&backlight>;

        enable-gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
	    reset-gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_LOW>;

        enable-delay-ms = <35>;
        prepare-delay-ms = <6>;
        reset-delay-ms = <25>;
        init-delay-ms = <55>;
        unprepare-delay-ms = <0>;
        disable-delay-ms = <20>;
        mipi-data-delay-ms = <200>;
        size,width = <120>;
        size,height = <170>;
        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 = [

        ];

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

        disp_timings1: display-timings {
            native-mode = <&dsi1_timing0>;
            dsi1_timing0: timing0 {
                clock-frequency = <72600000>;//<80000000>;
                hactive = <800>;//<768>;
                vactive = <1280>;
                hsync-len = <14>;   //20, 50,10
                hback-porch = <26>; //50, 56,10
                hfront-porch = <32>;//50, 30,180
	            vsync-len = <8>;//4
	            vback-porch = <20>;//4
	            vfront-porch = <80>;//8
	            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>;
                };
            };
        };
	};

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

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

&i2c1 {
    hxchipset@48{
        status = "okay";
        compatible = "himax,hxcommon";
        reg = <0x48>;

        himax,rst-gpio =  <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
        himax,irq-gpio = <&gpio0 RK_PB5 IRQ_TYPE_LEVEL_LOW>;
        //himax,3v3-gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
        //himax,pon-gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;

        himax,panel-coords = <0 800 0 1280>;      //触摸范围
        himax,display-coords = <0 800 0 1280>;    //分辨率
        report_type = <1>;
    };
};

&i2c5 {
    hxchipset@48{
        status = "disabled";
        compatible = "himax,hxcommon";
        reg = <0x48>;

        himax,rst-gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
        himax,irq-gpio = <&gpio2 RK_PD7 IRQ_TYPE_LEVEL_LOW>;
        //himax,3v3-gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
        //himax,pon-gpio = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;

        himax,panel-coords = <0 800 0 1280>;      //触摸范围
        himax,display-coords = <0 800 0 1280>;    //分辨率
        report_type = <1>;
    };
};

&route_hdmi {
    status = "okay";
    connect = <&vp1_out_hdmi>;
};

&hdmi {
    status = "okay";
};

&hdmi_in_vp1 {
    status = "okay";
};

&hdmi_in_vp0 {
    status = "disabled";
};

&pinctrl {
	lcd {
		vcc_lcd0_power_en: vcc-lcd0-power-en {
			rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		vcc_lcd1_power_en: vcc-lcd1-power-en {
			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};
/delete-node/ &vcc3v3_lcd0_n;
/delete-node/ &vcc3v3_lcd1_n;

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐