How should I use imx8_mkimage to build a flash.bin for loading an OS image?

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

How should I use imx8_mkimage to build a flash.bin for loading an OS image?

1,089 Views
LEEYEOREUM
Contributor I

IMX8QM,单核a72,我想要在container里直接放入操作系统镜像,这样在boot时自动把镜像copy到ddr内存里,我就可以在atf之后略过uboot,直接跳转操作系统,我看到read me里的-data选项说可以放置kernel image,但是我使用例如“-data os.bin a72 0xa0000000”这种参数把bin文件加入container好像整个container都有问题,连前面的atf都启动不了了,mkimage究竟能不能这样做呢,怎么样构建container来实现我想要的载入镜像到ddr呢?我用的boot设备是sd卡。

任何帮助都将不胜感激

 

IMX8QM, single core a72, I want to put the OS image directly in the container, so that the image will be automatically copied to the DDR memory during boot, and I can skip the uboot after the atf, and jump to the OS directly, I see that the -data option in the read me says that I can put the kernel image, but when I add it to the container with I see that the -data option in READ_ME says that I can put a kernel image, but when I add the bin file to the container with -data option like "-data os.bin a72 0xa0000000" it seems that the whole container has problems and the ATF in front of it won't boot. So can mkimage do this or not? How to build a container to load the operating system image to DDR? The boot device I'm using is a sd card.

Any help would be greatly appreciated.

0 Kudos
Reply
8 Replies

1,055 Views
kimease
Contributor II

1. 需要一个没有压缩过直接能跑的linux kernel image 

2. 遵守Image Restrictions 打包 

    我没有i.MX8QM 的手册,但我想是差不多的.

 

xxxxxxx.png

0 Kudos
Reply

950 Views
LEEYEOREUM
Contributor I

我确实是这样做的,例如在soc.mak增加

./$(MKIMG) -soc QM -rev B0 -append $(AHAB_IMG) -c -flags 0x00010000 -scfw scfw_tcm.bin -ap bl31.bin a72 0x80000000 -data kernel.bin a72 0x84000000 -out flash.bin,这样的处理,但是这样好像整个container都没能加载,我在atf里原本增加了些输出,这样构建以后连atf的输出都没了,去掉-data kernel.bin a72 0x84000000就没问题,运行到atf都是正常的,不是太明白哪里有问题,kernel.bin应该也没有违背Image Restrictions。

0 Kudos
Reply

946 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

uboot在跳转进内核之前做了一些dtb的fixup,你需要将fixup后的dtb手动导出来给内核用才行,并不是什么都不改就能用。而且需要改ATF代码,让其强制跳转,直接跳转到内核镜像地址,而不是默认的跳转到uboot,具体过程可以参考AN14093关于Falcon模式的实现。

0 Kudos
Reply

937 Views
LEEYEOREUM
Contributor I

这些修改我是做了的,它表现出来并不是跳转到内核的问题,是atf就没启动,感觉整个container有问题,如果我把atf的bin文件和内核的bin用dd合成为一个bin文件,是可以正常运行的,我把它们分开放就不行了,我尝试过把atf和uboot分开放也启动不了,我看mkimage里默认也是把atf和uboot的bin文件合到一起的,我是想问mkimage支不支持我这么做,是我container构建的有问题还是本身就不支持这么干,从atf跳转以及初始化那些我是做好了的,问题不在这个地方

0 Kudos
Reply

1,064 Views
Harvey021
NXP TechSupport
NXP TechSupport

你参考的这个是需要uboot的。

 

Regards

Harvey

0 Kudos
Reply

1,043 Views
LEEYEOREUM
Contributor I

所以能够不需要uboot构建container吗?有没有能参考的构建方式呢?实际上我需要的初始化过程在atf和内核都完成了,不需要uboot,我只是想把内核镜像放到container里,由SCU载入到ddr,这样我就可以让atf直接跳转到OS启动

0 Kudos
Reply

925 Views
Harvey021
NXP TechSupport
NXP TechSupport

We do not have this feature support by default that does not use uboot. 

You can refer to Fast Boot Linux with u-Boot Falcon Mode – Embetrix  and AN14093.

 

Regards

Harvey

0 Kudos
Reply

1,052 Views
kimease
Contributor II

你们家的芯片的ROM code 知道AP image 是个u-boot, 是个spl 还是其他的OS 的bootloader,还是其他可以运行的程序/image?

 

0 Kudos
Reply