diff options
author | David Brown <davidb@codeaurora.org> | 2010-12-21 13:53:43 -0500 |
---|---|---|
committer | David Brown <davidb@codeaurora.org> | 2010-12-21 13:53:43 -0500 |
commit | c6d92e9b84da2002ee7a75b784834970ddfd3bfd (patch) | |
tree | a90a39c4f79c19a64198aa19f1c7fab058901471 | |
parent | ba119204ff6ff722dcec387b305d9c2d23380726 (diff) | |
parent | 5155e2c70fc50bc475911dab5dba2f80130523c7 (diff) |
Merge branch 'msm-usb' into for-next
* msm-usb:
MSM: Add USB support for MSM7x30
MSM: Add USB suport for QSD8x50
-rw-r--r-- | arch/arm/mach-msm/board-msm7x30.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-msm/board-qsd8x50.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices-msm7x30.c | 72 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices-qsd8x50.c | 71 | ||||
-rw-r--r-- | arch/arm/mach-msm/devices.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/msm_iomap-7x30.h | 3 |
6 files changed, 187 insertions, 0 deletions
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c index 05241df3f9b6..6f3b9735e970 100644 --- a/arch/arm/mach-msm/board-msm7x30.c +++ b/arch/arm/mach-msm/board-msm7x30.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/smsc911x.h> | 24 | #include <linux/smsc911x.h> |
25 | #include <linux/usb/msm_hsusb.h> | ||
25 | 26 | ||
26 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
@@ -39,11 +40,26 @@ | |||
39 | 40 | ||
40 | extern struct sys_timer msm_timer; | 41 | extern struct sys_timer msm_timer; |
41 | 42 | ||
43 | static int hsusb_phy_init_seq[] = { | ||
44 | 0x30, 0x32, /* Enable and set Pre-Emphasis Depth to 20% */ | ||
45 | 0x02, 0x36, /* Disable CDR Auto Reset feature */ | ||
46 | -1 | ||
47 | }; | ||
48 | |||
49 | static struct msm_otg_platform_data msm_otg_pdata = { | ||
50 | .phy_init_seq = hsusb_phy_init_seq, | ||
51 | .mode = USB_PERIPHERAL, | ||
52 | .otg_control = OTG_PHY_CONTROL, | ||
53 | }; | ||
54 | |||
42 | static struct platform_device *devices[] __initdata = { | 55 | static struct platform_device *devices[] __initdata = { |
43 | #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER) | 56 | #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER) |
44 | &msm_device_uart2, | 57 | &msm_device_uart2, |
45 | #endif | 58 | #endif |
46 | &msm_device_smd, | 59 | &msm_device_smd, |
60 | &msm_device_otg, | ||
61 | &msm_device_hsusb, | ||
62 | &msm_device_hsusb_host, | ||
47 | }; | 63 | }; |
48 | 64 | ||
49 | static void __init msm7x30_init_irq(void) | 65 | static void __init msm7x30_init_irq(void) |
@@ -53,6 +69,10 @@ static void __init msm7x30_init_irq(void) | |||
53 | 69 | ||
54 | static void __init msm7x30_init(void) | 70 | static void __init msm7x30_init(void) |
55 | { | 71 | { |
72 | msm_device_otg.dev.platform_data = &msm_otg_pdata; | ||
73 | msm_device_hsusb.dev.parent = &msm_device_otg.dev; | ||
74 | msm_device_hsusb_host.dev.parent = &msm_device_otg.dev; | ||
75 | |||
56 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 76 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
57 | } | 77 | } |
58 | 78 | ||
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c index ed2af4ad97ed..2e8391307f55 100644 --- a/arch/arm/mach-msm/board-qsd8x50.c +++ b/arch/arm/mach-msm/board-qsd8x50.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/usb/msm_hsusb.h> | ||
23 | 24 | ||
24 | #include <asm/mach-types.h> | 25 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
@@ -74,9 +75,24 @@ static int __init msm_init_smc91x(void) | |||
74 | } | 75 | } |
75 | module_init(msm_init_smc91x); | 76 | module_init(msm_init_smc91x); |
76 | 77 | ||
78 | static int hsusb_phy_init_seq[] = { | ||
79 | 0x08, 0x31, /* Increase HS Driver Amplitude */ | ||
80 | 0x20, 0x32, /* Enable and set Pre-Emphasis Depth to 10% */ | ||
81 | -1 | ||
82 | }; | ||
83 | |||
84 | static struct msm_otg_platform_data msm_otg_pdata = { | ||
85 | .phy_init_seq = hsusb_phy_init_seq, | ||
86 | .mode = USB_PERIPHERAL, | ||
87 | .otg_control = OTG_PHY_CONTROL, | ||
88 | }; | ||
89 | |||
77 | static struct platform_device *devices[] __initdata = { | 90 | static struct platform_device *devices[] __initdata = { |
78 | &msm_device_uart3, | 91 | &msm_device_uart3, |
79 | &msm_device_smd, | 92 | &msm_device_smd, |
93 | &msm_device_otg, | ||
94 | &msm_device_hsusb, | ||
95 | &msm_device_hsusb_host, | ||
80 | }; | 96 | }; |
81 | 97 | ||
82 | static void __init qsd8x50_map_io(void) | 98 | static void __init qsd8x50_map_io(void) |
@@ -93,6 +109,9 @@ static void __init qsd8x50_init_irq(void) | |||
93 | 109 | ||
94 | static void __init qsd8x50_init(void) | 110 | static void __init qsd8x50_init(void) |
95 | { | 111 | { |
112 | msm_device_otg.dev.platform_data = &msm_otg_pdata; | ||
113 | msm_device_hsusb.dev.parent = &msm_device_otg.dev; | ||
114 | msm_device_hsusb_host.dev.parent = &msm_device_otg.dev; | ||
96 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 115 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
97 | } | 116 | } |
98 | 117 | ||
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c index 7fcf2e3b7698..4e9a0ab3e937 100644 --- a/arch/arm/mach-msm/devices-msm7x30.c +++ b/arch/arm/mach-msm/devices-msm7x30.c | |||
@@ -56,6 +56,77 @@ struct platform_device msm_device_smd = { | |||
56 | .id = -1, | 56 | .id = -1, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static struct resource resources_otg[] = { | ||
60 | { | ||
61 | .start = MSM_HSUSB_PHYS, | ||
62 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
63 | .flags = IORESOURCE_MEM, | ||
64 | }, | ||
65 | { | ||
66 | .start = INT_USB_HS, | ||
67 | .end = INT_USB_HS, | ||
68 | .flags = IORESOURCE_IRQ, | ||
69 | }, | ||
70 | }; | ||
71 | |||
72 | struct platform_device msm_device_otg = { | ||
73 | .name = "msm_otg", | ||
74 | .id = -1, | ||
75 | .num_resources = ARRAY_SIZE(resources_otg), | ||
76 | .resource = resources_otg, | ||
77 | .dev = { | ||
78 | .coherent_dma_mask = 0xffffffff, | ||
79 | }, | ||
80 | }; | ||
81 | |||
82 | static struct resource resources_hsusb[] = { | ||
83 | { | ||
84 | .start = MSM_HSUSB_PHYS, | ||
85 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
86 | .flags = IORESOURCE_MEM, | ||
87 | }, | ||
88 | { | ||
89 | .start = INT_USB_HS, | ||
90 | .end = INT_USB_HS, | ||
91 | .flags = IORESOURCE_IRQ, | ||
92 | }, | ||
93 | }; | ||
94 | |||
95 | struct platform_device msm_device_hsusb = { | ||
96 | .name = "msm_hsusb", | ||
97 | .id = -1, | ||
98 | .num_resources = ARRAY_SIZE(resources_hsusb), | ||
99 | .resource = resources_hsusb, | ||
100 | .dev = { | ||
101 | .coherent_dma_mask = 0xffffffff, | ||
102 | }, | ||
103 | }; | ||
104 | |||
105 | static u64 dma_mask = 0xffffffffULL; | ||
106 | static struct resource resources_hsusb_host[] = { | ||
107 | { | ||
108 | .start = MSM_HSUSB_PHYS, | ||
109 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
110 | .flags = IORESOURCE_MEM, | ||
111 | }, | ||
112 | { | ||
113 | .start = INT_USB_HS, | ||
114 | .end = INT_USB_HS, | ||
115 | .flags = IORESOURCE_IRQ, | ||
116 | }, | ||
117 | }; | ||
118 | |||
119 | struct platform_device msm_device_hsusb_host = { | ||
120 | .name = "msm_hsusb_host", | ||
121 | .id = -1, | ||
122 | .num_resources = ARRAY_SIZE(resources_hsusb_host), | ||
123 | .resource = resources_hsusb_host, | ||
124 | .dev = { | ||
125 | .dma_mask = &dma_mask, | ||
126 | .coherent_dma_mask = 0xffffffffULL, | ||
127 | }, | ||
128 | }; | ||
129 | |||
59 | struct clk msm_clocks_7x30[] = { | 130 | struct clk msm_clocks_7x30[] = { |
60 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), | 131 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), |
61 | CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), | 132 | CLK_PCOM("adsp_clk", ADSP_CLK, NULL, 0), |
@@ -107,6 +178,7 @@ struct clk msm_clocks_7x30[] = { | |||
107 | CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), | 178 | CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), |
108 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), | 179 | CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), |
109 | CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), | 180 | CLK_PCOM("uart_clk", UART2_CLK, &msm_device_uart2.dev, 0), |
181 | CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), | ||
110 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), | 182 | CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), |
111 | CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), | 183 | CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), |
112 | CLK_PCOM("usb_hs_core_clk", USB_HS_CORE_CLK, NULL, OFF), | 184 | CLK_PCOM("usb_hs_core_clk", USB_HS_CORE_CLK, NULL, OFF), |
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c index 6fe67c5d1ae0..a4b798f20ccb 100644 --- a/arch/arm/mach-msm/devices-qsd8x50.c +++ b/arch/arm/mach-msm/devices-qsd8x50.c | |||
@@ -53,6 +53,77 @@ struct platform_device msm_device_smd = { | |||
53 | .id = -1, | 53 | .id = -1, |
54 | }; | 54 | }; |
55 | 55 | ||
56 | static struct resource resources_otg[] = { | ||
57 | { | ||
58 | .start = MSM_HSUSB_PHYS, | ||
59 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
60 | .flags = IORESOURCE_MEM, | ||
61 | }, | ||
62 | { | ||
63 | .start = INT_USB_HS, | ||
64 | .end = INT_USB_HS, | ||
65 | .flags = IORESOURCE_IRQ, | ||
66 | }, | ||
67 | }; | ||
68 | |||
69 | struct platform_device msm_device_otg = { | ||
70 | .name = "msm_otg", | ||
71 | .id = -1, | ||
72 | .num_resources = ARRAY_SIZE(resources_otg), | ||
73 | .resource = resources_otg, | ||
74 | .dev = { | ||
75 | .coherent_dma_mask = 0xffffffff, | ||
76 | }, | ||
77 | }; | ||
78 | |||
79 | static struct resource resources_hsusb[] = { | ||
80 | { | ||
81 | .start = MSM_HSUSB_PHYS, | ||
82 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
83 | .flags = IORESOURCE_MEM, | ||
84 | }, | ||
85 | { | ||
86 | .start = INT_USB_HS, | ||
87 | .end = INT_USB_HS, | ||
88 | .flags = IORESOURCE_IRQ, | ||
89 | }, | ||
90 | }; | ||
91 | |||
92 | struct platform_device msm_device_hsusb = { | ||
93 | .name = "msm_hsusb", | ||
94 | .id = -1, | ||
95 | .num_resources = ARRAY_SIZE(resources_hsusb), | ||
96 | .resource = resources_hsusb, | ||
97 | .dev = { | ||
98 | .coherent_dma_mask = 0xffffffff, | ||
99 | }, | ||
100 | }; | ||
101 | |||
102 | static u64 dma_mask = 0xffffffffULL; | ||
103 | static struct resource resources_hsusb_host[] = { | ||
104 | { | ||
105 | .start = MSM_HSUSB_PHYS, | ||
106 | .end = MSM_HSUSB_PHYS + MSM_HSUSB_SIZE, | ||
107 | .flags = IORESOURCE_MEM, | ||
108 | }, | ||
109 | { | ||
110 | .start = INT_USB_HS, | ||
111 | .end = INT_USB_HS, | ||
112 | .flags = IORESOURCE_IRQ, | ||
113 | }, | ||
114 | }; | ||
115 | |||
116 | struct platform_device msm_device_hsusb_host = { | ||
117 | .name = "msm_hsusb_host", | ||
118 | .id = -1, | ||
119 | .num_resources = ARRAY_SIZE(resources_hsusb_host), | ||
120 | .resource = resources_hsusb_host, | ||
121 | .dev = { | ||
122 | .dma_mask = &dma_mask, | ||
123 | .coherent_dma_mask = 0xffffffffULL, | ||
124 | }, | ||
125 | }; | ||
126 | |||
56 | struct clk msm_clocks_8x50[] = { | 127 | struct clk msm_clocks_8x50[] = { |
57 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), | 128 | CLK_PCOM("adm_clk", ADM_CLK, NULL, 0), |
58 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), | 129 | CLK_PCOM("ebi1_clk", EBI1_CLK, NULL, CLK_MIN), |
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h index 68b8075f8ca4..87c70bfce2bd 100644 --- a/arch/arm/mach-msm/devices.h +++ b/arch/arm/mach-msm/devices.h | |||
@@ -28,6 +28,8 @@ extern struct platform_device msm_device_sdc3; | |||
28 | extern struct platform_device msm_device_sdc4; | 28 | extern struct platform_device msm_device_sdc4; |
29 | 29 | ||
30 | extern struct platform_device msm_device_hsusb; | 30 | extern struct platform_device msm_device_hsusb; |
31 | extern struct platform_device msm_device_otg; | ||
32 | extern struct platform_device msm_device_hsusb_host; | ||
31 | 33 | ||
32 | extern struct platform_device msm_device_i2c; | 34 | extern struct platform_device msm_device_i2c; |
33 | 35 | ||
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h index 8a00c2defbc1..0fd7b68ca114 100644 --- a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h +++ b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h | |||
@@ -119,4 +119,7 @@ | |||
119 | #define MSM_AD5_PHYS 0xA7000000 | 119 | #define MSM_AD5_PHYS 0xA7000000 |
120 | #define MSM_AD5_SIZE (SZ_1M*13) | 120 | #define MSM_AD5_SIZE (SZ_1M*13) |
121 | 121 | ||
122 | #define MSM_HSUSB_PHYS 0xA3600000 | ||
123 | #define MSM_HSUSB_SIZE SZ_1K | ||
124 | |||
122 | #endif | 125 | #endif |