summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMarkus Klotzbuecher <mk@denx.de>2006-11-27 11:46:46 +0100
committerMarkus Klotzbuecher <mk@pollux.denx.de>2006-11-27 11:46:46 +0100
commitae3b770e4eae8e98b6e9e29662e18c47fdf0171f (patch)
tree902aa56bab47d79b5b67e55bc13cb92a168236df /include
parent7b59b3c7a8ce2e4b567abf99c1cd667bf35b9418 (diff)
downloadtalos-obmc-uboot-ae3b770e4eae8e98b6e9e29662e18c47fdf0171f.tar.gz
talos-obmc-uboot-ae3b770e4eae8e98b6e9e29662e18c47fdf0171f.zip
Fix some endianness issues related to the generic ohci driver
Diffstat (limited to 'include')
-rw-r--r--include/configs/IceCube.h9
-rw-r--r--include/usb.h15
2 files changed, 17 insertions, 7 deletions
diff --git a/include/configs/IceCube.h b/include/configs/IceCube.h
index 1152f838d9..8753b9ff6f 100644
--- a/include/configs/IceCube.h
+++ b/include/configs/IceCube.h
@@ -94,9 +94,16 @@
/* USB */
#if 1
-#define CONFIG_USB_OHCI
+#define CONFIG_USB_OHCI_NEW
#define ADD_USB_CMD CFG_CMD_USB | CFG_CMD_FAT
#define CONFIG_USB_STORAGE
+
+#undef CFG_USB_OHCI_BOARD_INIT
+#define CFG_USB_OHCI_CPU_INIT
+#define CFG_USB_OHCI_REGS_BASE MPC5XXX_USB
+#define CFG_USB_OHCI_SLOT_NAME "mpc5200"
+#define CFG_USB_OHCI_MAX_ROOT_PORTS 15
+
#else
#define ADD_USB_CMD 0
#endif
diff --git a/include/usb.h b/include/usb.h
index fafac8934a..419a7e364a 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -230,16 +230,12 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
/* big endian -> little endian conversion */
/* some CPUs are already little endian e.g. the ARM920T */
-#ifdef LITTLEENDIAN
-#define swap_16(x) ((unsigned short)(x))
-#define swap_32(x) ((unsigned long)(x))
-#else
-#define swap_16(x) \
+#define __swap_16(x) \
({ unsigned short x_ = (unsigned short)x; \
(unsigned short)( \
((x_ & 0x00FFU) << 8) | ((x_ & 0xFF00U) >> 8) ); \
})
-#define swap_32(x) \
+#define __swap_32(x) \
({ unsigned long x_ = (unsigned long)x; \
(unsigned long)( \
((x_ & 0x000000FFUL) << 24) | \
@@ -247,6 +243,13 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
((x_ & 0x00FF0000UL) >> 8) | \
((x_ & 0xFF000000UL) >> 24) ); \
})
+
+#ifdef LITTLEENDIAN
+# define swap_16(x) (x)
+# define swap_32(x) (x)
+#else
+# define swap_16(x) __swap_16(x)
+# define swap_32(x) __swap_32(x)
#endif /* LITTLEENDIAN */
/*
OpenPOWER on IntegriCloud