硬件设备

  • 主板: EASY EAI Nano(送的),主控IC:RV1126
  • 屏幕: 晶尚显示10.1寸MIPI屏幕,显示IC:ILI9881C
  • 触摸: 晶尚显示10.1寸MIPI屏幕,触摸IC:GT9271

电路设计

主板的40pin接口线序和屏幕接口线序不一样,需要自己画转接板,将二者线序对上即可。注意mipi走线规范和阻抗匹配。


屏幕移植

厂家资料会给出相应的规格书和相关初始化代码,但是mipi屏幕在安卓上用的比较多,初始化代码基本上都是安卓内核的。需要我们自己对照厂商代码自行修改RV1126设备树相应的初始化序列。

主dts位置:EASY_EAI_NANO/kernel/arch/arm/boot/dts/rv1126-nano.dts
diff --git a/home/mkirin/Desktop/rv1126-nano.dts b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/arch/arm/boot/dts/rv1126-nano.dts
index 7b6d729..0f32361 100755
--- a/home/mkirin/Desktop/rv1126-nano.dts
+++ b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/arch/arm/boot/dts/rv1126-nano.dts
@@ -1,201 +1,205 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
  */
 /dts-v1/;
 #include "rv1126.dtsi"
 #include "rv1126-evb-v12.dtsi"
-#include "rv1126-lmo5inch.dtsi"
+//#include "rv1126-lmo5inch.dtsi"
 //#include "rv1126-lmo8inch.dtsi"
+
+#include "rv1126-lmo10-1inch.dtsi"
+
+
 #include "rv1126-dual-gc20xx.dtsi"
 //#include "rv1126-single-gc2093.c"

屏幕dts位置: /media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/arch/arm/boot/dts/rv1126-lmo10-1inch.dtsi

屏幕dts需要把dts中的rv1126-lmo8inch.dtsi复制一份重命名,然后再修改相关序列即可。

diff --git a/home/mkirin/Desktop/rv1126-lmo8inch.dtsi b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/arch/arm/boot/dts/rv1126-lmo10-1inch.dtsi
index ad79956..785662d 100755
--- a/home/mkirin/Desktop/rv1126-lmo8inch.dtsi
+++ b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/arch/arm/boot/dts/rv1126-lmo10-1inch.dtsi
@@ -8,6 +8,7 @@
     /delete-node/ vcc18-lcd-n;
 };
 
