AnsweredAssumed Answered

IVT App source address and imx_mkimage for iMX8MM

Question asked by Philip Hill on Mar 11, 2019
Latest reply on Mar 11, 2019 by igorpadykov

I looking for some support. I’ve got an i.MX8MMini EVK and an trying to build a system to ultimately boot through a trusted process through U-Boot’s secondary program loader (SPL), through Arm Trusted Firmware ( via BL31) to boot OP-TEE and then drop into uBoot to boot linux.

 

I can build the SPL from code from here https://source.codeaurora.org/external/imx/uboot-imx on branch /imx_v2018.03_4.14.78_1.0.0_ga using the build target u-boot-with-spl.imx. ( My Host machine is ubuntu 4.18.0-15 so I did need to add a small fix to the the  --pad-to() options in arch/arm/mach-imx/Makefile to make this work)

 

I can then flash the SPL to an SD card at offset 33K and it boots ok, but hangs in the DRAM training. Commenting out the line that waits for training to complete gets me to the next stage.  Though I cant seem to get it to boot u-boot after that

 

I’ve got ATF BL31 and optee.bin built but not yet running.

 

 

 

Firstly a few questions on the Image Vector Table (IVT)

 

1. At boot there are a number of SRAM regions you could choose to use during the boot process. At boot, the reference manual suggests that the first 4K from the boot offset (33k for SD card) to copied to RAM. At this stage I’d expect this to be secure SRAM, but experimentation shows it to use the region at 0x7e0000 (TCML Tightly coupled memory) Is this location Fixed by the boot code or can define a new location by specifying the new base address in the BootData Start parameter?

 

2. Since for an SD card boot, you cant use execute in place, you need to know where the code is and to copy the code from SD to a given location. The BootData points to the start of the memory region for the tables, this gives you the IVT “entry” field which is the final absolute entry point of the app, you also have length, so you know how much to copy, but I cant see how the ROM code can identify the source address of the application (held somewhere in NVM storage) how or where is this defined?

 

 

 

 

 

 

Reading around my uboot issue further, it looks like (?)  I need to utilise the  imx-mkimage scripts from https://source.codeaurora.org/external/imx/imx-mkimage

 

So this again leads onto further questions

 A. The 8M Mini is not defined as an SOC type, am I OK to use SOC=iMX8QM

A.1 If I use 8QM, do I still need the dram training lpddr4_pmu_train_[1|2]d_[d|i]mem.bin

A.2 I know I don’t need the hdmi and don’t think I need the display port FW for this SoC?

 

B.In imx-mkimage/iMX8QM/soc.mak for target u-boot-atf.itb it calls a utility or script mkimage_uboot, this seems to be missing, where should this come from?

 

C. imx-mkimage calls out a number of acronyms, what do the following stand for?

SCU?

AP?

 

 

 

If anyone has ATF, OPTEE and UBoot booting with code they have built on an SD card on an 8MMini, please point me any suitable guides

 

Thanks in advance

Outcomes