#include
当前位置:   article > 正文

RK3288[android 7.1]调试笔记----- mipi屏_rk3288[android7.1]调试笔记

rk3288[android7.1]调试笔记

1 找到 在要编译的rk3288-evb-android-rk808-edp.dts
加入以下mipi dts配置:

/dts-v1/;
#include "rk3288-evb.dtsi"
#include "rk3288-android.dtsi"
#include <dt-bindings/display/rk_fb.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/sensor-dev.h>


。。。。。。。。
// added  for mipi dsi start <<<
&dsi0 {
	status = "okay";
	rockchip,lane-rate = <420>;

	panel: panel {
        status = "okay";
		compatible = "simple-panel-dsi";
		reg = <0>;
		backlight = <&backlight>;
		//由于我们项目中有两个1V8和3V3的使能引脚,所以要配置
	    3v3_gpio = <&gpio0 13 GPIO_ACTIVE_LOW>;//3v3使能引脚 
	    enable = <&gpio5 13 GPIO_ACTIVE_HIGH>;   //1V8使能引脚  
        reset = <&gpio7 4 GPIO_ACTIVE_LOW>;//复位引脚
        dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM)>;
        dsi,format = <MIPI_DSI_FMT_RGB888>;
        bus-format = <MEDIA_BUS_FMT_RBG888_1X24>;
        dsi,lanes = <4>;
        //dsi,channel = <1>;
        reset-delay-ms = <30>;
        init-delay-ms = <120>;
        enable-delay-ms = <30>;
        prepare-delay-ms = <30>;
        unprepare-delay-ms = <30>; 
      
        panel-init-sequence = [    //此部分初始化命令一定要正确,此部分命令可找fae要
            15 00 02 E0 00  
            //15:表示DCS 命 令 的 类 型,其长度等于2, 
            // 00:表示 发送完该命令以后需要延时的时间,单位为 ms
            //02:表示命令 payload 的长度
            //E0 00  表示实际发送的 payload命令 其中 E0代表要发送的寄存器地址,00代表往0xe0写入的数据
            15 00 02 E1 93
            15 00 02 E2 65
            15 00 02 E3 F8
            15 00 02 E0 00
            15 00 02 70 02
            15 00 02 71 23
            15 00 02 72 06
            15 00 02 80 03
            15 00 02 E6 02
            15 00 02 E7 02
            15 00 02 E0 01
            15 00 02 00 00
            15 00 02 01 A0
            15 00 02 03 00
            15 00 02 04 A0
            15 00 02 17 00
            15 00 02 18 B1
            15 00 02 19 00
            15 00 02 1A 00
            15 00 02 1B B1
            15 00 02 1C 00
            15 00 02 1F 3E
            15 00 02 20 2D	
            15 00 02 21 2D
            15 00 02 22 0E
            15 00 02 37 19
            15 00 02 38 05
            15 00 02 39 08
            15 00 02 3A 12
            15 00 02 3C 78
            15 00 02 3E 80
            15 00 02 3F 80
            15 00 02 40 06
            15 00 02 41 A0
            //15 00 02 4A 35  // test mode on
            15 00 02 55 0F
            15 00 02 56 01
            15 00 02 57 69
            15 00 02 58 0A
            15 00 02 59 0A
            15 00 02 5A 28
            15 00 02 5B 19
            15 00 02 5D 7C
            15 00 02 5E 5E
            15 00 02 5F 4E
            15 00 02 60 41
            15 00 02 61 3F
            15 00 02 62 31
            15 00 02 63 37
            15 00 02 64 23
            15 00 02 65 3E
            15 00 02 66 3F
            15 00 02 67 40
            15 00 02 68 5E
            15 00 02 69 4F
            15 00 02 6A 57
            15 00 02 6B 4B
            15 00 02 6C 49
            15 00 02 6D 2F
            15 00 02 6E 03
            15 00 02 6F 00
            15 00 02 70 7C
            15 00 02 71 5E
            15 00 02 72 4E
            15 00 02 73 41
            15 00 02 74 3F
            15 00 02 75 31
            15 00 02 76 37
            15 00 02 77 23
            15 00 02 78 3E 
            15 00 02 79 3F
            15 00 02 7A 40
            15 00 02 7B 5E
            15 00 02 7C 4F
            15 00 02 7D 57
            15 00 02 7E 4B
            15 00 02 7F 49
            15 00 02 80 2F
            15 00 02 81 03
            15 00 02 82 00
            15 00 02 E0 02
            15 00 02 00 47
            15 00 02 01 47  
            15 00 02 02 45
            15 00 02 03 45
            15 00 02 04 4B
            15 00 02 05 4B
            15 00 02 06 49
            15 00 02 07 49
            15 00 02 08 41
            15 00 02 09 1F
            15 00 02 0A 1F
            15 00 02 0B 1F
            15 00 02 0C 1F
            15 00 02 0D 1F
            15 00 02 0E 1F
            15 00 02 0F 43
            15 00 02 10 1F
            15 00 02 11 1F
            15 00 02 12 1F
            15 00 02 13 1F
            15 00 02 14 1F
            15 00 02 15 1F
            15 00 02 16 46
            15 00 02 17 46
            15 00 02 18 44
            15 00 02 19 44
            15 00 02 1A 4A
            15 00 02 1B 4A
            15 00 02 1C 48
            15 00 02 1D 48
            15 00 02 1E 40
            15 00 02 1F 1F
            15 00 02 20 1F
            15 00 02 21 1F
            15 00 02 22 1F
            15 00 02 23 1F
            15 00 02 24 1F
            15 00 02 25 42
            15 00 02 26 1F
            15 00 02 27 1F
            15 00 02 28 1F
            15 00 02 29 1F
            15 00 02 2A 1F
            15 00 02 2B 1F
            15 00 02 58 10 
            15 00 02 59 00 
            15 00 02 5A 00 
            15 00 02 5B 30 
            15 00 02 5C 03 
            15 00 02 5D 30 
            15 00 02 5E 01 
            15 00 02 5F 02 
            15 00 02 60 30 
            15 00 02 61 01 
            15 00 02 62 02 
            15 00 02 63 04 
            15 00 02 64 7F 
            15 00 02 65 05 
            15 00 02 66 12 
            15 00 02 67 73 
            15 00 02 68 05 
            15 00 02 69 04 
            15 00 02 6A 7F 
            15 00 02 6B 09 
            15 00 02 6C 00 
            15 00 02 6D 04 
            15 00 02 6E 04 
            15 00 02 6F 88 
            15 00 02 70 00 
            15 00 02 71 00 
            15 00 02 72 06 
            15 00 02 73 7B 
            15 00 02 74 00 
            15 00 02 75 3C 
            15 00 02 76 00 
            15 00 02 77 0D 
            15 00 02 78 2C 
            15 00 02 79 00 
            15 00 02 7A 00 
            15 00 02 7B 00 
            15 00 02 7C 00 
            15 00 02 7D 03 
            15 00 02 7E 7B 
            15 00 02 E0 01
            15 00 02 0E 01
            15 00 02 E0 03
            15 00 02 98 2F
            15 00 02 E0 04
            15 00 02 2B 2B
            15 00 02 2E 44
            15 00 02 09 10
            15 00 02 2D 03
            15 00 02 E0 00
            05 78 01 11
            05 32 01 29
             //05:表示DCS 命 令 的 类 型,其长度等于1,还有一个39表示这是一个 DCS 长包命令,payload 长度大于 2。
        ];
                    
        panel-exit-sequence = [
            05 16 01 28
            05 78 01 10
        ];
   
      display-timings {
        native-mode = <&timing0>;
        timing0: timing0 {

            clock-frequency = <67000000>;
            hactive = <800>;
            vactive = <1280>;
            
            hback-porch = <10>;
            hfront-porch = <42>;
            hsync-len = <20>;
            
            vback-porch = <4>;
            vfront-porch = <8>;
            vsync-len = <4>;
            
            
            hsync-active = <0>;
            vsync-active = <0>;
            
            de-active = <0>;
            pixelclk-active = <0>;
        };
	};
     };
};
 

