最近需要更改im6 uboot的開機logo,使用10.1inch, 1024x600,18bit的LCD,期間遇到了很多的問題,記錄於此。
參考鏈接
https://community.nxp.com/message/650120?commentID=650120#comment-650120
https://community.nxp.com/thread/375767
https://sites.google.com/site/myembededlife/Home/u-boot/splashscreen
1. 生成24bit的bmp圖片
使用linux的gimp可以完成。gimp的使用可以參考我另一篇文章:GIMP 使用
更改圖片大小為1024x600,並另存為24bit的bmp圖片。
經過嘗試,一定要是24bit的bmp文件。
2. 將圖片轉為.h文件
使用freescale的bin2txt工具進行轉換。
- 下載地址
https://community.nxp.com/docs/DOC-93833
- 生成方法
python ./bin2txt tmp.bmp //tmp.bmp是圖片的名稱
3. 將生成的.h文件添加到uboot中
將生成的.h文件中數組中的內容替換board/freescale/common/fsl_bmp_reversed_600x400.c替換掉fsl_bmp_reversed_600x400數組中的內容。
4. 更改uboot參數
board/freescale/mx6q_sabresd/mx6q_sabresd.c
//更改10.1寸屏幕參數。
static struct fb_videomode lvds_xgc = {
"XGA", 60, 1024, 600, 19531, 150, 150, 15, 15, 20, 5,
FB_SYNC_EXT,
FB_VMODE_NONINTERLACED,
0,
}
void lcd_enable(void)
{
//18Bit
ret = ipuv3_fb_init(&lvds_xga, di, IPU_PIX_FMT_RGB666, DI_PCLK_LDB, 65000000);
//24Bit
//ret = ipuv3_fb_init(&lvds_xga, di, IPU_PIX_FMT_RGB24, DI_PCLK_LDB, 65000000);
......
if (di == 1)
{
//18bit
writel(0x40C, IOMUXC_BASE_ADDR + 0x8);
//24bit
//writel(0x48C, IOMUXC_BASE_ADDR + 0x8);
}
else
{
//18bit
writel(0x201, IOMUXC_BASE_ADDR + 0x8);//18BIT
//24bit
//writel(0x221, IOMUXC_BASE_ADDR + 0x8);//24BIT
}
}
Author
Tony Liu
2016-8-10, Shenzhen