Re: [PATCH v2 1/4] phy: Add new Exynos5 USB 3.0 PHY driver

2013-12-23 Thread Vivek Gautam
Hi All,


On Wed, Dec 4, 2013 at 3:39 PM, Vivek Gautam gautam.vi...@samsung.com wrote:
 Add a new driver for the USB 3.0 PHY on Exynos5 series of SoCs.
 The new driver uses the generic PHY framework and will interact
 with DWC3 controller present on Exynos5 series of SoCs.
 Thereby, removing old phy-samsung-usb3 driver and related code
 used untill now which was based on usb/phy framework.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 ---

a humble ping !! :-)
Any comments on this patch ?

  .../devicetree/bindings/phy/samsung-phy.txt|   43 ++
  drivers/phy/Kconfig|8 +
  drivers/phy/Makefile   |1 +
  drivers/phy/phy-exynos5-usb3.c |  545 
 
  drivers/usb/phy/Kconfig|   10 +-
  drivers/usb/phy/Makefile   |1 -
  drivers/usb/phy/phy-samsung-usb.h  |   80 ---
  drivers/usb/phy/phy-samsung-usb3.c |  350 -
  8 files changed, 598 insertions(+), 440 deletions(-)
  create mode 100644 drivers/phy/phy-exynos5-usb3.c
  delete mode 100644 drivers/usb/phy/phy-samsung-usb3.c

 diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt 
 b/Documentation/devicetree/bindings/phy/samsung-phy.txt
 index c0fccaa..bcd95dd 100644
 --- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
 +++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
 @@ -20,3 +20,46 @@ Required properties:
  - compatible : should be samsung,exynos5250-dp-video-phy;
  - reg : offset and length of the Display Port PHY register set;
  - #phy-cells : from the generic PHY bindings, must be 0;
 +
 +Samsung Exynos5 SoC series USB 3.0 PHY controller
 +--
 +
 +Required properties:
 +- compatible : Should be set to one of the following supported values:
 +   - samsung,exynos5250-usb3phy - for exynos5250 SoC,
 +   - samsung,exynos5420-usb3phy - for exynos5420 SoC.
 +- reg : Register offset and length of USB 3.0 PHY register set;
 +- clocks: Clock IDs array as required by the controller
 +- clock-names: names of clocks correseponding to IDs in the clock property;
 +   Required clocks:
 +   - phy: main PHY clock (same as USB 3.0 controller IP clock),
 +used for register access.
 +   - usb3phy_refclk: PHY's reference clock (usually crystal clock), 
 associated
 +  by phy name, used to determine bit values for clock
 +  settings register.
 +   Additional clock required for Exynos5420:
 +   - usb30_sclk_100m: Additional special clock used for PHY operation
 +  depicted as 'sclk_usbphy30' in CMU of Exynos5420.
 +- samsung,syscon-phandle: phandle for syscon interface, which is used to
 +   control pmu registers for power isolation.
 +- #phy-cells : from the generic PHY bindings, must be 0;
 +
 +Example:
 +   usb3_phy: usbphy@1210 {
 +   compatible = samsung,exynos5250-usb3phy;
 +   reg = 0x1210 0x100;
 +   clocks = clock 286, clock 1;
 +   clock-names = phy, usb3phy_refclk;
 +   samsung,syscon-phandle = pmu_syscon;
 +   #phy-cells = 0;
 +   };
 +
 +- aliases: For SoCs like Exynos5420 having multiple USB PHY controllers,
 +  'usb3_phy' nodes should have numbered alias in the aliases node,
 +  in the form of usb3phyN, N = 0, 1... (depending on number of
 +  controllers).
 +Example:
 +   aliases {
 +   usb3phy0 = usb3_phy0;
 +   usb3phy1 = usb3_phy1;
 +   };
 diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
 index a344f3d..67e9045 100644
 --- a/drivers/phy/Kconfig
 +++ b/drivers/phy/Kconfig
 @@ -51,4 +51,12 @@ config PHY_EXYNOS_DP_VIDEO
 help
   Support for Display Port PHY found on Samsung EXYNOS SoCs.

 +config PHY_EXYNOS5_USB3
 +   tristate Exynos5 SoC series USB 3.0 PHY driver
 +   depends on ARCH_EXYNOS5
 +   select GENERIC_PHY
 +   select MFD_SYSCON
 +   help
 + Enable USB 3.0 PHY support for Exynos 5 SoC series
 +
  endmenu
 diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
 index d0caae9..9c06a61 100644
 --- a/drivers/phy/Makefile
 +++ b/drivers/phy/Makefile
 @@ -7,3 +7,4 @@ obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)   += 
 phy-exynos-dp-video.o
  obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO)+= phy-exynos-mipi-video.o
  obj-$(CONFIG_OMAP_USB2)+= phy-omap-usb2.o
  obj-$(CONFIG_TWL4030_USB)  += phy-twl4030-usb.o
 +obj-$(CONFIG_PHY_EXYNOS5_USB3) += phy-exynos5-usb3.o
 diff --git a/drivers/phy/phy-exynos5-usb3.c b/drivers/phy/phy-exynos5-usb3.c
 new file mode 100644
 index 000..2bafc9d
 --- /dev/null
 +++ b/drivers/phy/phy-exynos5-usb3.c
 @@ -0,0 +1,545 @@
 +/*
 + * Samsung EXYNOS5 SoC series USB 3.0 PHY driver
 + *
 + * Copyright (C) 2013 Samsung 

Re: [PATCH v2 1/4] phy: Add new Exynos5 USB 3.0 PHY driver

2013-12-23 Thread Vivek Gautam
Hi Felipe,


On Mon, Dec 23, 2013 at 10:18 PM, Felipe Balbi ba...@ti.com wrote:
 Hi,

 On Mon, Dec 23, 2013 at 02:41:15PM +0530, Vivek Gautam wrote:
 On Wed, Dec 4, 2013 at 3:39 PM, Vivek Gautam gautam.vi...@samsung.com 
 wrote:
  Add a new driver for the USB 3.0 PHY on Exynos5 series of SoCs.
  The new driver uses the generic PHY framework and will interact
  with DWC3 controller present on Exynos5 series of SoCs.
  Thereby, removing old phy-samsung-usb3 driver and related code
  used untill now which was based on usb/phy framework.
 
  Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
  ---

 a humble ping !! :-)
 Any comments on this patch ?

 This is Kishon's domain. I think he's on vacations by now...

Right, :-)


  diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
  index a344f3d..67e9045 100644
  --- a/drivers/phy/Kconfig
  +++ b/drivers/phy/Kconfig
  @@ -51,4 +51,12 @@ config PHY_EXYNOS_DP_VIDEO
  help
Support for Display Port PHY found on Samsung EXYNOS SoCs.
 
  +config PHY_EXYNOS5_USB3
  +   tristate Exynos5 SoC series USB 3.0 PHY driver
  +   depends on ARCH_EXYNOS5

 I would add || COMPILE_TEST here and make sure this builds on other
 arches too.

Sure i will add this.


 The rest of the driver looks all right to my eyes.

Thanks Felipe for the review. :-)


 Reviewed-by: Felipe Balbi ba...@ti.com

 --
 balbi



-- 
Best Regards
Vivek Gautam
Samsung RD Institute, Bangalore
India
--
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


[PATCH v2 1/4] phy: Add new Exynos5 USB 3.0 PHY driver

2013-12-04 Thread Vivek Gautam
Add a new driver for the USB 3.0 PHY on Exynos5 series of SoCs.
The new driver uses the generic PHY framework and will interact
with DWC3 controller present on Exynos5 series of SoCs.
Thereby, removing old phy-samsung-usb3 driver and related code
used untill now which was based on usb/phy framework.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
---
 .../devicetree/bindings/phy/samsung-phy.txt|   43 ++
 drivers/phy/Kconfig|8 +
 drivers/phy/Makefile   |1 +
 drivers/phy/phy-exynos5-usb3.c |  545 
 drivers/usb/phy/Kconfig|   10 +-
 drivers/usb/phy/Makefile   |1 -
 drivers/usb/phy/phy-samsung-usb.h  |   80 ---
 drivers/usb/phy/phy-samsung-usb3.c |  350 -
 8 files changed, 598 insertions(+), 440 deletions(-)
 create mode 100644 drivers/phy/phy-exynos5-usb3.c
 delete mode 100644 drivers/usb/phy/phy-samsung-usb3.c

diff --git a/Documentation/devicetree/bindings/phy/samsung-phy.txt 
b/Documentation/devicetree/bindings/phy/samsung-phy.txt
index c0fccaa..bcd95dd 100644
--- a/Documentation/devicetree/bindings/phy/samsung-phy.txt
+++ b/Documentation/devicetree/bindings/phy/samsung-phy.txt
@@ -20,3 +20,46 @@ Required properties:
 - compatible : should be samsung,exynos5250-dp-video-phy;
 - reg : offset and length of the Display Port PHY register set;
 - #phy-cells : from the generic PHY bindings, must be 0;
+
+Samsung Exynos5 SoC series USB 3.0 PHY controller
+--
+
+Required properties:
+- compatible : Should be set to one of the following supported values:
+   - samsung,exynos5250-usb3phy - for exynos5250 SoC,
+   - samsung,exynos5420-usb3phy - for exynos5420 SoC.
+- reg : Register offset and length of USB 3.0 PHY register set;
+- clocks: Clock IDs array as required by the controller
+- clock-names: names of clocks correseponding to IDs in the clock property;
+   Required clocks:
+   - phy: main PHY clock (same as USB 3.0 controller IP clock),
+used for register access.
+   - usb3phy_refclk: PHY's reference clock (usually crystal clock), 
associated
+  by phy name, used to determine bit values for clock
+  settings register.
+   Additional clock required for Exynos5420:
+   - usb30_sclk_100m: Additional special clock used for PHY operation
+  depicted as 'sclk_usbphy30' in CMU of Exynos5420.
+- samsung,syscon-phandle: phandle for syscon interface, which is used to
+   control pmu registers for power isolation.
+- #phy-cells : from the generic PHY bindings, must be 0;
+
+Example:
+   usb3_phy: usbphy@1210 {
+   compatible = samsung,exynos5250-usb3phy;
+   reg = 0x1210 0x100;
+   clocks = clock 286, clock 1;
+   clock-names = phy, usb3phy_refclk;
+   samsung,syscon-phandle = pmu_syscon;
+   #phy-cells = 0;
+   };
+
+- aliases: For SoCs like Exynos5420 having multiple USB PHY controllers,
+  'usb3_phy' nodes should have numbered alias in the aliases node,
+  in the form of usb3phyN, N = 0, 1... (depending on number of
+  controllers).
+Example:
+   aliases {
+   usb3phy0 = usb3_phy0;
+   usb3phy1 = usb3_phy1;
+   };
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index a344f3d..67e9045 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -51,4 +51,12 @@ config PHY_EXYNOS_DP_VIDEO
help
  Support for Display Port PHY found on Samsung EXYNOS SoCs.
 
+config PHY_EXYNOS5_USB3
+   tristate Exynos5 SoC series USB 3.0 PHY driver
+   depends on ARCH_EXYNOS5
+   select GENERIC_PHY
+   select MFD_SYSCON
+   help
+ Enable USB 3.0 PHY support for Exynos 5 SoC series
+
 endmenu
diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile
index d0caae9..9c06a61 100644
--- a/drivers/phy/Makefile
+++ b/drivers/phy/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_PHY_EXYNOS_DP_VIDEO)   += phy-exynos-dp-video.o
 obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO)+= phy-exynos-mipi-video.o
 obj-$(CONFIG_OMAP_USB2)+= phy-omap-usb2.o
 obj-$(CONFIG_TWL4030_USB)  += phy-twl4030-usb.o
+obj-$(CONFIG_PHY_EXYNOS5_USB3) += phy-exynos5-usb3.o
diff --git a/drivers/phy/phy-exynos5-usb3.c b/drivers/phy/phy-exynos5-usb3.c
new file mode 100644
index 000..2bafc9d
--- /dev/null
+++ b/drivers/phy/phy-exynos5-usb3.c
@@ -0,0 +1,545 @@
+/*
+ * Samsung EXYNOS5 SoC series USB 3.0 PHY driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Vivek Gautam gautam.vi...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free