LeMaker Guitar:LCD

From BananaPro/Pi
Jump to: navigation, search

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

How to drive 10.1 inch LCD and touchscreen

There are two ways to drive 10.1 inch LCD. One way is to download the Linux platform firmware package to update the firmware. Another way is to edit the source code (uboot and kernel dts files),recompile and generate the firmware package, and then update the firmware.

Base on firmware package

Step 1: Download the LeMaker Guitar Linux platform firmware package
We download a pre-built firmware package that support 10.1 inch LCD screen from github. Here we describe how to download a firmware package:

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


Step 2: Extract 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 is the Linux platform firmware package that support 10.1 inch LCD screen.


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.


Step 4: Update 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


Step 5: Update dirver modules

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


Step 6: Reboot system, and then load touchscreen module dirver
We can use the command lsmod to list all driver modules that have been loaded. If we can't find ctp_gt9xx touchscreen driver module, we should type the below command:

sudo reboot
 
sudo modprobe ctp_gt9xx

If you want to use the touch screen when restart LeMaker Guitar everytime, we should edit the /etc/modules file,and add the content below into the file:

ctp_gt9xx

And edit the /etc/modprobe.d/blacklist-guitar.conf file,and delete the content below from the file:

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.

Base on source code

Step 1: Refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP to download 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>;
			};
	};
 
 .
 .
 .
        //Set LCD as a master device
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";          
        };
        //Set HDMI display as a master device
 /*     framebuffer {
                compatible = "actions,framebuffer";
                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>;
		};
	};
 
  .
 .
 .
        //Set LCD as a master device
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";          
        };
        //Set HDMI display as a master device
 /*     framebuffer {
                compatible = "actions,framebuffer";
                def_display = "hdmi";
                xres = <1280>;
                yres = <720>;
                bpp = <4>;               
        };
 */
 . 
 .
 .


Step 3: Compile LeMaker Guitar BSP
Please refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP to compile LeMaker Guitar BSP that includes the above two files.

cd linux-actions-bsp/
make


Step 4: Please refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_update_Linux_platform_firmware to update u-boot, misc.img(including kernel.dtb, uImage), and /lib/modules.


Step 5: Reboot system, and then load touchscreen module dirver
We can use the command lsmod to list all driver modules that have been loaded. If we can't find ctp_gt9xx touchscreen driver module, we should type the below command:

sudo modprobe ctp_gt9xx

If you want to use the touch screen when restart LeMaker Guitar everytime, we should edit the /etc/modules file,and add the content below into the file:

ctp_gt9xx

And edit the /etc/modprobe.d/blacklist-guitar.conf file, delete the content below from the file:

blacklist  ctp_gt9xx

How to drive 7 inch LCD and touchscreen

Since the LeMaker official System Image support the 7 inch LCD by default. In the following chapter, we will introduce mainly how to driver the LCD base on the source code and set the LCD as a master device.

Step 1: Refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP to download the LeMaker_Guitar_BSP.


Step 2: Configure 7 inch LCD resolution(1024* 600)
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>.

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>;
		};
	};
 
  .
 .
 .
        //Set LCD as a master device
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";          
        };
        //Set HDMI display as a master device
 /*     framebuffer {
                compatible = "actions,framebuffer";
                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>;
		};
	};
 
  .
 .
 .
        //Set LCD as a master device
        framebuffer {
                compatible = "actions,framebuffer";
                def_display = "lcd";          
        };
        //Set HDMI display as a master device
 /*     framebuffer {
                compatible = "actions,framebuffer";
                def_display = "hdmi";
                xres = <1280>;
                yres = <720>;
                bpp = <4>;               
        };
 */
 . 
 .
 .


Step 3: Compile LeMaker Guitar BSP
Please refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_use_LeMaker_Guitar_BSP to compile LeMaker Guitar BSP that includes the above two files.

cd linux-actions-bsp/
make


Step 4: Please refer to http://wiki.lemaker.org/LeMaker_Guitar:How_to_update_Linux_platform_firmware to update u-boot, misc.img(including kernel.dtb, uImage), and /lib/modules.


Step 5: Reboot system, and then load touchscreen module dirver
We can use the command lsmod to list all driver modules that have been loaded. If we can't find ctp_ft5x06 touchscreen driver module, we should type the below command:

sudo modprobe ctp_ft5x06

If you want to use the touch screen when restart LeMaker Guitar everytime, we should edit the /etc/modules file,and add the content below into the file:

ctp_ft5x06

Android

We have provided an Android OS image that supports 10.1 LCD display. Please click http://www.lemaker.org/product-guitar-download-19.html to download.