how add bmp file to emmc in uboot imx6dl-sabreauto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how add bmp file to emmc in uboot imx6dl-sabreauto

625 Views
runrunrun
Contributor I

Hi,

I use  https://community.nxp.com/docs/DOC-98109 to display logo.bmp in uboot.

but i can not read logo.bmp file.

I use imx6dl-sabreauto,It can not use sudo dd if=logo.bmp of=/dev/sdc bs=1 seek=1048576 skip=54

Now i display RGB OK

please how can i read the logo file to display in uboot?

if (mmc) {
if (mmc_init(mmc) == 0) {
start = ALIGN(UBOOT_LOGO_BMP_ADDR, mmc->read_bl_len) / mmc->read_bl_len;
count = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len;
ret = mmc->block_dev.block_read(mmc_dev, start, count, pData);///////?????
printf("load logo bmp, read ret is %d\n",ret);
printf("pdata: %2x %2x %2x \n", pData[0],pData[1],pData[2]);
bmpReady = 1;
}
}

where the file to be read? is EMMC? if yes.how should add the logo.bmp file to emmc?

Please help me,thanks

0 Kudos
2 Replies

503 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi honglei,

Which kernel are you using? you mentioned that you can not use "sudo dd.." then you can display RGB.

maybe you missed explanation or I miss something

0 Kudos

503 Views
runrunrun
Contributor I

Hi,Bio_TICFSL

I am using kernel3.10.53,

in this patch,

#ifdef CONFIG_UBOOT_LOGO_ENABLE
unsigned int size = DISPLAY_WIDTH * DISPLAY_HEIGHT * (DISPLAY_BPP / 8);
unsigned char * pData;
unsigned int start, count;
int i, bmpReady = 0;
int mmc_dev = mmc_get_env_devno();
struct mmc *mmc = find_mmc_device(mmc_dev);

pData = (unsigned char *)CONFIG_FB_BASE;

printf("load logo bmp, size is %d\n",size);

// 这里应该是显示logo图片,但是该patch支持的方式是从SD卡去读取图片,所以用dd命令的方式把图片备份到SD卡启动

然后通过地址(UBOOT_LOGO_BMP_ADDR)去找到图片显示出来
if (mmc) {
if (mmc_init(mmc) == 0) {
start = ALIGN(UBOOT_LOGO_BMP_ADDR, mmc->read_bl_len) / mmc->read_bl_len;
count = ALIGN(size, mmc->read_bl_len) / mmc->read_bl_len;
ret = mmc->block_dev.block_read(mmc_dev, start, count, pData);
printf("load logo bmp, read ret is %d\n",ret);
printf("pdata: %2x %2x %2x \n", pData[0],pData[1],pData[2]);
bmpReady = 1;
}
}

//这里是显示RGB的颜色,这里只是填充framebuffer,应该是调试用的,显示图片的时候就不需要显示RGB了
if (bmpReady == 0) {
printf("logo bmp not ready\n");
// Fill RGB frame buffer
// Red
for (i = 0; i < (DISPLAY_WIDTH * DISPLAY_HEIGHT * (DISPLAY_BPP / 8) / 3) ; i += (DISPLAY_BPP / 8)) {
#if (DISPLAY_BPP == 16)
pData[i + 0] = 0x00;
pData[i + 1] = 0xF8;
#else
pData[i + 0] = 0x00;
pData[i + 1] = 0x00;
pData[i + 2] = 0xFF;
#endif
}

// Green
for (; i < (DISPLAY_WIDTH * DISPLAY_HEIGHT * (DISPLAY_BPP / 8) / 3) *2; i += (DISPLAY_BPP / 8)) {
#if (DISPLAY_BPP == 16)
pData[i + 0] = 0xE0;
pData[i + 1] = 0x07;
#else
pData[i + 0] = 0x00;
pData[i + 1] = 0xFF;
pData[i + 2] = 0x00;
#endif
}

// Blue
for (; i < DISPLAY_WIDTH * DISPLAY_HEIGHT * (DISPLAY_BPP / 8); i += (DISPLAY_BPP / 8)) {
#if (DISPLAY_BPP == 16)
pData[i + 0] = 0x1F;
pData[i + 1] = 0x00;
#else
pData[i + 0] = 0xFF;
pData[i + 1] = 0x00;
pData[i + 2] = 0x00;
#endif
}
}

现在我想显示logo图片,但是我的板子不支持从SD卡启动显示,所以不能用dd命令把图片备份到/dev/sdX下,

所以我想用这个patch在uboot显示logo file,应该怎么去操作?

please help me,thanks

0 Kudos