Bootloader porting issue on i.MX8M Nano

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

Bootloader porting issue on i.MX8M Nano

984 Views
amber_yeh
Contributor I

Hi All,

I'm working on a custom board based on IMX8MN. The ddr is ddr3l 512MB and eMMC is 4GB.

On the lastes bsp, Yocto L5.4.47_2.2.0, I encountered the bootloader was too big to be downloaded to eMMC through uuu tool.

The bootloader size was about 3MB and bigger than on L5.4.24_2.1.0 because the optee-os has been upgraded to 3.10 on the latest bsp..

I tried to disable CFG_TA_ASLR and CFG_CORE_ASLR in optee-os to make the bootloader size smaller.

The size really became smaller and the bootloader can be downloaded to eMMC successfully.

However, I encountered another problem was boot freeze.  Logs are showed as below.

Spoiler
U-Boot SPL 2020.04-5.4.47-2.2.0+gffc3fbe7e5 (Nov 26 2020 - 07:44:30 +0000)
power_bd71837_init
DDRINFO: start DRAM init
DDRINFO: DRAM rate 1600MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
image offset 0x0, pagesize 0x200, ivt offset 0x0
NOTICE: BL31: v2.2(release):rel_imx_5.4.47_2.2.0-0-gc949a888e-dirty
NOTICE: BL31: Built : 07:43:45, Nov 26 2020

The bootloader can be downloaded to eMMC successfully.

Spoiler

U-Boot SPL 2020.04-5.4.47-2.2.0+gffc3fbe7e5 (Nov 26 2020 - 07:44:30 +0000)
power_bd71837_init
DDRINFO: start DRAM init
DDRINFO: DRAM rate 1600MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from BOOTROM
image offset 0x0, pagesize 0x200, ivt offset 0x0
NOTICE: BL31: v2.2(release):rel_imx_5.4.47_2.2.0-0-gc949a888e-dirty
NOTICE: BL31: Built : 07:43:45, Nov 26 2020


U-Boot 2020.04-5.4.47-2.2.0+gffc3fbe7e5 (Nov 26 2020 - 07:44:30 +0000)

CPU: i.MX8MNano Quad rev1.0 1500 MHz (running at 1200 MHz)
CPU: Commercial temperature grade (0C to 95C) at 31C
Reset cause: POR
Model: NXP i.MX8MNano LPDDR4 EVK board
DRAM: 480 MiB
TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x52]
Power supply on USB2
TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x50]
MMC: FSL_SDHC: 1, FSL_SDHC: 2
[*]-Video Link 0Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
failed to get any video link display timings
probe video device failed, ret -22

[0] lcd-controller@32e00000, video
[1] dsi_controller@32e10000, video_bridge
[2] adv7535@3d, panel
Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
failed to get any video link display timings
probe video device failed, ret -22
In: serial
Out: serial
Err: serial

BuildInfo:
- ATF c949a88
- U-Boot 2020.04-5.4.47-2.2.0+gffc3fbe7e5

MMC: no card present
Detect USB boot. Will enter fastboot mode!
Net:
Error: ethernet@30be0000 address not set.

Error: ethernet@30be0000 address not set.
No ethernet found.

Fastboot: Normal
Boot from USB for mfgtools
*** Warning - Use default environment for mfgtools
, using default environment

Run bootcmd_mfg: run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else booti ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
Hit any key to stop autoboot: 0

## Checking Image at 43800000 ...
Unknown image format!
Run fastboot ...
Detect USB boot. Will enter fastboot mode!
flash target is MMC:1
MMC: no card present
MMC card init failed!
MMC: no card present
** Block device MMC 1 not supported
Detect USB boot. Will enter fastboot mode!
flash target is MMC:2
switch to partitions #0, OK
mmc2(part 0) is current device
Detect USB boot. Will enter fastboot mode!
Starting download of 1633328 bytes
............
downloading of 1633328 bytes finished
writing to partition 'bootloader'
Initializing 'bootloader'
switch to partitions #1, OK
mmc2(part 1) is current device
Writing 'bootloader'

MMC write: dev # 2, block # 0, count 3191 ... 3191 blocks written: OK
Writing 'bootloader' DONE!
Detect USB boot. Will enter fastboot mode!
Detect USB boot. Will enter fastboot mode!

 

Could someone give me some advice? Or is there a method to lower bootloader size? Thanks.

BR,
Amber

 

Labels (1)
0 Kudos
5 Replies

966 Views
amber_yeh
Contributor I

Hi igor,

Thank you for your document.

I've change TEE entry address as customized DDR memory size.

But the bootloader size is still bigger than 2MB and can't be downloaded into 4GB eMMC through uuu.

And I found the ASLR which caused the bootloader size bigger. 

https://source.codeaurora.org/external/imx/imx-optee-os/commit/mk/config.mk?h=imx_5.4.47_2.2.0&id=87...

 

Could I disable ASLR function in optee on the Yocto L5.4.47 ?

 

BR,

Amber

0 Kudos

963 Views
igorpadykov
NXP Employee
NXP Employee

Hi Amber

 

so had you tried to disable optee using sect.5.6.10 OP-TEE enablement , if it works fine.

 

Best regards
igor

0 Kudos

941 Views
amber_yeh
Contributor I

Hi igor,

The same issue also happened on imx8 nano reference board which was disabled CFG_TA_ASLR and CFG_CORE_ASLR in optee-os. 

 

BR,

Amber

0 Kudos

953 Views
amber_yeh
Contributor I

Hi igor,

I disabled optee function and it worked fine.

 

BR,

Amber

0 Kudos

975 Views
igorpadykov
NXP Employee
NXP Employee

Hi Amber

 

one can check if freeze is caused by optee disabling it, use sect.5.6.10 OP-TEE

enablement  i.MX Yocto Project User’s Guide​

also additional file was sent via mail.

 

Best regards
igor

0 Kudos