|
几个月前入手了一个cubiescreen,装了官方支持cubiescreen的系统很完美;但是我希望自己能从头开始自己通过openwrt使用cubiescreen并且后面可能打算移植QT到openwrt上然后使用cubiescreen做一些小东西出来;最近几周通过各种google终于点亮了cubiescreen。
首先,我的openwrt是直接pull的最新的代码,使用的kernel版本是linux-4..4.14,uboot版本是u-boot-2016.03;
要能点亮cubiescreen,并且在lcd上打印启动信息首先需要修改uboot的编译config文件:
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:24,pclk_khz:27000,le:49,ri:70,up:2,lo:5,hs:1,vs:1,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=1
CONFIG_VIDEO_LCD_POWER="PB10"
CONFIG_VIDEO_LCD_RESET=""
CONFIG_VIDEO_LCD_BL_EN=""
CONFIG_VIDEO_LCD_BL_PWM="PB2"
CONFIG_VIDEO_LCD_BL_PWM_ACTIVE_LOW=y
# CONFIG_VIDEO_LCD_PANEL_I2C is not set
CONFIG_VIDEO_LCD_IF_PARALLEL=y
CONFIG_VIDEO_LCD_PANEL_PARALLEL=y
然后,因为LCD的背光使能是使用的PWM,所以在内核device tree里面要配置好pwm:
在sun4i-a10-cubieboard.dts 里面加上下面最后一行&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm0_pins_a>, <&pwm1_pins_a>;
status = "okay";
};
修改sun4i-a10.dtsi :
framebuffer@2 {
compatible = "allwinner,simple-framebuffer",
“simple-framebuffer";
allwinner,pipeline = "de_fe0-de_be0-lcd0";
clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>,
<&ahb_gates 46>, <&dram_gates 25>,
<&dram_gates 26>;
status = "enabled";
};
内核
这样,内核启动后,就能看到LCD背光打开了,但是屏幕还是没任何显示,/dev/fb0也能正常看到,这是因为在uboot里面没有对屏幕进行初始化;在uboot的driver/video/下面加入附件中的cubiescreen.c和cubiescreen.h文件,修改driver/video/sunxi_display.c如下:
if (IS_ENABLED(CONFIG_VIDEO_LCD_TL059WV5C0)) {
unsigned int orig_i2c_bus = i2c_get_bus_num();
i2c_set_bus_num(CONFIG_VIDEO_LCD_I2C_BUS);
i2c_reg_write(0x5c, 0x04, 0x42); /* Turn on the LCD */
i2c_set_bus_num(orig_i2c_bus);
}
if (IS_ENABLED(CONFIG_VIDEO_LCD_CUBIESCREEN)) {
mdelay(50);
cubiescreen_init();
}
修改uboot-sunxi-Cubieboard-uEnv.txt:
setenv bootargs console=ttyS0,115200 console=tty0 earlyprintk root=/dev/mmcblk0p2 rootwait
这只是一篇蜻蜓点水的文章,只是告诉大家大概使能cubiescreen的一个步骤!
|
|