On Mon, Sep 10, 2012 at 07:06:48PM -0700, Kuninori Morimoto wrote:
> This patch adds Renesas R-Car USB phy driver.
> It supports R8A7779 chip at this point.
> 
> R-Car has some USB controllers, but has only one phy-initializer.
> So, this driver is counting users.
> 

Hi Morimoto-san,

below is an incremental patch to add some workarounds that
were made available to me. I wonder if you have some documentation
available to replace the hex values with #defines?


From: Kouei Abe <kouei.abe...@rms.renesas.com>

arm: mach-rcar: Add USB-PHY workaround

Signed-off-by: Kouei Abe <kouei.abe...@rms.renesas.com>
Signed-off-by: Simon Horman <ho...@verge.net.au>
---
 drivers/usb/phy/Kconfig    |   21 +++++++++++++++++++++
 drivers/usb/phy/rcar-phy.c |    9 +++++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 7eb73c5..41e91a2 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -44,3 +44,24 @@ config USB_RCAR_PHY
 
          To compile this driver as a module, choose M here: the
          module will be called rcar-phy.
+
+choice
+       prompt "USB-RCAR-PHY workaround"
+       depends on USB_RCAR_PHY
+       default USB_PHY_MARZEN_010S
+       help
+         Select a workaround for the Renesas R-Car USB phy driver
+         based on the version the board in use.
+
+         If unsure select USB_PHY_MARZEN_010S.
+
+config USB_PHY_MARZEN_010S
+       bool "USB-RCAR-PHY workaround: Marzen R0P7779A00010S"
+       help
+         Renesas R-Car USB phy driver for Marzen R0P7779A00010S.
+
+config USB_PHY_MARZEN_110S
+       bool "USB-RCAR-PHY workaround: Marzen R0P7779A00110S"
+       help
+         Renesas R-Car USB phy driver for Marzen R0P7779A00010S.
+endchoice
diff --git a/drivers/usb/phy/rcar-phy.c b/drivers/usb/phy/rcar-phy.c
index 3fce889..5bf1634 100644
--- a/drivers/usb/phy/rcar-phy.c
+++ b/drivers/usb/phy/rcar-phy.c
@@ -86,6 +86,15 @@ static int rcar_usb_phy_init(struct usb_phy *phy)
                /* (2) start USB-PHY internal PLL */
                iowrite32(PHY_ENB | PLL_ENB, (reg0 + USBPCTRL1));
 
+               /* work around of USB-PHY */
+#ifdef CONFIG_USB_PHY_MARZEN_010S
+               writel(0x10700040, (reg0 + 0x0850));
+               writel(0x00007700, (reg0 + 0x085C));
+#elif CONFIG_USB_PHY_MARZEN_110S
+               writel(0x10B00040, (reg0 + 0x0850));
+               writel(0x00007700, (reg0 + 0x085C));
+#endif
+
                /* (3) USB module status check */
                for (i = 0; i < 1024; i++) {
                        udelay(10);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to