blob: 442028a764c71f3473a81f35bbe791a05ceb357a [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Dirk Behme9d0fc812009-01-28 21:39:57 +01002/*
3 * Maintainer : Steve Sakoman <steve@sakoman.com>
4 *
5 * Derived from Beagle Board, 3430 SDP, and OMAP3EVM code by
6 * Richard Woodruff <r-woodruff2@ti.com>
7 * Syed Mohammed Khasim <khasim@ti.com>
8 * Sunil Kumar <sunilsaini05@gmail.com>
9 * Shashi Ranjan <shashiranjanmca05@gmail.com>
10 *
11 * (C) Copyright 2004-2008
12 * Texas Instruments, <www.ti.com>
Dirk Behme9d0fc812009-01-28 21:39:57 +010013 */
14#include <common.h>
Simon Glassb3f4ca12014-10-22 21:37:15 -060015#include <dm.h>
Simon Glass9fb625c2019-08-01 09:46:51 -060016#include <env.h>
Simon Glassb3f4ca12014-10-22 21:37:15 -060017#include <ns16550.h>
Olof Johanssondf382622009-09-29 10:22:45 -040018#include <netdev.h>
Tom Rix2c155132009-06-28 12:52:30 -050019#include <twl4030.h>
Masahiro Yamada6ae39002017-11-30 13:45:24 +090020#include <linux/mtd/rawnand.h>
Dirk Behme9d0fc812009-01-28 21:39:57 +010021#include <asm/io.h>
Steve Sakomancd7c5722010-09-19 21:21:07 -070022#include <asm/arch/mmc_host_def.h>
Dirk Behme9d0fc812009-01-28 21:39:57 +010023#include <asm/arch/mux.h>
Olof Johanssondf382622009-09-29 10:22:45 -040024#include <asm/arch/mem.h>
Dirk Behme9d0fc812009-01-28 21:39:57 +010025#include <asm/arch/sys_proto.h>
Sanjeev Premi84c3b632011-09-08 10:51:01 -040026#include <asm/gpio.h>
Dirk Behme9d0fc812009-01-28 21:39:57 +010027#include <asm/mach-types.h>
28#include "overo.h"
29
Tom Rini8850c5d2017-05-12 22:33:27 -040030#ifdef CONFIG_USB_EHCI_HCD
Stefan Herbrechtsmeierf5c30c12014-09-16 17:51:09 +020031#include <usb.h>
32#include <asm/ehci-omap.h>
33#endif
34
Steve Sakomand64b5b82010-09-20 08:05:14 -070035#define TWL4030_I2C_BUS 0
36#define EXPANSION_EEPROM_I2C_BUS 2
37#define EXPANSION_EEPROM_I2C_ADDRESS 0x51
38
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +020039#define GUMSTIX_EMPTY_EEPROM 0x0
40
Steve Sakomand64b5b82010-09-20 08:05:14 -070041#define GUMSTIX_SUMMIT 0x01000200
42#define GUMSTIX_TOBI 0x02000200
43#define GUMSTIX_TOBI_DUO 0x03000200
44#define GUMSTIX_PALO35 0x04000200
45#define GUMSTIX_PALO43 0x05000200
46#define GUMSTIX_CHESTNUT43 0x06000200
47#define GUMSTIX_PINTO 0x07000200
48#define GUMSTIX_GALLOP43 0x08000200
Ash Charlesea5940e2014-05-21 14:04:53 -070049#define GUMSTIX_ALTO35 0x09000200
50#define GUMSTIX_STAGECOACH 0x0A000200
51#define GUMSTIX_THUMBO 0x0B000200
52#define GUMSTIX_TURTLECORE 0x0C000200
53#define GUMSTIX_ARBOR43C 0x0D000200
Steve Sakomand64b5b82010-09-20 08:05:14 -070054
55#define ETTUS_USRP_E 0x01000300
56
57#define GUMSTIX_NO_EEPROM 0xffffffff
58
59static struct {
60 unsigned int device_vendor;
61 unsigned char revision;
62 unsigned char content;
63 char fab_revision[8];
64 char env_var[16];
65 char env_setting[64];
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +020066} expansion_config = {0x0};
Steve Sakomanba9a11e2010-08-12 21:07:02 -070067
Simon Glassb3f4ca12014-10-22 21:37:15 -060068static const struct ns16550_platdata overo_serial = {
Adam Ford2f6ed3b2016-03-07 21:08:49 -060069 .base = OMAP34XX_UART3,
70 .reg_shift = 2,
Heiko Schocher17fa0322017-01-18 08:05:49 +010071 .clock = V_NS16550_CLK,
72 .fcr = UART_FCR_DEFVAL,
Simon Glassb3f4ca12014-10-22 21:37:15 -060073};
74
75U_BOOT_DEVICE(overo_uart) = {
Thomas Chouc7b96862015-11-19 21:48:12 +080076 "ns16550_serial",
Simon Glassb3f4ca12014-10-22 21:37:15 -060077 &overo_serial
78};
79
Tom Rix58911512009-04-01 22:02:20 -050080/*
Steve Sakomana06e1622010-08-24 10:37:29 -070081 * Routine: get_sdio2_config
82 * Description: Return information about the wifi module connection
83 * Returns 0 if the module connects though a level translator
84 * Returns 1 if the module connects directly
85 */
86int get_sdio2_config(void)
87{
88 int sdio_direct;
89
Sanjeev Premi84c3b632011-09-08 10:51:01 -040090 if (!gpio_request(130, "") && !gpio_request(139, "")) {
Steve Sakomana06e1622010-08-24 10:37:29 -070091
Sanjeev Premi84c3b632011-09-08 10:51:01 -040092 gpio_direction_output(130, 0);
93 gpio_direction_input(139);
Steve Sakomana06e1622010-08-24 10:37:29 -070094
95 sdio_direct = 1;
Sanjeev Premi84c3b632011-09-08 10:51:01 -040096 gpio_set_value(130, 0);
97 if (gpio_get_value(139) == 0) {
98 gpio_set_value(130, 1);
99 if (gpio_get_value(139) == 1)
Steve Sakomana06e1622010-08-24 10:37:29 -0700100 sdio_direct = 0;
101 }
102
Joe Hershbergerb5db0a02011-10-12 10:31:44 +0000103 gpio_direction_input(130);
Steve Sakomana06e1622010-08-24 10:37:29 -0700104 } else {
Andreas Müllerbae485d2012-01-04 15:26:20 +0000105 puts("Error: unable to acquire sdio2 clk GPIOs\n");
Steve Sakomana06e1622010-08-24 10:37:29 -0700106 sdio_direct = -1;
107 }
108
109 return sdio_direct;
110}
111
112/*
Steve Sakomand64b5b82010-09-20 08:05:14 -0700113 * Routine: get_expansion_id
114 * Description: This function checks for expansion board by checking I2C
115 * bus 2 for the availability of an AT24C01B serial EEPROM.
116 * returns the device_vendor field from the EEPROM
117 */
118unsigned int get_expansion_id(void)
119{
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200120 if (expansion_config.device_vendor != 0x0)
121 return expansion_config.device_vendor;
122
Steve Sakomand64b5b82010-09-20 08:05:14 -0700123 i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
124
125 /* return GUMSTIX_NO_EEPROM if eeprom doesn't respond */
126 if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
127 i2c_set_bus_num(TWL4030_I2C_BUS);
128 return GUMSTIX_NO_EEPROM;
129 }
130
131 /* read configuration data */
132 i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
133 sizeof(expansion_config));
134
135 i2c_set_bus_num(TWL4030_I2C_BUS);
136
137 return expansion_config.device_vendor;
138}
139
140/*
Dirk Behme9d0fc812009-01-28 21:39:57 +0100141 * Routine: misc_init_r
142 * Description: Configure board specific parts
Tom Rix58911512009-04-01 22:02:20 -0500143 */
Dirk Behme9d0fc812009-01-28 21:39:57 +0100144int misc_init_r(void)
145{
Ash Charlesea5940e2014-05-21 14:04:53 -0700146 unsigned int expansion_id;
147
Tom Rix2c155132009-06-28 12:52:30 -0500148 twl4030_power_init();
Grazvydas Ignotasead39d72009-12-10 17:10:21 +0200149 twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
Dirk Behme9d0fc812009-01-28 21:39:57 +0100150
Steve Sakomanc2d5b342010-08-12 15:13:02 -0700151 printf("Board revision: %d\n", get_board_revision());
Steve Sakomana06e1622010-08-24 10:37:29 -0700152
153 switch (get_sdio2_config()) {
154 case 0:
Andreas Müllerbae485d2012-01-04 15:26:20 +0000155 puts("Tranceiver detected on mmc2\n");
Steve Sakomana06e1622010-08-24 10:37:29 -0700156 MUX_OVERO_SDIO2_TRANSCEIVER();
157 break;
158 case 1:
Andreas Müllerbae485d2012-01-04 15:26:20 +0000159 puts("Direct connection on mmc2\n");
Steve Sakomana06e1622010-08-24 10:37:29 -0700160 MUX_OVERO_SDIO2_DIRECT();
161 break;
162 default:
Andreas Müllerbae485d2012-01-04 15:26:20 +0000163 puts("Unable to detect mmc2 connection type\n");
Steve Sakomana06e1622010-08-24 10:37:29 -0700164 }
165
Ash Charlesea5940e2014-05-21 14:04:53 -0700166 expansion_id = get_expansion_id();
167 switch (expansion_id) {
Steve Sakomand64b5b82010-09-20 08:05:14 -0700168 case GUMSTIX_SUMMIT:
169 printf("Recognized Summit expansion board (rev %d %s)\n",
170 expansion_config.revision,
171 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200172 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600173 env_set("defaultdisplay", "dvi");
174 env_set("expansionname", "summit");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700175 break;
176 case GUMSTIX_TOBI:
177 printf("Recognized Tobi expansion board (rev %d %s)\n",
178 expansion_config.revision,
179 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200180 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600181 env_set("defaultdisplay", "dvi");
182 env_set("expansionname", "tobi");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700183 break;
184 case GUMSTIX_TOBI_DUO:
185 printf("Recognized Tobi Duo expansion board (rev %d %s)\n",
186 expansion_config.revision,
187 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200188 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600189 env_set("expansionname", "tobiduo");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700190 break;
191 case GUMSTIX_PALO35:
192 printf("Recognized Palo35 expansion board (rev %d %s)\n",
193 expansion_config.revision,
194 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200195 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600196 env_set("defaultdisplay", "lcd35");
197 env_set("expansionname", "palo35");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700198 break;
199 case GUMSTIX_PALO43:
200 printf("Recognized Palo43 expansion board (rev %d %s)\n",
201 expansion_config.revision,
202 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200203 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600204 env_set("defaultdisplay", "lcd43");
205 env_set("expansionname", "palo43");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700206 break;
207 case GUMSTIX_CHESTNUT43:
208 printf("Recognized Chestnut43 expansion board (rev %d %s)\n",
209 expansion_config.revision,
210 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200211 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600212 env_set("defaultdisplay", "lcd43");
213 env_set("expansionname", "chestnut43");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700214 break;
215 case GUMSTIX_PINTO:
216 printf("Recognized Pinto expansion board (rev %d %s)\n",
217 expansion_config.revision,
218 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200219 MUX_GUMSTIX();
Steve Sakomand64b5b82010-09-20 08:05:14 -0700220 break;
221 case GUMSTIX_GALLOP43:
222 printf("Recognized Gallop43 expansion board (rev %d %s)\n",
223 expansion_config.revision,
224 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200225 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600226 env_set("defaultdisplay", "lcd43");
227 env_set("expansionname", "gallop43");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700228 break;
Ash Charlesea5940e2014-05-21 14:04:53 -0700229 case GUMSTIX_ALTO35:
230 printf("Recognized Alto35 expansion board (rev %d %s)\n",
231 expansion_config.revision,
232 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200233 MUX_GUMSTIX();
Ash Charlesea5940e2014-05-21 14:04:53 -0700234 MUX_ALTO35();
Simon Glass382bee52017-08-03 12:22:09 -0600235 env_set("defaultdisplay", "lcd35");
236 env_set("expansionname", "alto35");
Ash Charlesea5940e2014-05-21 14:04:53 -0700237 break;
238 case GUMSTIX_STAGECOACH:
239 printf("Recognized Stagecoach expansion board (rev %d %s)\n",
240 expansion_config.revision,
241 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200242 MUX_GUMSTIX();
Ash Charlesea5940e2014-05-21 14:04:53 -0700243 break;
244 case GUMSTIX_THUMBO:
245 printf("Recognized Thumbo expansion board (rev %d %s)\n",
246 expansion_config.revision,
247 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200248 MUX_GUMSTIX();
Ash Charlesea5940e2014-05-21 14:04:53 -0700249 break;
250 case GUMSTIX_TURTLECORE:
251 printf("Recognized Turtlecore expansion board (rev %d %s)\n",
252 expansion_config.revision,
253 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200254 MUX_GUMSTIX();
Ash Charlesea5940e2014-05-21 14:04:53 -0700255 break;
256 case GUMSTIX_ARBOR43C:
257 printf("Recognized Arbor43C expansion board (rev %d %s)\n",
258 expansion_config.revision,
259 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200260 MUX_GUMSTIX();
Ash Charlesea5940e2014-05-21 14:04:53 -0700261 MUX_ARBOR43C();
Simon Glass382bee52017-08-03 12:22:09 -0600262 env_set("defaultdisplay", "lcd43");
263 env_set("expansionname", "arbor43c");
Ash Charlesea5940e2014-05-21 14:04:53 -0700264 break;
Steve Sakomand64b5b82010-09-20 08:05:14 -0700265 case ETTUS_USRP_E:
266 printf("Recognized Ettus Research USRP-E (rev %d %s)\n",
267 expansion_config.revision,
268 expansion_config.fab_revision);
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200269 MUX_GUMSTIX();
Steve Sakomand64b5b82010-09-20 08:05:14 -0700270 MUX_USRP_E();
Simon Glass382bee52017-08-03 12:22:09 -0600271 env_set("defaultdisplay", "dvi");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700272 break;
273 case GUMSTIX_NO_EEPROM:
Stefan Herbrechtsmeier4ed914a2014-09-16 17:51:08 +0200274 case GUMSTIX_EMPTY_EEPROM:
275 puts("No or empty EEPROM on expansion board\n");
276 MUX_GUMSTIX();
Simon Glass382bee52017-08-03 12:22:09 -0600277 env_set("expansionname", "tobi");
Steve Sakomand64b5b82010-09-20 08:05:14 -0700278 break;
279 default:
Ash Charlesea5940e2014-05-21 14:04:53 -0700280 printf("Unrecognized expansion board 0x%08x\n", expansion_id);
281 break;
Steve Sakomand64b5b82010-09-20 08:05:14 -0700282 }
283
284 if (expansion_config.content == 1)
Simon Glass382bee52017-08-03 12:22:09 -0600285 env_set(expansion_config.env_var, expansion_config.env_setting);
Steve Sakomand64b5b82010-09-20 08:05:14 -0700286
Paul Kocialkowski679f82c2015-08-27 19:37:13 +0200287 omap_die_id_display();
Dirk Behmee6a6a702009-03-12 19:30:50 +0100288
Ash Charles12cc5432014-06-10 12:02:36 -0700289 if (get_cpu_family() == CPU_OMAP34XX)
Simon Glass382bee52017-08-03 12:22:09 -0600290 env_set("boardname", "overo");
Ash Charles12cc5432014-06-10 12:02:36 -0700291 else
Simon Glass382bee52017-08-03 12:22:09 -0600292 env_set("boardname", "overo-storm");
Ash Charles12cc5432014-06-10 12:02:36 -0700293
Dirk Behme9d0fc812009-01-28 21:39:57 +0100294 return 0;
295}
296
Arun Bharadwajfe5d4882015-04-28 16:55:29 -0700297#if defined(CONFIG_CMD_NET)
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200298/* GPMC definitions for LAN9221 chips on Tobi expansion boards */
299static const u32 gpmc_lan_config[] = {
300 NET_LAN9221_GPMC_CONFIG1,
301 NET_LAN9221_GPMC_CONFIG2,
302 NET_LAN9221_GPMC_CONFIG3,
303 NET_LAN9221_GPMC_CONFIG4,
304 NET_LAN9221_GPMC_CONFIG5,
305 NET_LAN9221_GPMC_CONFIG6,
306 /*CONFIG7- computed as params */
307};
308
Olof Johanssondf382622009-09-29 10:22:45 -0400309/*
310 * Routine: setup_net_chip
311 * Description: Setting up the configuration GPMC registers specific to the
312 * Ethernet hardware.
313 */
314static void setup_net_chip(void)
315{
316 struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
317
Olof Johanssondf382622009-09-29 10:22:45 -0400318 /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
319 writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
320 /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
321 writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
322 /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
323 writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
324 &ctrl_base->gpmc_nadv_ale);
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200325}
Olof Johanssondf382622009-09-29 10:22:45 -0400326
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200327/*
328 * Routine: reset_net_chip
329 * Description: Reset the Ethernet hardware.
330 */
331static void reset_net_chip(void)
332{
Olof Johanssondf382622009-09-29 10:22:45 -0400333 /* Make GPIO 64 as output pin and send a magic pulse through it */
Sanjeev Premi84c3b632011-09-08 10:51:01 -0400334 if (!gpio_request(64, "")) {
335 gpio_direction_output(64, 0);
336 gpio_set_value(64, 1);
Olof Johanssondf382622009-09-29 10:22:45 -0400337 udelay(1);
Sanjeev Premi84c3b632011-09-08 10:51:01 -0400338 gpio_set_value(64, 0);
Olof Johanssondf382622009-09-29 10:22:45 -0400339 udelay(1);
Sanjeev Premi84c3b632011-09-08 10:51:01 -0400340 gpio_set_value(64, 1);
Olof Johanssondf382622009-09-29 10:22:45 -0400341 }
342}
Olof Johanssondf382622009-09-29 10:22:45 -0400343
344int board_eth_init(bd_t *bis)
345{
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200346 unsigned int expansion_id;
Olof Johanssondf382622009-09-29 10:22:45 -0400347 int rc = 0;
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200348
Olof Johanssondf382622009-09-29 10:22:45 -0400349#ifdef CONFIG_SMC911X
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200350 expansion_id = get_expansion_id();
351 switch (expansion_id) {
352 case GUMSTIX_TOBI_DUO:
353 /* second lan chip */
354 enable_gpmc_cs_config(gpmc_lan_config, &gpmc_cfg->cs[4],
355 0x2B000000, GPMC_SIZE_16M);
356 /* no break */
357 case GUMSTIX_TOBI:
358 case GUMSTIX_CHESTNUT43:
359 case GUMSTIX_STAGECOACH:
360 case GUMSTIX_NO_EEPROM:
361 case GUMSTIX_EMPTY_EEPROM:
362 /* first lan chip */
363 enable_gpmc_cs_config(gpmc_lan_config, &gpmc_cfg->cs[5],
364 0x2C000000, GPMC_SIZE_16M);
365
366 setup_net_chip();
367 reset_net_chip();
368
369 rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
370 break;
371 default:
372 break;
373 }
Olof Johanssondf382622009-09-29 10:22:45 -0400374#endif
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200375
Olof Johanssondf382622009-09-29 10:22:45 -0400376 return rc;
377}
Stefan Herbrechtsmeier113429a2014-09-16 17:51:07 +0200378#endif
Steve Sakomancd7c5722010-09-19 21:21:07 -0700379
Tom Rini8850c5d2017-05-12 22:33:27 -0400380#if defined(CONFIG_USB_EHCI_HCD)
Stefan Herbrechtsmeierf5c30c12014-09-16 17:51:09 +0200381static struct omap_usbhs_board_data usbhs_bdata = {
382 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
383 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
384 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
385};
386
387#define GUMSTIX_GPIO_USBH_CPEN 168
388int ehci_hcd_init(int index, enum usb_init_type init,
389 struct ehci_hccr **hccr, struct ehci_hcor **hcor)
390{
391 /* Enable USB power */
392 if (!gpio_request(GUMSTIX_GPIO_USBH_CPEN, "usbh_cpen"))
393 gpio_direction_output(GUMSTIX_GPIO_USBH_CPEN, 1);
394
395 return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
396}
397
398int ehci_hcd_stop(void)
399{
400 /* Disable USB power */
401 gpio_set_value(GUMSTIX_GPIO_USBH_CPEN, 0);
402 gpio_free(GUMSTIX_GPIO_USBH_CPEN);
403
404 return omap_ehci_hcd_stop();
405}
406
Tom Rini8850c5d2017-05-12 22:33:27 -0400407#endif /* CONFIG_USB_EHCI_HCD */