Qemu Freescale i.MX6 DualLite SABRE : root filesystem does not mount

偶尔善良 提交于 2019-12-03 15:00:47

There are two problems here. Firstly, your command line isn't actually creating an SD card: the -drive option creates a drive object but doesn't try to plug it in anywhere (because the sabrelite board doesn't define a "default kind of block drive"). To actually plug in the drive to an emulated sd card you need

-drive file=yourfile.img,format=raw,id=mycard -device sd-card,drive=mycard

Secondly, there are bugs in QEMU's current imx6 sd controller emulation, because if you do that then the guest kernel continuously prints

[   28.971663] mmc1: Timeout waiting for hardware interrupt.
[   28.973619] mmc1: error -110 whilst initialising SD card

...so it has found the emulated card but isn't getting an interrupt it expects.

These can be fixed by a patch currently on the qemu-devel mailing lists and going through code review: http://patchwork.ozlabs.org/patch/834805/ plus a simple change to hw/arm/fsl-imx6.c to make it create TYPE_IMX_USDHC devices rather than TYPE_SYSBUS_SDHCI. (Basically the imx6's SD controller isn't a completely standard compatible sdhci controller but what we were creating in the QEMU model was the plain variety.)

If you do all that then you can boot a kernel that can see the mmc card:

[    8.878283] mmc1: new SD card at address 4567
[    8.910566] mmcblk0: mmc1:4567 QEMU! 256 MiB 

With a little luck we'll be able to have this fixed in the 2.12 release of QEMU, which will be out in some time in spring 2018.

Edit as of 9 Mar 2018 -- the relevant fixes are now in QEMU master (commits fd1e5c81796, df2a5cf4c8) and will be in 2.12.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!