U-boot 2016.03bootlogo problem

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

U-boot 2016.03bootlogo problem

1,896 Views
末班车上的乘客
Contributor II

Hi qiang

I have patched uboot2016.03 from fsl-yocto-L4.1.15_2.1.0-ga with L4.1.15_GA1.2.0_uboot_logo_keep_patch_2017-01-06.zip

after dd bmp file to emmc by following command,uboot print MMC: no card present,can't read bmp file from emmc

sudo dd if=./logo1.bmp of=/dev/mmcblk3 bs=1 seek=1048576 skip=54

I then modified the board_late_init function,it's print bellow debug messages

//boot log

U-Boot 2016.03 (Jun 15 2018 - 22:19:23 +0800)

CPU: Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
CPU: Extended Commercial temperature grade (-20C to 105C) at 57C
Reset cause: WDOG
Board: myimx6-ek314
I2C: ready
DRAM: 1 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
In: serial
Out: serial
Err: serial
mmc is 2
MMC: no card present
mmc init failed!
config_ipu_lvds_clk: freq = 448000000.
config_ipu_lvds_clk: set pll2_pfd0 clock to 450MHz, divider = 21.
switch to partitions #0, OK

//board late init

int board_late_init(void)
{
#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;
char *fs_argv[5];
char addr[17];
char part[3];
int mmc_dev = mmc_get_env_devno();
struct mmc *mmc = find_mmc_device(board_mmc_get_env_dev(mmc_dev));

sprintf(addr, "%lx", CONFIG_FB_BASE);
sprintf(part, "%d:%s", mmc_dev, getenv("mmcpart"));
pData = (unsigned char *)CONFIG_FB_BASE;

fs_argv[0] = "fatload";
fs_argv[1] = "mmc";
fs_argv[2] = part;
fs_argv[3] = addr;
fs_argv[4] = getenv("bootlogobmp");

// if (fs_argv[4])
// {
// if (!do_fat_fsload(NULL, 0, 5, fs_argv)) {
// bmpReady = 1;
// }
// }
printf("mmc is %d\n", mmc_dev);
if (bmpReady == 0)
{
if (mmc) {
if (mmc_init(mmc) == 0) {//can not found emm there!
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;
printf("reading bmp data...\n");
mmc->block_dev.block_read(mmc_dev, start, count, pData);
bmpReady = 1;
}
else{
printf("mmc init failed!\n");
}
}
}

if (bmpReady == 0) {
// 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
}

Labels (1)
0 Kudos
4 Replies

1,078 Views
末班车上的乘客
Contributor II

thanks all

I have fixed this issue。I compared two version’s mmc_bread() function,found out the param has changed in u-boot-2016.03.the old version pass a device num,new version pass a device point.

//in u-boot-2016.03

static ulong mmc_bread(block_dev_desc_t *block_dev, lbaint_t start,
lbaint_t blkcnt, void *dst)
{
int dev_num = block_dev->dev;
int err;
lbaint_t cur, blocks_todo = blkcnt;

if (blkcnt == 0)
return 0;

//in u-boot-2015.04

static ulong mmc_bread(int dev_num, lbaint_t start, lbaint_t blkcnt, void *dst)
{
lbaint_t cur, blocks_todo = blkcnt;

if (blkcnt == 0)
return 0;

struct mmc *mmc = find_mmc_device(dev_num);
if (!mmc)
return 0;

//board.c fixed code

if (bmpReady == 0)
{
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;

printf("reading bmp data from %lx to %lx\ntotal count is %lx\nmmc block size is %d\nmmc_dev is %d", start , pData, count, mmc->read_bl_len, mmc_dev);
mmc->block_dev.block_read(&mmc->block_dev, start, count, pData);
printf("read bmp completed,flush_cache...");
flush_cache((ulong)pData, count * 512);
printf("bmp data is ready!");
bmpReady = 1;

0 Kudos

1,078 Views
igorpadykov
NXP Employee
NXP Employee

Hi

please try nxp uboot

uboot-imx - i.MX U-Boot 

and patches

Patch to support uboot logo keep from uboot to kernel for NXP Linux and Android BSP (HDMI, LCD and L... 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,077 Views
末班车上的乘客
Contributor II

I tried uboot-imx-imx_v2016.03_4.1.15_2.0.0_ga,get the same result。And then I tried U-boot-2015.04,It's work fine。I compared two board.c files,couldn't found any major difference make cause this problem.I even tried to swtich the complier,and got the same result

0 Kudos

1,077 Views
末班车上的乘客
Contributor II

I have found the mmc_dev no is not match.after mmc_dev matched.uboot crashed and enter reset loop,then I modified board_late_init to print debug message,print as bellow

//debug message

U-Boot 2016.03 (Jun 16 2018 - 18:45:00 +0800)

CPU: Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
CPU: Extended Commercial temperature grade (-20C to 105C) at 39C
Reset cause: WDOG
Board: myimx6-ek314
I2C: ready
DRAM: 1 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
SF: Detected SST25VF016B with page size 256 Bytes, erase size 64 KiB, total 2 MiB
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
mmcdev is 2
reading bmp data from 800 to 18800000
total count 12c0
mmc block size is 512
data abort
pc : [<4ff6ed1c>] lr : [<4ff514fc>]
reloc pc : [<17827d1c>] lr : [<1780a4fc>]
sp : 4ef44da8 ip : 00000020 fp : 00000000
r10: 00000000 r9 : 4ef44eb8 r8 : 000012c0
r7 : 00000800 r6 : 000012c0 r5 : 4ef453a8 r4 : 4ff6ed04
r3 : 18800000 r2 : 000012c0 r1 : 00000800 r0 : 00000002
Flags: nzCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...

resetting ...

//board_late_init

if (bmpReady == 0)
{
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;

printf("reading bmp data from %lx to %lx\ntotal count %lx\nmmc block size is %d\n", start , pData, count, mmc->read_bl_len);
mmc->block_dev.block_read(mmc_dev, start, count, pData);
bmpReady = 1;
}
else{
printf("mmc init failed!\n");
}
}
else{
printf("No mmc found!\n");
}
}

0 Kudos