I.MX6Q(TQIMX6Q/TQE9)学习笔记——新版BSP之LCD移植

经过前面的移植,eMMC已经可以在tqimx6q上正常运行了,本文将来移植LCD驱动。

DTS编写

imx6的LCD控制器与之前的芯片略有不同,详细的信息可以阅读芯片手册。参考sabrelite开发板的DTS,我们可以添加如下内容:

/ {
	...

	aliases {
		mxcfb0 = &mxcfb1;
	};

	...
	
	regulators {
		...

		reg_mipi_dsi_pwr_on: mipi_dsi_pwr_on {
			compatible = "regulator-fixed";
			regulator-name = "mipi_dsi_pwr_on";
			gpio = <&gpio6 14 0>;
			enable-active-high;
		}; 
	};
	
	...
	
	backlight {
		compatible = "pwm-backlight";
		pwms = <&pwm1 0 5000000>;
		brightness-levels = <0 4 8 16 32 64 128 255>;
		default-brightness-level = <7>;
	};

	mipi_dsi_reset: mipi-dsi-reset {
		compatible = "gpio-reset";
		reset-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>;
		reset-delay-us = <50>;
		#reset-cells = <0>;
	};

	mxcfb1: fb@0 {
		compatible = "fsl,mxc_sdc_fb";
		disp_dev = "lcd";
		interface_pix_fmt = "RGB24";
		mode_str ="CLAA-WVGA";
		default_bpp = <24>;
		int_clk = <0>;
		late_init = <0>;
		status = "okay";
	};
};

...

&mipi_dsi {
	dev_id = <0>;
	disp_id = <1>;
	lcd_panel = "TRULY-WVGA";
	disp-power-on-supply = <&reg_mipi_dsi_pwr_on>;
	resets = <&mipi_dsi_reset>;
	status = "okay";
};

...

添加以上内容后重新编译并烧写DTB。

测试方法

用新的DTB启动内核会发现屏幕上出现了四只可爱的小企鹅,我这里就不发图片了,只附上完整的内核启动Log,详细如下:

U-Boot 2013.04-04987-g98fdbdc-dirty (May 03 2015 - 11:46:24)

CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
CPU:   Temperature 23 C, calibration data: 0x54e4bb69
Reset cause: POR
Board: MX6Q/SDL-SabreSD
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
No panel detected: default to Hannstar-XGA
Display: Hannstar-XGA (1024x768)
In:    serial
Out:   serial
Err:   serial
mmc0 is current device
Net:   Phy not found
PHY reset timed out
FEC [PRIME]
Warning: failed to set MAC address

Normal Boot
Hit any key to stop autoboot:  0 
mmc0 is current device

MMC read: dev # 0, block # 2048, count 12288 ... 12288 blocks read: OK

MMC read: dev # 0, block # 20480, count 2048 ... 2048 blocks read: OK
## Booting kernel from Legacy Image at 11ffffc0 ...
   Image Name:   Linux-3.10.17-80739-g33597e3-dir
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5289360 Bytes = 5 MiB
   Load Address: 12000000
   Entry Point:  12000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 18000000
   Booting using the fdt blob at 0x18000000
   XIP Kernel Image ... OK
OK
   Using Device Tree in place at 18000000, end 1800cb83

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 3.10.17-80739-g33597e3-dirty (lilianrong@lenovo) (gcc version 4.7.3 (Ubuntu/Linaro 
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值