Module Name:    src
Committed By:   matt
Date:           Wed Feb 16 18:46:37 UTC 2011

Modified Files:
        src/sys/arch/powerpc/booke/dev: pq3ehci.c

Log Message:
Use LE bus space tag for EHCI register access.
Initialize SNOOP for all of RAM.
Use IPL_USB


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/booke/dev/pq3ehci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/booke/dev/pq3ehci.c
diff -u src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.2 src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.3
--- src/sys/arch/powerpc/booke/dev/pq3ehci.c:1.2	Tue Jan 18 01:02:53 2011
+++ src/sys/arch/powerpc/booke/dev/pq3ehci.c	Wed Feb 16 18:46:37 2011
@@ -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",

Reply via email to