| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: gcscehci.c,v 1.4 2008/07/06 08:01:15 cegger Exp $ */ | | 1 | /* $NetBSD: gcscehci.c,v 1.5 2009/05/04 12:15:51 cegger Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2001, 2002, 2007 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001, 2002, 2007 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Lennart Augustsson (lennart@augustsson.net) | | 8 | * by Lennart Augustsson (lennart@augustsson.net) |
9 | * and Jared D. McNeill (jmcneill@invisible.ca) | | 9 | * and Jared D. McNeill (jmcneill@invisible.ca) |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30 | * POSSIBILITY OF SUCH DAMAGE. | | 30 | * POSSIBILITY OF SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: gcscehci.c,v 1.4 2008/07/06 08:01:15 cegger Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: gcscehci.c,v 1.5 2009/05/04 12:15:51 cegger Exp $"); |
35 | | | 35 | |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/kernel.h> | | 38 | #include <sys/kernel.h> |
39 | #include <sys/device.h> | | 39 | #include <sys/device.h> |
40 | #include <sys/proc.h> | | 40 | #include <sys/proc.h> |
41 | #include <sys/queue.h> | | 41 | #include <sys/queue.h> |
42 | | | 42 | |
43 | #include <machine/bus.h> | | 43 | #include <machine/bus.h> |
44 | #include <machine/cpufunc.h> | | 44 | #include <machine/cpufunc.h> |
45 | | | 45 | |
46 | #include <dev/pci/pcidevs.h> | | 46 | #include <dev/pci/pcidevs.h> |
47 | #include <dev/pci/pcivar.h> | | 47 | #include <dev/pci/pcivar.h> |
| @@ -63,42 +63,42 @@ extern int ehcidebug; | | | @@ -63,42 +63,42 @@ extern int ehcidebug; |
63 | #endif | | 63 | #endif |
64 | | | 64 | |
65 | #define GCSCUSB_MSR_BASE 0x51200000 | | 65 | #define GCSCUSB_MSR_BASE 0x51200000 |
66 | #define GCSCUSB_MSR_EHCB (GCSCUSB_MSR_BASE + 0x09) | | 66 | #define GCSCUSB_MSR_EHCB (GCSCUSB_MSR_BASE + 0x09) |
67 | | | 67 | |
68 | struct gcscehci_softc { | | 68 | struct gcscehci_softc { |
69 | ehci_softc_t sc; | | 69 | ehci_softc_t sc; |
70 | pci_chipset_tag_t sc_pc; | | 70 | pci_chipset_tag_t sc_pc; |
71 | pcitag_t sc_tag; | | 71 | pcitag_t sc_tag; |
72 | void *sc_ih; /* interrupt vectoring */ | | 72 | void *sc_ih; /* interrupt vectoring */ |
73 | }; | | 73 | }; |
74 | | | 74 | |
75 | static int | | 75 | static int |
76 | gcscehci_match(struct device *parent, struct cfdata *match, void *aux) | | 76 | gcscehci_match(device_t parent, cfdata_t match, void *aux) |
77 | { | | 77 | { |
78 | struct pci_attach_args *pa = (struct pci_attach_args *) aux; | | 78 | struct pci_attach_args *pa = (struct pci_attach_args *) aux; |
79 | | | 79 | |
80 | if (PCI_CLASS(pa->pa_class) == PCI_CLASS_SERIALBUS && | | 80 | if (PCI_CLASS(pa->pa_class) == PCI_CLASS_SERIALBUS && |
81 | PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_SERIALBUS_USB && | | 81 | PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_SERIALBUS_USB && |
82 | PCI_INTERFACE(pa->pa_class) == PCI_INTERFACE_EHCI && | | 82 | PCI_INTERFACE(pa->pa_class) == PCI_INTERFACE_EHCI && |
83 | PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD && | | 83 | PCI_VENDOR(pa->pa_id) == PCI_VENDOR_AMD && |
84 | PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_CS5536_EHCI) | | 84 | PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_CS5536_EHCI) |
85 | return (10); /* beat ehci_pci */ | | 85 | return (10); /* beat ehci_pci */ |
86 | | | 86 | |
87 | return (0); | | 87 | return (0); |
88 | } | | 88 | } |
89 | | | 89 | |
90 | static void | | 90 | static void |
91 | gcscehci_attach(struct device *parent, struct device *self, void *aux) | | 91 | gcscehci_attach(device_t parent, device_t self, void *aux) |
92 | { | | 92 | { |
93 | struct gcscehci_softc *sc = device_private(self); | | 93 | struct gcscehci_softc *sc = device_private(self); |
94 | struct pci_attach_args *pa = (struct pci_attach_args *)aux; | | 94 | struct pci_attach_args *pa = (struct pci_attach_args *)aux; |
95 | pci_chipset_tag_t pc = pa->pa_pc; | | 95 | pci_chipset_tag_t pc = pa->pa_pc; |
96 | pcitag_t tag = pa->pa_tag; | | 96 | pcitag_t tag = pa->pa_tag; |
97 | char const *intrstr; | | 97 | char const *intrstr; |
98 | pci_intr_handle_t ih; | | 98 | pci_intr_handle_t ih; |
99 | const char *vendor; | | 99 | const char *vendor; |
100 | const char *devname = device_xname(self); | | 100 | const char *devname = device_xname(self); |
101 | char devinfo[256]; | | 101 | char devinfo[256]; |
102 | usbd_status r; | | 102 | usbd_status r; |
103 | bus_addr_t ehcibase; | | 103 | bus_addr_t ehcibase; |
104 | int ncomp; | | 104 | int ncomp; |