+
 &backlight {
     pwms = <&pwm8 0 25000 0>;
     default-brightness-level = <255>;
@@ -16,7 +17,6 @@
 &display_subsystem {
     status = "okay";
 };
-
 &dsi {
     status = "okay";
 
@@ -25,7 +25,7 @@
     panel@0 {
         pinctrl-names = "default";
         pinctrl-0 = <&rst_lcd>;
-        compatible = "ilitek,ili9881d", "simple-panel-dsi";
+        compatible = "ilitek,ili9881c", "simple-panel-dsi";
         reg = <0>;
         backlight = <&backlight>;
         reset-gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_LOW>;
@@ -33,11 +33,10 @@
         reset-delay-ms = <1>;
         init-delay-ms = <80>;
 
-        width-mm = <107>;
-        height-mm = <172>;
+        width-mm = <135>;
+        height-mm = <216>;
 
-        dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
-                  MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
+        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>;
 
@@ -45,51 +44,51 @@
             39 00 04 FF 98 81 03
             15 00 02 01 00
             15 00 02 02 00
-            15 00 02 03 73
-            15 00 02 04 00
-            15 00 02 05 00
-            15 00 02 06 08
-            15 00 02 07 00
-            15 00 02 08 00
+            15 00 02 03 53
+            15 00 02 04 57
+            15 00 02 05 13
+            15 00 02 06 04
+            15 00 02 07 02
+            15 00 02 08 02
             15 00 02 09 00
-            15 00 02 0A 01
-            15 00 02 0B 01
-            15 00 02 0C 00
-            15 00 02 0D 01
-            15 00 02 0E 01
-            15 00 02 0F 00
+            15 00 02 0a 00
+            15 00 02 0b 00
+            15 00 02 0c 00
+            15 00 02 0d 00
+            15 00 02 0e 00
+            15 00 02 0f 00
             15 00 02 10 00
             15 00 02 11 00
             15 00 02 12 00
-            15 00 02 13 1F
-            15 00 02 14 1F
+            15 00 02 13 00
+            15 00 02 14 00
             15 00 02 15 00
             15 00 02 16 00
             15 00 02 17 00
             15 00 02 18 00
             15 00 02 19 00
-            15 00 02 1A 00
-            15 00 02 1B 00
-            15 00 02 1C 00
-            15 00 02 1D 00
-            15 00 02 1E 40
-            15 00 02 1F C0
-            15 00 02 20 06
-            15 00 02 21 01
-            15 00 02 22 06
-            15 00 02 23 01
-            15 00 02 24 88
-            15 00 02 25 88
+            15 00 02 1a 00
+            15 00 02 1b 00
+            15 00 02 1c 00
+            15 00 02 1d 00
+            15 00 02 1e 00
+            15 00 02 1f 00
+            15 00 02 20 02
+            15 00 02 21 09
+            15 00 02 22 00
+            15 00 02 23 00
+            15 00 02 24 00
+            15 00 02 25 00
             15 00 02 26 00
             15 00 02 27 00
-            15 00 02 28 3B
+            15 00 02 28 55
             15 00 02 29 03
-            15 00 02 2A 00
-            15 00 02 2B 00
-            15 00 02 2C 00
-            15 00 02 2D 00
-            15 00 02 2E 00
-            15 00 02 2F 00
+            15 00 02 2a 00
+            15 00 02 2b 00
+            15 00 02 2c 00
+            15 00 02 2d 00
+            15 00 02 2e 00
+            15 00 02 2f 00
             15 00 02 30 00
             15 00 02 31 00
             15 00 02 32 00
@@ -98,14 +97,14 @@
             15 00 02 35 00
             15 00 02 36 00
             15 00 02 37 00
-            15 00 02 38 00
+            15 00 02 38 3C
             15 00 02 39 00
-            15 00 02 3A 00
-            15 00 02 3B 00
-            15 00 02 3C 00
-            15 00 02 3D 00
-            15 00 02 3E 00
-            15 00 02 3F 00
+            15 00 02 3a 00
+            15 00 02 3b 00
+            15 00 02 3c 00
+            15 00 02 3d 00
+            15 00 02 3e 00
+            15 00 02 3f 00
             15 00 02 40 00
             15 00 02 41 00
             15 00 02 42 00
@@ -116,144 +115,141 @@
             15 00 02 52 45
             15 00 02 53 67
             15 00 02 54 89
-            15 00 02 55 AB
+            15 00 02 55 ab
             15 00 02 56 01
             15 00 02 57 23
             15 00 02 58 45
             15 00 02 59 67
-            15 00 02 5A 89
-            15 00 02 5B AB
-            15 00 02 5C CD
-            15 00 02 5D EF
-            15 00 02 5E 00
-            15 00 02 5F 01
-            15 00 02 60 01
-            15 00 02 61 06
-            15 00 02 62 06
-            15 00 02 63 07
-            15 00 02 64 07
-            15 00 02 65 00
-            15 00 02 66 00
-            15 00 02 67 02
+            15 00 02 5a 89
+            15 00 02 5b ab
+            15 00 02 5c cd
+            15 00 02 5d ef
+            15 00 02 5e 01
+            15 00 02 5f 0A
+            15 00 02 60 02
+            15 00 02 61 02
+            15 00 02 62 08
+            15 00 02 63 15
+            15 00 02 64 14
+            15 00 02 65 02
+            15 00 02 66 11
+            15 00 02 67 10
             15 00 02 68 02
-            15 00 02 69 05
-            15 00 02 6A 05
-            15 00 02 6B 02
-            15 00 02 6C 0D
-            15 00 02 6D 0D
-            15 00 02 6E 0C
-            15 00 02 6F 0C
-            15 00 02 70 0F
-            15 00 02 71 0F
-            15 00 02 72 0E
-            15 00 02 73 0E
+            15 00 02 69 0F
+            15 00 02 6a 0E
+            15 00 02 6b 02
+            15 00 02 6c 0D
+            15 00 02 6d 0C
+            15 00 02 6e 06
+            15 00 02 6f 02
+            15 00 02 70 02
+            15 00 02 71 02
+            15 00 02 72 02
+            15 00 02 73 02
             15 00 02 74 02
-            15 00 02 75 01
-            15 00 02 76 01
-            15 00 02 77 06
+            15 00 02 75 0A
+            15 00 02 76 02
+            15 00 02 77 02
             15 00 02 78 06
-            15 00 02 79 07
-            15 00 02 7A 07
-            15 00 02 7B 00
-            15 00 02 7C 00
-            15 00 02 7D 02
-            15 00 02 7E 02
-            15 00 02 7F 05
-            15 00 02 80 05
+            15 00 02 79 15
+            15 00 02 7a 14
+            15 00 02 7b 02
+            15 00 02 7c 10
+            15 00 02 7d 11
+            15 00 02 7e 02
+            15 00 02 7f 02
+            15 00 02 80 0D
             15 00 02 81 02
-            15 00 02 82 0D
-            15 00 02 83 0D
-            15 00 02 84 0C
-            15 00 02 85 0C
-            15 00 02 86 0F
-            15 00 02 87 0F
-            15 00 02 88 0E
-            15 00 02 89 0E
+            15 00 02 82 0E
+            15 00 02 83 0F
+            15 00 02 84 08
+            15 00 02 85 02
+            15 00 02 86 02
+            15 00 02 87 02
+            15 00 02 88 02
+            15 00 02 89 02
             15 00 02 8A 02
             39 00 04 FF 98 81 04
+            15 00 02 3B C0
             15 00 02 6C 15
-            15 00 02 6E 2A
-            15 00 02 6F 33
-            15 00 02 8D 1B
-            15 00 02 87 BA
+            15 00 02 6E 30
+            15 00 02 6F 55
             15 00 02 3A 24
+            15 00 02 8D 1F
+            15 00 02 87 BA
             15 00 02 26 76
             15 00 02 B2 D1
+            15 00 02 B5 07
+            15 00 02 35 1F
+            15 00 02 88 0B
+            15 00 02 21 30
             39 00 04 FF 98 81 01
             15 00 02 22 0A
-            15 00 02 31 00
-            15 00 02 43 66
-            15 00 02 53 42
-            15 00 02 50 87
-            15 00 02 51 82
-            15 00 02 60 15
-            15 00 02 61 01
-            15 00 02 62 0C
-            15 00 02 63 00
-            15 00 02 A0 00
-            15 00 02 A1 13
-            15 00 02 A2 23
-            15 00 02 A3 14
-            15 00 02 A4 16
-            15 00 02 A5 29
-            15 00 02 A6 1E
-            15 00 02 A7 1D
-            15 00 02 A8 86
-            15 00 02 A9 1E
-            15 00 02 AA 29
-            15 00 02 AB 74
-            15 00 02 AC 19
-            15 00 02 AD 17
+            15 00 02 31 09
+            15 00 02 40 33
+            15 00 02 53 37
+            15 00 02 55 38
+            15 00 02 50 95
+            15 00 02 51 95
+            15 00 02 60 30
+            15 00 02 A0 0F
+            15 00 02 A1 17
+            15 00 02 A2 22
+            15 00 02 A3 19
+            15 00 02 A4 15
+            15 00 02 A5 28
+            15 00 02 A6 1C
+            15 00 02 A7 1C
+            15 00 02 A8 78
+            15 00 02 A9 1C
+            15 00 02 AA 28
+            15 00 02 AB 69
+            15 00 02 AC 1A
+            15 00 02 AD 19
             15 00 02 AE 4B
-            15 00 02 AF 20
-            15 00 02 B0 26
-            15 00 02 B1 4C
-            15 00 02 B2 5D
+            15 00 02 AF 22
+            15 00 02 B0 2A
+            15 00 02 B1 4B
+            15 00 02 B2 6B
             15 00 02 B3 3F
-            15 00 02 C0 00
-            15 00 02 C1 13
-            15 00 02 C2 23
-            15 00 02 C3 14
-            15 00 02 C4 16
-            15 00 02 C5 29
-            15 00 02 C6 1E
+            15 00 02 C0 01
+            15 00 02 C1 17
+            15 00 02 C2 22
+            15 00 02 C3 19
+            15 00 02 C4 15
+            15 00 02 C5 28
+            15 00 02 C6 1C
             15 00 02 C7 1D
-            15 00 02 C8 86
-            15 00 02 C9 1E
-            15 00 02 CA 29
-            15 00 02 CB 74
-            15 00 02 CC 19
-            15 00 02 CD 17
+            15 00 02 C8 78
+            15 00 02 C9 1C
+            15 00 02 CA 28
+            15 00 02 CB 69
+            15 00 02 CC 1A
+            15 00 02 CD 19
             15 00 02 CE 4B
-            15 00 02 CF 20
-            15 00 02 D0 26
-            15 00 02 D1 4C
-            15 00 02 D2 5D
+            15 00 02 CF 22
+            15 00 02 D0 2A
+            15 00 02 D1 4B
+            15 00 02 D2 6B
             15 00 02 D3 3F
             39 00 04 FF 98 81 00
-            15 00 02 35 00
-            05 78 01 11
-            05 14 01 29
-        ];
-
-        panel-exit-sequence = [
-            15 00 02 28 00
-            15 00 02 10 00
+            05 78 02 11 00
+            05 05 02 29 00
         ];
 
         display-timings {
             native-mode = <&timing0>;
 
             timing0: timing0 {
-                clock-frequency = <68220000>;
+                clock-frequency = <71000000>;
                 hactive = <800>;
                 vactive = <1280>;
-                hfront-porch = <20>;
-                hsync-len = <20>;
-                hback-porch = <20>;
-                vfront-porch = <30>;
-                vsync-len = <4>;
-                vback-porch = <8>;
+                hfront-porch = <52>;
+                hsync-len = <8>;
+                hback-porch = <48>;
+                vfront-porch = <15>;
+                vsync-len = <6>;
+                vback-porch = <16>;
                 hsync-active = <0>;
                 vsync-active = <0>;
                 de-active = <0>;
@@ -270,29 +266,58 @@
                 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>;
             };
         };
+
     }; //panel
 }; //dsi
 
