Re: [PATCH] usb: phy: Add USB host phy support on Exyno4412
Hi, Can split patch into two parts? One for USB tree, another for samsung tree. Thank you, Kyungmin Park On Tue, Feb 5, 2013 at 9:37 AM, Dongjin Kim tobet...@gmail.com wrote: This patch adds host phy support for Samsung's Exynos4412 SoC to samsung-usbphy driver and its device node. Cc: Praveen Paneri p.pan...@samsung.com Signed-off-by: Dongjin Kim tobet...@gmail.com --- arch/arm/boot/dts/exynos4412.dtsi | 13 drivers/usb/phy/samsung-usbphy.c | 156 - 2 files changed, 167 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi index 387aa27..c01d841 100644 --- a/arch/arm/boot/dts/exynos4412.dtsi +++ b/arch/arm/boot/dts/exynos4412.dtsi @@ -33,4 +33,17 @@ #address-cells = 1; #size-cells = 0; }; + + usbphy@125B { + #address-cells = 1; + #size-cells = 1; + compatible = samsung,exynos4412-usbphy; + reg = 0x125B 0x100; + status = disabled; + ranges; + + usbphy-sys { + reg = 0x10020704 0xc; + }; + }; }; diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c index 6ea5537..c800fa4 100644 --- a/drivers/usb/phy/samsung-usbphy.c +++ b/drivers/usb/phy/samsung-usbphy.c @@ -47,7 +47,7 @@ #define PHYCLK_MODE_USB11 (0x1 6) #define PHYCLK_EXT_OSC (0x1 5) -#define PHYCLK_COMMON_ON_N (0x1 4) +#define PHYCLK_COMMON_ON_N_PHY0(0x1 4) #define PHYCLK_ID_PULL (0x1 2) #define PHYCLK_CLKSEL_MASK (0x3 0) #define PHYCLK_CLKSEL_48M (0x0 0) @@ -60,6 +60,22 @@ #define RSTCON_HLINK_SWRST (0x1 1) #define RSTCON_SWRST (0x1 0) +/* For Exynos4412 */ +#define PHYCLK_COMMON_ON_N_PHY1(0x1 7) + +#define PHYPWR_NORMAL_MASK_HSIC1 (0x7 12) +#define PHYPWR_NORMAL_MASK_HSIC0 (0x7 9) +#define PHYPWR_NORMAL_MASK_PHY1(0x7 6) + +#define PHYPWR_ANALOG_POWERDOWN_PHY1 (0x1 7) + +#define RSTCON_HLINK_SWRST_MASK(0xf 7) +#define RSTCON_PHY1_SWRST_MASK (0xf 3) +#define RSTCON_PHY0_SWRST_MASK (0x7 0) + +#define EXYNOS4_PHY_HSIC_CTRL0 (0x04) +#define EXYNOS4_PHY_HSIC_CTRL1 (0x08) + /* EXYNOS5 */ #define EXYNOS5_PHY_HOST_CTRL0 (0x00) @@ -174,6 +190,7 @@ enum samsung_cpu_type { TYPE_S3C64XX, TYPE_EXYNOS4210, + TYPE_EXYNOS4412, TYPE_EXYNOS5250, }; @@ -322,6 +339,17 @@ static void samsung_usbphy_set_isolation(struct samsung_usbphy *sphy, bool on) en_mask = sphy-drv_data-hostphy_en_mask; } break; + case TYPE_EXYNOS4412: + if (sphy-phy_type == USB_PHY_TYPE_DEVICE) { + reg = sphy-pmuregs + + sphy-drv_data-devphy_reg_offset; + en_mask = sphy-drv_data-devphy_en_mask; + } else if (sphy-phy_type == USB_PHY_TYPE_HOST) { + reg = sphy-pmuregs + + sphy-drv_data-hostphy_reg_offset; + en_mask = sphy-drv_data-hostphy_en_mask; + } + break; default: dev_err(sphy-dev, Invalid SoC type\n); return; @@ -422,6 +450,29 @@ static int samsung_usbphy_get_refclk_freq(struct samsung_usbphy *sphy) refclk_freq = FSEL_CLKSEL_24M; break; } + } else if (sphy-drv_data-cpu_type == TYPE_EXYNOS4412) { + switch (clk_get_rate(ref_clk)) { + case 9600 * KHZ: + refclk_freq = FSEL_CLKSEL_9600K; + break; + case 10 * MHZ: + refclk_freq = FSEL_CLKSEL_10M; + break; + case 12 * MHZ: + refclk_freq = FSEL_CLKSEL_12M; + break; + case 19200 * KHZ: + refclk_freq = FSEL_CLKSEL_19200K; + break; + case 20 * MHZ: + refclk_freq = FSEL_CLKSEL_20M; + break; + case 24 * MHZ: + default: + /* default reference clock */ + refclk_freq = FSEL_CLKSEL_24M; + break; + } } else { switch (clk_get_rate(ref_clk)) { case 12 * MHZ
RE: [RFCv4 PATCH 01/13] usb: composite: add make_group and add_function operations
Hi, -Original Message- From: Sebastian Andrzej Siewior [mailto:bige...@linutronix.de] Sent: Friday, November 23, 2012 7:17 PM To: Michal Nazarewicz Cc: Andrzej Pietrasiewicz; linux-usb@vger.kernel.org; 'Kyungmin Park'; 'Felipe Balbi'; 'Greg Kroah-Hartman'; 'Joel Becker'; Marek Szyprowski Subject: Re: [RFCv4 PATCH 01/13] usb: composite: add make_group and add_function operations On 11/22/2012 09:48 PM, Michal Nazarewicz wrote: I think neither is correct. The reviewed-by tag implies that the person did a careful review of the code as per “Reviewer's statement of oversight” (see Documentation/SubmittingPatches). What actually happens is Kyungmin giving a green light to shipping the patch from copyright stand-point since Samsung is copyright holder and Andrzej has no power to say weather he can or cannot release the code. So logical path the code took was: Andrzej - Kyungmin - Andrzej - linux-usb Aha. So is Kyungmin a lawyer and not a hacker as I assumed in the first place. If you look at other patches coming from SPRC (including mine while I was working for Samsung) they all have the same Signed-off schema where the first line is of the author and second is of Kyungmin. This together with the statement above explains a lot to me. I always saw that and wondered how much code he can write. I assumed that Kyungmin was some kind of kick-ass hacker that knows all the chips very well and therefore writes all of the Samsung code ahead of HW and then is too busy with other stuff and so other people in his team push his patches mainline and deal with the review. I know that other companies work like that, where a small group of people does the bring-up and then others take their code and try to merge upstream. And this impressed me because Kyungmin is a person and not a small group. Anyway. Signed-off indicates that he was involved in code development but he was not. As it seems it me, his OKAY is very important why not add him as Acked-By: ... [copyright] I added the [copyright] as the subsystem since he did Ack only a part of the patch, not the functionality etc. I know that (now) but others might not. Even though all codes are not tested at internal tree, but most codes are tested internal tree. And these internal tree is managed by me. That's reason to add Signed-off as internal tree maintainer. And most of codes from us, I checked it by internal approval process. If you don't feel it's not correct Signed-off scheme. No problem to replace it with Reviewed-by or Acked-by. Thank you, Kyungmin Park Sebastian -- 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
RE: [RFCv4 PATCH 01/13] usb: composite: add make_group and add_function operations
One more, I checked it again Documentation/SubmittingPatches In the 12) Sign your work You can find the following paragraphs. Some people also put extra tags at the end. They'll just be ignored for now, but you can do this to mark internal company procedures or just point out some special detail about the sign-off. And 13) When to use Acked-by: and Cc: The Signed-off-by: tag indicates that the signer was involved in the development of the patch, or that he/she was in the patch's delivery path. I used Signed-off as our contribution to open source from our teams. Of course some codes are written by me with correct Signed-off Thank you, Kyungmin Park -Original Message- From: Kyungmin Park [mailto:kyungmin.p...@samsung.com] Sent: Friday, November 23, 2012 8:05 PM To: 'Sebastian Andrzej Siewior'; 'Michal Nazarewicz' Cc: 'Andrzej Pietrasiewicz'; 'linux-usb@vger.kernel.org'; 'Felipe Balbi'; 'Greg Kroah-Hartman'; 'Joel Becker'; 'Marek Szyprowski' Subject: RE: [RFCv4 PATCH 01/13] usb: composite: add make_group and add_function operations Hi, -Original Message- From: Sebastian Andrzej Siewior [mailto:bige...@linutronix.de] Sent: Friday, November 23, 2012 7:17 PM To: Michal Nazarewicz Cc: Andrzej Pietrasiewicz; linux-usb@vger.kernel.org; 'Kyungmin Park'; 'Felipe Balbi'; 'Greg Kroah-Hartman'; 'Joel Becker'; Marek Szyprowski Subject: Re: [RFCv4 PATCH 01/13] usb: composite: add make_group and add_function operations On 11/22/2012 09:48 PM, Michal Nazarewicz wrote: I think neither is correct. The reviewed-by tag implies that the person did a careful review of the code as per “Reviewer's statement of oversight” (see Documentation/SubmittingPatches). What actually happens is Kyungmin giving a green light to shipping the patch from copyright stand-point since Samsung is copyright holder and Andrzej has no power to say weather he can or cannot release the code. So logical path the code took was: Andrzej - Kyungmin - Andrzej - linux-usb Aha. So is Kyungmin a lawyer and not a hacker as I assumed in the first place. If you look at other patches coming from SPRC (including mine while I was working for Samsung) they all have the same Signed-off schema where the first line is of the author and second is of Kyungmin. This together with the statement above explains a lot to me. I always saw that and wondered how much code he can write. I assumed that Kyungmin was some kind of kick-ass hacker that knows all the chips very well and therefore writes all of the Samsung code ahead of HW and then is too busy with other stuff and so other people in his team push his patches mainline and deal with the review. I know that other companies work like that, where a small group of people does the bring-up and then others take their code and try to merge upstream. And this impressed me because Kyungmin is a person and not a small group. Anyway. Signed-off indicates that he was involved in code development but he was not. As it seems it me, his OKAY is very important why not add him as Acked-By: ... [copyright] I added the [copyright] as the subsystem since he did Ack only a part of the patch, not the functionality etc. I know that (now) but others might not. Even though all codes are not tested at internal tree, but most codes are tested internal tree. And these internal tree is managed by me. That's reason to add Signed-off as internal tree maintainer. And most of codes from us, I checked it by internal approval process. If you don't feel it's not correct Signed-off scheme. No problem to replace it with Reviewed-by or Acked-by. Thank you, Kyungmin Park Sebastian -- 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
Re: [PATCH v7 0/5] usb: phy: samsung: Introducing usb phy driver for samsung SoCs
On Fri, Nov 9, 2012 at 8:54 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Tue, Oct 30, 2012 at 10:27:32AM +0530, Praveen Paneri wrote: Changes from v6: Modified register definitions according to the existing ones. Changed default PHY clk selection for SoCs. Improved binding text and rebased to the latest usb-next. Changes from v5: Moved clk_get() to driver's probe function. Now reference clock frequency selection value is stored in samsung_usbphy structure for later use. Used IS_ENABLED() instead of #ifdef in samsung_usbphy_get_driver_data(). Changes from v4: Moved header file contents to driver's source file Removed unnecessary print message from driver's probe function Dropped the Free Software Foundation address from the header Changed the platform data code to use __initdata Changes from v3: Replaced susbsys_initcall()/module_exit() by module_platform_driver(). Accordingly in the hsotg driver returned -EPROBE_DEFER until phy driver is registered Removed unnecessary devm_usb_put_phy() call from the hsotg driver remove. Changes from v2: Changed the driver filenames to samsung-usbphy Changed 's3c' to 'samsung' for platform device as well as platform data Moved platform data structure to a separate file Rectified coding style related errors Changes from v1: Rebased patches to latest usb-next branch Changed the name 'sec_usbphy' to 'samsung_usbphy' This patch set introduces a phy driver for samsung SoCs. It uses the existing transceiver infrastructure to provide phy control functions. Use of this driver can be extended for usb host phy as well. Over the period of time all the phy related code for most of the samsung SoCs can be integrated here. Removing the existing phy code from mach-s3c64xx. Same can be done for other SoCs when they start supporting this phy driver. This driver is tested with smdk6410 and Exynos4210(with DT). Praveen Paneri (5): usb: phy: samsung: Introducing usb phy driver for hsotg usb: s3c-hsotg: Adding phy driver support For usb parts: Acked-by: Kyungmin Park kyungmin.p...@samsung.com ARM: S3C64XX: Removing old phy setup code ARM: S3C64XX: Enabling samsung-usbphy driver ARM: Exynos4210: Enabling samsung-usbphy driver guys I can't wait any longer. If I don't get proper Acks today, I will go ahead without all the PHY changes from Samsung :-s To Praveen, To remove these dependency and merge issue, please send patches for each subsystem. In this case, usb patches for usb tree and others are for arm arch. Thank you, Kyungmin Park -- balbi ___ linux-arm-kernel mailing list linux-arm-ker...@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel -- 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
Re: [PATCH] usb: phy: samsung: Introducing usb phy driver for hsotg
+ Tomasz Figa, Acked-by: Kyungmin Park kyungmin.p...@samsung.com On Mon, Oct 15, 2012 at 10:28 PM, Felipe Balbi ba...@ti.com wrote: On Fri, Oct 12, 2012 at 03:45:34PM +0530, Praveen Paneri wrote: platform_set_drvdata() required for driver's remove function, so adding it back. From v6: Added TODO for phy bindings with controller Dropped platform_set_drvdata() from driver probe This driver uses usb_phy interface to interact with s3c-hsotg. Supports phy_init and phy_shutdown functions to enable/disable phy. Tested with smdk6410 and smdkv310. More SoCs can be brought under later. this commit log needs improvement. There are stuff there which shouldn't go to git's history. I would like to get Tested-bys and Acked-by from DT maintainers. Signed-off-by: Praveen Paneri p.pan...@samsung.com Acked-by: Heiko Stuebner he...@sntech.de --- .../devicetree/bindings/usb/samsung-usbphy.txt | 11 + drivers/usb/phy/Kconfig|8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/samsung-usbphy.c | 357 include/linux/platform_data/samsung-usbphy.h | 27 ++ 5 files changed, 404 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt create mode 100644 drivers/usb/phy/samsung-usbphy.c create mode 100644 include/linux/platform_data/samsung-usbphy.h diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt new file mode 100644 index 000..7b26e2d --- /dev/null +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt @@ -0,0 +1,11 @@ +* Samsung's usb phy transceiver + +The Samsung's phy transceiver is used for controlling usb otg phy for +s3c-hsotg usb device controller. +TODO: Adding the PHY binding with controller(s) according to the under +developement generic PHY driver. + +Required properties: +- compatible : should be samsung,exynos4210-usbphy +- reg : base physical address of the phy registers and length of memory mapped + region. diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 63c339b..313685f 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -32,3 +32,11 @@ config MV_U3D_PHY help Enable this to support Marvell USB 3.0 phy controller for Marvell SoC. + +config SAMSUNG_USBPHY + bool Samsung USB PHY controller Driver + depends on USB_S3C_HSOTG + select USB_OTG_UTILS + help + Enable this to support Samsung USB phy controller for samsung + SoCs. diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index b069f29..55dcfc1 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_OMAP_USB2) += omap-usb2.o obj-$(CONFIG_USB_ISP1301)+= isp1301.o obj-$(CONFIG_MV_U3D_PHY) += mv_u3d_phy.o obj-$(CONFIG_USB_EHCI_TEGRA) += tegra_usb_phy.o +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c new file mode 100644 index 000..14c182f --- /dev/null +++ b/drivers/usb/phy/samsung-usbphy.c @@ -0,0 +1,357 @@ +/* linux/drivers/usb/phy/samsung-usbphy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Praveen Paneri p.pan...@samsung.com + * + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller + * + * 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 Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include linux/module.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/delay.h +#include linux/err.h +#include linux/io.h +#include linux/of.h +#include linux/usb/otg.h +#include linux/platform_data/samsung-usbphy.h + +/* Register definitions */ + +#define S3C_PHYPWR (0x00) + +#define S3C_PHYPWR_NORMAL_MASK (0x19 0) +#define S3C_PHYPWR_OTG_DISABLE (1 4) +#define S3C_PHYPWR_ANALOG_POWERDOWN (1 3) +#define S3C_PHYPWR_FORCE_SUSPEND (1 1) +/* For Exynos4 */ +#define EXYNOS4_PHYPWR_NORMAL_MASK (0x39 0) +#define EXYNOS4_PHYPWR_SLEEP (1 5) + +#define S3C_PHYCLK (0x04) + +#define S3C_PHYCLK_MODE_SERIAL (1 6) +#define S3C_PHYCLK_EXT_OSC (1 5) +#define
Re: [PATCH v6 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
Acked-by: Kyungmin Park kyungmin.p...@samsung.com On 9/17/12, Praveen Paneri p.pan...@samsung.com wrote: This driver uses usb_phy interface to interact with s3c-hsotg. Supports phy_init and phy_shutdown functions to enable/disable phy. Tested with smdk6410 and smdkv310. More SoCs can be brought under later. Signed-off-by: Praveen Paneri p.pan...@samsung.com Acked-by: Heiko Stuebner he...@sntech.de --- .../devicetree/bindings/usb/samsung-usbphy.txt |9 + drivers/usb/phy/Kconfig|8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/samsung-usbphy.c | 360 include/linux/platform_data/samsung-usbphy.h | 27 ++ 5 files changed, 405 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt create mode 100644 drivers/usb/phy/samsung-usbphy.c create mode 100644 include/linux/platform_data/samsung-usbphy.h diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt new file mode 100644 index 000..fefd9c8 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt @@ -0,0 +1,9 @@ +* Samsung's usb phy transceiver + +The Samsung's phy transceiver is used for controlling usb otg phy for +s3c-hsotg usb device controller. + +Required properties: +- compatible : should be samsung,exynos4210-usbphy +- reg : base physical address of the phy registers and length of memory mapped + region. diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 63c339b..313685f 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -32,3 +32,11 @@ config MV_U3D_PHY help Enable this to support Marvell USB 3.0 phy controller for Marvell SoC. + +config SAMSUNG_USBPHY + bool Samsung USB PHY controller Driver + depends on USB_S3C_HSOTG + select USB_OTG_UTILS + help + Enable this to support Samsung USB phy controller for samsung + SoCs. diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index b069f29..55dcfc1 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -8,3 +8,4 @@ obj-$(CONFIG_OMAP_USB2) += omap-usb2.o obj-$(CONFIG_USB_ISP1301)+= isp1301.o obj-$(CONFIG_MV_U3D_PHY) += mv_u3d_phy.o obj-$(CONFIG_USB_EHCI_TEGRA) += tegra_usb_phy.o +obj-$(CONFIG_SAMSUNG_USBPHY) += samsung-usbphy.o diff --git a/drivers/usb/phy/samsung-usbphy.c b/drivers/usb/phy/samsung-usbphy.c new file mode 100644 index 000..95ec4d0 --- /dev/null +++ b/drivers/usb/phy/samsung-usbphy.c @@ -0,0 +1,360 @@ +/* linux/drivers/usb/phy/samsung-usbphy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Praveen Paneri p.pan...@samsung.com + * + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller + * + * 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 Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include linux/module.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/delay.h +#include linux/err.h +#include linux/io.h +#include linux/of.h +#include linux/usb/otg.h +#include linux/platform_data/samsung-usbphy.h + +/* Register definitions */ + +#define S3C_PHYPWR (0x00) + +#define S3C_PHYPWR_NORMAL_MASK (0x19 0) +#define S3C_PHYPWR_OTG_DISABLE (1 4) +#define S3C_PHYPWR_ANALOG_POWERDOWN (1 3) +#define S3C_PHYPWR_FORCE_SUSPEND (1 1) +/* For Exynos4 */ +#define EXYNOS4_PHYPWR_NORMAL_MASK (0x39 0) +#define EXYNOS4_PHYPWR_SLEEP (1 5) + +#define S3C_PHYCLK (0x04) + +#define S3C_PHYCLK_MODE_SERIAL (1 6) +#define S3C_PHYCLK_EXT_OSC (1 5) +#define S3C_PHYCLK_COMMON_ON_N (1 4) +#define S3C_PHYCLK_ID_PULL (1 2) +#define S3C_PHYCLK_CLKSEL_MASK (0x3 0) +#define S3C_PHYCLK_CLKSEL_SHIFT (0) +#define S3C_PHYCLK_CLKSEL_48M(0x0 0) +#define S3C_PHYCLK_CLKSEL_12M(0x2 0) +#define S3C_PHYCLK_CLKSEL_24M(0x3 0) + +#define S3C_RSTCON (0x08) + +#define S3C_RSTCON_PHYCLK(1 2) +#define S3C_RSTCON_HCLK
Re: [PATCH 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
Hi Praveen, On 8/6/12, Praveen Paneri p.pan...@samsung.com wrote: Hi Heiko, On Mon, Aug 6, 2012 at 3:24 AM, Heiko Stübner he...@sntech.de wrote: Hi Praveen, Am Mittwoch, 1. August 2012, 15:05:47 schrieb Praveen Paneri: This driver uses usb_phy interface to interact with s3c-hsotg. Supports phy_init and phy_shutdown functions to enable/disable phy. Tested with smdk6410 and smdkv310. More SoCs can be brought under later. Looks cool. Thanks From what I've seen the phy controllers on newer Samsung SoCs are still somewhat similar to the one on my s3c2416/2450 machines. So hopefully at some point after the driver has settled, I'll find the time to add support for these to the phy driver. Yes! that's great. Out of curiosity, what does the sec in sec_usbphy for? Its Samsung Electronics Co. :) I'm also prefer to use 'samsung' or 'exynos'. Since I didn't see the 'sec' prefix for samsung drivers. Thank you, Kyungmin Park Praveen Signed-off-by: Praveen Paneri p.pan...@samsung.com Acked-by: Heiko Stuebner he...@sntech.de Heiko --- .../devicetree/bindings/usb/samsung-usbphy.txt |9 + drivers/usb/phy/Kconfig|8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/sec_usbphy.c | 354 drivers/usb/phy/sec_usbphy.h | 48 +++ include/linux/platform_data/s3c-hsotg.h|5 + 6 files changed, 425 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt create mode 100644 drivers/usb/phy/sec_usbphy.c create mode 100644 drivers/usb/phy/sec_usbphy.h diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt new file mode 100644 index 000..fefd9c8 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt @@ -0,0 +1,9 @@ +* Samsung's usb phy transceiver + +The Samsung's phy transceiver is used for controlling usb otg phy for +s3c-hsotg usb device controller. + +Required properties: +- compatible : should be samsung,exynos4210-usbphy +- reg : base physical address of the phy registers and length of memory mapped + region. diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index e7cf84f..abbebe2 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -15,3 +15,11 @@ config USB_ISP1301 To compile this driver as a module, choose M here: the module will be called isp1301. + +config SEC_USBPHY + bool Samsung USB PHY controller Driver + depends on USB_S3C_HSOTG + select USB_OTG_UTILS + help + Enable this to support Samsung USB phy controller for samsung + SoCs. diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index eca095b..6bb66f0 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -5,3 +5,4 @@ ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG obj-$(CONFIG_USB_ISP1301)+= isp1301.o +obj-$(CONFIG_SEC_USBPHY) += sec_usbphy.o diff --git a/drivers/usb/phy/sec_usbphy.c b/drivers/usb/phy/sec_usbphy.c new file mode 100644 index 000..33119eb --- /dev/null +++ b/drivers/usb/phy/sec_usbphy.c @@ -0,0 +1,354 @@ +/* linux/drivers/usb/phy/sec_usbphy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Praveen Paneri p.pan...@samsung.com + * + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG controller + * + * 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 Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include linux/module.h +#include linux/platform_device.h +#include linux/clk.h +#include linux/delay.h +#include linux/err.h +#include linux/io.h +#include linux/of.h +#include linux/usb/otg.h +#include linux/platform_data/s3c-hsotg.h + +#include sec_usbphy.h + +enum sec_cpu_type { + TYPE_S3C64XX, + TYPE_EXYNOS4210, +}; + +/* + * struct sec_usbphy - transceiver driver state + * @phy: transceiver structure + * @plat: platform data + * @dev: The parent device supplied to the probe function + * @clk: usb phy clock + * @regs: usb phy register memory base + * @cpu_type: machine identifier + */ +struct sec_usbphy { + struct usb_phy phy; + struct s3c_usbphy_plat *plat
Re: [PATCH 1/5] usb: phy: samsung: Introducing usb phy driver for hsotg
On 8/7/12, Praveen Paneri p.pan...@samsung.com wrote: Hi, On Mon, Aug 6, 2012 at 3:21 PM, Praveen Paneri p.pan...@samsung.com wrote: Hi, On Mon, Aug 6, 2012 at 2:53 PM, Heiko Stübner he...@sntech.de wrote: Am Montag, 6. August 2012, 10:23:52 schrieb Kyungmin Park: Hi Praveen, On 8/6/12, Praveen Paneri p.pan...@samsung.com wrote: Hi Heiko, On Mon, Aug 6, 2012 at 3:24 AM, Heiko Stübner he...@sntech.de wrote: Hi Praveen, Am Mittwoch, 1. August 2012, 15:05:47 schrieb Praveen Paneri: This driver uses usb_phy interface to interact with s3c-hsotg. Supports phy_init and phy_shutdown functions to enable/disable phy. Tested with smdk6410 and smdkv310. More SoCs can be brought under later. Looks cool. Thanks From what I've seen the phy controllers on newer Samsung SoCs are still somewhat similar to the one on my s3c2416/2450 machines. So hopefully at some point after the driver has settled, I'll find the time to add support for these to the phy driver. Yes! that's great. Out of curiosity, what does the sec in sec_usbphy for? Its Samsung Electronics Co. :) I'm also prefer to use 'samsung' or 'exynos'. Since I didn't see the 'sec' prefix for samsung drivers. I'd second that. All new generic samsung drivers look like this (i.e. gpio- samsung, pwm-samsung). On the second thought I am thinking 'sec' is shorter and cooler. I know that it has not I also think about it. but most of people think 'sec' is Securities and Exchange Commission or security instead of Samsung Electronics. Ans TLA is avoid if possible. Thank you, Kyungmin Park been used anywhere else but there is always a first time :-P The shorter string helps in writing the code; especially when we have 80 character restriction. If you go through this driver itself you will realize this. Also there was a suggestion some time back to use 'sec' instead of 'samsung'. This is just my view about it. Please comment. Praveen Just checked the datasheets again. This general phy type is used in some form down to the S3C2443, so I'd prefer something with samsung in the name :-) Yes! That makes sense. I will change the name to samsung_usbphy Praveen Heiko Thank you, Kyungmin Park Praveen Signed-off-by: Praveen Paneri p.pan...@samsung.com Acked-by: Heiko Stuebner he...@sntech.de Heiko --- .../devicetree/bindings/usb/samsung-usbphy.txt |9 + drivers/usb/phy/Kconfig|8 + drivers/usb/phy/Makefile |1 + drivers/usb/phy/sec_usbphy.c | 354 drivers/usb/phy/sec_usbphy.h 48 +++ include/linux/platform_data/s3c-hsotg.h|5 + 6 files changed, 425 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/samsung-usbphy.txt create mode 100644 drivers/usb/phy/sec_usbphy.c create mode 100644 drivers/usb/phy/sec_usbphy.h diff --git a/Documentation/devicetree/bindings/usb/samsung-usbphy.txt b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt new file mode 100644 index 000..fefd9c8 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/samsung-usbphy.txt @@ -0,0 +1,9 @@ +* Samsung's usb phy transceiver + +The Samsung's phy transceiver is used for controlling usb otg phy for +s3c-hsotg usb device controller. + +Required properties: +- compatible : should be samsung,exynos4210-usbphy +- reg : base physical address of the phy registers and length of memory mapped + region. diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index e7cf84f..abbebe2 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -15,3 +15,11 @@ config USB_ISP1301 To compile this driver as a module, choose M here: the module will be called isp1301. + +config SEC_USBPHY + bool Samsung USB PHY controller Driver + depends on USB_S3C_HSOTG + select USB_OTG_UTILS + help + Enable this to support Samsung USB phy controller for samsung + SoCs. diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index eca095b..6bb66f0 100644 --- a/drivers/usb/phy/Makefile +++ b/drivers/usb/phy/Makefile @@ -5,3 +5,4 @@ ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG obj-$(CONFIG_USB_ISP1301)+= isp1301.o +obj-$(CONFIG_SEC_USBPHY) += sec_usbphy.o diff --git a/drivers/usb/phy/sec_usbphy.c b/drivers/usb/phy/sec_usbphy.c new file mode 100644 index 000..33119eb --- /dev/null +++ b/drivers/usb/phy/sec_usbphy.c @@ -0,0 +1,354 @@ +/* linux/drivers/usb/phy/sec_usbphy.c + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * http://www.samsung.com + * + * Author: Praveen Paneri p.pan...@samsung.com + * + * Samsung USB2.0 High-speed OTG transceiver, talks to S3C HS OTG
Re: [PATCH] ARM: EXYNOS: Add USB HSIC device
Hi, Now another person try to use drivers/usb/phy for it. usb: phy: samsung: Introducing usb phy driver for hsotg Can you use it instead of previous one? Thank you, Kyungmin Park On 8/6/12, Dongjin Kim tobet...@gmail.com wrote: This patch support to control USB HSIC of EXYNOS4, edited based on Samsung's GT-i9100 ICS Opensource Update7. Change-Id: Ifba33c6a5166abf3644794eee6abe528bd71f521 Signed-off-by: Dongjin Kim dongjin@agreeyamobility.net --- arch/arm/mach-exynos/common.c|5 + arch/arm/mach-exynos/include/mach/regs-pmu.h | 12 + arch/arm/mach-exynos/include/mach/regs-usb-phy.h | 97 + arch/arm/mach-exynos/setup-usb-phy.c | 493 -- drivers/usb/host/Kconfig | 14 + 5 files changed, 501 insertions(+), 120 deletions(-) diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 4eb39cd..94d58af 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c @@ -179,6 +179,11 @@ static struct map_desc exynos4_iodesc[] __initdata = { .length = SZ_4K, .type = MT_DEVICE, }, { + .virtual= (unsigned long)S5P_VA_GPIO2, + .pfn= __phys_to_pfn(EXYNOS4_PA_GPIO2), + .length = SZ_4K, + .type = MT_DEVICE, + }, { .virtual= (unsigned long)S5P_VA_DMC0, .pfn= __phys_to_pfn(EXYNOS4_PA_DMC0), .length = SZ_64K, diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h index 0bb21e2..d98c2fe 100644 --- a/arch/arm/mach-exynos/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h @@ -185,6 +185,15 @@ #define S5P_PMU_LCD1_CONFS5P_PMUREG(0x3CA0) /* Only for EXYNOS4x12 */ +#define S5P_USB_PHY_CONTROL S5P_PMUREG(0x0704) +#define S5P_USB_PHY_ENABLE (0x1 0) + +#define S5P_HSIC_1_PHY_CONTROL S5P_PMUREG(0x0708) +#define S5P_HSIC_1_PHY_ENABLE(0x1 0) + +#define S5P_HSIC_2_PHY_CONTROL S5P_PMUREG(0x070C) +#define S5P_HSIC_2_PHY_ENABLE(0x1 0) + #define S5P_ISP_ARM_LOWPWR S5P_PMUREG(0x1050) #define S5P_DIS_IRQ_ISP_ARM_LOCAL_LOWPWR S5P_PMUREG(0x1054) #define S5P_DIS_IRQ_ISP_ARM_CENTRAL_LOWPWR S5P_PMUREG(0x1058) @@ -242,6 +251,9 @@ #define EXYNOS5_SYS_WDTRESET (1 20) +#define EXYNOS5_USBDEV_PHY_CONTROL S5P_PMUREG(0x0704) +#define EXYNOS5_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708) + #define EXYNOS5_ARM_CORE0_SYS_PWR_REG S5P_PMUREG(0x1000) #define EXYNOS5_DIS_IRQ_ARM_CORE0_LOCAL_SYS_PWR_REG S5P_PMUREG(0x1004) #define EXYNOS5_DIS_IRQ_ARM_CORE0_CENTRAL_SYS_PWR_REG S5P_PMUREG(0x1008) diff --git a/arch/arm/mach-exynos/include/mach/regs-usb-phy.h b/arch/arm/mach-exynos/include/mach/regs-usb-phy.h index 0727773..79021a0 100644 --- a/arch/arm/mach-exynos/include/mach/regs-usb-phy.h +++ b/arch/arm/mach-exynos/include/mach/regs-usb-phy.h @@ -43,6 +43,43 @@ #define EXYNOS4210_CLKSEL_12M(0x2 0) #define EXYNOS4210_CLKSEL_24M(0x3 0) +#define EXYNOS4210_HSIC1_NORMAL_MASK(0x3 11) +#define EXYNOS4210_HSIC1_SLEEP (1 12) +#define EXYNOS4210_HSIC1_FORCE_SUSPEND (1 11) +#define EXYNOS4210_HSIC0_NORMAL_MASK(0x3 9) +#define EXYNOS4210_HSIC0_SLEEP (1 10) +#define EXYNOS4210_HSIC0_FORCE_SUSPEND (1 9) + +#define EXYNOS4210_HOST_LINK_PORT_SWRST_MASK(0xf 6) +#define EXYNOS4210_HOST_LINK_PORT2_SWRST(1 9) +#define EXYNOS4210_HOST_LINK_PORT1_SWRST(1 8) +#define EXYNOS4210_HOST_LINK_PORT0_SWRST(1 7) +#define EXYNOS4210_HOST_LINK_ALL_SWRST (1 6) +#define EXYNOS4210_PHY1_SWRST_MASK (0x7 3) +#define EXYNOS4210_PHY1_HSIC_SWRST (1 5) +#define EXYNOS4210_PHY1_STD_SWRST (1 4) +#define EXYNOS4210_PHY1_ALL_SWRST (1 3) + +#define EXYNOS4X12_HSIC1_NORMAL_MASK (0x7 12) +#define EXYNOS4X12_HSIC1_SLEEP (1 14) +#define EXYNOS4X12_HSIC1_ANALOG_POWERDOWN(1 13) +#define EXYNOS4X12_HSIC1_FORCE_SUSPEND (1 12) +#define EXYNOS4X12_HSIC0_NORMAL_MASK (0x7 9) +#define EXYNOS4X12_HSIC0_SLEEP (1 11) +#define EXYNOS4X12_HSIC0_ANALOG_POWERDOWN(1 10) +#define EXYNOS4X12_HSIC0_FORCE_SUSPEND (1 9) + +#define EXYNOS4X12_HOST_LINK_PORT_SWRST_MASK (0xf 7) +#define EXYNOS4X12_HOST_LINK_PORT2_SWRST (1 10) +#define EXYNOS4X12_HOST_LINK_PORT1_SWRST (1 9) +#define