Difference between revisions of "LeMaker Guitar:LCD/zh-hans"

From BananaPro/Pi
Jump to: navigation, search
Line 255: Line 255:
  
  
'''Step 2''': Configure 7 inch LCD resolution('''1024* 600)<br />
+
'''第2步''':配置7寸LCD分辨率('''1024* 600)<br />
Edit the kernel dts file: ''linux-actions-bsp/linux-actions/arch/arm/boot/dts/lemaker_guitar_bbb.dts''. set refresh = <60>, xres = <1024>, yres = <600>.
+
编辑kernel dts文件:''linux-actions-bsp/linux-actions/arch/arm/boot/dts/lemaker_guitar_bbb.dts''。设置refresh= <60>, xres = <1024>, yres = <600>
  
 
<source lang="bash">
 
<source lang="bash">

Revision as of 17:52, 15 June 2016

Other languages:
English • ‎中文(简体)‎

Description

LVDS (Low-voltage differential signaling), also known as TIA/EIA-644, is a technical standard that specifies electrical characteristics of a differential, serial communications protocol. LVDS operates at low power and can run at very high speeds using inexpensive twisted-pair copper cables. LeMaker Guitar supports 7.0 inch LCD module by default. And HDMI works as master display device interface, LVDS works as slave display device interface. If you want to use other size LVDS LCD module, you should configure the relate parameters of the LCD as bellow. In order to obtain a better display, we advice to set LVDS as master display device interface.
More information, Please refer to http://wiki.lemaker.org/LeMaker_Guitar:The_instructions_on_display


Linux系统

10.1寸LCD触摸屏

有两种方法支持10.1寸触摸屏。一种方法是直接下载支持10.1寸LCD的Linux系统平台固件包,然后更新系统固件即可;另一种方法是修改LeMaker Guitar BSP源码中的LCD相关的配置文件(uboot和kernel dts文件),并重新编译和生成新的固件包,然后更新系统固件。

基于固件包

第1步: 下载Linux platform firmware package
我们可以从github上下载已经编译好的支持10.1寸LCD显示屏的平台固件包. 下载方法如下:

sudo apt-get update
sudo apt-get install git
sudo mkdir -p /home/lemaker/git
cd /home/lemaker/git
git clone https://github.com/LeMaker/hwpack-actions


第2步: 提取Linux platform firmware package

sudo -s
cd hwpack-actions/lemaker_guitar
tar Jxvf lemaker_guitar_hwpack_lcd101_v1604.tar.xz

lemaker_guitar_hwpack_lcd101_v1604.tar.xz是支持10.1寸LCD显示屏的固件。


Step 3: Update u-boot

cd bootloader
sudo dd if=u-boot-dtb.img of=/dev/mmcblkX bs=512 seek=6144
sync

Notice: Assume that we have installed OS image into eMMC. If the OS boot from Micro SD card, mmcblkX is mmcblk1; If the OS boot from eMMC, mmcblkX is mmcblk0.


第4步: 更新misc.img

cd ../kernel/
sudo dd if=misc.img of=/dev/mmcblk0p1
sync

or

cd ../kernel/
sudo mkdir /mnt/misc1
sudo mkdir /mnt/misc2
sudo mount -o loop misc.img /mnt/misc1
sudo mount /dev/mmcblk0p1 /mnt/misc2
sudo cp -a /mnt/misc1/* /mnt/misc2/
sync
sudo umount  /mnt/misc1
sudo umount  /mnt/misc2


第5步: 更新驱动模块

cd ../rootfs/
sudo rm -rf /lib/modules
sudo cp -rf lib/* /lib/


第6步: 重新启动LeMaker Guitar
我们可以使用lsmod命令,显示所有的已加载的驱动模块。如果不能找到If ctp_gt9xx触摸屏驱动程序,使用下面命令加载驱动程序:

sudo reboot
 
sudo modprobe ctp_gt9xx

如果你想每次启动LeMaker Guitar都加载触摸屏驱动,我们应该编辑文件 /etc/modules,添加下面内容

ctp_gt9xx

并且编辑文件/etc/modprobe.d/blacklist-guitar.conf,删除下面的内容:

blacklist ctp_gt9xx

Notice: mmcblkX represents mmcblk0, or mmcblk1. When the OS boot from eMMC NAND Flash, /dev/mmcblk0 is the device node of eMMC NAND Flash. If you insert a MicroSD card into MicroSD card slot, you will find /dev/mmcblk1 become the device node of MicroSD card. But when the OS boot from the MicroSD card, /dev/mmcblk0 is the device node of MicroSD card, and /dev/mmcblk1 is the device node of eMMC NAND Flash. You should clearly know which storage media you're going to update the firmware on.

基于源代码

第1步:参考http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP下载the LeMaker_Guitar_BSP板级支持包。


Step 2: Configure 10.1 inch LCD resolution(1280 * 800)
Edit the kernel dts file: linux-actions-bsp/linux-actions/arch/arm/boot/dts/lemaker_guitar_bbb.dts. set refresh = <60>, xres = <1280>, yres = <800>.

lcd0: lcd0@b02a0000 {
		pinctrl-names = "default";
		pinctrl-0 = <&lvds_state_default>;
		lcd_power_gpios = <&gpio 36 0>;    /*GPIOB4*/
		//lcd_reset_gpios = <&gpio 49 0>; /*GPIOB17*/
		port_type = "lvds";
		data_width = <0>;		/* 0:24bit ,1:18bit */
		videomode-0 = <&lcd_mode0>;
		vsync_inversion = <0>;
		hsync_inversion = <0>;
 
		dclk_inversion = <0>;
		lde_inversion = <0>;
		lvds_ctl = <0x000a9523>;	/* last two bit: 3:8bit ,1:6bit */
		lvds_alg_ctl0 = <0xc141a030>;
		lightness = <128>;
		saturation = <7>;
		contrast = <5>;
 
		lcd_mode0:mode@1280x800p60 {
				refresh = <60>;
				xres = <1280>; 
				yres = <800>;    
				pixclock = <14090>;
				left_margin = <80>;
				right_margin = <60>;
				upper_margin = <8>;
				lower_margin = <7>;
				hsync_len = <20>;
				vsync_len = <8>;
				vmode = <0>;
		};
	};
 
ctp_detect {
		compatible = "owl-ctp-detect";
		i2c_adapter_id = <1>;
		tp_vcc = "ldo5";
		//reset_gpios = <&gpio 35 1>;    /*GPIOB(3) 0: high, 1: low*/
		//interrupt-parent = <&sirq>;
		//interrupts =< 0 0x4 >; /*SIRQ0*/
		vol_range = <3100000 3110000>;
 
		ctp_detect_list {
				compatible = "ctp_detect_list";
				ICN83XX =  <0>;
				GSLX6X0 =  <0>;
				FT52-406 = <0>;
				FT5606 =   <0>;
				GT813 =    <0>;
				AW5206 =   <0>;
				AW5209 =   <0>;
				CT36X =    <0>;
				HL3X06 =   <0>;
				ILITEK =   <0>;
				ili2672 =  <0>;
				ft5x06 =   <0>;
				Goodix-TS =<1>;   # Touchscreen driver
				MT395 =    <0>;
				NT1100X =  <0>;
				SSD254X =  <0>;
			};
	};
 
 .
 .
 .
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";
                //def_display = "hdmi";
                //xres = <1280>;
                //yres = <720>;
                //bpp = <4>;               
        };
 . 
 .
 .

Edit the uboot dts file: linux-actions-bsp/u-boot-actions/arch/arm/dts/lemaker_guitar.dts. set refresh = <60>, xres = <1280>, yres = <800>.

lcd0: lcd0@b02a0000 {
		pinctrl-names = "default";
		pinctrl-0 = <&lvds_state_default>;
		lcd_power_gpios = <&gpio 36 0>;    /*GPIOB4*/
		//lcd_reset_gpios = <&gpio 49 0>; /*GPIOB17*/
		port_type = "lvds";
		data_width = <0>;		/* 0:24bit ,1:18bit */
		videomode-0 = <&lcd_mode0>;
		vsync_inversion = <0>;
		hsync_inversion = <0>;
 
		dclk_inversion = <0>;
		lde_inversion = <0>;
		lvds_ctl = <0x000a9523>;	/* last two bit: 3:8bit ,1:6bit */
		lvds_alg_ctl0 = <0xc141a030>;
		lightness = <128>;
		saturation = <7>;
		contrast = <5>;
 
		lcd_mode0:mode@1280x800p60 {
				refresh = <60>;
				xres = <1280>; 
				yres = <800>;    
				pixclock = <14090>;
				left_margin = <80>;
				right_margin = <60>;
				upper_margin = <8>;
				lower_margin = <7>;
				hsync_len = <20>;
				vsync_len = <8>;
				vmode = <0>;
		};
	};
 
 .
 .
 .
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";
                //def_display = "hdmi";
                //xres = <1280>;
                //yres = <720>;
                //bpp = <4>;               
        };
 . 
 .
 .


第3步: 编译LeMaker Guitar BSP
参考http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP编译LeMaker Guitar BSP,其中包含了上面两个dts文件。

cd linux-actions-bsp/
make


第4步:参考http://wiki.lemaker.org/LeMaker_Guitar:How_to_update_Linux_platform_firmware更新u-boot, misc.img(其中包括kernel.dtb, uImage)和/lib/modules


第5步:重启系统,并加载驱动模块
我们可以使用命令lsmod查看所有已经加载的内核驱动程序。如果不能找到ctp_gt9xx触摸屏驱动程序,我们应该使用下面命令加载驱动程序:

sudo modprobe ctp_gt9xx

如果你想每次重新启动LeMaker Guitar都是有触摸屏,我们应该编辑/etc/modules文件,在文件里面添加以下内容:

ctp_gt9xx

并且编辑文件/etc/modprobe.d/blacklist-guitar.conf,删除以下内容:

blacklist  ctp_gt9xx

7寸LCD和触摸屏

由于系统默认支持7" LCD, 下面我们主要介绍7" LCD 的相关配置选项及如何将LCD设置为主显示设备。

第1步: 参考http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP下载LeMaker_Guitar_BSP板级支持包。


第2步:配置7寸LCD分辨率(1024* 600)
编辑kernel dts文件:linux-actions-bsp/linux-actions/arch/arm/boot/dts/lemaker_guitar_bbb.dts。设置refresh= <60>, xres = <1024>, yres = <600>。

lcd0: lcd0@b02a0000 {
		pinctrl-names = "default";
		pinctrl-0 = <&lvds_state_default>;
		lcd_power_gpios = <&gpio 36 0>;     /*GPIOB4*/
		lcd_reset_gpios = <&gpio 49 0>;     /*GPIOB17*/
		port_type = "lvds";
		data_width = <0>;		    /* 0:24bit ,1:18bit */
		videomode-0 = <&lcd_mode0>;
		vsync_inversion = <0>;
		hsync_inversion = <0>;
		dclk_inversion = <0>;
		lde_inversion = <0>;
		lvds_ctl = <0x000a9523>;	     /* last two bit: 3:8bit ,1:6bit */
		lvds_alg_ctl0 = <0xc141a030>;
		lightness = <128>;
		saturation = <7>;
		contrast = <5>;
		lcd_mode0:mode@1024x600p60 {
			refresh = <60>;              /* refresh frequency*/
			xres = <1024>;               /* width */
			yres = <600>;                /* height*/
			/*in pico second, 0.000 000 000 001s*/
			pixclock = <20000>;
			left_margin = <56>;
			right_margin = <60>;
			upper_margin = <13>;
			lower_margin = <18>;
			hsync_len = <4>;
			vsync_len = <4>;
			/*0: FB_VMODE_NONINTERLACED, 1:FB_VMODE_INTERLACED*/
			vmode = <0>;
		};
	};
 