&route_dsi0 {
	status = "okay";
};


&dsi0_in_vopb {
	status = "okay";
};

&dsi0_in_vopl {
	status = "disabled";
};

// added mipi dsi end

。。。。。。。。。。。。。。


  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 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
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270

注:由原理图可以知道1v8使能引脚是GPIO5_B5(gpio5 13)和3v3使能引脚是GPIO0_B5(gpio0 13), reset引脚是GPIO7_A4(gpio7 4)
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在驱动中增加3v3使能引脚的配置,注意3v3使能引脚是低电平有效

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
old mode 100644
new mode 100755
index daf891c..adbdc7d
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
//增加3v3gpio
@@ -114,6 +114,7 @@ struct panel_simple {
 
        struct gpio_desc *enable_gpio;
        struct gpio_desc *reset_gpio;
+       struct gpio_desc *vdd3_3_gpio;
        int cmd_type;
 
        struct gpio_desc *spi_sdi_gpio;



//掉电时序  3v3使能引脚是低电平有效,空闲电平是高电平
@@ -603,6 +611,8 @@ static int panel_simple_unprepare(struct drm_panel *panel)
 
        if (p->enable_gpio)
                gpiod_direction_output(p->enable_gpio, 0);
+       if (p->vdd3_3_gpio)
+               gpiod_direction_output(p->vdd3_3_gpio, 1);
 
        panel_simple_regulator_disable(panel);
 


 //上电时序  3v3使能引脚是低电平有效,空闲电平是高电平
@@ -630,6 +641,8 @@ static int panel_simple_prepare(struct drm_panel *panel)
 
        if (p->enable_gpio)
                gpiod_direction_output(p->enable_gpio, 1);
+       if (p->vdd3_3_gpio)
+               gpiod_direction_output(p->vdd3_3_gpio, 0);
 
        if (p->desc && p->desc->delay.prepare)
                msleep(p->desc->delay.prepare);
                return -ENOMEM;
   


 //3v3_gpio的dts
@@ -799,6 +818,12 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
                dev_err(dev, "failed to request enable GPIO: %d\n", err);
                return err;
        }
