lcd在uboot 中调用关系如下:
board_init_r
--->stdio_init_tables
--->drv_video_init
{
/* Check if video initialization should be skipped */
if (board_video_skip())
return 0;
/* Init video chip - returns with framebuffer cleared */
if (cfg_video_init() == -1)
return 0;
...
}
board_video_skip主要功能:
1、根据单板提供的LCD信息struct display_info_t const displays[]来设置struct fb_videomode 、 depth(像素格式)、panel.isaBase(lcd控制器寄存器地址)、 setup=1(后续函数判断是否设置相关lcd参数)。
2、配置LCD需要用的引脚,参考imx6ull elcdif文章里面的External Signals
3、使能LCD时钟 CCM_CCGR3 bit11–10 lcdif1 pix clock (lcdif1_pix_clk_enable) CCM_CCGR2 bit29–28 lcd clocks (lcd_clk_enable)
CSCDR2 000 derive clock from divided pre-muxed LCDIF1 clock
struct fb_videomode {
typedef struct graphic_device {
const char *name; /* optional */ unsigned int isaBase;
u32 refresh; /* optional */ unsigned int isaBase;
u32 xres; unsigned int pciBase;
u32 yres; unsigned int dprBase;
u32 pixclock; unsigned int vprBase;
u32 left_margin; unsigned int cprBase;
u32 right_margin; unsigned int frameAdrs;
u32 upper_margin; unsigned int memSize;
u32 lower_margin