ctp_detect {
		compatible = "owl-ctp-detect";
		i2c_adapter_id = <1>;
		tp_vcc = "ldo5";
		//reset_gpios = <&gpio 35 1>;    /*GPIOB(3) 0: high, 1: low*/
		//interrupt-parent = <&sirq>;
		//interrupts =< 0 0x4 >; /*SIRQ0*/
		vol_range = <3100000 3110000>;
 
		ctp_detect_list {
				compatible = "ctp_detect_list";
				ICN83XX =  <0>;
				GSLX6X0 =  <0>;
				FT52-406 = <0>;
				FT5606 =   <0>;
				GT813 =    <0>;
				AW5206 =   <0>;
				AW5209 =   <0>;
				CT36X =    <0>;
				HL3X06 =   <0>;
				ILITEK =   <0>;
				ili2672 =  <0>;
				ft5x06 =   <1>;  # Touchscreen driver
				Goodix-TS =<0>;
				MT395 =    <0>;
				NT1100X =  <0>;
				SSD254X =  <0>;
		};
	};
 
 .
 .
 .
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";
                //def_display = "hdmi";
                //xres = <1280>;
                //yres = <720>;
                //bpp = <4>;               
        };
 . 
 .
 .

Edit the uboot dts file: linux-actions-bsp/u-boot-actions/arch/arm/dts/lemaker_guitar.dts. set refresh = <60>, xres = <1024>, yres = <600>.

lcd0: lcd0@b02a0000 {
		pinctrl-names = "default";
		pinctrl-0 = <&lvds_state_default>;
		lcd_power_gpios = <&gpio 36 0>;     /*GPIOB4*/
		lcd_reset_gpios = <&gpio 49 0>;     /*GPIOB17*/
		port_type = "lvds";
		data_width = <0>;		    /* 0:24bit ,1:18bit */
		videomode-0 = <&lcd_mode0>;
		vsync_inversion = <0>;
		hsync_inversion = <0>;
		dclk_inversion = <0>;
		lde_inversion = <0>;
		lvds_ctl = <0x000a9523>;	     /* last two bit: 3:8bit ,1:6bit */
		lvds_alg_ctl0 = <0xc141a030>;
		lightness = <128>;
		saturation = <7>;
		contrast = <5>;
		lcd_mode0:mode@1024x600p60 {
			refresh = <60>;              /* refresh frequency*/
			xres = <1024>;               /* width */
			yres = <600>;                /* height*/
			/*in pico second, 0.000 000 000 001s*/
			pixclock = <20000>;
			left_margin = <56>;
			right_margin = <60>;
			upper_margin = <13>;
			lower_margin = <18>;
			hsync_len = <4>;
			vsync_len = <4>;
			/*0: FB_VMODE_NONINTERLACED, 1:FB_VMODE_INTERLACED*/
			vmode = <0>;
		};
	};
 
 .
 .
 .
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";
                //def_display = "hdmi";
                //xres = <1280>;
                //yres = <720>;
                //bpp = <4>;               
        };
 . 
 .
 .


第3步: 编译LeMaker Guitar BSP
参考 http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP编译LeMaker Guitar BSP,其中包含上面的两个dts文件。

cd linux-actions-bsp/
make


第4步: 参考http://wiki.lemaker.org/LeMaker_Guitar:How_to_update_Linux_platform_firmware更新u-boot, misc.img(其中包括kernel.dtb, uImage),和/lib/modules.


第5步:重启系统,然后加载驱动模块
我们可以使用lsmod查看所有已经加载的内核驱动模块。如果不能找到ctp_ft5x06触摸屏驱动模块,我们应该使用下面命令加载驱动模块:

sudo modprobe ctp_ft5x06

如果你想要每次重新启动LeMaker Guitar都使用触摸屏,我们应该编辑文件/etc/modules,然后在里面添加以下内容:

ctp_ft5x06

Android系统

我们已经提供支持10.1寸LCD的Android系统镜像,请点击http://www.lemaker.org/product-guitar-download-19.html下载。