Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/booke/dev Use LE bus space tag for EHCI reg...
details: https://anonhg.NetBSD.org/src/rev/749685297150
branches: trunk
changeset: 762148:749685297150
user: matt <matt%NetBSD.org@localhost>
date: Wed Feb 16 18:46:37 2011 +0000
description:
Use LE bus space tag for EHCI register access.
Initialize SNOOP for all of RAM.
Use IPL_USB
diffstat:
sys/arch/powerpc/booke/dev/pq3ehci.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diffs (45 lines):
diff -r c053c1d45cf7 -r 749685297150 sys/arch/powerpc/booke/dev/pq3ehci.c
--- a/sys/arch/powerpc/booke/dev/pq3ehci.c Wed Feb 16 18:45:33 2011 +0000
+++ b/sys/arch/powerpc/booke/dev/pq3ehci.c Wed Feb 16 18:46:37 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pq3ehci.c,v 1.2 2011/01/18 01:02:53 matt Exp $ */
+/* $NetBSD: pq3ehci.c,v 1.3 2011/02/16 18:46:37 matt Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pq3ehci.c,v 1.2 2011/01/18 01:02:53 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3ehci.c,v 1.3 2011/02/16 18:46:37 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,7 +90,7 @@
int error;
psc->sc_children |= cna->cna_childmask;
- sc->sc.iot = cna->cna_memt;
+ sc->sc.iot = cna->cna_le_memt; /* EHCI registers are little endian */
sc->sc.sc_dev = self;
sc->sc.sc_bus.dmatag = cna->cna_dmat;
sc->sc.sc_bus.hci_private = sc;
@@ -111,7 +111,16 @@
}
sc->sc.sc_size = cnl->cnl_size;
- sc->sc_ih = intr_establish(cnl->cnl_intrs[0], IPL_VM, IST_ONCHIP,
+ /*
+ * We need to tell the USB interface to snoop all off RAM starting
+ * at 0. Since it can do it by powers of 2, get the highest RAM
+ * address and roughly round it to the next power of 2 and find
+ * the number of leading zero bits.
+ */
+ cpu_write_4(cnl->cnl_addr + USB_SNOOP1,
+ SNOOP_2GB - __builtin_clz(curcpu()->ci_softc->cpu_highmem * 2 - 1));
+
+ sc->sc_ih = intr_establish(cnl->cnl_intrs[0], IPL_USB, IST_ONCHIP,
ehci_intr, sc);
if (sc->sc_ih == NULL) {
aprint_error_dev(self, "failed to establish interrupt %d\n",
Home |
Main Index |
Thread Index |
Old Index