????????前期调过天马的10寸屏,现在要更换天马的8寸屏,特地记录一下调试过程。本文章只记录屏幕参数调试过程,其他硬件调试过程不再详细描述,有需要可以参考其他文章。需要注意的硬件资源包括复位引脚,时钟引脚,信号引脚,I2C引脚等。
?
????????RK3399,Ubuntu系统,LVDS屏幕配置
????????调试天马的MIPI屏幕,需要一个配置文件,如下图所示。下载链接我附到最后,需要的可以下载,这个文件为配置天马屏幕的启动序列。
? ? ? ? 我使用的是RK3399,MIPI的配置文件,打开该文件:rk3399-firefly-aiojd4-mipi.dts
ubt@ubt-ThinkPad-E470:~/proj/firefly-rk3399/kernel/arch/arm64/boot/dts/rockchip$ ls
123 rk3399-firefly-aioc-ai.dtsi rk3399-firefly-aiojd4-edp.dts rk3399-firefly.dtb
4k3399-firefly-port.dtsi rk3399-firefly-aioc-ai-lvds.dts rk3399-firefly-aiojd4-lvds-HSX101H40C.dtb rk3399-firefly.dts
Makefile rk3399-firefly-aioc-ai-lvds-HSX101H40C.dts rk3399-firefly-aiojd4-lvds-HSX101H40C.dts rk3399-firefly-edp13.dts
px30.dtsi rk3399-firefly-aioc.dts rk3399-firefly-aiojd4-mipi.dtb rk3399-firefly-edp.dts
rk3300-firefly-aiojd4-mipi.dts rk3399-firefly-aioc.dts_back rk3399-firefly-aiojd4-mipi.dts rk3399-firefly-linux.dts
rk3399-android-6.0.dtsi rk3399-firefly-aioc.dtsi rk3399-firefly-aiojd4-mipi.dts.1280_720.bak rk3399-firefly-mipi.dts
rk3399-android.dtsi rk3399-firefly-aioc-edp.dts rk3399-firefly-aiojd4-mipi.dts.bak rk3399-firefly-mipi.dts.bak
rk3399-android.dtsi.bak rk3399-firefly-aioc-lvds.dts rk3399-firefly-aiojd4-mipi.dts.bak1212 rk3399-firefly-mipi.dts.bak1015
rk3399-dram-default-timing.dtsi rk3399-firefly-aioc-lvds-HSX101H40C.dts rk3399-firefly-aio-lvds.dts rk3399-firefly-port.dtsi
rk3399.dtsi rk3399-firefly-aioc-mipi.dts rk3399-firefly-aio-lvds-HSX101H40C.dts rk3399-linux.dtsi
rk3399.dtsi.bak rk3399-firefly-aio.dts rk3399-firefly-aio-lvds-M185XTN01.dts rk3399-opp.dtsi
rk3399-early-opp.dtsi rk3399-firefly-aio.dtsi rk3399-firefly-aio-mipi.dts rk3399-roc-pc.dts
rk3399-evb-rev3-android-mipi-edp.dts rk3399-firefly-aio-edp.dts rk3399-firefly-android.dts rk3399-roc-pc-edp.dts
rk3399-evb-rev3-android-mipi-edp.dts.bak rk3399-firefly-aiojd4.dtb rk3399-firefly-core.dtsi rk3399-roc-pc-mipi.dts
rk3399-evb-rev3-android-mipi-edp.dts.bak1014 rk3399-firefly-aiojd4.dts rk3399-firefly-demo.dtsi rk3399-sched-energy.dtsi
rk3399-firefly-aioc-ai.dts rk3399-firefly-aiojd4.dtsi rk3399-firefly-demo.dtsi.bak1017 rk3399-vop-clk-set.dtsi
ubt@ubt-ThinkPad-E470:~/proj/firefly-rk3399/kernel/arch/arm64/boot/dts/rockchip$ vim rk3399-firefly-aiojd4-mipi.dts
? ? ? ? 打开后,找到dts配置,里面的参数是我们需要修改的。具体测参数不再详细分析,可以参考文章开始给出的链接,这里主要讨论一下启动和关闭序列的配置。
&dsi {
120 status = "okay";
121 dsi_panel: panel {
122 compatible ="simple-panel-dsi";
123 reg = <0>;
124 //ddc-i2c-bu
125 //power-supply = <&vcc_lcd>;
126 pinctrl-0 = <&lcd_panel_reset>;
127 backlight = <&backlight>;
128 /*
129 enable-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
130 reset-gpios = <&gpio4 29 GPIO_ACTIVE_LOW>;
131 */
132 dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
133 dsi,format = <MIPI_DSI_FMT_RGB888>;
134 //dsi,format = <MIPI_DSI_FMT_RGB666>;
135 //bus-format = <MEDIA_BUS_FMT_RGB666_1X18>;
136 //bus-format = <MEDIA_BUS_FMT_RGB888_1X24>;
137 dsi,lvds-force-clk = <800>; // 800/2/3 ~= 65Mhz
138 dsi,lanes = <4>;
139
140 dsi,channel = <0>;
141
142 enable-delay-ms = <35>;
143 prepare-delay-ms = <6>;
144
145 unprepare-delay-ms = <0>;
146 disable-delay-ms = <20>;
147
148 size,width = <120>;
149 size,height = <170>;
150
151 status = "okay";
152
153 panel-init-sequence = [
178 29 00 06 3C 01 09 00 07 00
179 29 00 06 14 01 06 00 00 00
180 29 00 06 64 01 09 00 00 00
181 29 00 06 68 01 09 00 00 00
182 29 00 06 6C 01 09 00 00 00
183 29 00 06 70 01 09 00 00 00
184 29 00 06 34 01 1F 00 00 00
185 29 00 06 10 02 1F 00 00 00
186 29 00 06 04 01 01 00 00 00
187 29 00 06 04 02 01 00 00 00
188 29 00 06 50 04 21 01 E0 15
189 29 00 06 54 04 04 00 04 00
190 29 00 06 58 04 00 05 28 00
191 29 00 06 5C 04 01 00 02 00
192 29 00 06 60 04 20 03 28 00
193 29 00 06 64 04 01 00 00 00
194 29 10 06 A0 04 06 80 44 00
195 29 00 06 A0 04 06 80 04 00
196 29 00 06 04 05 04 00 00 00
197
198 29 00 06 80 04 00 01 02 03
199 29 00 06 84 04 04 07 05 08
200 29 00 06 88 04 09 0A 0E 0F
201 29 00 06 8C 04 0B 0C 0D 10
202 29 00 06 90 04 16 17 11 12
203 29 00 06 94 04 13 14 15 1B
204 29 00 06 98 04 18 19 1A 06
205
206 29 00 06 9C 04 31 04 00 00
207
208
209 ];
210
211 panel-exit-sequence = [
212 05 05 01 28
213 05 78 01 10
214 ];
power_ctr: power_ctr {
217 rockchip,debug = <0>;
237
238 lcd_rst: lcd-rst {
239 gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
240 pinctrl-names = "default";
241 pinctrl-0 = <&lcd_panel_reset>;
242 rockchip,delay = <66>;
243 };
244 };
disp_timings: display-timings {
247 native-mode = <&timing0>;
248 timing0: timing0 {
265 clock-frequency = <66866760>;
266 //clock-frequency = <68000000>;
267 hactive = <1280>;
268 vactive = <800>;
269 hsync-len = <10>;
270 hback-porch = <2>;
271 hfront-porch = <30>;
272 vsync-len = <1>;
273 vback-porch = <2>;
274 vfront-porch = <40>;
275 hsync-active = <0>;
276 vsync-active = <0>;
277 de-active = <0>;
278 pixelclk-active = <0>;
279
280 //screen-type = <SCREEN_LVDS>;
281 //lvds-format = <LVDS_6BIT>;
282 //out-face = <OUT_P666>;
3 };
314 };
315 };
316 };
????????
按照手册上的参数,填入配置文件中,HBP,HFP,HPW,HDA,VBP,VFP,VPW,VDA等参数。
? ? ? ? 根据系统频率,引脚个数等参数,配置上图黄色区域参数,具体我就不过多描述了,使得后边的显示Judge为OK,如果不为OK,则需要调整参数得到OK结果。
?选择code,点击start?conversion,得到初始化序列。
29 00 06 3C 01 09 00 07 00
29 00 06 14 01 06 00 00 00
29 00 06 64 01 09 00 00 00
29 00 06 68 01 09 00 00 00
29 00 06 6C 01 09 00 00 00
29 00 06 70 01 09 00 00 00
29 00 06 34 01 1F 00 00 00
29 00 06 10 02 1F 00 00 00
29 00 06 04 01 01 00 00 00
29 00 06 04 02 01 00 00 00
29 00 06 50 04 21 01 E0 15
29 00 06 54 04 04 00 A0 00
29 00 06 58 04 00 04 A0 00
29 00 06 5C 04 01 00 17 00
29 00 06 60 04 00 03 0F 00
29 00 06 64 04 01 00 00 00
29 00 06 A0 04 06 80 44 00
29 00 06 A0 04 06 80 04 00
29 00 06 04 05 04 00 00 00
29 00 06 80 04 00 01 02 03
29 00 06 84 04 04 07 05 08
29 00 06 88 04 09 0A 0E 0F
29 00 06 8C 04 0B 0C 0D 10
29 00 06 90 04 16 17 11 12
29 00 06 94 04 13 14 15 1B
29 00 06 98 04 18 19 1A 06
29 00 06 9C 04 31 04 00 00
disp_timings: display-timings {
277 native-mode = <&timing0>;
278 timing0: timing0 {
294
295 clock-frequency = <66866760>;
296 //clock-frequency = <68000000>;
297 hactive = <1024>;
298 vactive = <768>;
299 hsync-len = <10>;
300 hback-porch = <2>;
301 hfront-porch = <30>;
302 vsync-len = <1>;
303 vback-porch = <2>;
304 vfront-porch = <40>;
305 hsync-active = <0>;
306 vsync-active = <0>;
307 de-active = <0>;
308 pixelclk-active = <0>;
调整disp_timing参数
clock-frequency = H(total)( Hactive + hsync-len + hback-porch +hfront-porch )?×?V(total)(同H)×?fps(60)= (1024+10+2+30)×(768+1+2+40)× 60 = 51871560;填入其中。
hactive、vactive等参数,按照规格书填写即可。
填写完成后,保存退出,编译烧录测试。
如果测试有问题,那么需要确认的地方包括:
1、各引脚的状态,包括复位引脚,I2C引脚,时钟引脚是否正确,信号是否正确。
?
?2、确认输出格式:??dsi,format = <MIPI_DSI_FMT_RGB888>;? 或者dsi,format = <MIPI_DSI_FMT_RGB666>;? 根据屏幕位数选择,6bit选择666,? 8bit选择888。
3、确认时钟频率正确,在液晶屏规格书规定范围之内。
4、确认供电引脚是否供电。
5、确认各个引脚都处于接通状态。
如果还有问题,那么就换块板子测试吧。
我测试了一天,各个引脚信号都确认了还是不出图像,测量信号感觉时钟信号可能不正确,实在没招了,换了换板子后图像正常了……
?
|