QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation
@ 2020-02-15 12:23 Guenter Roeck
  2020-02-15 12:23 ` [PATCH v2 1/2] " Guenter Roeck
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-02-15 12:23 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, qemu-devel, qemu-arm, Gerd Hoffmann,
	Edgar E . Iglesias, Guenter Roeck

USB ports on Xilinx Zync must be instantiated as TYPE_CHIPIDEA to work.
Linux expects and checks various chipidea registers, which do not exist
with the basic ehci emulation. This patch series fixes the problem.

The first patch in the series fixes the actual problem.

The second patch removes the now obsolete explicit Xilinx
support from the EHCI code.

v2: Introduced summary

----------------------------------------------------------------
Guenter Roeck (2):
      hw/arm/xilinx_zynq: Fix USB port instantiation
      hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx,ps7-usb class

 hw/arm/xilinx_zynq.c     |  5 +++--
 hw/usb/hcd-ehci-sysbus.c | 17 -----------------
 2 files changed, 3 insertions(+), 19 deletions(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/2] hw/arm/xilinx_zynq: Fix USB port instantiation
  2020-02-15 12:23 [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Guenter Roeck
@ 2020-02-15 12:23 ` " Guenter Roeck
  2020-02-15 12:23 ` [PATCH v2 2/2] hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx, ps7-usb class Guenter Roeck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-02-15 12:23 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, qemu-devel, qemu-arm, Gerd Hoffmann,
	Edgar E . Iglesias, Guenter Roeck

USB ports on Xilinx Zync must be instantiated as TYPE_CHIPIDEA to work.
Linux expects and checks various chipidea registers, which do not exist
with the basic ehci emulation. This patch series fixes the problem.

Without this patch, USB ports fail to instantiate under Linux.

ci_hdrc ci_hdrc.0: doesn't support host
ci_hdrc ci_hdrc.0: no supported roles

With this patch, USB ports are instantiated, and it is possible
to boot from USB drive.

ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
usb 1-1: new full-speed USB device number 2 using ci_hdrc
usb 1-1: not running at top speed; connect to a high speed hub
usb 1-1: config 1 interface 0 altsetting 0 endpoint 0x81 has invalid maxpacket 512, setting to 64
usb 1-1: config 1 interface 0 altsetting 0 endpoint 0x2 has invalid maxpacket 512, setting to 64
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: No change

 hw/arm/xilinx_zynq.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 3a0fa5b23f..b4a8b2f2c6 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -29,6 +29,7 @@
 #include "hw/loader.h"
 #include "hw/misc/zynq-xadc.h"
 #include "hw/ssi/ssi.h"
+#include "hw/usb/chipidea.h"
 #include "qemu/error-report.h"
 #include "hw/sd/sdhci.h"
 #include "hw/char/cadence_uart.h"
@@ -228,8 +229,8 @@ static void zynq_init(MachineState *machine)
     zynq_init_spi_flashes(0xE0007000, pic[81-IRQ_OFFSET], false);
     zynq_init_spi_flashes(0xE000D000, pic[51-IRQ_OFFSET], true);
 
-    sysbus_create_simple("xlnx,ps7-usb", 0xE0002000, pic[53-IRQ_OFFSET]);
-    sysbus_create_simple("xlnx,ps7-usb", 0xE0003000, pic[76-IRQ_OFFSET]);
+    sysbus_create_simple(TYPE_CHIPIDEA, 0xE0002000, pic[53 - IRQ_OFFSET]);
+    sysbus_create_simple(TYPE_CHIPIDEA, 0xE0003000, pic[76 - IRQ_OFFSET]);
 
     cadence_uart_create(0xE0000000, pic[59 - IRQ_OFFSET], serial_hd(0));
     cadence_uart_create(0xE0001000, pic[82 - IRQ_OFFSET], serial_hd(1));
-- 
2.17.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx, ps7-usb class
  2020-02-15 12:23 [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Guenter Roeck
  2020-02-15 12:23 ` [PATCH v2 1/2] " Guenter Roeck
