1
votes

Lately, I am trying to get Linux up on qemu-arm mcimx6ul-evk machine using buildroot. I have generated all the images required for my target machine. Following are the steps I followed for building images on buildroot (version: buildroot-2016.11.1).

$ make freescale_imx6ulevk_defconfig
$ make nconfig

I have selected the packages required and then built the images using command

$ make

in "output/images" I see the following images generated, boot.vfat, imx6ul-14x14-evk.dtb, rootfs.ext2, rootfs.ext4, rootfs.tar, sdcard.img, u-boot.bin, u-boot.imx, zImage.

I am referring this article to replicate the same for mcimx6ul-evk. I ran the below command to boot Linux on my target machine

$ qemu-system-arm -M mcimx6ul-evk -m 512M -kernel output/images/zImage -monitor stdio -drive file=output/images/rootfs.ext2,format=raw

When a run the above command with -d int I get the exception logs as follows

    QEMU 4.1.0 monitor - type 'help' for more information
(qemu) Exception return from AArch32 hyp to svc PC 0x80010088
Taking exception 11 [Hypervisor Call]
...from EL1 to EL2
...with ESR 0x12/0x4a000000
Exception return from AArch32 hyp to svc PC 0x800134dc
Taking exception 11 [Hypervisor Call]
...from EL1 to EL2
...with ESR 0x12/0x4a000000
Exception return from AArch32 hyp to svc PC 0x800134dc
Taking exception 11 [Hypervisor Call]
...from EL1 to EL2
...with ESR 0x12/0x4a000000
Exception return from AArch32 hyp to svc PC 0x80be4d1c
Taking exception 11 [Hypervisor Call]
...from EL1 to EL2
...with ESR 0x12/0x4a000000
Exception return from AArch32 hyp to svc PC 0x80008034
AArch32 mode switch from svc to irq PC 0x800118b4
AArch32 mode switch from irq to abt PC 0x800118b8
AArch32 mode switch from abt to und PC 0x800118c4
AArch32 mode switch from und to fiq PC 0x800118d0
AArch32 mode switch from fiq to svc PC 0x800118dc
Taking exception 4 [Data Abort]
...from EL1 to EL1
...with ESR 0x25/0x9600003f
...with DFSR 0x5 DFAR 0x0
Exception return from AArch32 abt to svc PC 0x800130e0

I don't see Linux booting logs on the serial0 console. can someone please help me how to resolve this? Or am I missing something here?

Note: The qemu(version: qemu-4.1.0) is built for arm target using below commands.

$ ./configure --target-list=arm-softmmu --enable-sdl
$ make
$ sudo make install
1
Could you figure anything out by now?Dominik Schmidt
No, this issue still remains unsolved for me.Pratik Parvati

1 Answers

1
votes

I encountered this issue as well. Here are the steps I did to investigate it:

  1. Compile the kernel with debugging info enabled:

    CONFIG_DEBUG_INFO=y

  2. Start qemu with gdb debugging:

    $qemu-system-arm -M mcimx6ul-evk -cpu cortex-a7 -m 512M -kernel arch/arm/boot/zImage -nographic -dtb arch/arm/boot/dts/imx6ul-14x14-evk.dtb -s -S -d int

    Take note of these qemu parameters:

    -s : -gdb tcp::1234 for gdb debugging
    -S : do not start CPU at startup(use ‘c’ to start execution). Stopped at startup code. Need to do ‘c’ command in gdb.

  3. Debug with gdb-multiarch:

    $gdb-multiarch  
    
    (gdb) target remote localhost:1234  
    (gdb) file vmlinux  
    (gdb) b start_kernel  
    Breakpoint 1 at 0x80e008cc: file init/main.c, line 482.  
    (gdb) c  
    Continuing.  
    Breakpoint 1, start_kernel () at init/main.c:482  
    482     {  
    (gdb)
    

    The kernel was starting because it hit the breakpoint.

  4. Add kernel command-line entries to see more logs:

    $qemu-system-arm -M mcimx6ul-evk -cpu cortex-a7 -m 512M -kernel arch/arm/boot/zImage -nographic -dtb arch/arm/boot/dts/imx6ul-14x14-evk.dtb -append "console=ttymxc0 loglevel=8 earlycon earlyprintk"

    Based on the logs, I disabled drivers that were causing the kernel to crash (it is because they are not supported by the qemu mcimx6ul-evk machine). You can disable them from menuconfig, then recompile the kernel.

Note that I did not use buildroot. This was my setup:

Repository: https://source.codeaurora.org/external/imx/linux-imx  
Config: imx_v7_defconfig
Toolchain: arm-linux-gnueabihf-
Host: WSL2