qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 4/6] MIPS: Initial support of VIA USB controller used by fulong mini pc
@ 2010-05-19 14:28 Huacai Chen
  2010-05-28 21:04 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: Huacai Chen @ 2010-05-19 14:28 UTC (permalink / raw)
  To: aurelien; +Cc: blauwirbel, qemu-devel, Huacai Chen

Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
---
 hw/usb-uhci.c |   30 ++++++++++++++++++++++++++++++
 hw/usb-uhci.h |    1 +
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 624d55b..5fd5388 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -1152,6 +1152,26 @@ static int usb_uhci_piix4_initfn(PCIDevice *dev)
     return usb_uhci_common_initfn(s);
 }
 
+static int usb_uhci_vt82c686b_initfn(PCIDevice *dev)
+{
+    UHCIState *s = DO_UPCAST(UHCIState, dev, dev);
+    uint8_t *pci_conf = s->dev.config;
+
+    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA);
+    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_UHCI);
+
+    pci_set_long(pci_conf + 0x0c,0x00001600);
+    pci_set_long(pci_conf + 0x20,0x00000301);
+    pci_set_long(pci_conf + 0x34,0x00001080);
+    pci_set_long(pci_conf + 0x3c,0x00000004);
+    pci_set_long(pci_conf + 0x40,0x00001000);
+    pci_set_long(pci_conf + 0x60,0x00000010);
+    pci_set_long(pci_conf + 0x80,0x00020001);
+    pci_set_long(pci_conf + 0xc0,0x00002000);
+
+    return usb_uhci_common_initfn(s);
+}
+
 static PCIDeviceInfo uhci_info[] = {
     {
         .qdev.name    = "piix3-usb-uhci",
@@ -1164,6 +1184,11 @@ static PCIDeviceInfo uhci_info[] = {
         .qdev.vmsd    = &vmstate_uhci,
         .init         = usb_uhci_piix4_initfn,
     },{
+        .qdev.name    = "vt82c686b-usb-uhci",
+        .qdev.size    = sizeof(UHCIState),
+        .qdev.vmsd    = &vmstate_uhci,
+        .init         = usb_uhci_vt82c686b_initfn,
+    },{
         /* end of list */
     }
 };
@@ -1183,3 +1208,8 @@ void usb_uhci_piix4_init(PCIBus *bus, int devfn)
 {
     pci_create_simple(bus, devfn, "piix4-usb-uhci");
 }
+
+void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn)
+{
+    pci_create_simple(bus, devfn, "vt82c686b-usb-uhci");
+}
diff --git a/hw/usb-uhci.h b/hw/usb-uhci.h
index 911948e..3e4d377 100644
--- a/hw/usb-uhci.h
+++ b/hw/usb-uhci.h
@@ -5,5 +5,6 @@
 
 void usb_uhci_piix3_init(PCIBus *bus, int devfn);
 void usb_uhci_piix4_init(PCIBus *bus, int devfn);
+void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn);
 
 #endif
-- 
1.7.0.4

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

* Re: [Qemu-devel] [PATCH v2 4/6] MIPS: Initial support of VIA USB controller used by fulong mini pc
  2010-05-19 14:28 [Qemu-devel] [PATCH v2 4/6] MIPS: Initial support of VIA USB controller used by fulong mini pc Huacai Chen
@ 2010-05-28 21:04 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2010-05-28 21:04 UTC (permalink / raw)
  To: Huacai Chen; +Cc: blauwirbel, qemu-devel

On Wed, May 19, 2010 at 10:28:11PM +0800, Huacai Chen wrote:
> Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
> ---
>  hw/usb-uhci.c |   30 ++++++++++++++++++++++++++++++
>  hw/usb-uhci.h |    1 +
>  2 files changed, 31 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
> index 624d55b..5fd5388 100644
> --- a/hw/usb-uhci.c
> +++ b/hw/usb-uhci.c
> @@ -1152,6 +1152,26 @@ static int usb_uhci_piix4_initfn(PCIDevice *dev)
>      return usb_uhci_common_initfn(s);
>  }
>  
> +static int usb_uhci_vt82c686b_initfn(PCIDevice *dev)
> +{
> +    UHCIState *s = DO_UPCAST(UHCIState, dev, dev);
> +    uint8_t *pci_conf = s->dev.config;
> +
> +    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA);
> +    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_UHCI);
> +
> +    pci_set_long(pci_conf + 0x0c,0x00001600);
> +    pci_set_long(pci_conf + 0x20,0x00000301);
> +    pci_set_long(pci_conf + 0x34,0x00001080);
> +    pci_set_long(pci_conf + 0x3c,0x00000004);
> +    pci_set_long(pci_conf + 0x40,0x00001000);
> +    pci_set_long(pci_conf + 0x60,0x00000010);
> +    pci_set_long(pci_conf + 0x80,0x00020001);
> +    pci_set_long(pci_conf + 0xc0,0x00002000);

Do we have an idea what those hex values are? It would probably be a
good idea to add some comments and/or use values from hw/pci_regs.h

> +    return usb_uhci_common_initfn(s);
> +}
> +
>  static PCIDeviceInfo uhci_info[] = {
>      {
>          .qdev.name    = "piix3-usb-uhci",
> @@ -1164,6 +1184,11 @@ static PCIDeviceInfo uhci_info[] = {
>          .qdev.vmsd    = &vmstate_uhci,
>          .init         = usb_uhci_piix4_initfn,
>      },{
> +        .qdev.name    = "vt82c686b-usb-uhci",
> +        .qdev.size    = sizeof(UHCIState),
> +        .qdev.vmsd    = &vmstate_uhci,
> +        .init         = usb_uhci_vt82c686b_initfn,
> +    },{
>          /* end of list */
>      }
>  };
> @@ -1183,3 +1208,8 @@ void usb_uhci_piix4_init(PCIBus *bus, int devfn)
>  {
>      pci_create_simple(bus, devfn, "piix4-usb-uhci");
>  }
> +
> +void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn)
> +{
> +    pci_create_simple(bus, devfn, "vt82c686b-usb-uhci");
> +}
> diff --git a/hw/usb-uhci.h b/hw/usb-uhci.h
> index 911948e..3e4d377 100644
> --- a/hw/usb-uhci.h
> +++ b/hw/usb-uhci.h
> @@ -5,5 +5,6 @@
>  
>  void usb_uhci_piix3_init(PCIBus *bus, int devfn);
>  void usb_uhci_piix4_init(PCIBus *bus, int devfn);
> +void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn);
>  
>  #endif
> -- 
> 1.7.0.4
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

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

end of thread, other threads:[~2010-05-28 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 14:28 [Qemu-devel] [PATCH v2 4/6] MIPS: Initial support of VIA USB controller used by fulong mini pc Huacai Chen
2010-05-28 21:04 ` Aurelien Jarno

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).