Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/ralink Clean these up and move some defines to...



details:   https://anonhg.NetBSD.org/src/rev/5173e5ca67c0
branches:  trunk
changeset: 329019:5173e5ca67c0
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Apr 29 17:10:07 2014 +0000

description:
Clean these up and move some defines to ralink_reg.h

diffstat:

 sys/arch/mips/ralink/ralink_ehci.c |  13 +++++--------
 sys/arch/mips/ralink/ralink_ohci.c |  15 ++++++---------
 2 files changed, 11 insertions(+), 17 deletions(-)

diffs (101 lines):

diff -r ce428a5361be -r 5173e5ca67c0 sys/arch/mips/ralink/ralink_ehci.c
--- a/sys/arch/mips/ralink/ralink_ehci.c        Tue Apr 29 17:09:17 2014 +0000
+++ b/sys/arch/mips/ralink/ralink_ehci.c        Tue Apr 29 17:10:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_ehci.c,v 1.3 2012/07/20 02:14:02 matt Exp $     */
+/*     $NetBSD: ralink_ehci.c,v 1.4 2014/04/29 17:10:07 matt Exp $     */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ralink_ehci.c -- Ralink EHCI USB Driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ralink_ehci.c,v 1.3 2012/07/20 02:14:02 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_ehci.c,v 1.4 2014/04/29 17:10:07 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -47,9 +47,6 @@
 #include <mips/ralink/ralink_var.h>
 #include <mips/ralink/ralink_reg.h>
 
-#define RT3XXX_EHCI_BASE       0x101c0000
-#define RT3XXX_BLOCK_SIZE      0x1000
-
 struct ralink_ehci_softc {
        struct ehci_softc       sc_ehci;
        void                    *sc_ih;
@@ -122,14 +119,14 @@
        bus_space_unmap(ma->ma_memt, sysctl_memh, 0x10000);
 
        /* Map EHCI registers */
-       if ((error = bus_space_map(sc->sc_ehci.iot, RT3XXX_EHCI_BASE,
-           RT3XXX_BLOCK_SIZE, 0, &sc->sc_ehci.ioh)) != 0) {
+       if ((error = bus_space_map(sc->sc_ehci.iot, RA_USB_EHCI_BASE,
+           RA_USB_BLOCK_SIZE, 0, &sc->sc_ehci.ioh)) != 0) {
                aprint_error_dev(self, "can't map EHCI registers, "
                        "error=%d\n", error);
                return;
        }
 
-       sc->sc_ehci.sc_size = RT3XXX_BLOCK_SIZE;
+       sc->sc_ehci.sc_size = RA_USB_BLOCK_SIZE;
        sc->sc_ehci.sc_bus.usbrev = USBREV_2_0;
 
 #ifdef RALINK_EHCI_DEBUG
diff -r ce428a5361be -r 5173e5ca67c0 sys/arch/mips/ralink/ralink_ohci.c
--- a/sys/arch/mips/ralink/ralink_ohci.c        Tue Apr 29 17:09:17 2014 +0000
+++ b/sys/arch/mips/ralink/ralink_ohci.c        Tue Apr 29 17:10:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_ohci.c,v 1.2 2011/07/28 15:38:49 matt Exp $     */
+/*     $NetBSD: ralink_ohci.c,v 1.3 2014/04/29 17:10:07 matt Exp $     */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -31,7 +31,7 @@
 #include "ehci.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ralink_ohci.c,v 1.2 2011/07/28 15:38:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_ohci.c,v 1.3 2014/04/29 17:10:07 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -51,9 +51,6 @@
 #define OREAD4(sc, a) bus_space_read_4((sc)->iot, (sc)->ioh, (a))
 #define OWRITE4(sc, a, x) bus_space_write_4((sc)->iot, (sc)->ioh, (a), (x))
 
-#define RT3XXX_OHCI_BASE       0x101c1000
-#define RT3XXX_BLOCK_SIZE      0x1000
-
 struct ralink_ohci_softc {
        struct ohci_softc sc_ohci;
 #if NEHCI > 0
@@ -86,7 +83,7 @@
 ralink_ohci_attach(device_t parent, device_t self, void *aux)
 {
        struct ralink_ohci_softc * const sc = device_private(self);
-       const struct mainbus_attach_args *ma = aux;
+       const struct mainbus_attach_args * const ma = aux;
        usbd_status status;
        int error;
 #ifdef RALINK_OHCI_DEBUG
@@ -102,14 +99,14 @@
        sc->sc_ohci.sc_bus.dmatag = ma->ma_dmat;
 
        /* Map I/O registers */
-       if ((error = bus_space_map(sc->sc_ohci.iot, RT3XXX_OHCI_BASE,
-           RT3XXX_BLOCK_SIZE, 0, &sc->sc_ohci.ioh)) != 0) {
+       if ((error = bus_space_map(sc->sc_ohci.iot, RA_USB_OHCI_BASE,
+           RA_USB_BLOCK_SIZE, 0, &sc->sc_ohci.ioh)) != 0) {
                aprint_error_dev(self, "can't map OHCI registers, "
                        "error=%d\n", error);
                return;
        }
        
-       sc->sc_ohci.sc_size = RT3XXX_BLOCK_SIZE;
+       sc->sc_ohci.sc_size = RA_USB_BLOCK_SIZE;
 
 #ifdef RALINK_OHCI_DEBUG
        printf("%s sc: %p ma: %p\n", devname, sc, ma);



Home | Main Index | Thread Index | Old Index