On 20/06/2024 10.28, Arthur Tumanyan wrote:
Hi all,
My question may sound stupid, however...
Hi Arthur,
no worries, the question how to use which device in QEMU can be quite tricky ;-)
Currently I'm trying to make
available designware-root-{port,host} devices in linux when I run it in qemu.
I try the following way to run:
qemu-system-arm -M virt -m 2G \
-kernel images/Image \
-append "rootwait root=/dev/vda ro" \
-drive file=images/rootfs.ext2,format=raw,id=hd0 \
-device designware-root-port,id=rp0,chassis=1,slot=0,bus=pcie.0,addr=1 \
-device e1000,netdev=net0,mac=52:54:00:12:34:56,bus=rp0,addr=0 \
-netdev user,id=net0
but it seems designware device is not enabled by default: qemu-system-arm:
-device designware-root-port,id=rp0,chassis=1,slot=0,bus=pcie.0,addr=1:
'designware-root-port' is not a valid device model name
Are you sure about the names?
$ grep -r 'designware' *
...
include/hw/pci-host/designware.h:#define TYPE_DESIGNWARE_PCIE_HOST
"designware-pcie-host"
include/hw/pci-host/designware.h:#define TYPE_DESIGNWARE_PCIE_ROOT
"designware-pcie-root"
when I enable it from Kconfig/meson.build it says the device is already
registered and exits with abort().
From the other hand the device is declared as non pluggable:
dc->user_creatable = false;
Well, that means that you cannot use those with "-device". They can only be
instantiated via the code that creates the machine.
Can you please help me to use designware-root-host/port devices ?
It seems like the i.MX7 SABRE machine is using this device, so instead of
"-M virt", you could have a try with "-M mcimx7d-sabre" (and a kernel that
supports this machine) instead.
HTH,
Thomas