+&i2c1 {
+    /delete-node/ gc2053@37;
+    /delete-node/ gc2093@7e;
+};
+
 &i2c5 {
     status = "okay";
     pinctrl-0 = <&i2c5m1_xfer>;
     /delete-node/ gt1x@14;
 
-    gt911@14 {
+    /* Goodix-TS@5d { */
+    Goodix-TS@5d {
+        status = "okay";
+        /* compatible = "goodix,gt9xx","goodix,gt9271"; */
+        compatible = "goodix,gt9xx";
         pinctrl-names = "default";
         pinctrl-0 = <&tp_rst &tp_int>;
-        compatible = "goodix,gt911";
-        reg = <0x14>;
+        reg = <0x5d>;
         interrupt-parent = <&gpio3>;
-        interrupts = <RK_PC1 0>;
+        interrupts = <RK_PC1 IRQ_TYPE_LEVEL_LOW>;
+        /* irq-gpio = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; */
+        touch-gpio = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>;
+        reset-gpio = <&gpio3 RK_PC3 GPIO_ACTIVE_HIGH>;
+        max-x = <1280>;
+        max-y = <800>;
+        tp-size = <927>;
+        tp_supply = <&vcc_3v3>;
+
 
-        irq-gpios = <&gpio3 RK_PC1 0>;
-        reset-gpios = <&gpio3 RK_PC3 0>;
     };
 };
 
+
+
 &pinctrl {
     mipi-dsi {
         /omit-if-no-ref/
@@ -302,6 +327,7 @@
         };
     };
     touch-screen {
+    status = "okay";
         /omit-if-no-ref/
         tp_rst: tp_rst {
             rockchip,pins =
@@ -310,7 +336,7 @@
         /omit-if-no-ref/
         tp_int: tp_int {
             rockchip,pins =
-                <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_up>;
+                <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
         };
     };
 };

内核编译选项

make命令: make menuconfig ARCH=arm CC=/media/mkirin/Android_Dev/EASY_EAI_NANO/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc rv1126_ubuntu_defconfig
记得自行替换地址哦

  • 屏幕选项: Device Drivers -> Graphics support -> Display Panels
    Display Panel.png
  • 触摸选项:Device Drivers -> Input device support -> Generic input layer -> Touchscreens
    Touchscreen.png

驱动修改

触摸驱动修改

触摸驱动在EASY_EAI_NANO/kernel/drivers/input/touchscreen/gt9xx/目录下。

  • gt9xx_cfg.h
diff --git a/home/mkirin/Desktop/gt9xx_cfg.h b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/drivers/input/touchscreen/gt9xx/gt9xx_cfg.h
index c667948..05d32d0 100644
--- a/home/mkirin/Desktop/gt9xx_cfg.h
+++ b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/drivers/input/touchscreen/gt9xx/gt9xx_cfg.h
@@ -44,7 +44,10 @@ u8 gtp_dat_9_7[] = {
 u8 gtp_dat_10_1[] = {
     /* TODO:Puts your update firmware data here! */
     /* <1200, 1920> 10.1 */
-    #include "WGJ10187_GT9271_Config_20140623_104014_0X41.cfg" /*(厂商给的触摸屏配置)*/
+    /* #include "WGJ10187_GT9271_Config_20140623_104014_0X41.cfg" */
+
+    /* <1280, 800> 10.1 */
+    #include "JSD2296436754GT9271_Config_20220925_172459.cfg"
 };
  • gt9xx.c 新增的选项要与dts里tp-size对应
diff --git a/home/mkirin/Desktop/gt9xx.c b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/drivers/input/touchscreen/gt9xx/gt9xx.c
index 6db7e39..8e3eb60 100644
--- a/home/mkirin/Desktop/gt9xx.c
+++ b/media/mkirin/Android_Dev/EASY_EAI_NANO/kernel/drivers/input/touchscreen/gt9xx/gt9xx.c
@@ -60,6 +60,7 @@ static u8 m89or101 = TRUE;
 static u8 bgt911 = FALSE;
 static u8 bgt970 = FALSE;
 static u8 bgt910 = FALSE;
+static u8 bgt927 = FALSE;
 static u8 gtp_change_x2y = TRUE;
 static u8 gtp_x_reverse = FALSE;
 static u8 gtp_y_reverse = TRUE;
@@ -423,13 +424,29 @@ static void gtp_touch_down(struct goodix_ts_data* ts,s32 id,s32 x,s32 y,s32 w)
     if (gtp_change_x2y)
         GTP_SWAP(x, y);
 
-    if (!bgt911 && !bgt970) {
-        if (gtp_x_reverse)
+        if (gtp_x_reverse)
             x = ts->abs_x_max - x;
-
         if (gtp_y_reverse)
             y = ts->abs_y_max - y;
-    }
+
+
+    // if (!bgt911 && !bgt970) {
+    //     if (gtp_x_reverse)
+    //         x = ts->abs_x_max - x;
+ //
+    //     if (gtp_y_reverse)
+    //         y = ts->abs_y_max - y;
+    // }
+    // else if(bgt927){
+ //        if (gtp_change_x2y)
+    //     GTP_SWAP(x, y);
+
+  //       if (gtp_x_reverse)
+        //     x = ts->abs_x_max - x;
+  //
+        // if (gtp_y_reverse)
+        //     y = ts->abs_y_max - y;
+    // }
 
 #if GTP_ICS_SLOT_REPORT
     input_mt_slot(ts->input_dev, id);
@@ -1452,6 +1469,10 @@ static s32 gtp_init_panel(struct goodix_ts_data *ts)
         send_cfg_buf[0] = gtp_dat_7;
         cfg_info_len[0] = CFG_GROUP_LEN(gtp_dat_7);
     }
+    if (bgt927) {
+        send_cfg_buf[0] = gtp_dat_10_1;
+        cfg_info_len[0] = CFG_GROUP_LEN(gtp_dat_10_1);
+    }
 
     GTP_DEBUG_FUNC();
     GTP_DEBUG("Config Groups\' Lengths: %d, %d, %d, %d, %d, %d", 
@@ -2657,7 +2678,16 @@ static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id
         gtp_change_x2y = TRUE;
         gtp_x_reverse = FALSE;
         gtp_y_reverse = TRUE;
-    }
+    } else if (val == 927) {
+        m89or101 = FALSE;
+        bgt911 = FALSE;
+        bgt970 = FALSE;
+        bgt910 = FALSE;
+        bgt927 = TRUE;
+        gtp_change_x2y = TRUE;
+        gtp_x_reverse = TRUE;
+        gtp_y_reverse = FALSE;
+    }
 
     ts->tp_regulator = devm_regulator_get(&client->dev, "tp");
     if (IS_ERR(ts->tp_regulator)) {

编译&调试

在kernel目录下执行此命令:./build-kernel.sh && adb push ./tmp/modules.tar.gz /userdata && adb shell "tar -xf /userdata/modules.tar.gz -C /usr"
待一切ok后,按住boot键+短按电源键重启到boot模式,执行以下命令:sudo ./upgrade_tool di -boot ./kernel/boot.img
烧录完成后需要手动按一下电源键复位开机。
如无问题,开机会正常显示开机logo.


附件