Patchwork [U-Boot] USB: ehci-mx6: Fix broken IO access

login
register
mail settings
Submitter Wolfgang Grandegger
Date May 2, 2012, 2:36 p.m.
Message ID <4FA14677.30206@denx.de>
Download mbox | patch
Permalink /patch/156475/
State Accepted
Commit 3f29d96218d985268c46a6821ba893d1ea2cbc8c
Delegated to: Stefano Babic
Headers show

Comments

Wolfgang Grandegger - May 2, 2012, 2:36 p.m.
To get USB working again on the i.MX6, this patch fixes a bug introduced
with commit 522b2a0 "Add proper IO accessors for mx6 usb registers.".
At that occasion, I also added the missing __iomem directive.

Cc: Marek Vasut <marex@denx.de>
CC: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
---
 drivers/usb/host/ehci-mx6.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
Fabio Estevam - May 2, 2012, 3:24 p.m.
On Wed, May 2, 2012 at 11:36 AM, Wolfgang Grandegger <wg@denx.de> wrote:
> To get USB working again on the i.MX6, this patch fixes a bug introduced
> with commit 522b2a0 "Add proper IO accessors for mx6 usb registers.".

Good catch on the usb register name change.

> At that occasion, I also added the missing __iomem directive.

Is this really needed?
Wolfgang Grandegger - May 2, 2012, 7:30 p.m.
Hi Fabio,

On 05/02/2012 05:24 PM, Fabio Estevam wrote:
> On Wed, May 2, 2012 at 11:36 AM, Wolfgang Grandegger <wg@denx.de> wrote:
>> To get USB working again on the i.MX6, this patch fixes a bug introduced
>> with commit 522b2a0 "Add proper IO accessors for mx6 usb registers.".
> 
> Good catch on the usb register name change.
> 
>> At that occasion, I also added the missing __iomem directive.
> 
> Is this really needed?

As I see it, __iomem is a dummy function in U-Boot. I just added it for
consistency reasons. If we remove it, we should also remove all other
__iomem's from that file. Maybe somebody else could clarify if __iomem
should be used.

Wolfgang.
Stefano Babic - May 6, 2012, 4:35 p.m.
On 02/05/2012 16:36, Wolfgang Grandegger wrote:
> To get USB working again on the i.MX6, this patch fixes a bug introduced
> with commit 522b2a0 "Add proper IO accessors for mx6 usb registers.".
> At that occasion, I also added the missing __iomem directive.
> 
> Cc: Marek Vasut <marex@denx.de>
> CC: Fabio Estevam <festevam@gmail.com>
> Signed-off-by: Wolfgang Grandegger <wg@denx.de>
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Patch

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 5dec673..42c77fe 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -73,7 +73,8 @@  static void usbh1_internal_phy_clock_gate(int on)
 
 static void usbh1_power_config(void)
 {
-	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+	struct anatop_regs __iomem *anatop =
+		(struct anatop_regs __iomem *)ANATOP_BASE_ADDR;
 	/*
 	 * Some phy and power's special controls for host1
 	 * 1. The external charger detector needs to be disabled
@@ -87,7 +88,7 @@  static void usbh1_power_config(void)
 		     &anatop->usb2_chrg_detect);
 
 	__raw_writel(ANADIG_USB2_PLL_480_CTRL_BYPASS,
-		     &anatop->usb2_pll_480_ctrl);
+		     &anatop->usb2_pll_480_ctrl_clr);
 
 	__raw_writel(ANADIG_USB2_PLL_480_CTRL_ENABLE |
 		     ANADIG_USB2_PLL_480_CTRL_POWER |