svn commit: r186350 - in projects/cambria/sys: arm/conf conf dev/usb
Sam Leffler
sam at FreeBSD.org
Fri Dec 19 18:45:42 PST 2008
Author: sam
Date: Sat Dec 20 02:45:42 2008
New Revision: 186350
URL: http://svn.freebsd.org/changeset/base/186350
Log:
add USB_EHCI_BIG_ENDIAN_DESC option to enable bi-endian EHCI descriptor
format handling and enable it for CAMBRIA
Modified:
projects/cambria/sys/arm/conf/CAMBRIA
projects/cambria/sys/conf/options
projects/cambria/sys/dev/usb/ehcivar.h
Modified: projects/cambria/sys/arm/conf/CAMBRIA
==============================================================================
--- projects/cambria/sys/arm/conf/CAMBRIA Sat Dec 20 01:29:19 2008 (r186349)
+++ projects/cambria/sys/arm/conf/CAMBRIA Sat Dec 20 02:45:42 2008 (r186350)
@@ -101,8 +101,8 @@ device random # Entrop
# NB: 2 USB 2.0 ports standard
device usb
-options USB_DEBUG
-device ohci
+options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order
+#options USB_DEBUG
device ehci
device ugen
device umass
Modified: projects/cambria/sys/conf/options
==============================================================================
--- projects/cambria/sys/conf/options Sat Dec 20 01:29:19 2008 (r186349)
+++ projects/cambria/sys/conf/options Sat Dec 20 02:45:42 2008 (r186350)
@@ -627,6 +627,7 @@ BUS_DEBUG opt_bus.h
# options for USB support
USB_DEBUG opt_usb.h
USBVERBOSE opt_usb.h
+USB_EHCI_BIG_ENDIAN_DESC opt_usb.h
U3G_DEBUG opt_u3g.h
UKBD_DFLT_KEYMAP opt_ukbd.h
UPLCOM_INTR_INTERVAL opt_uplcom.h
Modified: projects/cambria/sys/dev/usb/ehcivar.h
==============================================================================
--- projects/cambria/sys/dev/usb/ehcivar.h Sat Dec 20 01:29:19 2008 (r186349)
+++ projects/cambria/sys/dev/usb/ehcivar.h Sat Dec 20 02:45:42 2008 (r186350)
@@ -199,6 +199,7 @@ typedef struct ehci_softc {
#define EOWRITE2(sc, a, x) bus_space_write_2((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x))
#define EOWRITE4(sc, a, x) bus_space_write_4((sc)->iot, (sc)->ioh, (sc)->sc_offs+(a), (x))
+#ifdef USB_EHCI_BIG_ENDIAN_DESC
/*
* Handle byte order conversion between host and ``host controller''.
* Typically the latter is little-endian but some controllers require
@@ -227,6 +228,34 @@ hc16toh(const struct ehci_softc *sc, con
{
return sc->sc_flags & EHCI_SCFLG_BIGEDESC ? be16toh(v) : le16toh(v);
}
+#else
+/*
+ * Normal little-endian only conversion routines.
+ */
+static __inline uint32_t
+htohc32(const struct ehci_softc *sc, const uint32_t v)
+{
+ return htole32(v);
+}
+
+static __inline uint16_t
+htohc16(const struct ehci_softc *sc, const uint16_t v)
+{
+ return htole16(v);
+}
+
+static __inline uint32_t
+hc32toh(const struct ehci_softc *sc, const uint32_t v)
+{
+ return le32toh(v);
+}
+
+static __inline uint16_t
+hc16toh(const struct ehci_softc *sc, const uint16_t v)
+{
+ return le16toh(v);
+}
+#endif
usbd_status ehci_init(ehci_softc_t *);
int ehci_intr(void *);
More information about the svn-src-projects
mailing list