U-Boot error uncompressing kernel image when booting from emmc

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

U-Boot error uncompressing kernel image when booting from emmc

1,788 Views
occam25
Contributor II

 

Hi,

I'm trying to boot a custom board from the emmc, which is device mmc0, so I load the fitImage, set the bootargs variable to tell the kernel where the rootfs is and call bootm to start the booting process:

 

=> mmc rescan
=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
=> load mmc 0:1 ${loadaddr} fitImage
9677056 bytes read in 58 ms (159.1 MiB/s)
=> setenv bootargs root=/dev/mmcblk0p2 rootwait
=> bootm ${loadaddr}

 

but the kernel uncompression fails with the following messages and U-Boot restarts:

 

Error: inflate() returned -3
gzip compressed: uncompress error -1

 

If I boot from the SD card (mmc1) the error does not happend and the system boots ok.

 

Here is the whole boot log:

 

U-Boot 2020.01_ktn-dunfell_4.0.0-beta+gbc9b2bd160 (Nov 03 2020 - 16:21:17 +0000)

CPU:   Freescale i.MX8MMQ rev1.0 at 1200 MHz
Reset cause: POR
Model: Kontron i.MX8MM N801X S
DRAM:  1 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet@30be0000 [PRIME]
Hit any key to stop autoboot:  0 
=> mmc dev 0
switch to partitions #0, OK
mmc0(part 0) is current device
=> load mmc 0:1 ${loadaddr} fitImage
9677056 bytes read in 232 ms (39.8 MiB/s)
=> setenv bootargs root=/dev/mmcblk0p2 rootwait 
=> bootm ${loadaddr}
## Loading kernel from FIT Image at 40200000 ...
   Using 'conf-freescale_imx8mm-kontron-bl.dtb' configuration
   Trying 'kernel-1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x402000fc
     Data Size:    9557750 Bytes = 9.1 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x40400000
     Entry Point:  0x40400000
     Hash algo:    sha256
     Hash value:   beb200b07bd811221628f290720ac6647ddf499c203bf495edcbfd0c792f5937
   Verifying Hash Integrity ... sha256+ OK
## Loading fdt from FIT Image at 40200000 ...
   Using 'conf-freescale_imx8mm-kontron-bl.dtb' configuration
   Trying 'fdt-freescale_imx8mm-kontron-bl.dtb' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x40b1d914
     Data Size:    50780 Bytes = 49.6 KiB
     Architecture: AArch64
     Load Address: 0x48000000
     Hash algo:    sha256
     Hash value:   c471c0cb60f1dd69f38011170eb0db250a050934d76b4a160040a24f7f17081c
   Verifying Hash Integrity ... sha256+ OK
   Loading fdt from 0x40b1d914 to 0x48000000
   Booting using the fdt blob at 0x48000000
   Uncompressing Kernel Image
Error: inflate() returned -3
gzip compressed: uncompress error -1
Must RESET board to recover
resetting ...

 

 

[EDIT]

The loadaddr variable that is used when booting from the sd card is 0x40200000 (don't know why).

If I use 0x50000000 instead, the system boots ok. Why is this happening? and why the 0x40200000 is valid when booting from the sd card and not valid when booting from the emmc?

Can someone explain how to calculate what addresses to use?

 

Kind regards,

Javi

 

Labels (1)
Tags (2)
0 Kudos
Reply
2 Replies

1,767 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Make sure you build the image and uboot for the eMMC device and put the sw in this right position before boot. if this does not fix the issue the eMMC don't have enough space to boot the image.

 

Regards

0 Kudos
Reply

1,747 Views
occam25
Contributor II

 

Hi @Bio_TICFSL , thanks for the response. What do you mean with "build the image and uboot for the eMMC"? I've seen that uboot has a config set to that address: CONFIG_TEXT_BASE=0x40200000, do you mean to update that config to 0x50000000? can you explain it a little bit?

Also, I don't understand why the 0x40200000 is working with the sd card and failing with the eMMC, that address is just where to put the fitImage file in RAM, right? what does it have to do with the storing device being used?

Thanks

0 Kudos
Reply