* How to use designware-root-port and designware-root-host devices ?
@ 2024-06-20 8:28 Arthur Tumanyan
2024-06-20 17:34 ` Thomas Huth
0 siblings, 1 reply; 8+ messages in thread
From: Arthur Tumanyan @ 2024-06-20 8:28 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1021 bytes --]
Hi all,
My question may sound stupid, however... 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
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;
Can you please help me to use designware-root-host/port devices ?
Thanks in advance,
Arthur
[-- Attachment #2: Type: text/html, Size: 2071 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to use designware-root-port and designware-root-host devices ?
2024-06-20 8:28 How to use designware-root-port and designware-root-host devices ? Arthur Tumanyan
@ 2024-06-20 17:34 ` Thomas Huth
2024-06-20 19:05 ` Peter Maydell
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2024-06-20 17:34 UTC (permalink / raw)
To: Arthur Tumanyan, qemu-devel; +Cc: qemu-arm, Peter Maydell, Andrey Smirnov
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to use designware-root-port and designware-root-host devices ?
2024-06-20 17:34 ` Thomas Huth
@ 2024-06-20 19:05 ` Peter Maydell
2024-06-20 19:37 ` Arthur Tumanyan
0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2024-06-20 19:05 UTC (permalink / raw)
To: Thomas Huth; +Cc: Arthur Tumanyan, qemu-devel, qemu-arm, Andrey Smirnov
On Thu, 20 Jun 2024 at 18:34, Thomas Huth <thuth@redhat.com> wrote:
>
> On 20/06/2024 10.28, Arthur Tumanyan wrote:
> > 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.
Right -- these devices are the PCIe controller that's used on the i.MX7
and i.MX6 SoCs, and they're automatically created when you use a machine
type that uses one of those SoCs. The "virt" board doesn't use that
PCIe controller, it uses the "generic PCIe bridge" TYPE_GPEX_HOST
(and you automatically get a PCIe controller when you use the virt board).
You can't change the PCIe controller type of a QEMU machine from
the command line, you have to configure the guest to use the controller
the machine type provides.
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to use designware-root-port and designware-root-host devices ?
2024-06-20 19:05 ` Peter Maydell
@ 2024-06-20 19:37 ` Arthur Tumanyan
2024-06-21 7:07 ` Arthur Tumanyan
0 siblings, 1 reply; 8+ messages in thread
From: Arthur Tumanyan @ 2024-06-20 19:37 UTC (permalink / raw)
To: peter.maydell; +Cc: thuth, qemu-devel, qemu-arm, andrew.smirnov
[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]
Thanks for the answers, I could move forward a bit more. I'm going/I need
to to create a "virt" machine with designware PCI controller for simulation
purposes. Will get back with progress in case anyone is interested in
results. Thank you again for your time and support.
Arthur
On Thu, Jun 20, 2024, 23:05 Peter Maydell <peter.maydell@linaro.org> wrote:
> On Thu, 20 Jun 2024 at 18:34, Thomas Huth <thuth@redhat.com> wrote:
> >
> > On 20/06/2024 10.28, Arthur Tumanyan wrote:
> > > 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.
>
> Right -- these devices are the PCIe controller that's used on the i.MX7
> and i.MX6 SoCs, and they're automatically created when you use a machine
> type that uses one of those SoCs. The "virt" board doesn't use that
> PCIe controller, it uses the "generic PCIe bridge" TYPE_GPEX_HOST
> (and you automatically get a PCIe controller when you use the virt board).
> You can't change the PCIe controller type of a QEMU machine from
> the command line, you have to configure the guest to use the controller
> the machine type provides.
>
> thanks
> -- PMM
>
[-- Attachment #2: Type: text/html, Size: 2108 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to use designware-root-port and designware-root-host devices ?
2024-06-20 19:37 ` Arthur Tumanyan
@ 2024-06-21 7:07 ` Arthur Tumanyan
2024-06-21 9:16 ` Peter Maydell
0 siblings, 1 reply; 8+ messages in thread
From: Arthur Tumanyan @ 2024-06-21 7:07 UTC (permalink / raw)
To: peter.maydell; +Cc: thuth, qemu-devel, qemu-arm, andrew.smirnov
[-- Attachment #1: Type: text/plain, Size: 2522 bytes --]
Hi,
I just tried to run mcimx7d-sabre machine this way:
${HOME}/cosim/usr/local/bin/qemu-system-arm -M mcimx7d-sabre -m 2G \
-kernel ${HOME}/cosim-arm/buildroot/output/images/uImage \
--initrd ${HOME}/cosim-arm/buildroot/output/images/rootfs.cpio.gz \
-nographic \
-net nic -net user
and it just prints this and do nothing: *qemu-system-arm: warning: nic
imx.enet.1 has no peer*
Based on what I see in the mcimx7d-sabre.c , it configures just very basic
things, no PCIe at all (may be I'm wrong ;) )
Is there any idea what goes wrong here ? Maybe someone has experience with
running this machine ?
Before starting to create my own virt machine I would like to know I'm not
missing the existing ways to run this.
Thanks in advance,
Arthur
On Thu, Jun 20, 2024 at 11:37 PM Arthur Tumanyan <arthurtumanyan@gmail.com>
wrote:
> Thanks for the answers, I could move forward a bit more. I'm going/I need
> to to create a "virt" machine with designware PCI controller for simulation
> purposes. Will get back with progress in case anyone is interested in
> results. Thank you again for your time and support.
> Arthur
>
> On Thu, Jun 20, 2024, 23:05 Peter Maydell <peter.maydell@linaro.org>
> wrote:
>
>> On Thu, 20 Jun 2024 at 18:34, Thomas Huth <thuth@redhat.com> wrote:
>> >
>> > On 20/06/2024 10.28, Arthur Tumanyan wrote:
>> > > 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.
>>
>> Right -- these devices are the PCIe controller that's used on the i.MX7
>> and i.MX6 SoCs, and they're automatically created when you use a machine
>> type that uses one of those SoCs. The "virt" board doesn't use that
>> PCIe controller, it uses the "generic PCIe bridge" TYPE_GPEX_HOST
>> (and you automatically get a PCIe controller when you use the virt board).
>> You can't change the PCIe controller type of a QEMU machine from
>> the command line, you have to configure the guest to use the controller
>> the machine type provides.
>>
>> thanks
>> -- PMM
>>
>
[-- Attachment #2: Type: text/html, Size: 3537 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to use designware-root-port and designware-root-host devices ?
2024-06-21 7:07 ` Arthur Tumanyan
@ 2024-06-21 9:16 ` Peter Maydell
2024-06-21 9:30 ` Thomas Huth
0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2024-06-21 9:16 UTC (permalink / raw)
To: Arthur Tumanyan; +Cc: thuth, qemu-devel, qemu-arm, andrew.smirnov
On Fri, 21 Jun 2024 at 08:07, Arthur Tumanyan <arthurtumanyan@gmail.com> wrote:
>
> Hi,
>
> I just tried to run mcimx7d-sabre machine this way:
>
> ${HOME}/cosim/usr/local/bin/qemu-system-arm -M mcimx7d-sabre -m 2G \
> -kernel ${HOME}/cosim-arm/buildroot/output/images/uImage \
> --initrd ${HOME}/cosim-arm/buildroot/output/images/rootfs.cpio.gz \
> -nographic \
> -net nic -net user
>
> and it just prints this and do nothing: qemu-system-arm: warning: nic imx.enet.1 has no peer
>
> Based on what I see in the mcimx7d-sabre.c , it configures just very basic things, no PCIe at all (may be I'm wrong ;) )
The machine model in mcimx7d-sabre.c creates the SoC object
(TYPE_FSL_IMX7). It's the code for that in hw/arm/fsl-imx7.c
that creates all the SoC devices including the PCIe controller.
(This structure is similar to real hardware where you have a
board, which has one or two chips on it like RAM but most of
the complicated stuff is inside the one big SoC chip.)
> Is there any idea what goes wrong here ? Maybe someone has experience with running this machine ?
"No output" usually means "your guest kernel is not configured
correctly for this machine type", and/or possibly "you didn't
tell the kernel to output on the serial port".
The "no peer" warning is because this board has two ethernet devices,
and your command line explicitly wires up one but not the other.
If you drop both the "-net" options entirely it will probably go
away (you get the default user networking anyway).
thanks
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to use designware-root-port and designware-root-host devices ?
2024-06-21 9:16 ` Peter Maydell
@ 2024-06-21 9:30 ` Thomas Huth
2024-06-25 7:52 ` Arthur Tumanyan
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2024-06-21 9:30 UTC (permalink / raw)
To: Peter Maydell, Arthur Tumanyan; +Cc: qemu-devel, qemu-arm, andrew.smirnov
On 21/06/2024 11.16, Peter Maydell wrote:
> On Fri, 21 Jun 2024 at 08:07, Arthur Tumanyan <arthurtumanyan@gmail.com> wrote:
>>
>> Hi,
>>
>> I just tried to run mcimx7d-sabre machine this way:
>>
>> ${HOME}/cosim/usr/local/bin/qemu-system-arm -M mcimx7d-sabre -m 2G \
>> -kernel ${HOME}/cosim-arm/buildroot/output/images/uImage \
>> --initrd ${HOME}/cosim-arm/buildroot/output/images/rootfs.cpio.gz \
>> -nographic \
>> -net nic -net user
>>
>> and it just prints this and do nothing: qemu-system-arm: warning: nic imx.enet.1 has no peer
>>
>> Based on what I see in the mcimx7d-sabre.c , it configures just very basic things, no PCIe at all (may be I'm wrong ;) )
>
> The machine model in mcimx7d-sabre.c creates the SoC object
> (TYPE_FSL_IMX7). It's the code for that in hw/arm/fsl-imx7.c
> that creates all the SoC devices including the PCIe controller.
> (This structure is similar to real hardware where you have a
> board, which has one or two chips on it like RAM but most of
> the complicated stuff is inside the one big SoC chip.)
>
>> Is there any idea what goes wrong here ? Maybe someone has experience with running this machine ?
>
> "No output" usually means "your guest kernel is not configured
> correctly for this machine type", and/or possibly "you didn't
> tell the kernel to output on the serial port".
By the way, it seems like we don't even have an avocado test for that
machine available. Peter, do you know whether there is a kernel for this
machine available somewhere that we could use for testing?
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How to use designware-root-port and designware-root-host devices ?
2024-06-21 9:30 ` Thomas Huth
@ 2024-06-25 7:52 ` Arthur Tumanyan
0 siblings, 0 replies; 8+ messages in thread
From: Arthur Tumanyan @ 2024-06-25 7:52 UTC (permalink / raw)
To: Thomas Huth; +Cc: Peter Maydell, qemu-devel, qemu-arm, andrew.smirnov
[-- Attachment #1: Type: text/plain, Size: 2196 bytes --]
Hi,
I ported DWC PCIE part from fsl-imx7.c to my new cusotm virt machine based
on RISC-V "virt".
It looks ok so far. Now i'm wondering whether there is a "standard/ready to
use for most of cases" device tree description for the synopsis pcie host
device ?
Looking this way:
https://mjmwired.net/kernel/Documentation/devicetree/bindings/pci/designware-pcie.txt
but would be glad to hear some advices if any.
Best regards,
Arthur
On Fri, Jun 21, 2024 at 1:30 PM Thomas Huth <thuth@redhat.com> wrote:
> On 21/06/2024 11.16, Peter Maydell wrote:
> > On Fri, 21 Jun 2024 at 08:07, Arthur Tumanyan <arthurtumanyan@gmail.com>
> wrote:
> >>
> >> Hi,
> >>
> >> I just tried to run mcimx7d-sabre machine this way:
> >>
> >> ${HOME}/cosim/usr/local/bin/qemu-system-arm -M mcimx7d-sabre -m 2G \
> >> -kernel ${HOME}/cosim-arm/buildroot/output/images/uImage \
> >> --initrd
> ${HOME}/cosim-arm/buildroot/output/images/rootfs.cpio.gz \
> >> -nographic \
> >> -net nic -net user
> >>
> >> and it just prints this and do nothing: qemu-system-arm: warning: nic
> imx.enet.1 has no peer
> >>
> >> Based on what I see in the mcimx7d-sabre.c , it configures just very
> basic things, no PCIe at all (may be I'm wrong ;) )
> >
> > The machine model in mcimx7d-sabre.c creates the SoC object
> > (TYPE_FSL_IMX7). It's the code for that in hw/arm/fsl-imx7.c
> > that creates all the SoC devices including the PCIe controller.
> > (This structure is similar to real hardware where you have a
> > board, which has one or two chips on it like RAM but most of
> > the complicated stuff is inside the one big SoC chip.)
> >
> >> Is there any idea what goes wrong here ? Maybe someone has experience
> with running this machine ?
> >
> > "No output" usually means "your guest kernel is not configured
> > correctly for this machine type", and/or possibly "you didn't
> > tell the kernel to output on the serial port".
>
> By the way, it seems like we don't even have an avocado test for that
> machine available. Peter, do you know whether there is a kernel for this
> machine available somewhere that we could use for testing?
>
> Thomas
>
>
>
[-- Attachment #2: Type: text/html, Size: 3003 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-06-25 7:53 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20 8:28 How to use designware-root-port and designware-root-host devices ? Arthur Tumanyan
2024-06-20 17:34 ` Thomas Huth
2024-06-20 19:05 ` Peter Maydell
2024-06-20 19:37 ` Arthur Tumanyan
2024-06-21 7:07 ` Arthur Tumanyan
2024-06-21 9:16 ` Peter Maydell
2024-06-21 9:30 ` Thomas Huth
2024-06-25 7:52 ` Arthur Tumanyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).