USB: EXYNOS: Set USB 2.0 HOST Link mode
authorRajeshwari Shinde <rajeshwari.s@samsung.com>
Mon, 14 May 2012 05:52:02 +0000 (05:52 +0000)
committerMarek Vasut <marex@denx.de>
Mon, 9 Jul 2012 16:27:55 +0000 (18:27 +0200)
This patch adds a function to set usb host mode to USB 2.0 HOST Link
for EXYNOS5

Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
arch/arm/cpu/armv7/exynos/system.c
arch/arm/include/asm/arch-exynos/system.h
drivers/usb/host/ehci-exynos.c

index 6c34730b97dc65e1057bd147683409ebbc4a52ab..cc6ee031c7384b121f21e223ca3435b2e8fd6232 100644 (file)
 #include <asm/io.h>
 #include <asm/arch/system.h>
 
+static void exynos5_set_usbhost_mode(unsigned int mode)
+{
+       struct exynos5_sysreg *sysreg =
+               (struct exynos5_sysreg *)samsung_get_base_sysreg();
+       unsigned int phy_cfg;
+
+       /* Setting USB20PHY_CONFIG register to USB 2.0 HOST link */
+       if (mode == USB20_PHY_CFG_HOST_LINK_EN) {
+               setbits_le32(&sysreg->usb20phy_cfg,
+                               USB20_PHY_CFG_HOST_LINK_EN);
+       } else {
+               clrbits_le32(&sysreg->usb20phy_cfg,
+                               USB20_PHY_CFG_HOST_LINK_EN);
+       }
+}
+
+void set_usbhost_mode(unsigned int mode)
+{
+       if (cpu_is_exynos5())
+               exynos5_set_usbhost_mode(mode);
+}
+
 static void exynos4_set_system_display(void)
 {
        struct exynos4_sysreg *sysreg =
index c1d880f4ce640e76e7ea629a4fef169073f181e0..42e1d21e53474f7f3bd49e7996e9948d96ee4cdc 100644 (file)
@@ -49,6 +49,9 @@ struct exynos5_sysreg {
 };
 #endif
 
+#define USB20_PHY_CFG_HOST_LINK_EN     (1 << 0)
+
+void set_usbhost_mode(unsigned int mode);
 void set_system_display_ctrl(void);
 
 #endif /* _EXYNOS4_SYSTEM_H */
index 3830c43b80ec7c442617e09d080f485495881678..90d66d3aa3c7252c560f62a5ce640d2415c9bdfa 100644 (file)
 #include <usb.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/ehci.h>
+#include <asm/arch/system.h>
 #include "ehci.h"
 #include "ehci-core.h"
 
 /* Setup the EHCI host controller. */
 static void setup_usb_phy(struct exynos_usb_phy *usb)
 {
+       set_usbhost_mode(USB20_PHY_CFG_HOST_LINK_EN);
+
        clrbits_le32(&usb->usbphyctrl0,
                        HOST_CTRL0_FSEL_MASK |
                        HOST_CTRL0_COMMONON_N |