Mango-AM335x LCD Type 커널 Module Parameter 에서 변경하기 http://www.mangoboard.com/ http://cafe.naver.com/embeddedcrazyboys Crazy Embedded Laboratory www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 1
2
Document History Revision Date Change note Init 2016-09-27 전종인 www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 3
1. 개선책... 5 2. Fw_printenv 이용... 5 2.1. Fw.env.config파일설정... 5 3. LCD를 u-boot 환경변수 (panel) 변경해서제어... 8 4
1. 개선책 LCD 에서종류를 Kernel Module Parameter 로변경하여, 컴파일을하지않고도, LCD 를조정하기 Nand 에 u-boot, kernel, 파일시스템이있을때사용가능 2. Fw_printenv 이용 http://elinux.org/u-boot_environment_variables_in_linux https://www.google.co.kr/webhp?sourceid=chrome- instant&ion=1&espv=2&ie=utf-8#newwindow=1&q=read+and+modify+u- Boot%27s+environment. http://processors.wiki.ti.com/index.php/update_u- Boot_Environment_Variables_stored_in_SPI_Flash_from_Linux u-boot 소스에서 tools/env 디렉토리를컴파일하면됩니다. 컴파일방법./build_uboot config;./build_uboot make -j$cpu_job_num HOSTCC=${CROSS_COMPILE}gcc HOSTSTRIP=${CROSS_COMPILE}strip env fw_setenv 명령은 fw_printenv 명령을복사또는 Soft link 하면됩니다. 2.1. Fw.env.config 파일설정 # NAND example /dev/mtd5 0x0000 0x20000 0x20000 4 fw.env.config 파일은파일시스템에 /etc/ 디렉토리에복사 테스트결과 [root@(none) ~]#./fw_setenv crz test Read 0x20000 bytes at 0x0 on /dev/mtd5 Warning: Bad CRC, using default environment Writing new environment at 0x0 on /dev/mtd5 www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 5
Write 0x20000 bytes at 0x0 [root@(none) ~]#./fw_printenv Read 0x20000 bytes at 0x0 on /dev/mtd5 bootcmd=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd...;run uenvcmd;fi;if run loaduimagefat; then run mmcboot;elif run loaduimage; then run mmcboot;else echo Could not find ${bootfile} ;fi;else run nandboot;fi; bootdelay=1 baudrate=115200 arch=arm cpu=armv7 board=am335x board_name=am335x vendor=ti soc=am33xx loadaddr=0x80200000 kloadaddr=0x80007fc0 fdtaddr=0x80f80000 fdt_high=0xffffffff rdaddr=0x81000000 bootfile=uimage fdtfile= console=ttyo0,115200n8 optargs= mtdids=nand0=omap2-nand.0 mtdparts=mtdparts=omap2- nand.0:128k(spl),128k(spl.backup1),128k(spl.backup2),128k(spl.backup3),1920k(u-boot),128k(u-bootenv),5m(kernel),-(rootfs) dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 100 100;u-boot.img.raw mmc 300 3C0;u-boot.img fat 0 1;uEnv.txt fat 0 1 dfu_alt_info_emmc=rawemmc mmc 0 3751936 dfu_alt_info_nand=spl part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;uboot part 0 5;kernel part 0 7;rootfs part 0 8 mmcdev=0 mmcroot=/dev/mmcblk0p2 ro mmcrootfstype=ext3 rootwait nandroot=ubi0:rootfs rw ubi.mtd=7,2048 6
nandrootfstype=ubifs rootwait=1 nandsrcaddr=0x280000 nandimgsize=0x500000 rootpath=/export/rootfs nfsopts=nolock static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64m ramrootfstype=ext2 ip_method=none bootargs_defaults=setenv bootargs console=${console} ${optargs} mmcargs=run bootargs_defaults;setenv bootargs ${bootargs} root=${mmcroot} rootfstype=${mmcrootfstype} ip=${ip_method} nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype} netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp bootenv=uenv.txt loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv} importbootenv=echo Importing environment from mmc...; env import -t $loadaddr $filesize ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype} loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz loaduimagefat=fatload mmc ${mmcdev} ${kloadaddr} ${bootfile} loaduimage=ext2load mmc ${mmcdev}:2 ${kloadaddr} /boot/${bootfile} mmcboot=echo Booting from mmc...; run mmcargs; bootm ${kloadaddr} nandboot=echo Booting from nand...; run nandargs; nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize}; bootm ${loadaddr} netboot=echo Booting from network...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; run netargs; bootm ${loadaddr} ramboot=echo Booting from ramdisk...; run ramargs; bootm ${loadaddr} findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi crz=test www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 7
3. LCD 를 u-boot 환경변수 (panel) 변경해서제어 커널수정 "arch/arm/mach-omap2/board-am335xevm.c" #if 1//CRZ_icanjji crazyboys 20160928 static unsigned int initdata panel; static int init root_panel_setup(char *str) { panel = simple_strtoul(str, NULL, 0); MANGO_DBG("panel=%d,\n",panel); return 1; } setup("panel=", root_panel_setup); #endif static void lcdc_init(int evm_id, int profile) 수정 #if 1 //CRZ_icanjji crazyboys 20160928 MANGO_DBG("panel=%d\n",panel); if(panel==1)//5inch lcdc_pdata=&ino_ej050na_5inch_pdata; else if(panel==2)//7inch press lcdc_pdata=&ino_at070tn94_pdata; else if(panel==3)//7inch cap 1024x600 { lcdc_pdata=&inno_at070tna2_pdata; ft_touch_init();//crazyboys 20150520 } else if(panel==4)//10.4inch press 800x600 lcdc_pdata=&inno_lsa40at9001_pdata; else { lcdc_pdata=&inno_ltn101al03_pdata; ft_touch_init();//crazyboys 20150520 }./fw_setenv nandargs setenv bootargs console=ttyo0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 8
rootfstype=ubifs rootwait=1 panel=2 변경된것을확인 [root@(none) ~]#./fw_printenv nandargs Read 0x20000 bytes at 0x0 on /dev/mtd5 nandargs=setenv bootargs console=ttyo0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 rootfstype=ubifs rootwait=1 panel=2 리부팅합니다. 커널로그확인결과 [ 0.000000] Kernel command line: console=ttyo0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 rootfstype=ubifs rootwait=1 panel=1 [ 0.000000] [CRZ] init/do_mounts.c (261) root_dev_setup: ubi0:rootfs [ 0.000000] [CRZ] init/do_mounts.c (54) readwrite: [ 0.000000] [CRZ] init/do_mounts.c (270) rootwait_setup: [ 0.000000] [CRZ] init/do_mounts.c (45) readonly: [ 0.000000] [CRZ] arch/arm/mach-omap2/board-am335xevm.c (1978) root_panel_setup: panel=2, da8xx_lcdc da8xx_lcdc.0: GLCD: Found INNO_AT070TN94 panel www.mangoboard.com cafe.naver.com/embeddedcrazyboys CRZ Technology 9