+       panel->vdd3_3_gpio = devm_gpiod_get_optional(dev, "3v3_gpio", 0);
+       if (IS_ERR(panel->vdd3_3_gpio)) {
+               err = PTR_ERR(panel->vdd3_3_gpio);
+               dev_err(dev, "failed to request vdd3_3_gpio GPIO: %d\n", err);
+               return err;
+       }
 
        panel->reset_gpio = devm_gpiod_get_optional(dev, "reset", 0);
        if (IS_ERR(panel->reset_gpio)) {



//关机函数,3v3使能引脚是低电平有效,空闲电平是高电平
@@ -935,6 +963,8 @@ static void panel_simple_shutdown(struct device *dev)
 
        if (panel->enable_gpio)
                gpiod_direction_output(panel->enable_gpio, 0);
+       if (panel->vdd3_3_gpio)
+               gpiod_direction_output(panel->vdd3_3_gpio, 1);
 
        panel_simple_regulator_disable(&panel->base);
 }


  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 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

2.编译kernel,烧写固件,绑定mipi成功会有以下log出现

	Line 618: [    0.923158] rockchip-drm display-subsystem: bound ff960000.dsi (ops dw_mipi_dsi_ops)
	Line 619: [    0.923170] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
  • 1
  • 2

在rk3288.dtsi中可以知道mipi地址是 ff960000

。。。。。。。。
dsi0: dsi@ff960000 {
		compatible = "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi";
		reg = <0x0 0xff960000 0x0 0x4000>;
		interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
		clocks = <&cru SCLK_MIPIDSI_24M>, <&cru PCLK_MIPI_DSI0>;
		clock-names = "ref", "pclk";
		resets = <&cru SRST_MIPIDSI0>;
		reset-names = "apb";
		power-domains = <&power RK3288_PD_VIO>;
		rockchip,grf = <&grf>;
		#address-cells = <1>;
		#size-cells = <0>;
		status = "disabled";

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

			dsi0_in: port {
				#address-cells = <1>;
				#size-cells = <0>;

				dsi0_in_vopb: endpoint@0 {
					reg = <0>;
					remote-endpoint = <&vopb_out_dsi0>;
				};
				dsi0_in_vopl: endpoint@1 {
					reg = <1>;
					remote-endpoint = <&vopl_out_dsi0>;
				};
			};
		};
	};
。。。。。。。。
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/330273
推荐阅读
相关标签