Patchwork [v2,08/11] xilinx_zynq: add USB controllers

login
register
mail settings
Submitter Peter Crosthwaite
Date Oct. 26, 2012, 5:47 a.m.
Message ID <602c6648fbc0ba72b70cf3223479c6ec7e829a58.1351229557.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/194378/
State New
Headers show

Comments

Peter Crosthwaite - Oct. 26, 2012, 5:47 a.m.
Add the two usb controllers in Zynq.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
changed from v1:
Simplified to use sysbus_create_simple - dont need prop anymore

 hw/usb/hcd-ehci.c |    2 +-
 hw/xilinx_zynq.c  |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
Gerd Hoffmann - Oct. 26, 2012, 12:26 p.m.
> diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
> index c55dafb..154e397 100644
> --- a/hw/xilinx_zynq.c
> +++ b/hw/xilinx_zynq.c
> @@ -150,6 +150,9 @@ static void zynq_init(QEMUMachineInitArgs *args)
>      zynq_init_spi_flashes(0xE0006000, pic[58-IRQ_OFFSET]);
>      zynq_init_spi_flashes(0xE0007000, pic[81-IRQ_OFFSET]);
>  
> +    sysbus_create_simple("xlnx,ps7-usb", 0xE0002000, pic[53-IRQ_OFFSET]);
> +    sysbus_create_simple("xlnx,ps7-usb", 0xE0003000, pic[75-IRQ_OFFSET]);

Nice.  Much better than the create-usb helper function setting properties.

cheers,
  Gerd

Patch

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 443038b..4d5e476 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2749,7 +2749,7 @@  static TypeInfo ehci_info[] = {
     }, {
         .name          = "xlnx,ps7-usb",
         .parent        = TYPE_SYS_BUS_DEVICE,
-        .instance_size = sizeof(EHCISysBusState),
+        .instance_size = sizeof(EHCIItfState),
         .class_init    = ehci_sysbus_class_init,
         .class_size    = sizeof(EHCIClass),
         .class_data    = (EHCIClass[]) {{
diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
index c55dafb..154e397 100644
--- a/hw/xilinx_zynq.c
+++ b/hw/xilinx_zynq.c
@@ -150,6 +150,9 @@  static void zynq_init(QEMUMachineInitArgs *args)
     zynq_init_spi_flashes(0xE0006000, pic[58-IRQ_OFFSET]);
     zynq_init_spi_flashes(0xE0007000, pic[81-IRQ_OFFSET]);
 
+    sysbus_create_simple("xlnx,ps7-usb", 0xE0002000, pic[53-IRQ_OFFSET]);
+    sysbus_create_simple("xlnx,ps7-usb", 0xE0003000, pic[75-IRQ_OFFSET]);
+
     sysbus_create_simple("cadence_uart", 0xE0000000, pic[59-IRQ_OFFSET]);
     sysbus_create_simple("cadence_uart", 0xE0001000, pic[82-IRQ_OFFSET]);