mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-07-08 17:56:11 +00:00
ENGR00120698 iMX28 add usb write register work around
mx28 require read arc register before write. Signed-off-by: Frank Li <Frank.Li@freescale.com>
This commit is contained in:
@@ -489,6 +489,14 @@ config USB_ARC
|
||||
default USB_GADGET
|
||||
select USB_GADGET_SELECTED
|
||||
|
||||
config WORKAROUND_ARCUSB_REG_RW
|
||||
bool "work around mx28 arch register write"
|
||||
depends on ARCH_MX28 && USB_ARC
|
||||
default ARCH_MX28
|
||||
help
|
||||
MX28 require read ARC register before write. Use SWP intructure to
|
||||
implement this requirement.
|
||||
|
||||
config USB_GADGET_LANGWELL
|
||||
boolean "Intel Langwell USB Device Controller"
|
||||
depends on PCI
|
||||
|
||||
@@ -119,9 +119,19 @@ dr_wake_up_enable(struct fsl_udc *udc, bool enable)
|
||||
pdata->wake_up_enable(pdata, enable);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WORKAROUND_ARCUSB_REG_RW
|
||||
static void safe_writel(u32 val32, void *addr)
|
||||
{
|
||||
__asm__ ("swp %0, %0, [%1]" : : "r"(val32), "r"(addr));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
#define fsl_readl(addr) in_le32((addr))
|
||||
#define fsl_writel(addr, val32) out_le32((val32), (addr))
|
||||
#elif defined (CONFIG_WORKAROUND_ARCUSB_REG_RW)
|
||||
#define fsl_readl(addr) readl((addr))
|
||||
#define fsl_writel(val32, addr) safe_writel(val32, addr)
|
||||
#else
|
||||
#define fsl_readl(addr) readl((addr))
|
||||
#define fsl_writel(addr, val32) writel((addr), (val32))
|
||||
|
||||
Reference in New Issue
Block a user