Re: [PATCH 1/6] ARM: S3C64XX: Add usb otg phy control
On 03/08/12 05:20, Lukasz Majewski wrote: Hi Joonyoung, On Thu, 8 Mar 2012 12:27:30 +0100 Joonyoung Shimjy0922.s...@samsung.com wrote: On 03/08/2012 06:52 PM, Kukjin Kim wrote: On 03/07/12 04:28, Kukjin Kim wrote: On 02/10/12 10:26, Mark Brown wrote: On Fri, Feb 10, 2012 at 11:35:41AM +0100, Lukasz Majewski wrote: From: Joonyoung Shimjy0922.s...@samsung.com This patch supports to control usb otg phy of S3C64XX. Currently, the driver for usb otg controls usb otg phy but it can be removed by this patch. Acked-by: Mark Brownbroo...@opensource.wolfsonmicro.com Applied, thanks. Oops, following error happened with s5pv210_defconfig after applying this. arch/arm/plat-samsung/built-in.o: In function `s3c_hsotg_set_platdata': arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' make: *** [.tmp_vmlinux1] Error 1 Also the s5pv210 needs setup-usb-phy.c file. I think the attached patch will solve this errors. This patch was tested only compile. Thanks. Thank you for the patch. I've extended your's patch by adding GONI dependent platform code. It has been tested and works with s3c-hsotg driver. Test HW: GONI S5PC110 Tested-by: Lukasz Majewskil.majew...@samsung.com Looks good to me. Applied, Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/6] ARM: S3C64XX: Add usb otg phy control
On 03/07/12 04:28, Kukjin Kim wrote: On 02/10/12 10:26, Mark Brown wrote: On Fri, Feb 10, 2012 at 11:35:41AM +0100, Lukasz Majewski wrote: From: Joonyoung Shimjy0922.s...@samsung.com This patch supports to control usb otg phy of S3C64XX. Currently, the driver for usb otg controls usb otg phy but it can be removed by this patch. Acked-by: Mark Brownbroo...@opensource.wolfsonmicro.com Applied, thanks. Oops, following error happened with s5pv210_defconfig after applying this. arch/arm/plat-samsung/built-in.o: In function `s3c_hsotg_set_platdata': arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' make: *** [.tmp_vmlinux1] Error 1 Thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/6] ARM: S3C64XX: Add usb otg phy control
On 03/08/2012 06:52 PM, Kukjin Kim wrote: On 03/07/12 04:28, Kukjin Kim wrote: On 02/10/12 10:26, Mark Brown wrote: On Fri, Feb 10, 2012 at 11:35:41AM +0100, Lukasz Majewski wrote: From: Joonyoung Shimjy0922.s...@samsung.com This patch supports to control usb otg phy of S3C64XX. Currently, the driver for usb otg controls usb otg phy but it can be removed by this patch. Acked-by: Mark Brownbroo...@opensource.wolfsonmicro.com Applied, thanks. Oops, following error happened with s5pv210_defconfig after applying this. arch/arm/plat-samsung/built-in.o: In function `s3c_hsotg_set_platdata': arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' make: *** [.tmp_vmlinux1] Error 1 Also the s5pv210 needs setup-usb-phy.c file. I think the attached patch will solve this errors. This patch was tested only compile. Thanks. From 9ae6ac166743391a6037d7e7a4d178f68a96f047 Mon Sep 17 00:00:00 2001 From: Joonyoung Shim jy0922.s...@samsung.com Date: Thu, 8 Mar 2012 19:52:25 +0900 Subject: [PATCH] ARM: S5PV210: Add usb otg phy control This patch supports to control usb otg phy of S5PV210. Based on setup-usb-phy.c of S3C64XX. Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/mach-s5pv210/Kconfig |6 ++ arch/arm/mach-s5pv210/Makefile|1 + arch/arm/mach-s5pv210/include/mach/regs-sys.h |4 - arch/arm/mach-s5pv210/setup-usb-phy.c | 90 + 4 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 arch/arm/mach-s5pv210/setup-usb-phy.c diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 2cdc42e..82525e3 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -65,6 +65,11 @@ config S5PV210_SETUP_SPI help Common setup code for SPI GPIO configurations. +config S5PV210_SETUP_USB_PHY + bool + help + Common setup code for USB PHY controller + menu S5PC110 Machines config MACH_AQUILA @@ -107,6 +112,7 @@ config MACH_GONI select S5PV210_SETUP_KEYPAD select S5PV210_SETUP_SDHCI select S5PV210_SETUP_FIMC + select S5PV210_SETUP_USB_PHY help Machine support for Samsung GONI board S5PC110(MCP) is one of package option of S5PV210 diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index 76a121d..1c4e419 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile @@ -39,3 +39,4 @@ obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o obj-$(CONFIG_S5PV210_SETUP_SPI) += setup-spi.o +obj-$(CONFIG_S5PV210_SETUP_USB_PHY) += setup-usb-phy.o diff --git a/arch/arm/mach-s5pv210/include/mach/regs-sys.h b/arch/arm/mach-s5pv210/include/mach/regs-sys.h index 26691d3..cccb1ed 100644 --- a/arch/arm/mach-s5pv210/include/mach/regs-sys.h +++ b/arch/arm/mach-s5pv210/include/mach/regs-sys.h @@ -13,7 +13,3 @@ #define S5PV210_USB_PHY_CON (S3C_VA_SYS + 0xE80C) #define S5PV210_USB_PHY0_EN (1 0) #define S5PV210_USB_PHY1_EN (1 1) - -/* compatibility defines for s3c-hsotg driver */ -#define S3C64XX_OTHERS S5PV210_USB_PHY_CON -#define S3C64XX_OTHERS_USBMASK S5PV210_USB_PHY0_EN diff --git a/arch/arm/mach-s5pv210/setup-usb-phy.c b/arch/arm/mach-s5pv210/setup-usb-phy.c new file mode 100644 index 000..be39cf4 --- /dev/null +++ b/arch/arm/mach-s5pv210/setup-usb-phy.c @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co.Ltd + * Author: Joonyoung Shim jy0922.s...@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 Software Foundationr + */ + +#include linux/clk.h +#include linux/delay.h +#include linux/err.h +#include linux/io.h +#include linux/platform_device.h +#include mach/map.h +#include mach/regs-sys.h +#include plat/cpu.h +#include plat/regs-usb-hsotg-phy.h +#include plat/usb-phy.h + +static int s5pv210_usb_otgphy_init(struct platform_device *pdev) +{ + struct clk *xusbxti; + u32 phyclk; + + writel(readl(S5PV210_USB_PHY_CON) | S5PV210_USB_PHY0_EN, + S5PV210_USB_PHY_CON); + + /* set clock frequency for PLL */ + phyclk = readl(S3C_PHYCLK) ~S3C_PHYCLK_CLKSEL_MASK; + + xusbxti = clk_get(pdev-dev, xusbxti); + if (xusbxti !IS_ERR(xusbxti)) { + switch (clk_get_rate(xusbxti)) { + case 12 * MHZ: + phyclk |= S3C_PHYCLK_CLKSEL_12M; + break; + case 24 * MHZ: + phyclk |= S3C_PHYCLK_CLKSEL_24M; + break; + default: + case 48 * MHZ: + /* default reference clock */ + break; + } + clk_put(xusbxti); + } + + /* TODO: select external clock/oscillator
Re: [PATCH 1/6] ARM: S3C64XX: Add usb otg phy control
Hi Joonyoung, On Thu, 8 Mar 2012 12:27:30 +0100 Joonyoung Shim jy0922.s...@samsung.com wrote: On 03/08/2012 06:52 PM, Kukjin Kim wrote: On 03/07/12 04:28, Kukjin Kim wrote: On 02/10/12 10:26, Mark Brown wrote: On Fri, Feb 10, 2012 at 11:35:41AM +0100, Lukasz Majewski wrote: From: Joonyoung Shimjy0922.s...@samsung.com This patch supports to control usb otg phy of S3C64XX. Currently, the driver for usb otg controls usb otg phy but it can be removed by this patch. Acked-by: Mark Brownbroo...@opensource.wolfsonmicro.com Applied, thanks. Oops, following error happened with s5pv210_defconfig after applying this. arch/arm/plat-samsung/built-in.o: In function `s3c_hsotg_set_platdata': arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1449: undefined reference to `s5p_usb_phy_init' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' arch/arm/plat-samsung/devs.c:1451: undefined reference to `s5p_usb_phy_exit' make: *** [.tmp_vmlinux1] Error 1 Also the s5pv210 needs setup-usb-phy.c file. I think the attached patch will solve this errors. This patch was tested only compile. Thanks. Thank you for the patch. I've extended your's patch by adding GONI dependent platform code. It has been tested and works with s3c-hsotg driver. Test HW: GONI S5PC110 Tested-by: Lukasz Majewski l.majew...@samsung.com -- Best regards, Lukasz Majewski Samsung Poland RD Center Platform Group From a18166a6e87df8ade29f1d4e37b96f932d2a8909 Mon Sep 17 00:00:00 2001 From: Joonyoung Shim jy0922.s...@samsung.com Date: Thu, 8 Mar 2012 19:52:25 +0900 Subject: [PATCH] ARM: S5PV210: Add usb otg phy control This patch supports to control usb otg phy of S5PV210. Based on setup-usb-phy.c of S3C64XX. Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- arch/arm/mach-s5pv210/Kconfig |7 ++ arch/arm/mach-s5pv210/Makefile|1 + arch/arm/mach-s5pv210/include/mach/regs-sys.h |4 - arch/arm/mach-s5pv210/mach-goni.c |6 ++ arch/arm/mach-s5pv210/setup-usb-phy.c | 90 + 5 files changed, 104 insertions(+), 4 deletions(-) create mode 100644 arch/arm/mach-s5pv210/setup-usb-phy.c diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig index 2ae6a5f..b51210c 100644 --- a/arch/arm/mach-s5pv210/Kconfig +++ b/arch/arm/mach-s5pv210/Kconfig @@ -65,6 +65,11 @@ config S5PV210_SETUP_SPI help Common setup code for SPI GPIO configurations. +config S5PV210_SETUP_USB_PHY + bool + help + Common setup code for USB PHY controller + menu S5PC110 Machines config MACH_AQUILA @@ -81,6 +86,7 @@ config MACH_AQUILA select S3C_DEV_USB_HSOTG select S5PV210_SETUP_FB_24BPP select S5PV210_SETUP_SDHCI + select S5PV210_SETUP_USB_PHY help Machine support for the Samsung Aquila target based on S5PC110 SoC @@ -108,6 +114,7 @@ config MACH_GONI select S5PV210_SETUP_KEYPAD select S5PV210_SETUP_SDHCI select S5PV210_SETUP_FIMC + select S5PV210_SETUP_USB_PHY help Machine support for Samsung GONI board S5PC110(MCP) is one of package option of S5PV210 diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile index 76a121d..1c4e419 100644 --- a/arch/arm/mach-s5pv210/Makefile +++ b/arch/arm/mach-s5pv210/Makefile @@ -39,3 +39,4 @@ obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o obj-$(CONFIG_S5PV210_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o obj-$(CONFIG_S5PV210_SETUP_SPI) += setup-spi.o +obj-$(CONFIG_S5PV210_SETUP_USB_PHY) += setup-usb-phy.o diff --git a/arch/arm/mach-s5pv210/include/mach/regs-sys.h b/arch/arm/mach-s5pv210/include/mach/regs-sys.h index 26691d3..cccb1ed 100644 --- a/arch/arm/mach-s5pv210/include/mach/regs-sys.h +++ b/arch/arm/mach-s5pv210/include/mach/regs-sys.h @@ -13,7 +13,3 @@ #define S5PV210_USB_PHY_CON (S3C_VA_SYS + 0xE80C) #define S5PV210_USB_PHY0_EN (1 0) #define S5PV210_USB_PHY1_EN (1 1) - -/* compatibility defines for s3c-hsotg driver */ -#define S3C64XX_OTHERS S5PV210_USB_PHY_CON -#define S3C64XX_OTHERS_USBMASK S5PV210_USB_PHY0_EN diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c index 2cf5ed7..f5f4926 100644 --- a/arch/arm/mach-s5pv210/mach-goni.c +++ b/arch/arm/mach-s5pv210/mach-goni.c @@ -49,6 +49,7 @@ #include plat/mfc.h #include plat/regs-fb-v4.h #include plat/camport.h +#include plat/udc-hs.h #include media/v4l2-mediabus.h #include media/s5p_fimc.h @@ -277,6 +278,9 @@ static void __init goni_tsp_init(void) i2c2_devs[0].irq = gpio_to_irq(gpio); } +/* USB OTG */ +static struct s3c_hsotg_plat goni_hsotg_pdata; + static void goni_camera_init(void) { s5pv210_fimc_setup_gpio(S5P_CAMPORT_A); @@ -939,6 +943,8 @@ static void __init goni_machine_init(void)
Re: [PATCH 1/6] ARM: S3C64XX: Add usb otg phy control
On 02/10/12 10:26, Mark Brown wrote: On Fri, Feb 10, 2012 at 11:35:41AM +0100, Lukasz Majewski wrote: From: Joonyoung Shimjy0922.s...@samsung.com This patch supports to control usb otg phy of S3C64XX. Currently, the driver for usb otg controls usb otg phy but it can be removed by this patch. Acked-by: Mark Brownbroo...@opensource.wolfsonmicro.com Applied, thanks. Best regards, Kgene. -- Kukjin Kim kgene@samsung.com, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/6] ARM: S3C64XX: Add usb otg phy control
From: Joonyoung Shim jy0922.s...@samsung.com This patch supports to control usb otg phy of S3C64XX. Currently, the driver for usb otg controls usb otg phy but it can be removed by this patch. Signed-off-by: Joonyoung Shim jy0922.s...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com [Rebased on the newest git/kgene/linux-samsung #for-next] Signed-off-by: Lukasz Majewski l.majew...@samsung.com --- arch/arm/mach-s3c64xx/Kconfig |8 ++ arch/arm/mach-s3c64xx/Makefile |1 + arch/arm/mach-s3c64xx/mach-crag6410.c |4 + arch/arm/mach-s3c64xx/mach-smartq.c|3 + arch/arm/mach-s3c64xx/mach-smdk6410.c |4 + arch/arm/mach-s3c64xx/setup-usb-phy.c | 90 arch/arm/plat-samsung/devs.c | 14 +++ .../plat-samsung/include/plat/regs-usb-hsotg-phy.h |7 +- arch/arm/plat-samsung/include/plat/udc-hs.h|5 + 9 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 arch/arm/mach-s3c64xx/setup-usb-phy.c diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index dc45123..82c0915 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -83,6 +83,11 @@ config S3C64XX_SETUP_SPI help Common setup code for SPI GPIO configurations +config S3C64XX_SETUP_USB_PHY + bool + help + Common setup code for USB PHY controller + # S36400 Macchine support config MACH_SMDK6400 @@ -157,6 +162,7 @@ config MACH_SMDK6410 select S3C64XX_SETUP_IDE select S3C64XX_SETUP_FB_24BPP select S3C64XX_SETUP_KEYPAD + select S3C64XX_SETUP_USB_PHY help Machine support for the Samsung SMDK6410 @@ -256,6 +262,7 @@ config MACH_SMARTQ select S3C_DEV_USB_HOST select S3C64XX_SETUP_SDHCI select S3C64XX_SETUP_FB_24BPP + select S3C64XX_SETUP_USB_PHY select SAMSUNG_DEV_ADC select SAMSUNG_DEV_PWM select SAMSUNG_DEV_TS @@ -283,6 +290,7 @@ config MACH_WLF_CRAGG_6410 select S3C64XX_SETUP_FB_24BPP select S3C64XX_SETUP_KEYPAD select S3C64XX_SETUP_SPI + select S3C64XX_SETUP_USB_PHY select SAMSUNG_DEV_ADC select SAMSUNG_DEV_KEYPAD select S3C_DEV_USB_HOST diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile index 610fe28..f9ce1dc 100644 --- a/arch/arm/mach-s3c64xx/Makefile +++ b/arch/arm/mach-s3c64xx/Makefile @@ -43,6 +43,7 @@ obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o obj-$(CONFIG_S3C64XX_SETUP_SPI)+= setup-spi.o +obj-$(CONFIG_S3C64XX_SETUP_USB_PHY) += setup-usb-phy.o # Machine support diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index f93caad..c55a822 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c @@ -61,6 +61,7 @@ #include plat/sdhci.h #include plat/gpio-cfg.h #include plat/s3c64xx-spi.h +#include plat/udc-hs.h #include plat/keypad.h #include plat/clock.h @@ -759,6 +760,8 @@ static const struct gpio_led_platform_data gpio_leds_pdata = { .num_leds = ARRAY_SIZE(gpio_leds), }; +static struct s3c_hsotg_plat crag6410_hsotg_pdata; + static void __init crag6410_machine_init(void) { /* Open drain IRQs need pullups */ @@ -783,6 +786,7 @@ static void __init crag6410_machine_init(void) s3c_i2c0_set_platdata(i2c0_pdata); s3c_i2c1_set_platdata(i2c1_pdata); s3c_fb_set_platdata(crag6410_lcd_pdata); + s3c_hsotg_set_platdata(crag6410_hsotg_pdata); i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c index ce31db1..ce745e1 100644 --- a/arch/arm/mach-s3c64xx/mach-smartq.c +++ b/arch/arm/mach-s3c64xx/mach-smartq.c @@ -187,6 +187,8 @@ static struct s3c_hwmon_pdata smartq_hwmon_pdata __initdata = { }, }; +static struct s3c_hsotg_plat smartq_hsotg_pdata; + static int __init smartq_lcd_setup_gpio(void) { int ret; @@ -383,6 +385,7 @@ void __init smartq_map_io(void) void __init smartq_machine_init(void) { s3c_i2c0_set_platdata(NULL); + s3c_hsotg_set_platdata(smartq_hsotg_pdata); s3c_hwmon_set_platdata(smartq_hwmon_pdata); s3c_sdhci1_set_platdata(smartq_internal_hsmmc_pdata); s3c_sdhci2_set_platdata(smartq_internal_hsmmc_pdata); diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index ca6fc20..d55bc96 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c @@ -72,6 +72,7 @@ #include plat/keypad.h #include
Re: [PATCH 1/6] ARM: S3C64XX: Add usb otg phy control
On Fri, Feb 10, 2012 at 11:35:41AM +0100, Lukasz Majewski wrote: From: Joonyoung Shim jy0922.s...@samsung.com This patch supports to control usb otg phy of S3C64XX. Currently, the driver for usb otg controls usb otg phy but it can be removed by this patch. Acked-by: Mark Brown broo...@opensource.wolfsonmicro.com -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html