summaryrefslogtreecommitdiff
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)
downloadu-boot-imx-ae3b770e4eae8e98b6e9e29662e18c47fdf0171f.zip
u-boot-imx-ae3b770e4eae8e98b6e9e29662e18c47fdf0171f.tar.gz
u-boot-imx-ae3b770e4eae8e98b6e9e29662e18c47fdf0171f.tar.bz2
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 1152f83..8753b9f 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 fafac89..419a7e3 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 */
/*