diff options
Diffstat (limited to 'arch')
21 files changed, 461 insertions, 2 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index e849f67be47d..805196207ce8 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig | |||
@@ -170,6 +170,7 @@ config MACH_NURI | |||
170 | select S3C_DEV_HSMMC3 | 170 | select S3C_DEV_HSMMC3 |
171 | select S3C_DEV_I2C1 | 171 | select S3C_DEV_I2C1 |
172 | select S3C_DEV_I2C5 | 172 | select S3C_DEV_I2C5 |
173 | select S5P_DEV_USB_EHCI | ||
173 | select EXYNOS4_SETUP_I2C1 | 174 | select EXYNOS4_SETUP_I2C1 |
174 | select EXYNOS4_SETUP_I2C5 | 175 | select EXYNOS4_SETUP_I2C5 |
175 | select EXYNOS4_SETUP_SDHCI | 176 | select EXYNOS4_SETUP_SDHCI |
diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile index 9be104f63c0b..777897551e42 100644 --- a/arch/arm/mach-exynos4/Makefile +++ b/arch/arm/mach-exynos4/Makefile | |||
@@ -54,3 +54,5 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C7) += setup-i2c7.o | |||
54 | obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o | 54 | obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o |
55 | obj-$(CONFIG_EXYNOS4_SETUP_SDHCI) += setup-sdhci.o | 55 | obj-$(CONFIG_EXYNOS4_SETUP_SDHCI) += setup-sdhci.o |
56 | obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 56 | obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
57 | |||
58 | obj-$(CONFIG_USB_SUPPORT) += usb-phy.o | ||
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c index 793011391943..08813a6f66b1 100644 --- a/arch/arm/mach-exynos4/cpu.c +++ b/arch/arm/mach-exynos4/cpu.c | |||
@@ -97,7 +97,12 @@ static struct map_desc exynos4_iodesc[] __initdata = { | |||
97 | .pfn = __phys_to_pfn(EXYNOS4_PA_SROMC), | 97 | .pfn = __phys_to_pfn(EXYNOS4_PA_SROMC), |
98 | .length = SZ_4K, | 98 | .length = SZ_4K, |
99 | .type = MT_DEVICE, | 99 | .type = MT_DEVICE, |
100 | }, | 100 | }, { |
101 | .virtual = (unsigned long)S5P_VA_USB_HSPHY, | ||
102 | .pfn = __phys_to_pfn(EXYNOS4_PA_HSPHY), | ||
103 | .length = SZ_4K, | ||
104 | .type = MT_DEVICE, | ||
105 | } | ||
101 | }; | 106 | }; |
102 | 107 | ||
103 | static void exynos4_idle(void) | 108 | static void exynos4_idle(void) |
diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h index 6330b73b9ea7..0009e77a05fc 100644 --- a/arch/arm/mach-exynos4/include/mach/map.h +++ b/arch/arm/mach-exynos4/include/mach/map.h | |||
@@ -101,6 +101,9 @@ | |||
101 | 101 | ||
102 | #define EXYNOS4_PA_SROMC 0x12570000 | 102 | #define EXYNOS4_PA_SROMC 0x12570000 |
103 | 103 | ||
104 | #define EXYNOS4_PA_EHCI 0x12580000 | ||
105 | #define EXYNOS4_PA_HSPHY 0x125B0000 | ||
106 | |||
104 | #define EXYNOS4_PA_UART 0x13800000 | 107 | #define EXYNOS4_PA_UART 0x13800000 |
105 | 108 | ||
106 | #define EXYNOS4_PA_IIC(x) (0x13860000 + ((x) * 0x10000)) | 109 | #define EXYNOS4_PA_IIC(x) (0x13860000 + ((x) * 0x10000)) |
@@ -143,6 +146,7 @@ | |||
143 | #define S5P_PA_SROMC EXYNOS4_PA_SROMC | 146 | #define S5P_PA_SROMC EXYNOS4_PA_SROMC |
144 | #define S5P_PA_SYSCON EXYNOS4_PA_SYSCON | 147 | #define S5P_PA_SYSCON EXYNOS4_PA_SYSCON |
145 | #define S5P_PA_TIMER EXYNOS4_PA_TIMER | 148 | #define S5P_PA_TIMER EXYNOS4_PA_TIMER |
149 | #define S5P_PA_EHCI EXYNOS4_PA_EHCI | ||
146 | 150 | ||
147 | #define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD | 151 | #define SAMSUNG_PA_KEYPAD EXYNOS4_PA_KEYPAD |
148 | 152 | ||
diff --git a/arch/arm/mach-exynos4/include/mach/regs-pmu.h b/arch/arm/mach-exynos4/include/mach/regs-pmu.h index 62b0014d05e0..a9643371f8e7 100644 --- a/arch/arm/mach-exynos4/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos4/include/mach/regs-pmu.h | |||
@@ -33,6 +33,9 @@ | |||
33 | #define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) | 33 | #define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) |
34 | #define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) | 34 | #define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) |
35 | 35 | ||
36 | #define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708) | ||
37 | #define S5P_USBHOST_PHY_ENABLE (1 << 0) | ||
38 | |||
36 | #define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4) | 39 | #define S5P_MIPI_DPHY_CONTROL(n) S5P_PMUREG(0x0710 + (n) * 4) |
37 | #define S5P_MIPI_DPHY_ENABLE (1 << 0) | 40 | #define S5P_MIPI_DPHY_ENABLE (1 << 0) |
38 | #define S5P_MIPI_DPHY_SRESETN (1 << 1) | 41 | #define S5P_MIPI_DPHY_SRESETN (1 << 1) |
diff --git a/arch/arm/mach-exynos4/include/mach/regs-usb-phy.h b/arch/arm/mach-exynos4/include/mach/regs-usb-phy.h new file mode 100644 index 000000000000..703118d5173c --- /dev/null +++ b/arch/arm/mach-exynos4/include/mach/regs-usb-phy.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
3 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef __PLAT_S5P_REGS_USB_PHY_H | ||
12 | #define __PLAT_S5P_REGS_USB_PHY_H | ||
13 | |||
14 | #define EXYNOS4_HSOTG_PHYREG(x) ((x) + S5P_VA_USB_HSPHY) | ||
15 | |||
16 | #define EXYNOS4_PHYPWR EXYNOS4_HSOTG_PHYREG(0x00) | ||
17 | #define PHY1_HSIC_NORMAL_MASK (0xf << 9) | ||
18 | #define PHY1_HSIC1_SLEEP (1 << 12) | ||
19 | #define PHY1_HSIC1_FORCE_SUSPEND (1 << 11) | ||
20 | #define PHY1_HSIC0_SLEEP (1 << 10) | ||
21 | #define PHY1_HSIC0_FORCE_SUSPEND (1 << 9) | ||
22 | |||
23 | #define PHY1_STD_NORMAL_MASK (0x7 << 6) | ||
24 | #define PHY1_STD_SLEEP (1 << 8) | ||
25 | #define PHY1_STD_ANALOG_POWERDOWN (1 << 7) | ||
26 | #define PHY1_STD_FORCE_SUSPEND (1 << 6) | ||
27 | |||
28 | #define PHY0_NORMAL_MASK (0x39 << 0) | ||
29 | #define PHY0_SLEEP (1 << 5) | ||
30 | #define PHY0_OTG_DISABLE (1 << 4) | ||
31 | #define PHY0_ANALOG_POWERDOWN (1 << 3) | ||
32 | #define PHY0_FORCE_SUSPEND (1 << 0) | ||
33 | |||
34 | #define EXYNOS4_PHYCLK EXYNOS4_HSOTG_PHYREG(0x04) | ||
35 | #define PHY1_COMMON_ON_N (1 << 7) | ||
36 | #define PHY0_COMMON_ON_N (1 << 4) | ||
37 | #define PHY0_ID_PULLUP (1 << 2) | ||
38 | #define CLKSEL_MASK (0x3 << 0) | ||
39 | #define CLKSEL_SHIFT (0) | ||
40 | #define CLKSEL_48M (0x0 << 0) | ||
41 | #define CLKSEL_12M (0x2 << 0) | ||
42 | #define CLKSEL_24M (0x3 << 0) | ||
43 | |||
44 | #define EXYNOS4_RSTCON EXYNOS4_HSOTG_PHYREG(0x08) | ||
45 | #define HOST_LINK_PORT_SWRST_MASK (0xf << 6) | ||
46 | #define HOST_LINK_PORT2_SWRST (1 << 9) | ||
47 | #define HOST_LINK_PORT1_SWRST (1 << 8) | ||
48 | #define HOST_LINK_PORT0_SWRST (1 << 7) | ||
49 | #define HOST_LINK_ALL_SWRST (1 << 6) | ||
50 | |||
51 | #define PHY1_SWRST_MASK (0x7 << 3) | ||
52 | #define PHY1_HSIC_SWRST (1 << 5) | ||
53 | #define PHY1_STD_SWRST (1 << 4) | ||
54 | #define PHY1_ALL_SWRST (1 << 3) | ||
55 | |||
56 | #define PHY0_SWRST_MASK (0x7 << 0) | ||
57 | #define PHY0_PHYLINK_SWRST (1 << 2) | ||
58 | #define PHY0_HLINK_SWRST (1 << 1) | ||
59 | #define PHY0_SWRST (1 << 0) | ||
60 | |||
61 | #define EXYNOS4_PHY1CON EXYNOS4_HSOTG_PHYREG(0x34) | ||
62 | #define FPENABLEN (1 << 0) | ||
63 | |||
64 | #endif /* __PLAT_S5P_REGS_USB_PHY_H */ | ||
diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-nuri.c index b79ad010d194..bb5d12f43af8 100644 --- a/arch/arm/mach-exynos4/mach-nuri.c +++ b/arch/arm/mach-exynos4/mach-nuri.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <plat/cpu.h> | 30 | #include <plat/cpu.h> |
31 | #include <plat/devs.h> | 31 | #include <plat/devs.h> |
32 | #include <plat/sdhci.h> | 32 | #include <plat/sdhci.h> |
33 | #include <plat/ehci.h> | ||
34 | #include <plat/clock.h> | ||
33 | 35 | ||
34 | #include <mach/map.h> | 36 | #include <mach/map.h> |
35 | 37 | ||
@@ -262,6 +264,16 @@ static struct i2c_board_info i2c5_devs[] __initdata = { | |||
262 | /* max8997, To be updated */ | 264 | /* max8997, To be updated */ |
263 | }; | 265 | }; |
264 | 266 | ||
267 | /* USB EHCI */ | ||
268 | static struct s5p_ehci_platdata nuri_ehci_pdata; | ||
269 | |||
270 | static void __init nuri_ehci_init(void) | ||
271 | { | ||
272 | struct s5p_ehci_platdata *pdata = &nuri_ehci_pdata; | ||
273 | |||
274 | s5p_ehci_set_platdata(pdata); | ||
275 | } | ||
276 | |||
265 | static struct platform_device *nuri_devices[] __initdata = { | 277 | static struct platform_device *nuri_devices[] __initdata = { |
266 | /* Samsung Platform Devices */ | 278 | /* Samsung Platform Devices */ |
267 | &emmc_fixed_voltage, | 279 | &emmc_fixed_voltage, |
@@ -270,6 +282,7 @@ static struct platform_device *nuri_devices[] __initdata = { | |||
270 | &s3c_device_hsmmc3, | 282 | &s3c_device_hsmmc3, |
271 | &s3c_device_wdt, | 283 | &s3c_device_wdt, |
272 | &s3c_device_timer[0], | 284 | &s3c_device_timer[0], |
285 | &s5p_device_ehci, | ||
273 | 286 | ||
274 | /* NURI Devices */ | 287 | /* NURI Devices */ |
275 | &nuri_gpio_keys, | 288 | &nuri_gpio_keys, |
@@ -291,6 +304,9 @@ static void __init nuri_machine_init(void) | |||
291 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | 304 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
292 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | 305 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); |
293 | 306 | ||
307 | nuri_ehci_init(); | ||
308 | clk_xusbxti.rate = 24000000; | ||
309 | |||
294 | /* Last */ | 310 | /* Last */ |
295 | platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); | 311 | platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); |
296 | } | 312 | } |
diff --git a/arch/arm/mach-exynos4/usb-phy.c b/arch/arm/mach-exynos4/usb-phy.c new file mode 100644 index 000000000000..0883c1b824b9 --- /dev/null +++ b/arch/arm/mach-exynos4/usb-phy.c | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
3 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/clk.h> | ||
13 | #include <linux/delay.h> | ||
14 | #include <linux/err.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <mach/regs-pmu.h> | ||
18 | #include <mach/regs-usb-phy.h> | ||
19 | #include <plat/cpu.h> | ||
20 | #include <plat/usb-phy.h> | ||
21 | |||
22 | static int exynos4_usb_phy1_init(struct platform_device *pdev) | ||
23 | { | ||
24 | struct clk *otg_clk; | ||
25 | struct clk *xusbxti_clk; | ||
26 | u32 phyclk; | ||
27 | u32 rstcon; | ||
28 | int err; | ||
29 | |||
30 | otg_clk = clk_get(&pdev->dev, "otg"); | ||
31 | if (IS_ERR(otg_clk)) { | ||
32 | dev_err(&pdev->dev, "Failed to get otg clock\n"); | ||
33 | return PTR_ERR(otg_clk); | ||
34 | } | ||
35 | |||
36 | err = clk_enable(otg_clk); | ||
37 | if (err) { | ||
38 | clk_put(otg_clk); | ||
39 | return err; | ||
40 | } | ||
41 | |||
42 | writel(readl(S5P_USBHOST_PHY_CONTROL) | S5P_USBHOST_PHY_ENABLE, | ||
43 | S5P_USBHOST_PHY_CONTROL); | ||
44 | |||
45 | /* set clock frequency for PLL */ | ||
46 | phyclk = readl(EXYNOS4_PHYCLK) & ~CLKSEL_MASK; | ||
47 | |||
48 | xusbxti_clk = clk_get(&pdev->dev, "xusbxti"); | ||
49 | if (xusbxti_clk && !IS_ERR(xusbxti_clk)) { | ||
50 | switch (clk_get_rate(xusbxti_clk)) { | ||
51 | case 12 * MHZ: | ||
52 | phyclk |= CLKSEL_12M; | ||
53 | break; | ||
54 | case 24 * MHZ: | ||
55 | phyclk |= CLKSEL_24M; | ||
56 | break; | ||
57 | default: | ||
58 | case 48 * MHZ: | ||
59 | /* default reference clock */ | ||
60 | break; | ||
61 | } | ||
62 | clk_put(xusbxti_clk); | ||
63 | } | ||
64 | |||
65 | writel(phyclk, EXYNOS4_PHYCLK); | ||
66 | |||
67 | /* floating prevention logic: disable */ | ||
68 | writel((readl(EXYNOS4_PHY1CON) | FPENABLEN), EXYNOS4_PHY1CON); | ||
69 | |||
70 | /* set to normal HSIC 0 and 1 of PHY1 */ | ||
71 | writel((readl(EXYNOS4_PHYPWR) & ~PHY1_HSIC_NORMAL_MASK), | ||
72 | EXYNOS4_PHYPWR); | ||
73 | |||
74 | /* set to normal standard USB of PHY1 */ | ||
75 | writel((readl(EXYNOS4_PHYPWR) & ~PHY1_STD_NORMAL_MASK), EXYNOS4_PHYPWR); | ||
76 | |||
77 | /* reset all ports of both PHY and Link */ | ||
78 | rstcon = readl(EXYNOS4_RSTCON) | HOST_LINK_PORT_SWRST_MASK | | ||
79 | PHY1_SWRST_MASK; | ||
80 | writel(rstcon, EXYNOS4_RSTCON); | ||
81 | udelay(10); | ||
82 | |||
83 | rstcon &= ~(HOST_LINK_PORT_SWRST_MASK | PHY1_SWRST_MASK); | ||
84 | writel(rstcon, EXYNOS4_RSTCON); | ||
85 | udelay(50); | ||
86 | |||
87 | clk_disable(otg_clk); | ||
88 | clk_put(otg_clk); | ||
89 | |||
90 | return 0; | ||
91 | } | ||
92 | |||
93 | static int exynos4_usb_phy1_exit(struct platform_device *pdev) | ||
94 | { | ||
95 | struct clk *otg_clk; | ||
96 | int err; | ||
97 | |||
98 | otg_clk = clk_get(&pdev->dev, "otg"); | ||
99 | if (IS_ERR(otg_clk)) { | ||
100 | dev_err(&pdev->dev, "Failed to get otg clock\n"); | ||
101 | return PTR_ERR(otg_clk); | ||
102 | } | ||
103 | |||
104 | err = clk_enable(otg_clk); | ||
105 | if (err) { | ||
106 | clk_put(otg_clk); | ||
107 | return err; | ||
108 | } | ||
109 | |||
110 | writel((readl(EXYNOS4_PHYPWR) | PHY1_STD_ANALOG_POWERDOWN), | ||
111 | EXYNOS4_PHYPWR); | ||
112 | |||
113 | writel(readl(S5P_USBHOST_PHY_CONTROL) & ~S5P_USBHOST_PHY_ENABLE, | ||
114 | S5P_USBHOST_PHY_CONTROL); | ||
115 | |||
116 | clk_disable(otg_clk); | ||
117 | clk_put(otg_clk); | ||
118 | |||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | int s5p_usb_phy_init(struct platform_device *pdev, int type) | ||
123 | { | ||
124 | if (type == S5P_USB_PHY_HOST) | ||
125 | return exynos4_usb_phy1_init(pdev); | ||
126 | |||
127 | return -EINVAL; | ||
128 | } | ||
129 | |||
130 | int s5p_usb_phy_exit(struct platform_device *pdev, int type) | ||
131 | { | ||
132 | if (type == S5P_USB_PHY_HOST) | ||
133 | return exynos4_usb_phy1_exit(pdev); | ||
134 | |||
135 | return -EINVAL; | ||
136 | } | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h index 25bbf5a942dd..425552d84b60 100644 --- a/arch/arm/mach-s3c2410/include/mach/map.h +++ b/arch/arm/mach-s3c2410/include/mach/map.h | |||
@@ -21,6 +21,10 @@ | |||
21 | /* USB host controller */ | 21 | /* USB host controller */ |
22 | #define S3C2410_PA_USBHOST (0x49000000) | 22 | #define S3C2410_PA_USBHOST (0x49000000) |
23 | 23 | ||
24 | /* S3C2416/S3C2443/S3C2450 High-Speed USB Gadget */ | ||
25 | #define S3C2416_PA_HSUDC (0x49800000) | ||
26 | #define S3C2416_SZ_HSUDC (SZ_4K) | ||
27 | |||
24 | /* DMA controller */ | 28 | /* DMA controller */ |
25 | #define S3C2410_PA_DMA (0x4B000000) | 29 | #define S3C2410_PA_DMA (0x4B000000) |
26 | #define S3C24XX_SZ_DMA SZ_1M | 30 | #define S3C24XX_SZ_DMA SZ_1M |
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h index 44494a56e68b..5e06c7265835 100644 --- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h +++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h | |||
@@ -37,6 +37,10 @@ | |||
37 | #define S3C2443_SYSID S3C2443_CLKREG(0x5C) | 37 | #define S3C2443_SYSID S3C2443_CLKREG(0x5C) |
38 | #define S3C2443_PWRCFG S3C2443_CLKREG(0x60) | 38 | #define S3C2443_PWRCFG S3C2443_CLKREG(0x60) |
39 | #define S3C2443_RSTCON S3C2443_CLKREG(0x64) | 39 | #define S3C2443_RSTCON S3C2443_CLKREG(0x64) |
40 | #define S3C2443_PHYCTRL S3C2443_CLKREG(0x80) | ||
41 | #define S3C2443_PHYPWR S3C2443_CLKREG(0x84) | ||
42 | #define S3C2443_URSTCON S3C2443_CLKREG(0x88) | ||
43 | #define S3C2443_UCLKCON S3C2443_CLKREG(0x8C) | ||
40 | 44 | ||
41 | #define S3C2443_SWRST_RESET (0x533c2443) | 45 | #define S3C2443_SWRST_RESET (0x533c2443) |
42 | 46 | ||
@@ -121,6 +125,27 @@ | |||
121 | 125 | ||
122 | #define S3C2443_PWRCFG_SLEEP (1<<15) | 126 | #define S3C2443_PWRCFG_SLEEP (1<<15) |
123 | 127 | ||
128 | #define S3C2443_PWRCFG_USBPHY (1 << 4) | ||
129 | |||
130 | #define S3C2443_URSTCON_FUNCRST (1 << 2) | ||
131 | #define S3C2443_URSTCON_PHYRST (1 << 0) | ||
132 | |||
133 | #define S3C2443_PHYCTRL_CLKSEL (1 << 3) | ||
134 | #define S3C2443_PHYCTRL_EXTCLK (1 << 2) | ||
135 | #define S3C2443_PHYCTRL_PLLSEL (1 << 1) | ||
136 | #define S3C2443_PHYCTRL_DSPORT (1 << 0) | ||
137 | |||
138 | #define S3C2443_PHYPWR_COMMON_ON (1 << 31) | ||
139 | #define S3C2443_PHYPWR_ANALOG_PD (1 << 4) | ||
140 | #define S3C2443_PHYPWR_PLL_REFCLK (1 << 3) | ||
141 | #define S3C2443_PHYPWR_XO_ON (1 << 2) | ||
142 | #define S3C2443_PHYPWR_PLL_PWRDN (1 << 1) | ||
143 | #define S3C2443_PHYPWR_FSUSPEND (1 << 0) | ||
144 | |||
145 | #define S3C2443_UCLKCON_DETECT_VBUS (1 << 31) | ||
146 | #define S3C2443_UCLKCON_FUNC_CLKEN (1 << 2) | ||
147 | #define S3C2443_UCLKCON_TCLKEN (1 << 0) | ||
148 | |||
124 | #include <asm/div64.h> | 149 | #include <asm/div64.h> |
125 | 150 | ||
126 | static inline unsigned int | 151 | static inline unsigned int |
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c2416/mach-smdk2416.c index 3f83177246c7..ac27ebb31c9b 100644 --- a/arch/arm/mach-s3c2416/mach-smdk2416.c +++ b/arch/arm/mach-s3c2416/mach-smdk2416.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/mtd/partitions.h> | 23 | #include <linux/mtd/partitions.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/fb.h> | 25 | #include <linux/fb.h> |
26 | #include <linux/delay.h> | ||
26 | 27 | ||
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
@@ -35,6 +36,7 @@ | |||
35 | #include <plat/regs-serial.h> | 36 | #include <plat/regs-serial.h> |
36 | #include <mach/regs-gpio.h> | 37 | #include <mach/regs-gpio.h> |
37 | #include <mach/regs-lcd.h> | 38 | #include <mach/regs-lcd.h> |
39 | #include <mach/regs-s3c2443-clock.h> | ||
38 | 40 | ||
39 | #include <mach/idle.h> | 41 | #include <mach/idle.h> |
40 | #include <mach/leds-gpio.h> | 42 | #include <mach/leds-gpio.h> |
@@ -47,6 +49,7 @@ | |||
47 | #include <plat/cpu.h> | 49 | #include <plat/cpu.h> |
48 | #include <plat/nand.h> | 50 | #include <plat/nand.h> |
49 | #include <plat/sdhci.h> | 51 | #include <plat/sdhci.h> |
52 | #include <plat/udc.h> | ||
50 | 53 | ||
51 | #include <plat/regs-fb-v4.h> | 54 | #include <plat/regs-fb-v4.h> |
52 | #include <plat/fb.h> | 55 | #include <plat/fb.h> |
@@ -121,6 +124,27 @@ static struct s3c2410_uartcfg smdk2416_uartcfgs[] __initdata = { | |||
121 | } | 124 | } |
122 | }; | 125 | }; |
123 | 126 | ||
127 | void smdk2416_hsudc_gpio_init(void) | ||
128 | { | ||
129 | s3c_gpio_setpull(S3C2410_GPH(14), S3C_GPIO_PULL_UP); | ||
130 | s3c_gpio_setpull(S3C2410_GPF(2), S3C_GPIO_PULL_NONE); | ||
131 | s3c_gpio_cfgpin(S3C2410_GPH(14), S3C_GPIO_SFN(1)); | ||
132 | s3c2410_modify_misccr(S3C2416_MISCCR_SEL_SUSPND, 0); | ||
133 | } | ||
134 | |||
135 | void smdk2416_hsudc_gpio_uninit(void) | ||
136 | { | ||
137 | s3c2410_modify_misccr(S3C2416_MISCCR_SEL_SUSPND, 1); | ||
138 | s3c_gpio_setpull(S3C2410_GPH(14), S3C_GPIO_PULL_NONE); | ||
139 | s3c_gpio_cfgpin(S3C2410_GPH(14), S3C_GPIO_SFN(0)); | ||
140 | } | ||
141 | |||
142 | struct s3c24xx_hsudc_platdata smdk2416_hsudc_platdata = { | ||
143 | .epnum = 9, | ||
144 | .gpio_init = smdk2416_hsudc_gpio_init, | ||
145 | .gpio_uninit = smdk2416_hsudc_gpio_uninit, | ||
146 | }; | ||
147 | |||
124 | struct s3c_fb_pd_win smdk2416_fb_win[] = { | 148 | struct s3c_fb_pd_win smdk2416_fb_win[] = { |
125 | [0] = { | 149 | [0] = { |
126 | /* think this is the same as the smdk6410 */ | 150 | /* think this is the same as the smdk6410 */ |
@@ -186,6 +210,7 @@ static struct platform_device *smdk2416_devices[] __initdata = { | |||
186 | &s3c_device_i2c0, | 210 | &s3c_device_i2c0, |
187 | &s3c_device_hsmmc0, | 211 | &s3c_device_hsmmc0, |
188 | &s3c_device_hsmmc1, | 212 | &s3c_device_hsmmc1, |
213 | &s3c_device_usb_hsudc, | ||
189 | }; | 214 | }; |
190 | 215 | ||
191 | static void __init smdk2416_map_io(void) | 216 | static void __init smdk2416_map_io(void) |
@@ -203,6 +228,8 @@ static void __init smdk2416_machine_init(void) | |||
203 | s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata); | 228 | s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata); |
204 | s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata); | 229 | s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata); |
205 | 230 | ||
231 | s3c24xx_hsudc_set_platdata(&smdk2416_hsudc_platdata); | ||
232 | |||
206 | gpio_request(S3C2410_GPB(4), "USBHost Power"); | 233 | gpio_request(S3C2410_GPB(4), "USBHost Power"); |
207 | gpio_direction_output(S3C2410_GPB(4), 1); | 234 | gpio_direction_output(S3C2410_GPB(4), 1); |
208 | 235 | ||
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index 268f3ed0a105..73667994518a 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/string.h> | 24 | #include <linux/string.h> |
25 | #include <linux/dma-mapping.h> | ||
25 | 26 | ||
26 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 28 | #include <asm/mach/map.h> |
@@ -233,6 +234,46 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) | |||
233 | } | 234 | } |
234 | } | 235 | } |
235 | 236 | ||
237 | /* USB High Speed 2.0 Device (Gadget) */ | ||
238 | static struct resource s3c_hsudc_resource[] = { | ||
239 | [0] = { | ||
240 | .start = S3C2416_PA_HSUDC, | ||
241 | .end = S3C2416_PA_HSUDC + S3C2416_SZ_HSUDC - 1, | ||
242 | .flags = IORESOURCE_MEM, | ||
243 | }, | ||
244 | [1] = { | ||
245 | .start = IRQ_USBD, | ||
246 | .end = IRQ_USBD, | ||
247 | .flags = IORESOURCE_IRQ, | ||
248 | } | ||
249 | }; | ||
250 | |||
251 | static u64 s3c_hsudc_dmamask = DMA_BIT_MASK(32); | ||
252 | |||
253 | struct platform_device s3c_device_usb_hsudc = { | ||
254 | .name = "s3c-hsudc", | ||
255 | .id = -1, | ||
256 | .num_resources = ARRAY_SIZE(s3c_hsudc_resource), | ||
257 | .resource = s3c_hsudc_resource, | ||
258 | .dev = { | ||
259 | .dma_mask = &s3c_hsudc_dmamask, | ||
260 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
261 | }, | ||
262 | }; | ||
263 | |||
264 | void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) | ||
265 | { | ||
266 | struct s3c24xx_hsudc_platdata *npd; | ||
267 | |||
268 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | ||
269 | if (npd) { | ||
270 | memcpy(npd, pd, sizeof(*npd)); | ||
271 | s3c_device_usb_hsudc.dev.platform_data = npd; | ||
272 | } else { | ||
273 | printk(KERN_ERR "no memory for udc platform data\n"); | ||
274 | } | ||
275 | } | ||
276 | |||
236 | /* IIS */ | 277 | /* IIS */ |
237 | 278 | ||
238 | static struct resource s3c_iis_resource[] = { | 279 | static struct resource s3c_iis_resource[] = { |
diff --git a/arch/arm/plat-s3c24xx/include/plat/udc.h b/arch/arm/plat-s3c24xx/include/plat/udc.h index 80457c6414aa..f63884242506 100644 --- a/arch/arm/plat-s3c24xx/include/plat/udc.h +++ b/arch/arm/plat-s3c24xx/include/plat/udc.h | |||
@@ -37,4 +37,21 @@ struct s3c2410_udc_mach_info { | |||
37 | 37 | ||
38 | extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *); | 38 | extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *); |
39 | 39 | ||
40 | /** | ||
41 | * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller. | ||
42 | * @epnum: Number of endpoints to be instantiated by the controller driver. | ||
43 | * @gpio_init: Platform specific USB related GPIO initialization. | ||
44 | * @gpio_uninit: Platform specific USB releted GPIO uninitialzation. | ||
45 | * | ||
46 | * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget | ||
47 | * controllers. | ||
48 | */ | ||
49 | struct s3c24xx_hsudc_platdata { | ||
50 | unsigned int epnum; | ||
51 | void (*gpio_init)(void); | ||
52 | void (*gpio_uninit)(void); | ||
53 | }; | ||
54 | |||
55 | extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd); | ||
56 | |||
40 | #endif /* __ASM_ARM_ARCH_UDC_H */ | 57 | #endif /* __ASM_ARM_ARCH_UDC_H */ |
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig index 849229716586..6751bcf7b888 100644 --- a/arch/arm/plat-s5p/Kconfig +++ b/arch/arm/plat-s5p/Kconfig | |||
@@ -85,6 +85,11 @@ config S5P_DEV_CSIS1 | |||
85 | help | 85 | help |
86 | Compile in platform device definitions for MIPI-CSIS channel 1 | 86 | Compile in platform device definitions for MIPI-CSIS channel 1 |
87 | 87 | ||
88 | config S5P_DEV_USB_EHCI | ||
89 | bool | ||
90 | help | ||
91 | Compile in platform device definition for USB EHCI | ||
92 | |||
88 | config S5P_SETUP_MIPIPHY | 93 | config S5P_SETUP_MIPIPHY |
89 | bool | 94 | bool |
90 | help | 95 | help |
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile index 42afff7f60be..e234cc4d49a0 100644 --- a/arch/arm/plat-s5p/Makefile +++ b/arch/arm/plat-s5p/Makefile | |||
@@ -33,4 +33,5 @@ obj-$(CONFIG_S5P_DEV_FIMC3) += dev-fimc3.o | |||
33 | obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o | 33 | obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o |
34 | obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o | 34 | obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o |
35 | obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o | 35 | obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o |
36 | obj-$(CONFIG_S5P_DEV_USB_EHCI) += dev-ehci.o | ||
36 | obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o | 37 | obj-$(CONFIG_S5P_SETUP_MIPIPHY) += setup-mipiphy.o |
diff --git a/arch/arm/plat-s5p/dev-ehci.c b/arch/arm/plat-s5p/dev-ehci.c new file mode 100644 index 000000000000..94080fff9e9b --- /dev/null +++ b/arch/arm/plat-s5p/dev-ehci.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
3 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/platform_device.h> | ||
13 | #include <mach/irqs.h> | ||
14 | #include <mach/map.h> | ||
15 | #include <plat/devs.h> | ||
16 | #include <plat/ehci.h> | ||
17 | #include <plat/usb-phy.h> | ||
18 | |||
19 | /* USB EHCI Host Controller registration */ | ||
20 | static struct resource s5p_ehci_resource[] = { | ||
21 | [0] = { | ||
22 | .start = S5P_PA_EHCI, | ||
23 | .end = S5P_PA_EHCI + SZ_256 - 1, | ||
24 | .flags = IORESOURCE_MEM, | ||
25 | }, | ||
26 | [1] = { | ||
27 | .start = IRQ_USB_HOST, | ||
28 | .end = IRQ_USB_HOST, | ||
29 | .flags = IORESOURCE_IRQ, | ||
30 | } | ||
31 | }; | ||
32 | |||
33 | static u64 s5p_device_ehci_dmamask = 0xffffffffUL; | ||
34 | |||
35 | struct platform_device s5p_device_ehci = { | ||
36 | .name = "s5p-ehci", | ||
37 | .id = -1, | ||
38 | .num_resources = ARRAY_SIZE(s5p_ehci_resource), | ||
39 | .resource = s5p_ehci_resource, | ||
40 | .dev = { | ||
41 | .dma_mask = &s5p_device_ehci_dmamask, | ||
42 | .coherent_dma_mask = 0xffffffffUL | ||
43 | } | ||
44 | }; | ||
45 | |||
46 | void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd) | ||
47 | { | ||
48 | struct s5p_ehci_platdata *npd; | ||
49 | |||
50 | npd = s3c_set_platdata(pd, sizeof(struct s5p_ehci_platdata), | ||
51 | &s5p_device_ehci); | ||
52 | |||
53 | if (!npd->phy_init) | ||
54 | npd->phy_init = s5p_usb_phy_init; | ||
55 | if (!npd->phy_exit) | ||
56 | npd->phy_exit = s5p_usb_phy_exit; | ||
57 | } | ||
diff --git a/arch/arm/plat-s5p/include/plat/ehci.h b/arch/arm/plat-s5p/include/plat/ehci.h new file mode 100644 index 000000000000..6ae6810c7569 --- /dev/null +++ b/arch/arm/plat-s5p/include/plat/ehci.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
3 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef __PLAT_S5P_EHCI_H | ||
12 | #define __PLAT_S5P_EHCI_H | ||
13 | |||
14 | struct s5p_ehci_platdata { | ||
15 | int (*phy_init)(struct platform_device *pdev, int type); | ||
16 | int (*phy_exit)(struct platform_device *pdev, int type); | ||
17 | }; | ||
18 | |||
19 | extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd); | ||
20 | |||
21 | #endif /* __PLAT_S5P_EHCI_H */ | ||
diff --git a/arch/arm/plat-s5p/include/plat/map-s5p.h b/arch/arm/plat-s5p/include/plat/map-s5p.h index d973d39666a3..a6c3d327ce72 100644 --- a/arch/arm/plat-s5p/include/plat/map-s5p.h +++ b/arch/arm/plat-s5p/include/plat/map-s5p.h | |||
@@ -39,7 +39,7 @@ | |||
39 | #define S5P_VA_TWD S5P_VA_COREPERI(0x600) | 39 | #define S5P_VA_TWD S5P_VA_COREPERI(0x600) |
40 | #define S5P_VA_GIC_DIST S5P_VA_COREPERI(0x1000) | 40 | #define S5P_VA_GIC_DIST S5P_VA_COREPERI(0x1000) |
41 | 41 | ||
42 | #define S3C_VA_USB_HSPHY S3C_ADDR(0x02900000) | 42 | #define S5P_VA_USB_HSPHY S3C_ADDR(0x02900000) |
43 | 43 | ||
44 | #define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000)) | 44 | #define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000)) |
45 | #define VA_VIC0 VA_VIC(0) | 45 | #define VA_VIC0 VA_VIC(0) |
diff --git a/arch/arm/plat-s5p/include/plat/usb-phy.h b/arch/arm/plat-s5p/include/plat/usb-phy.h new file mode 100644 index 000000000000..6dd6bcfca3ce --- /dev/null +++ b/arch/arm/plat-s5p/include/plat/usb-phy.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Samsung Electronics Co.Ltd | ||
3 | * Author: Joonyoung Shim <jy0922.shim@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef __PLAT_S5P_USB_PHY_H | ||
12 | #define __PLAT_S5P_USB_PHY_H | ||
13 | |||
14 | enum s5p_usb_phy_type { | ||
15 | S5P_USB_PHY_DEVICE, | ||
16 | S5P_USB_PHY_HOST, | ||
17 | }; | ||
18 | |||
19 | extern int s5p_usb_phy_init(struct platform_device *pdev, int type); | ||
20 | extern int s5p_usb_phy_exit(struct platform_device *pdev, int type); | ||
21 | |||
22 | #endif /* __PLAT_S5P_REGS_USB_PHY_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h index f0da6b70fba4..39818d8da420 100644 --- a/arch/arm/plat-samsung/include/plat/devs.h +++ b/arch/arm/plat-samsung/include/plat/devs.h | |||
@@ -88,6 +88,7 @@ extern struct platform_device s3c64xx_device_onenand1; | |||
88 | extern struct platform_device s5p_device_onenand; | 88 | extern struct platform_device s5p_device_onenand; |
89 | 89 | ||
90 | extern struct platform_device s3c_device_usbgadget; | 90 | extern struct platform_device s3c_device_usbgadget; |
91 | extern struct platform_device s3c_device_usb_hsudc; | ||
91 | extern struct platform_device s3c_device_usb_hsotg; | 92 | extern struct platform_device s3c_device_usb_hsotg; |
92 | 93 | ||
93 | extern struct platform_device s5pv210_device_ac97; | 94 | extern struct platform_device s5pv210_device_ac97; |
@@ -142,6 +143,8 @@ extern struct platform_device s5p_device_fimc3; | |||
142 | extern struct platform_device s5p_device_mipi_csis0; | 143 | extern struct platform_device s5p_device_mipi_csis0; |
143 | extern struct platform_device s5p_device_mipi_csis1; | 144 | extern struct platform_device s5p_device_mipi_csis1; |
144 | 145 | ||
146 | extern struct platform_device s5p_device_ehci; | ||
147 | |||
145 | extern struct platform_device exynos4_device_sysmmu; | 148 | extern struct platform_device exynos4_device_sysmmu; |
146 | 149 | ||
147 | /* s3c2440 specific devices */ | 150 | /* s3c2440 specific devices */ |
diff --git a/arch/mips/ath79/Kconfig b/arch/mips/ath79/Kconfig index b05828260f7f..47707410582c 100644 --- a/arch/mips/ath79/Kconfig +++ b/arch/mips/ath79/Kconfig | |||
@@ -26,12 +26,17 @@ config ATH79_MACH_PB44 | |||
26 | endmenu | 26 | endmenu |
27 | 27 | ||
28 | config SOC_AR71XX | 28 | config SOC_AR71XX |
29 | select USB_ARCH_HAS_EHCI | ||
30 | select USB_ARCH_HAS_OHCI | ||
29 | def_bool n | 31 | def_bool n |
30 | 32 | ||
31 | config SOC_AR724X | 33 | config SOC_AR724X |
34 | select USB_ARCH_HAS_EHCI | ||
35 | select USB_ARCH_HAS_OHCI | ||
32 | def_bool n | 36 | def_bool n |
33 | 37 | ||
34 | config SOC_AR913X | 38 | config SOC_AR913X |
39 | select USB_ARCH_HAS_EHCI | ||
35 | def_bool n | 40 | def_bool n |
36 | 41 | ||
37 | config ATH79_DEV_AR913X_WMAC | 42 | config ATH79_DEV_AR913X_WMAC |