IFomin
IFomin

Reputation: 11

qemu-system-ppc for SMARC p2020: which CPU or machine is need?

I'am trying to start kernel of router's device, which hardware has a CPU SMARC p2020, using QEMU. So, I have a Qemu 7.2.4, installed on Debian Bookworm. I have a compiled kernel (with buildroot 2018.11) for such device, u-boot, and so on. On a hardware everything is working fine. But, when I trying to start it's software, using qemu 7.2.4, I have a trouble. Using:

qemu-system-ppc -m 1G -drive format=raw,file=./rootfs.ext2 -kernel ./vmlinux.bin -nographic -append "console=ttyS0 root=/dev/sda"

And output was:

>> =============================================================
>> OpenBIOS 1.1 [Jul 11 2023 20:07]
>> Configuration device id QEMU version 1 machine id 2
>> CPUs: 1
>> Memory: 1024M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,750
milliseconds isn't unique.
Welcome to OpenBIOS v1.1 built on Jul 11 2023 20:07
>> [ppc] Kernel already loaded (0x01000000 + 0x005d9578) (initrd 0x00000000 + 0x00000000)
>> [ppc] Kernel command line: console=ttyS0 root=/dev/sda
>> switching to new context:

Then nothing!

I also read, there is need to include -machine and CPU options. I found, that machine shoul be set with options: -machine ppce500 -cpu e500v2, and include it. Also, I included a bios u-boot.e500 for this machine (from github). Trying again:

qemu-system-ppc -machine ppce500 -cpu e500v2 -m 2G -nographic -bios u-boot.e500 -drive format=raw,file=./rootfs.ext2 -kernel ./vmlinux.bin -append "console=ttyS0 root=/dev/sda"

And my output is:

U-Boot 2021.07 (Jul 06 2021 - 09:21:42 +0800)

CPU:   Unknown, Version: 0.0, (0x00000000)     
Core:  e500, Version: 2.2, (0x80210022)     
Clock Configuration:
       CPU0:400  MHz, 
       CCB:400  MHz,
       DDR:200  MHz (400 MT/s data rate), LBC: unknown (LCRR[CLKDIV] = 0x00)
L1:    D-cache 32 KiB enabled
       I-cache 32 KiB enabled
DRAM:  2 GiB
L2:    disabled
Loading Environment from nowhere... OK
In:    serial@4500
Out:   serial@4500
Err:   serial@4500
Net:   eth0: virtio-net#0
Hit any key to stop autoboot:  0 
WARNING: adjusting available memory to 30000000     
Wrong Image Format for bootm command      
ERROR: can't get kernel image!

What I do wrong? May be there is need another kind of machine for SMARC p2020? I hope, someone could explain me what I'am doing wrong with QEMU. On hardware everything is booting and loading successfully.

Upvotes: 1

Views: 132

Answers (0)

Related Questions