Commit 08406f54 authored by Arnaud Patard (Rtp)'s avatar Arnaud Patard (Rtp) Committed by Sascha Hauer

arch/arm/plat-mxc/ehci.c: fix errors/typos

This patch is fixing some issues :

- MXC_OTG_UCTRL_OPM_BIT is for USBCTRL register and not PHYCTRL register.
- the MXC_EHCI_WAKEUP_ENABLED check was only clearing the bits so never allows
  to set them.
Signed-off-by: default avatarArnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
parent 0d95b75e
...@@ -278,10 +278,13 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) ...@@ -278,10 +278,13 @@ int mxc_initialize_usb_hw(int port, unsigned int flags)
if (flags & MXC_EHCI_INTERNAL_PHY) { if (flags & MXC_EHCI_INTERNAL_PHY) {
v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET); v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
if (flags & MXC_EHCI_POWER_PINS_ENABLED) if (flags & MXC_EHCI_POWER_PINS_ENABLED) {
v |= (MXC_OTG_PHYCTRL_OC_DIS_BIT | MXC_OTG_UCTRL_OPM_BIT); /* OC/USBPWR is not used */ /* OC/USBPWR is not used */
else v |= MXC_OTG_PHYCTRL_OC_DIS_BIT;
v &= ~(MXC_OTG_PHYCTRL_OC_DIS_BIT | MXC_OTG_UCTRL_OPM_BIT); /* OC/USBPWR is used */ } else {
/* OC/USBPWR is used */
v &= ~MXC_OTG_PHYCTRL_OC_DIS_BIT;
}
__raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET); __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC_OFFSET);
v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET); v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
...@@ -289,16 +292,23 @@ int mxc_initialize_usb_hw(int port, unsigned int flags) ...@@ -289,16 +292,23 @@ int mxc_initialize_usb_hw(int port, unsigned int flags)
v |= MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup enable */ v |= MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup enable */
else else
v &= ~MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup disable */ v &= ~MXC_OTG_UCTRL_OWIE_BIT;/* OTG wakeup disable */
if (flags & MXC_EHCI_POWER_PINS_ENABLED)
v |= MXC_OTG_UCTRL_OPM_BIT;
else
v &= ~MXC_OTG_UCTRL_OPM_BIT;
__raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET); __raw_writel(v, usbother_base + MXC_USBCTRL_OFFSET);
} }
break; break;
case 1: /* Host 1 */ case 1: /* Host 1 */
/*Host ULPI */ /*Host ULPI */
v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET); v = __raw_readl(usbother_base + MXC_USBCTRL_OFFSET);
if (flags & MXC_EHCI_WAKEUP_ENABLED) if (flags & MXC_EHCI_WAKEUP_ENABLED) {
v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);/* HOST1 wakeup/ULPI intr disable */ /* HOST1 wakeup/ULPI intr enable */
else v |= (MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);
v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);/* HOST1 wakeup/ULPI intr disable */ } else {
/* HOST1 wakeup/ULPI intr disable */
v &= ~(MXC_H1_UCTRL_H1WIE_BIT | MXC_H1_UCTRL_H1UIE_BIT);
}
if (flags & MXC_EHCI_POWER_PINS_ENABLED) if (flags & MXC_EHCI_POWER_PINS_ENABLED)
v &= ~MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/ v &= ~MXC_H1_UCTRL_H1PM_BIT; /* HOST1 power mask used*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment