Fix some endianness issues related to the generic ohci driver
This commit is contained in:
committed by
Markus Klotzbuecher
parent
7b59b3c7a8
commit
ae3b770e4e
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user