blob: 5450f5d11cea91ac6b85e6520747b8b361fea25f [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Dirk Behme220faba2009-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 Behme220faba2009-01-28 21:39:57 +010013 */
14#include <common.h>
Simon Glassbc0f4ea2014-10-22 21:37:15 -060015#include <dm.h>
Simon Glass5e6201b2019-08-01 09:46:51 -060016#include <env.h>
Simon Glass97589732020-05-10 11:40:02 -060017#include <init.h>
Simon Glass9bc15642020-02-03 07:36:16 -070018#include <malloc.h>
Simon Glass274e0b02020-05-10 11:39:56 -060019#include <net.h>
Simon Glassbc0f4ea2014-10-22 21:37:15 -060020#include <ns16550.h>
Olof Johansson4963f922009-09-29 10:22:45 -040021#include <netdev.h>
Tom Rix0f2a8042009-06-28 12:52:30 -050022#include <twl4030.h>
Simon Glassdbd79542020-05-10 11:40:11 -060023#include <linux/delay.h>
Masahiro Yamada2b7a8732017-11-30 13:45:24 +090024#include <linux/mtd/rawnand.h>
Dirk Behme220faba2009-01-28 21:39:57 +010025#include <asm/io.h>
Steve Sakomanb7d80522010-09-19 21:21:07 -070026#include <asm/arch/mmc_host_def.h>
Dirk Behme220faba2009-01-28 21:39:57 +010027#include <asm/arch/mux.h>
Olof Johansson4963f922009-09-29 10:22:45 -040028#include <asm/arch/mem.h>
Dirk Behme220faba2009-01-28 21:39:57 +010029#include <asm/arch/sys_proto.h>
Sanjeev Premi7b3dc822011-09-08 10:51:01 -040030#include <asm/gpio.h>
Dirk Behme220faba2009-01-28 21:39:57 +010031#include <asm/mach-types.h>
32#include "overo.h"
33
Tom Riniceed5d22017-05-12 22:33:27 -040034#ifdef CONFIG_USB_EHCI_HCD
Stefan Herbrechtsmeier0c87e682014-09-16 17:51:09 +020035#include <usb.h>
36#include <asm/ehci-omap.h>
37#endif
38
Steve Sakoman0b880632010-09-20 08:05:14 -070039#define TWL4030_I2C_BUS 0
40#define EXPANSION_EEPROM_I2C_BUS 2
41#define EXPANSION_EEPROM_I2C_ADDRESS 0x51
42
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +020043#define GUMSTIX_EMPTY_EEPROM 0x0
44
Steve Sakoman0b880632010-09-20 08:05:14 -070045#define GUMSTIX_SUMMIT 0x01000200
46#define GUMSTIX_TOBI 0x02000200
47#define GUMSTIX_TOBI_DUO 0x03000200
48#define GUMSTIX_PALO35 0x04000200
49#define GUMSTIX_PALO43 0x05000200
50#define GUMSTIX_CHESTNUT43 0x06000200
51#define GUMSTIX_PINTO 0x07000200
52#define GUMSTIX_GALLOP43 0x08000200
Ash Charles7baad0f2014-05-21 14:04:53 -070053#define GUMSTIX_ALTO35 0x09000200
54#define GUMSTIX_STAGECOACH 0x0A000200
55#define GUMSTIX_THUMBO 0x0B000200
56#define GUMSTIX_TURTLECORE 0x0C000200
57#define GUMSTIX_ARBOR43C 0x0D000200
Steve Sakoman0b880632010-09-20 08:05:14 -070058
59#define ETTUS_USRP_E 0x01000300
60
61#define GUMSTIX_NO_EEPROM 0xffffffff
62
63static struct {
64 unsigned int device_vendor;
65 unsigned char revision;
66 unsigned char content;
67 char fab_revision[8];
68 char env_var[16];
69 char env_setting[64];
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +020070} expansion_config = {0x0};
Steve Sakoman0d1d0082010-08-12 21:07:02 -070071
Simon Glassbc0f4ea2014-10-22 21:37:15 -060072static const struct ns16550_platdata overo_serial = {
Adam Fordd1e22fa2016-03-07 21:08:49 -060073 .base = OMAP34XX_UART3,
74 .reg_shift = 2,
Heiko Schocher06f108e2017-01-18 08:05:49 +010075 .clock = V_NS16550_CLK,
76 .fcr = UART_FCR_DEFVAL,
Simon Glassbc0f4ea2014-10-22 21:37:15 -060077};
78
79U_BOOT_DEVICE(overo_uart) = {
Thomas Chou52ac4432015-11-19 21:48:12 +080080 "ns16550_serial",
Simon Glassbc0f4ea2014-10-22 21:37:15 -060081 &overo_serial
82};
83
Tom Rix558bb832009-04-01 22:02:20 -050084/*
Steve Sakoman541ce992010-08-24 10:37:29 -070085 * Routine: get_sdio2_config
86 * Description: Return information about the wifi module connection
87 * Returns 0 if the module connects though a level translator
88 * Returns 1 if the module connects directly
89 */
90int get_sdio2_config(void)
91{
92 int sdio_direct;
93
Sanjeev Premi7b3dc822011-09-08 10:51:01 -040094 if (!gpio_request(130, "") && !gpio_request(139, "")) {
Steve Sakoman541ce992010-08-24 10:37:29 -070095
Sanjeev Premi7b3dc822011-09-08 10:51:01 -040096 gpio_direction_output(130, 0);
97 gpio_direction_input(139);
Steve Sakoman541ce992010-08-24 10:37:29 -070098
99 sdio_direct = 1;
Sanjeev Premi7b3dc822011-09-08 10:51:01 -0400100 gpio_set_value(130, 0);
101 if (gpio_get_value(139) == 0) {
102 gpio_set_value(130, 1);
103 if (gpio_get_value(139) == 1)
Steve Sakoman541ce992010-08-24 10:37:29 -0700104 sdio_direct = 0;
105 }
106
Joe Hershberger9b124d32011-10-12 10:31:44 +0000107 gpio_direction_input(130);
Steve Sakoman541ce992010-08-24 10:37:29 -0700108 } else {
Andreas Müllerb958a5d2012-01-04 15:26:20 +0000109 puts("Error: unable to acquire sdio2 clk GPIOs\n");
Steve Sakoman541ce992010-08-24 10:37:29 -0700110 sdio_direct = -1;
111 }
112
113 return sdio_direct;
114}
115
116/*
Steve Sakoman0b880632010-09-20 08:05:14 -0700117 * Routine: get_expansion_id
118 * Description: This function checks for expansion board by checking I2C
119 * bus 2 for the availability of an AT24C01B serial EEPROM.
120 * returns the device_vendor field from the EEPROM
121 */
122unsigned int get_expansion_id(void)
123{
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200124 if (expansion_config.device_vendor != 0x0)
125 return expansion_config.device_vendor;
126
Steve Sakoman0b880632010-09-20 08:05:14 -0700127 i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS);
128
129 /* return GUMSTIX_NO_EEPROM if eeprom doesn't respond */
130 if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) {
131 i2c_set_bus_num(TWL4030_I2C_BUS);
132 return GUMSTIX_NO_EEPROM;
133 }
134
135 /* read configuration data */
136 i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config,
137 sizeof(expansion_config));
138
139 i2c_set_bus_num(TWL4030_I2C_BUS);
140
141 return expansion_config.device_vendor;
142}
143
144/*
Dirk Behme220faba2009-01-28 21:39:57 +0100145 * Routine: misc_init_r
146 * Description: Configure board specific parts
Tom Rix558bb832009-04-01 22:02:20 -0500147 */
Dirk Behme220faba2009-01-28 21:39:57 +0100148int misc_init_r(void)
149{
Ash Charles7baad0f2014-05-21 14:04:53 -0700150 unsigned int expansion_id;
151
Tom Rix0f2a8042009-06-28 12:52:30 -0500152 twl4030_power_init();
Grazvydas Ignotas17887bf2009-12-10 17:10:21 +0200153 twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
Dirk Behme220faba2009-01-28 21:39:57 +0100154
Steve Sakoman5ddc70b2010-08-12 15:13:02 -0700155 printf("Board revision: %d\n", get_board_revision());
Steve Sakoman541ce992010-08-24 10:37:29 -0700156
157 switch (get_sdio2_config()) {
158 case 0:
Andreas Müllerb958a5d2012-01-04 15:26:20 +0000159 puts("Tranceiver detected on mmc2\n");
Steve Sakoman541ce992010-08-24 10:37:29 -0700160 MUX_OVERO_SDIO2_TRANSCEIVER();
161 break;
162 case 1:
Andreas Müllerb958a5d2012-01-04 15:26:20 +0000163 puts("Direct connection on mmc2\n");
Steve Sakoman541ce992010-08-24 10:37:29 -0700164 MUX_OVERO_SDIO2_DIRECT();
165 break;
166 default:
Andreas Müllerb958a5d2012-01-04 15:26:20 +0000167 puts("Unable to detect mmc2 connection type\n");
Steve Sakoman541ce992010-08-24 10:37:29 -0700168 }
169
Ash Charles7baad0f2014-05-21 14:04:53 -0700170 expansion_id = get_expansion_id();
171 switch (expansion_id) {
Steve Sakoman0b880632010-09-20 08:05:14 -0700172 case GUMSTIX_SUMMIT:
173 printf("Recognized Summit expansion board (rev %d %s)\n",
174 expansion_config.revision,
175 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200176 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600177 env_set("defaultdisplay", "dvi");
178 env_set("expansionname", "summit");
Steve Sakoman0b880632010-09-20 08:05:14 -0700179 break;
180 case GUMSTIX_TOBI:
181 printf("Recognized Tobi expansion board (rev %d %s)\n",
182 expansion_config.revision,
183 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200184 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600185 env_set("defaultdisplay", "dvi");
186 env_set("expansionname", "tobi");
Steve Sakoman0b880632010-09-20 08:05:14 -0700187 break;
188 case GUMSTIX_TOBI_DUO:
189 printf("Recognized Tobi Duo expansion board (rev %d %s)\n",
190 expansion_config.revision,
191 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200192 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600193 env_set("expansionname", "tobiduo");
Steve Sakoman0b880632010-09-20 08:05:14 -0700194 break;
195 case GUMSTIX_PALO35:
196 printf("Recognized Palo35 expansion board (rev %d %s)\n",
197 expansion_config.revision,
198 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200199 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600200 env_set("defaultdisplay", "lcd35");
201 env_set("expansionname", "palo35");
Steve Sakoman0b880632010-09-20 08:05:14 -0700202 break;
203 case GUMSTIX_PALO43:
204 printf("Recognized Palo43 expansion board (rev %d %s)\n",
205 expansion_config.revision,
206 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200207 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600208 env_set("defaultdisplay", "lcd43");
209 env_set("expansionname", "palo43");
Steve Sakoman0b880632010-09-20 08:05:14 -0700210 break;
211 case GUMSTIX_CHESTNUT43:
212 printf("Recognized Chestnut43 expansion board (rev %d %s)\n",
213 expansion_config.revision,
214 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200215 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600216 env_set("defaultdisplay", "lcd43");
217 env_set("expansionname", "chestnut43");
Steve Sakoman0b880632010-09-20 08:05:14 -0700218 break;
219 case GUMSTIX_PINTO:
220 printf("Recognized Pinto expansion board (rev %d %s)\n",
221 expansion_config.revision,
222 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200223 MUX_GUMSTIX();
Steve Sakoman0b880632010-09-20 08:05:14 -0700224 break;
225 case GUMSTIX_GALLOP43:
226 printf("Recognized Gallop43 expansion board (rev %d %s)\n",
227 expansion_config.revision,
228 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200229 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600230 env_set("defaultdisplay", "lcd43");
231 env_set("expansionname", "gallop43");
Steve Sakoman0b880632010-09-20 08:05:14 -0700232 break;
Ash Charles7baad0f2014-05-21 14:04:53 -0700233 case GUMSTIX_ALTO35:
234 printf("Recognized Alto35 expansion board (rev %d %s)\n",
235 expansion_config.revision,
236 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200237 MUX_GUMSTIX();
Ash Charles7baad0f2014-05-21 14:04:53 -0700238 MUX_ALTO35();
Simon Glass6a38e412017-08-03 12:22:09 -0600239 env_set("defaultdisplay", "lcd35");
240 env_set("expansionname", "alto35");
Ash Charles7baad0f2014-05-21 14:04:53 -0700241 break;
242 case GUMSTIX_STAGECOACH:
243 printf("Recognized Stagecoach expansion board (rev %d %s)\n",
244 expansion_config.revision,
245 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200246 MUX_GUMSTIX();
Ash Charles7baad0f2014-05-21 14:04:53 -0700247 break;
248 case GUMSTIX_THUMBO:
249 printf("Recognized Thumbo expansion board (rev %d %s)\n",
250 expansion_config.revision,
251 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200252 MUX_GUMSTIX();
Ash Charles7baad0f2014-05-21 14:04:53 -0700253 break;
254 case GUMSTIX_TURTLECORE:
255 printf("Recognized Turtlecore expansion board (rev %d %s)\n",
256 expansion_config.revision,
257 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200258 MUX_GUMSTIX();
Ash Charles7baad0f2014-05-21 14:04:53 -0700259 break;
260 case GUMSTIX_ARBOR43C:
261 printf("Recognized Arbor43C expansion board (rev %d %s)\n",
262 expansion_config.revision,
263 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200264 MUX_GUMSTIX();
Ash Charles7baad0f2014-05-21 14:04:53 -0700265 MUX_ARBOR43C();
Simon Glass6a38e412017-08-03 12:22:09 -0600266 env_set("defaultdisplay", "lcd43");
267 env_set("expansionname", "arbor43c");
Ash Charles7baad0f2014-05-21 14:04:53 -0700268 break;
Steve Sakoman0b880632010-09-20 08:05:14 -0700269 case ETTUS_USRP_E:
270 printf("Recognized Ettus Research USRP-E (rev %d %s)\n",
271 expansion_config.revision,
272 expansion_config.fab_revision);
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200273 MUX_GUMSTIX();
Steve Sakoman0b880632010-09-20 08:05:14 -0700274 MUX_USRP_E();
Simon Glass6a38e412017-08-03 12:22:09 -0600275 env_set("defaultdisplay", "dvi");
Steve Sakoman0b880632010-09-20 08:05:14 -0700276 break;
277 case GUMSTIX_NO_EEPROM:
Stefan Herbrechtsmeiere2f29a12014-09-16 17:51:08 +0200278 case GUMSTIX_EMPTY_EEPROM:
279 puts("No or empty EEPROM on expansion board\n");
280 MUX_GUMSTIX();
Simon Glass6a38e412017-08-03 12:22:09 -0600281 env_set("expansionname", "tobi");
Steve Sakoman0b880632010-09-20 08:05:14 -0700282 break;
283 default:
Ash Charles7baad0f2014-05-21 14:04:53 -0700284 printf("Unrecognized expansion board 0x%08x\n", expansion_id);
285 break;
Steve Sakoman0b880632010-09-20 08:05:14 -0700286 }
287
288 if (expansion_config.content == 1)
Simon Glass6a38e412017-08-03 12:22:09 -0600289 env_set(expansion_config.env_var, expansion_config.env_setting);
Steve Sakoman0b880632010-09-20 08:05:14 -0700290
Paul Kocialkowski6bc318e2015-08-27 19:37:13 +0200291 omap_die_id_display();
Dirk Behme12dbcf62009-03-12 19:30:50 +0100292
Ash Charles1bfdde62014-06-10 12:02:36 -0700293 if (get_cpu_family() == CPU_OMAP34XX)
Simon Glass6a38e412017-08-03 12:22:09 -0600294 env_set("boardname", "overo");
Ash Charles1bfdde62014-06-10 12:02:36 -0700295 else
Simon Glass6a38e412017-08-03 12:22:09 -0600296 env_set("boardname", "overo-storm");
Ash Charles1bfdde62014-06-10 12:02:36 -0700297
Dirk Behme220faba2009-01-28 21:39:57 +0100298 return 0;
299}
300
Arun Bharadwaj9a0475c2015-04-28 16:55:29 -0700301#if defined(CONFIG_CMD_NET)
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200302/* GPMC definitions for LAN9221 chips on Tobi expansion boards */
303static const u32 gpmc_lan_config[] = {
304 NET_LAN9221_GPMC_CONFIG1,
305 NET_LAN9221_GPMC_CONFIG2,
306 NET_LAN9221_GPMC_CONFIG3,
307 NET_LAN9221_GPMC_CONFIG4,
308 NET_LAN9221_GPMC_CONFIG5,
309 NET_LAN9221_GPMC_CONFIG6,
310 /*CONFIG7- computed as params */
311};
312
Olof Johansson4963f922009-09-29 10:22:45 -0400313/*
314 * Routine: setup_net_chip
315 * Description: Setting up the configuration GPMC registers specific to the
316 * Ethernet hardware.
317 */
318static void setup_net_chip(void)
319{
320 struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE;
321
Olof Johansson4963f922009-09-29 10:22:45 -0400322 /* Enable off mode for NWE in PADCONF_GPMC_NWE register */
323 writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe);
324 /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */
325 writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe);
326 /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */
327 writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00,
328 &ctrl_base->gpmc_nadv_ale);
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200329}
Olof Johansson4963f922009-09-29 10:22:45 -0400330
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200331/*
332 * Routine: reset_net_chip
333 * Description: Reset the Ethernet hardware.
334 */
335static void reset_net_chip(void)
336{
Olof Johansson4963f922009-09-29 10:22:45 -0400337 /* Make GPIO 64 as output pin and send a magic pulse through it */
Sanjeev Premi7b3dc822011-09-08 10:51:01 -0400338 if (!gpio_request(64, "")) {
339 gpio_direction_output(64, 0);
340 gpio_set_value(64, 1);
Olof Johansson4963f922009-09-29 10:22:45 -0400341 udelay(1);
Sanjeev Premi7b3dc822011-09-08 10:51:01 -0400342 gpio_set_value(64, 0);
Olof Johansson4963f922009-09-29 10:22:45 -0400343 udelay(1);
Sanjeev Premi7b3dc822011-09-08 10:51:01 -0400344 gpio_set_value(64, 1);
Olof Johansson4963f922009-09-29 10:22:45 -0400345 }
346}
Olof Johansson4963f922009-09-29 10:22:45 -0400347
348int board_eth_init(bd_t *bis)
349{
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200350 unsigned int expansion_id;
Olof Johansson4963f922009-09-29 10:22:45 -0400351 int rc = 0;
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200352
Olof Johansson4963f922009-09-29 10:22:45 -0400353#ifdef CONFIG_SMC911X
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200354 expansion_id = get_expansion_id();
355 switch (expansion_id) {
356 case GUMSTIX_TOBI_DUO:
357 /* second lan chip */
358 enable_gpmc_cs_config(gpmc_lan_config, &gpmc_cfg->cs[4],
359 0x2B000000, GPMC_SIZE_16M);
360 /* no break */
361 case GUMSTIX_TOBI:
362 case GUMSTIX_CHESTNUT43:
363 case GUMSTIX_STAGECOACH:
364 case GUMSTIX_NO_EEPROM:
365 case GUMSTIX_EMPTY_EEPROM:
366 /* first lan chip */
367 enable_gpmc_cs_config(gpmc_lan_config, &gpmc_cfg->cs[5],
368 0x2C000000, GPMC_SIZE_16M);
369
370 setup_net_chip();
371 reset_net_chip();
372
373 rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
374 break;
375 default:
376 break;
377 }
Olof Johansson4963f922009-09-29 10:22:45 -0400378#endif
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200379
Olof Johansson4963f922009-09-29 10:22:45 -0400380 return rc;
381}
Stefan Herbrechtsmeier59f72d22014-09-16 17:51:07 +0200382#endif
Steve Sakomanb7d80522010-09-19 21:21:07 -0700383
Tom Riniceed5d22017-05-12 22:33:27 -0400384#if defined(CONFIG_USB_EHCI_HCD)
Stefan Herbrechtsmeier0c87e682014-09-16 17:51:09 +0200385static struct omap_usbhs_board_data usbhs_bdata = {
386 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
387 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
388 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
389};
390
391#define GUMSTIX_GPIO_USBH_CPEN 168
392int ehci_hcd_init(int index, enum usb_init_type init,
393 struct ehci_hccr **hccr, struct ehci_hcor **hcor)
394{
395 /* Enable USB power */
396 if (!gpio_request(GUMSTIX_GPIO_USBH_CPEN, "usbh_cpen"))
397 gpio_direction_output(GUMSTIX_GPIO_USBH_CPEN, 1);
398
399 return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
400}
401
402int ehci_hcd_stop(void)
403{
404 /* Disable USB power */
405 gpio_set_value(GUMSTIX_GPIO_USBH_CPEN, 0);
406 gpio_free(GUMSTIX_GPIO_USBH_CPEN);
407
408 return omap_ehci_hcd_stop();
409}
410
Tom Riniceed5d22017-05-12 22:33:27 -0400411#endif /* CONFIG_USB_EHCI_HCD */