diff options
Diffstat (limited to 'arch/arm/mach-omap2/board-omap4panda.c')
-rw-r--r-- | arch/arm/mach-omap2/board-omap4panda.c | 55 |
1 files changed, 21 insertions, 34 deletions
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index b02c2f00609b..a71ad345f20d 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/ti_wilink_st.h> | 31 | #include <linux/ti_wilink_st.h> |
32 | #include <linux/usb/musb.h> | 32 | #include <linux/usb/musb.h> |
33 | #include <linux/usb/phy.h> | 33 | #include <linux/usb/phy.h> |
34 | #include <linux/usb/nop-usb-xceiv.h> | ||
34 | #include <linux/wl12xx.h> | 35 | #include <linux/wl12xx.h> |
35 | #include <linux/irqchip/arm-gic.h> | 36 | #include <linux/irqchip/arm-gic.h> |
36 | #include <linux/platform_data/omap-abe-twl6040.h> | 37 | #include <linux/platform_data/omap-abe-twl6040.h> |
@@ -132,6 +133,22 @@ static struct platform_device btwilink_device = { | |||
132 | .id = -1, | 133 | .id = -1, |
133 | }; | 134 | }; |
134 | 135 | ||
136 | /* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */ | ||
137 | static struct nop_usb_xceiv_platform_data hsusb1_phy_data = { | ||
138 | /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ | ||
139 | .clk_rate = 19200000, | ||
140 | }; | ||
141 | |||
142 | static struct usbhs_phy_data phy_data[] __initdata = { | ||
143 | { | ||
144 | .port = 1, | ||
145 | .reset_gpio = GPIO_HUB_NRESET, | ||
146 | .vcc_gpio = GPIO_HUB_POWER, | ||
147 | .vcc_polarity = 1, | ||
148 | .platform_data = &hsusb1_phy_data, | ||
149 | }, | ||
150 | }; | ||
151 | |||
135 | static struct platform_device *panda_devices[] __initdata = { | 152 | static struct platform_device *panda_devices[] __initdata = { |
136 | &leds_gpio, | 153 | &leds_gpio, |
137 | &wl1271_device, | 154 | &wl1271_device, |
@@ -142,49 +159,19 @@ static struct platform_device *panda_devices[] __initdata = { | |||
142 | 159 | ||
143 | static struct usbhs_omap_platform_data usbhs_bdata __initdata = { | 160 | static struct usbhs_omap_platform_data usbhs_bdata __initdata = { |
144 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, | 161 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
145 | .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, | ||
146 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, | ||
147 | .phy_reset = false, | ||
148 | .reset_gpio_port[0] = -EINVAL, | ||
149 | .reset_gpio_port[1] = -EINVAL, | ||
150 | .reset_gpio_port[2] = -EINVAL | ||
151 | }; | ||
152 | |||
153 | static struct gpio panda_ehci_gpios[] __initdata = { | ||
154 | { GPIO_HUB_POWER, GPIOF_OUT_INIT_LOW, "hub_power" }, | ||
155 | { GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" }, | ||
156 | }; | 162 | }; |
157 | 163 | ||
158 | static void __init omap4_ehci_init(void) | 164 | static void __init omap4_ehci_init(void) |
159 | { | 165 | { |
160 | int ret; | 166 | int ret; |
161 | struct clk *phy_ref_clk; | ||
162 | 167 | ||
163 | /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ | 168 | /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ |
164 | phy_ref_clk = clk_get(NULL, "auxclk3_ck"); | 169 | ret = clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL); |
165 | if (IS_ERR(phy_ref_clk)) { | 170 | if (ret) |
166 | pr_err("Cannot request auxclk3\n"); | 171 | pr_err("Failed to add main_clk alias to auxclk3_ck\n"); |
167 | return; | ||
168 | } | ||
169 | clk_set_rate(phy_ref_clk, 19200000); | ||
170 | clk_prepare_enable(phy_ref_clk); | ||
171 | |||
172 | /* disable the power to the usb hub prior to init and reset phy+hub */ | ||
173 | ret = gpio_request_array(panda_ehci_gpios, | ||
174 | ARRAY_SIZE(panda_ehci_gpios)); | ||
175 | if (ret) { | ||
176 | pr_err("Unable to initialize EHCI power/reset\n"); | ||
177 | return; | ||
178 | } | ||
179 | |||
180 | gpio_export(GPIO_HUB_POWER, 0); | ||
181 | gpio_export(GPIO_HUB_NRESET, 0); | ||
182 | gpio_set_value(GPIO_HUB_NRESET, 1); | ||
183 | 172 | ||
173 | usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); | ||
184 | usbhs_init(&usbhs_bdata); | 174 | usbhs_init(&usbhs_bdata); |
185 | |||
186 | /* enable power to hub */ | ||
187 | gpio_set_value(GPIO_HUB_POWER, 1); | ||
188 | } | 175 | } |
189 | 176 | ||
190 | static struct omap_musb_board_data musb_board_data = { | 177 | static struct omap_musb_board_data musb_board_data = { |