@ 2020-02-15 12:23 ` Guenter Roeck
  2020-02-17  8:21 ` [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Gerd Hoffmann
  2020-02-20 15:05 ` Peter Maydell
  3 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-02-15 12:23 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, qemu-devel, qemu-arm, Gerd Hoffmann,
	Edgar E . Iglesias, Guenter Roeck

Xilinx USB devices are now instantiated through TYPE_CHIPIDEA,
and xlnx support in the EHCI code is no longer needed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: No change

 hw/usb/hcd-ehci-sysbus.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index 62612c9f5b..b5a014f968 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -114,22 +114,6 @@ static const TypeInfo ehci_platform_type_info = {
     .class_init    = ehci_platform_class_init,
 };
 
-static void ehci_xlnx_class_init(ObjectClass *oc, void *data)
-{
-    SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc);
-    DeviceClass *dc = DEVICE_CLASS(oc);
-
-    set_bit(DEVICE_CATEGORY_USB, dc->categories);
-    sec->capsbase = 0x100;
-    sec->opregbase = 0x140;
-}
-
-static const TypeInfo ehci_xlnx_type_info = {
-    .name          = "xlnx,ps7-usb",
-    .parent        = TYPE_SYS_BUS_EHCI,
-    .class_init    = ehci_xlnx_class_init,
-};
-
 static void ehci_exynos4210_class_init(ObjectClass *oc, void *data)
 {
     SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc);
@@ -266,7 +250,6 @@ static void ehci_sysbus_register_types(void)
 {
     type_register_static(&ehci_type_info);
     type_register_static(&ehci_platform_type_info);
-    type_register_static(&ehci_xlnx_type_info);
     type_register_static(&ehci_exynos4210_type_info);
     type_register_static(&ehci_tegra2_type_info);
     type_register_static(&ehci_ppc4xx_type_info);
-- 
2.17.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation
  2020-02-15 12:23 [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Guenter Roeck
  2020-02-15 12:23 ` [PATCH v2 1/2] " Guenter Roeck
  2020-02-15 12:23 ` [PATCH v2 2/2] hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx, ps7-usb class Guenter Roeck
@ 2020-02-17  8:21 ` Gerd Hoffmann
  2020-02-20 15:05 ` Peter Maydell
  3 siblings, 0 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2020-02-17  8:21 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Peter Maydell, Alistair Francis, qemu-devel, qemu-arm,
	Edgar E . Iglesias

On Sat, Feb 15, 2020 at 04:23:52AM -0800, Guenter Roeck wrote:
> USB ports on Xilinx Zync must be instantiated as TYPE_CHIPIDEA to work.
> Linux expects and checks various chipidea registers, which do not exist
> with the basic ehci emulation. This patch series fixes the problem.
> 
> The first patch in the series fixes the actual problem.
> 
> The second patch removes the now obsolete explicit Xilinx
> support from the EHCI code.

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation
  2020-02-15 12:23 [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Guenter Roeck
                   ` (2 preceding siblings ...)
  2020-02-17  8:21 ` [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Gerd Hoffmann
@ 2020-02-20 15:05 ` Peter Maydell
  2020-02-28 15:59   ` Peter Maydell
  3 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2020-02-20 15:05 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Edgar E . Iglesias, Alistair Francis, Gerd Hoffmann, qemu-arm,
	QEMU Developers

On Sat, 15 Feb 2020 at 12:23, Guenter Roeck <linux@roeck-us.net> wrote:
>
> USB ports on Xilinx Zync must be instantiated as TYPE_CHIPIDEA to work.
> Linux expects and checks various chipidea registers, which do not exist
> with the basic ehci emulation. This patch series fixes the problem.
>
> The first patch in the series fixes the actual problem.
>
> The second patch removes the now obsolete explicit Xilinx
> support from the EHCI code.
>
> v2: Introduced summary
>
> ----------------------------------------------------------------
> Guenter Roeck (2):
>       hw/arm/xilinx_zynq: Fix USB port instantiation
>       hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx,ps7-usb class

Xilinx folks -- could you provide a reviewed-by or acked-by
for this series, please?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation
  2020-02-20 15:05 ` Peter Maydell
@ 2020-02-28 15:59   ` Peter Maydell
  2020-02-28 18:44     ` Edgar E. Iglesias
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2020-02-28 15:59 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Edgar E . Iglesias, Alistair Francis, Gerd Hoffmann, qemu-arm,
	QEMU Developers

On Thu, 20 Feb 2020 at 15:05, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Sat, 15 Feb 2020 at 12:23, Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > USB ports on Xilinx Zync must be instantiated as TYPE_CHIPIDEA to work.
> > Linux expects and checks various chipidea registers, which do not exist
> > with the basic ehci emulation. This patch series fixes the problem.
> >
> > The first patch in the series fixes the actual problem.
> >
> > The second patch removes the now obsolete explicit Xilinx
> > support from the EHCI code.
> >
> > v2: Introduced summary
> >
> > ----------------------------------------------------------------
> > Guenter Roeck (2):
> >       hw/arm/xilinx_zynq: Fix USB port instantiation
> >       hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx,ps7-usb class
>
> Xilinx folks -- could you provide a reviewed-by or acked-by
> for this series, please?

No? Oh, well, applied to target-arm.next anyway.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation
  2020-02-28 15:59   ` Peter Maydell
@ 2020-02-28 18:44     ` Edgar E. Iglesias
  2020-02-28 23:16       ` Guenter Roeck
  0 siblings, 1 reply; 8+ messages in thread
From: Edgar E. Iglesias @ 2020-02-28 18:44 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Alistair Francis, qemu-arm, Gerd Hoffmann, Guenter Roeck,
	QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 1203 bytes --]

Sorry Peter, I missed the email.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>

Best regards,
Edgar


On Fri, 28 Feb. 2020, 10:00 Peter Maydell, <peter.maydell@linaro.org> wrote:

> On Thu, 20 Feb 2020 at 15:05, Peter Maydell <peter.maydell@linaro.org>
> wrote:
> >
> > On Sat, 15 Feb 2020 at 12:23, Guenter Roeck <linux@roeck-us.net> wrote:
> > >
> > > USB ports on Xilinx Zync must be instantiated as TYPE_CHIPIDEA to work.
> > > Linux expects and checks various chipidea registers, which do not exist
> > > with the basic ehci emulation. This patch series fixes the problem.
> > >
> > > The first patch in the series fixes the actual problem.
> > >
> > > The second patch removes the now obsolete explicit Xilinx
> > > support from the EHCI code.
> > >
> > > v2: Introduced summary
> > >
> > > ----------------------------------------------------------------
> > > Guenter Roeck (2):
> > >       hw/arm/xilinx_zynq: Fix USB port instantiation
> > >       hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx,ps7-usb class
> >
> > Xilinx folks -- could you provide a reviewed-by or acked-by
> > for this series, please?
>
> No? Oh, well, applied to target-arm.next anyway.
>
> thanks
> -- PMM
>

[-- Attachment #2: Type: text/html, Size: 2013 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation
  2020-02-28 18:44     ` Edgar E. Iglesias
@ 2020-02-28 23:16       ` Guenter Roeck
  0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2020-02-28 23:16 UTC (permalink / raw)
  To: Edgar E. Iglesias
  Cc: Peter Maydell, Alistair Francis, Gerd Hoffmann, qemu-arm,
	QEMU Developers

On Fri, Feb 28, 2020 at 12:44:19PM -0600, Edgar E. Iglesias wrote:
> Sorry Peter, I missed the email.
> 
> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> 

Thanks a lot everyone!

Guenter

> Best regards,
> Edgar
> 
> 
> On Fri, 28 Feb. 2020, 10:00 Peter Maydell, <peter.maydell@linaro.org> wrote:
> 
> > On Thu, 20 Feb 2020 at 15:05, Peter Maydell <peter.maydell@linaro.org>
> > wrote:
> > >
> > > On Sat, 15 Feb 2020 at 12:23, Guenter Roeck <linux@roeck-us.net> wrote:
> > > >
> > > > USB ports on Xilinx Zync must be instantiated as TYPE_CHIPIDEA to work.
> > > > Linux expects and checks various chipidea registers, which do not exist
> > > > with the basic ehci emulation. This patch series fixes the problem.
> > > >
> > > > The first patch in the series fixes the actual problem.
> > > >
> > > > The second patch removes the now obsolete explicit Xilinx
> > > > support from the EHCI code.
> > > >
> > > > v2: Introduced summary
> > > >
> > > > ----------------------------------------------------------------
> > > > Guenter Roeck (2):
> > > >       hw/arm/xilinx_zynq: Fix USB port instantiation
> > > >       hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx,ps7-usb class
> > >
> > > Xilinx folks -- could you provide a reviewed-by or acked-by
> > > for this series, please?
> >
> > No? Oh, well, applied to target-arm.next anyway.
> >
> > thanks
> > -- PMM
> >


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15 12:23 [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Guenter Roeck
2020-02-15 12:23 ` [PATCH v2 1/2] " Guenter Roeck
2020-02-15 12:23 ` [PATCH v2 2/2] hw/usb/hcd-ehci-sysbus: Remove obsolete xlnx, ps7-usb class Guenter Roeck
2020-02-17  8:21 ` [PATCH v2 0/2] hw/arm/xilinx_zynq: Fix USB port instantiation Gerd Hoffmann
2020-02-20 15:05 ` Peter Maydell
2020-02-28 15:59   ` Peter Maydell
2020-02-28 18:44     ` Edgar E. Iglesias
2020-02-28 23:16       ` Guenter Roeck

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git