blob: 4ceeb56c414c3f94d4593eac94dddd2ec1364a09 [file] [log] [blame]
Steve Sakomaneba26452008-10-09 17:51:43 +03001/*
2 * board-overo.c (Gumstix Overo)
3 *
4 * Initial code: Steve Sakoman <steve@sakoman.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 */
21
22#include <linux/clk.h>
23#include <linux/delay.h>
24#include <linux/err.h>
25#include <linux/init.h>
26#include <linux/io.h>
27#include <linux/kernel.h>
28#include <linux/platform_device.h>
Santosh Shilimkarb07682b2009-12-13 20:05:51 +010029#include <linux/i2c/twl.h>
David Brownellbb3b9d82009-05-28 14:04:03 -070030#include <linux/regulator/machine.h>
Steve Sakomaneba26452008-10-09 17:51:43 +030031
32#include <linux/mtd/mtd.h>
33#include <linux/mtd/nand.h>
34#include <linux/mtd/partitions.h>
35
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/mach/flash.h>
39#include <asm/mach/map.h>
40
Tony Lindgrence491cf2009-10-20 09:40:47 -070041#include <plat/board.h>
42#include <plat/common.h>
Steve Sakomaneba26452008-10-09 17:51:43 +030043#include <mach/gpio.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070044#include <plat/gpmc.h>
Steve Sakomaneba26452008-10-09 17:51:43 +030045#include <mach/hardware.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070046#include <plat/nand.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070047#include <plat/usb.h>
Steve Sakomaneba26452008-10-09 17:51:43 +030048
Tony Lindgrenca5742b2009-12-11 16:16:32 -080049#include "mux.h"
Paul Walmsley2e12bd72009-05-28 14:03:59 -070050#include "sdram-micron-mt46h32m32lf-6.h"
Adrian Hunterd02a900b2010-02-15 10:03:34 -080051#include "hsmmc.h"
Tony Lindgren90c62bf2008-12-10 17:37:17 -080052
Tony Lindgren0d4d9ab2009-03-23 18:07:38 -070053#define OVERO_GPIO_BT_XGATE 15
54#define OVERO_GPIO_W2W_NRESET 16
Kevin Hilman6fd210a2009-07-20 09:09:23 -070055#define OVERO_GPIO_PENDOWN 114
Tony Lindgren0d4d9ab2009-03-23 18:07:38 -070056#define OVERO_GPIO_BT_NRESET 164
57#define OVERO_GPIO_USBH_CPEN 168
58#define OVERO_GPIO_USBH_NRESET 183
59
Steve Sakomaneba26452008-10-09 17:51:43 +030060#define NAND_BLOCK_SIZE SZ_128K
61#define GPMC_CS0_BASE 0x60
62#define GPMC_CS_SIZE 0x30
63
Steve Sakoman172ef272009-02-02 06:27:49 +000064#define OVERO_SMSC911X_CS 5
65#define OVERO_SMSC911X_GPIO 176
Steve Sakoman5c9a29e2010-05-10 14:29:18 -070066#define OVERO_SMSC911X2_CS 4
67#define OVERO_SMSC911X2_GPIO 65
Steve Sakoman172ef272009-02-02 06:27:49 +000068
Steve Sakomanc6a81312009-03-23 18:38:16 -070069#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
70 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
71
Tony Lindgrence491cf2009-10-20 09:40:47 -070072#include <plat/mcspi.h>
Steve Sakomanc6a81312009-03-23 18:38:16 -070073#include <linux/spi/spi.h>
74#include <linux/spi/ads7846.h>
75
76static struct omap2_mcspi_device_config ads7846_mcspi_config = {
77 .turbo_mode = 0,
78 .single_channel = 1, /* 0: slave, 1: master */
79};
80
81static int ads7846_get_pendown_state(void)
82{
83 return !gpio_get_value(OVERO_GPIO_PENDOWN);
84}
85
86static struct ads7846_platform_data ads7846_config = {
87 .x_max = 0x0fff,
88 .y_max = 0x0fff,
89 .x_plate_ohms = 180,
90 .pressure_max = 255,
91 .debounce_max = 10,
92 .debounce_tol = 3,
93 .debounce_rep = 1,
94 .get_pendown_state = ads7846_get_pendown_state,
95 .keep_vref_on = 1,
96};
97
98static struct spi_board_info overo_spi_board_info[] __initdata = {
99 {
100 .modalias = "ads7846",
101 .bus_num = 1,
102 .chip_select = 0,
103 .max_speed_hz = 1500000,
104 .controller_data = &ads7846_mcspi_config,
105 .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
106 .platform_data = &ads7846_config,
107 }
108};
109
110static void __init overo_ads7846_init(void)
111{
112 if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
113 (gpio_direction_input(OVERO_GPIO_PENDOWN) == 0)) {
114 gpio_export(OVERO_GPIO_PENDOWN, 0);
115 } else {
116 printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
117 return;
118 }
119
120 spi_register_board_info(overo_spi_board_info,
121 ARRAY_SIZE(overo_spi_board_info));
122}
123
124#else
125static inline void __init overo_ads7846_init(void) { return; }
126#endif
127
Steve Sakoman172ef272009-02-02 06:27:49 +0000128#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
129
130#include <linux/smsc911x.h>
131
132static struct resource overo_smsc911x_resources[] = {
133 {
134 .name = "smsc911x-memory",
135 .flags = IORESOURCE_MEM,
136 },
137 {
138 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
139 },
140};
141
Steve Sakoman5c9a29e2010-05-10 14:29:18 -0700142static struct resource overo_smsc911x2_resources[] = {
143 {
144 .name = "smsc911x2-memory",
145 .flags = IORESOURCE_MEM,
146 },
147 {
148 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
149 },
150};
151
Steve Sakoman172ef272009-02-02 06:27:49 +0000152static struct smsc911x_platform_config overo_smsc911x_config = {
153 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
154 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
155 .flags = SMSC911X_USE_32BIT ,
156 .phy_interface = PHY_INTERFACE_MODE_MII,
157};
158
159static struct platform_device overo_smsc911x_device = {
160 .name = "smsc911x",
Steve Sakoman5c9a29e2010-05-10 14:29:18 -0700161 .id = 0,
Steve Sakoman172ef272009-02-02 06:27:49 +0000162 .num_resources = ARRAY_SIZE(overo_smsc911x_resources),
Sergio Aguirre50329022009-08-10 14:49:50 +0300163 .resource = overo_smsc911x_resources,
Steve Sakoman172ef272009-02-02 06:27:49 +0000164 .dev = {
165 .platform_data = &overo_smsc911x_config,
166 },
167};
168
Steve Sakomana5ba7ae2010-08-02 14:21:39 +0300169static struct platform_device overo_smsc911x2_device = {
170 .name = "smsc911x",
171 .id = 1,
172 .num_resources = ARRAY_SIZE(overo_smsc911x2_resources),
173 .resource = overo_smsc911x2_resources,
174 .dev = {
175 .platform_data = &overo_smsc911x_config,
176 },
177};
178
179static struct platform_device *smsc911x_devices[] = {
180 &overo_smsc911x_device,
181 &overo_smsc911x2_device,
182};
183
Steve Sakoman172ef272009-02-02 06:27:49 +0000184static inline void __init overo_init_smsc911x(void)
185{
Steve Sakomana5ba7ae2010-08-02 14:21:39 +0300186 unsigned long cs_mem_base, cs_mem_base2;
187
188 /* set up first smsc911x chip */
Steve Sakoman172ef272009-02-02 06:27:49 +0000189
190 if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
191 printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
192 return;
193 }
194
195 overo_smsc911x_resources[0].start = cs_mem_base + 0x0;
196 overo_smsc911x_resources[0].end = cs_mem_base + 0xff;
197
198 if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
199 (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) {
200 gpio_export(OVERO_SMSC911X_GPIO, 0);
201 } else {
202 printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n");
203 return;
204 }
205
206 overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
207 overo_smsc911x_resources[1].end = 0;
208
Steve Sakomana5ba7ae2010-08-02 14:21:39 +0300209 /* set up second smsc911x chip */
210
211 if (gpmc_cs_request(OVERO_SMSC911X2_CS, SZ_16M, &cs_mem_base2) < 0) {
212 printk(KERN_ERR "Failed request for GPMC mem for smsc911x2\n");
213 return;
214 }
215
216 overo_smsc911x2_resources[0].start = cs_mem_base2 + 0x0;
217 overo_smsc911x2_resources[0].end = cs_mem_base2 + 0xff;
218
219 if ((gpio_request(OVERO_SMSC911X2_GPIO, "SMSC911X2 IRQ") == 0) &&
220 (gpio_direction_input(OVERO_SMSC911X2_GPIO) == 0)) {
221 gpio_export(OVERO_SMSC911X2_GPIO, 0);
222 } else {
223 printk(KERN_ERR "could not obtain gpio for SMSC911X2 IRQ\n");
224 return;
225 }
226
227 overo_smsc911x2_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X2_GPIO);
228 overo_smsc911x2_resources[1].end = 0;
229
230 platform_add_devices(smsc911x_devices, ARRAY_SIZE(smsc911x_devices));
Steve Sakoman172ef272009-02-02 06:27:49 +0000231}
232
233#else
234static inline void __init overo_init_smsc911x(void) { return; }
235#endif
236
Steve Sakomaneba26452008-10-09 17:51:43 +0300237static struct mtd_partition overo_nand_partitions[] = {
238 {
239 .name = "xloader",
240 .offset = 0, /* Offset = 0x00000 */
241 .size = 4 * NAND_BLOCK_SIZE,
242 .mask_flags = MTD_WRITEABLE
243 },
244 {
245 .name = "uboot",
246 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
247 .size = 14 * NAND_BLOCK_SIZE,
248 },
249 {
250 .name = "uboot environment",
251 .offset = MTDPART_OFS_APPEND, /* Offset = 0x240000 */
252 .size = 2 * NAND_BLOCK_SIZE,
253 },
254 {
255 .name = "linux",
256 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
257 .size = 32 * NAND_BLOCK_SIZE,
258 },
259 {
260 .name = "rootfs",
261 .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
262 .size = MTDPART_SIZ_FULL,
263 },
264};
265
266static struct omap_nand_platform_data overo_nand_data = {
267 .parts = overo_nand_partitions,
268 .nr_parts = ARRAY_SIZE(overo_nand_partitions),
269 .dma_channel = -1, /* disable DMA in OMAP NAND driver */
270};
271
272static struct resource overo_nand_resource = {
273 .flags = IORESOURCE_MEM,
274};
275
276static struct platform_device overo_nand_device = {
277 .name = "omap2-nand",
278 .id = -1,
279 .dev = {
280 .platform_data = &overo_nand_data,
281 },
282 .num_resources = 1,
283 .resource = &overo_nand_resource,
284};
285
286
287static void __init overo_flash_init(void)
288{
289 u8 cs = 0;
290 u8 nandcs = GPMC_CS_NUM + 1;
291
292 u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
293
294 /* find out the chip-select on which NAND exists */
295 while (cs < GPMC_CS_NUM) {
296 u32 ret = 0;
297 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
298
299 if ((ret & 0xC00) == 0x800) {
300 printk(KERN_INFO "Found NAND on CS%d\n", cs);
301 if (nandcs > GPMC_CS_NUM)
302 nandcs = cs;
303 }
304 cs++;
305 }
306
307 if (nandcs > GPMC_CS_NUM) {
308 printk(KERN_INFO "NAND: Unable to find configuration "
309 "in GPMC\n ");
310 return;
311 }
312
313 if (nandcs < GPMC_CS_NUM) {
314 overo_nand_data.cs = nandcs;
315 overo_nand_data.gpmc_cs_baseaddr = (void *)
316 (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
317 overo_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
318
319 printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
320 if (platform_device_register(&overo_nand_device) < 0)
321 printk(KERN_ERR "Unable to register NAND device\n");
322 }
323}
Steve Sakomaneba26452008-10-09 17:51:43 +0300324
Adrian Hunter68ff0422010-02-15 10:03:34 -0800325static struct omap2_hsmmc_info mmc[] = {
David Brownellbb3b9d82009-05-28 14:04:03 -0700326 {
327 .mmc = 1,
328 .wires = 4,
329 .gpio_cd = -EINVAL,
330 .gpio_wp = -EINVAL,
331 },
332 {
333 .mmc = 2,
334 .wires = 4,
335 .gpio_cd = -EINVAL,
336 .gpio_wp = -EINVAL,
337 .transceiver = true,
338 .ocr_mask = 0x00100000, /* 3.3V */
339 },
340 {} /* Terminator */
341};
342
343static struct regulator_consumer_supply overo_vmmc1_supply = {
344 .supply = "vmmc",
345};
346
347static int overo_twl_gpio_setup(struct device *dev,
348 unsigned gpio, unsigned ngpio)
349{
Adrian Hunter68ff0422010-02-15 10:03:34 -0800350 omap2_hsmmc_init(mmc);
David Brownellbb3b9d82009-05-28 14:04:03 -0700351
352 overo_vmmc1_supply.dev = mmc[0].dev;
353
354 return 0;
355}
356
Tony Lindgren90c62bf2008-12-10 17:37:17 -0800357static struct twl4030_gpio_platform_data overo_gpio_data = {
358 .gpio_base = OMAP_MAX_GPIO_LINES,
359 .irq_base = TWL4030_GPIO_IRQ_BASE,
360 .irq_end = TWL4030_GPIO_IRQ_END,
David Brownellbb3b9d82009-05-28 14:04:03 -0700361 .setup = overo_twl_gpio_setup,
Tony Lindgren90c62bf2008-12-10 17:37:17 -0800362};
363
David Brownellbb3b9d82009-05-28 14:04:03 -0700364static struct twl4030_usb_data overo_usb_data = {
365 .usb_mode = T2_USB_MODE_ULPI,
366};
367
368static struct regulator_init_data overo_vmmc1 = {
369 .constraints = {
370 .min_uV = 1850000,
371 .max_uV = 3150000,
372 .valid_modes_mask = REGULATOR_MODE_NORMAL
373 | REGULATOR_MODE_STANDBY,
374 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
375 | REGULATOR_CHANGE_MODE
376 | REGULATOR_CHANGE_STATUS,
377 },
378 .num_consumer_supplies = 1,
379 .consumer_supplies = &overo_vmmc1_supply,
380};
381
Peter Ujfalusie86fa0b2009-10-22 13:26:46 +0300382static struct twl4030_codec_audio_data overo_audio_data = {
383 .audio_mclk = 26000000,
384};
385
386static struct twl4030_codec_data overo_codec_data = {
Peter Ujfalusi6df74ef2009-11-04 09:58:18 +0200387 .audio_mclk = 26000000,
Peter Ujfalusie86fa0b2009-10-22 13:26:46 +0300388 .audio = &overo_audio_data,
389};
390
David Brownellbb3b9d82009-05-28 14:04:03 -0700391/* mmc2 (WLAN) and Bluetooth don't use twl4030 regulators */
392
Tony Lindgren90c62bf2008-12-10 17:37:17 -0800393static struct twl4030_platform_data overo_twldata = {
394 .irq_base = TWL4030_IRQ_BASE,
395 .irq_end = TWL4030_IRQ_END,
396 .gpio = &overo_gpio_data,
David Brownellbb3b9d82009-05-28 14:04:03 -0700397 .usb = &overo_usb_data,
Peter Ujfalusie86fa0b2009-10-22 13:26:46 +0300398 .codec = &overo_codec_data,
David Brownellbb3b9d82009-05-28 14:04:03 -0700399 .vmmc1 = &overo_vmmc1,
Tony Lindgren90c62bf2008-12-10 17:37:17 -0800400};
401
402static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
403 {
David Brownellbb3b9d82009-05-28 14:04:03 -0700404 I2C_BOARD_INFO("tps65950", 0x48),
Tony Lindgren90c62bf2008-12-10 17:37:17 -0800405 .flags = I2C_CLIENT_WAKE,
406 .irq = INT_34XX_SYS_NIRQ,
407 .platform_data = &overo_twldata,
408 },
409};
410
Steve Sakomaneba26452008-10-09 17:51:43 +0300411static int __init overo_i2c_init(void)
412{
Tony Lindgren90c62bf2008-12-10 17:37:17 -0800413 omap_register_i2c_bus(1, 2600, overo_i2c_boardinfo,
414 ARRAY_SIZE(overo_i2c_boardinfo));
Steve Sakomaneba26452008-10-09 17:51:43 +0300415 /* i2c2 pins are used for gpio */
416 omap_register_i2c_bus(3, 400, NULL, 0);
417 return 0;
418}
419
Steve Sakomaneba26452008-10-09 17:51:43 +0300420static struct platform_device overo_lcd_device = {
421 .name = "overo_lcd",
422 .id = -1,
423};
424
425static struct omap_lcd_config overo_lcd_config __initdata = {
426 .ctrl_name = "internal",
427};
428
429static struct omap_board_config_kernel overo_config[] __initdata = {
Steve Sakomaneba26452008-10-09 17:51:43 +0300430 { OMAP_TAG_LCD, &overo_lcd_config },
431};
432
Paul Walmsleyb3c6df32009-09-03 20:14:02 +0300433static void __init overo_init_irq(void)
434{
435 omap_board_config = overo_config;
436 omap_board_config_size = ARRAY_SIZE(overo_config);
437 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
438 mt46h32m32lf6_sdrc_params);
439 omap_init_irq();
440 omap_gpio_init();
441}
442
Steve Sakomaneba26452008-10-09 17:51:43 +0300443static struct platform_device *overo_devices[] __initdata = {
444 &overo_lcd_device,
445};
446
Felipe Balbi6f69a182010-03-04 09:45:53 +0200447static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
Felipe Balbi58a54912009-11-22 10:11:01 -0800448 .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
449 .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
450 .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
451
452 .phy_reset = true,
453 .reset_gpio_port[0] = -EINVAL,
454 .reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET,
455 .reset_gpio_port[2] = -EINVAL
456};
457
Tony Lindgrenca5742b2009-12-11 16:16:32 -0800458#ifdef CONFIG_OMAP_MUX
459static struct omap_board_mux board_mux[] __initdata = {
460 { .reg_offset = OMAP_MUX_TERMINATOR },
461};
462#else
463#define board_mux NULL
464#endif
Felipe Balbi58a54912009-11-22 10:11:01 -0800465
Maulik Mankad884b83692010-02-17 14:09:30 -0800466static struct omap_musb_board_data musb_board_data = {
467 .interface_type = MUSB_INTERFACE_ULPI,
468 .mode = MUSB_OTG,
469 .power = 100,
470};
471
Steve Sakomaneba26452008-10-09 17:51:43 +0300472static void __init overo_init(void)
473{
Tony Lindgrenca5742b2009-12-11 16:16:32 -0800474 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
Steve Sakomaneba26452008-10-09 17:51:43 +0300475 overo_i2c_init();
476 platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
Steve Sakomaneba26452008-10-09 17:51:43 +0300477 omap_serial_init();
Steve Sakomaneba26452008-10-09 17:51:43 +0300478 overo_flash_init();
Maulik Mankad884b83692010-02-17 14:09:30 -0800479 usb_musb_init(&musb_board_data);
Felipe Balbi58a54912009-11-22 10:11:01 -0800480 usb_ehci_init(&ehci_pdata);
Steve Sakomanc6a81312009-03-23 18:38:16 -0700481 overo_ads7846_init();
Steve Sakoman172ef272009-02-02 06:27:49 +0000482 overo_init_smsc911x();
Steve Sakomaneba26452008-10-09 17:51:43 +0300483
Jean Pihet9fb97412009-07-24 19:43:25 -0600484 /* Ensure SDRC pins are mux'd for self-refresh */
Tony Lindgren4896e392009-12-11 16:16:32 -0800485 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
486 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
Jean Pihet9fb97412009-07-24 19:43:25 -0600487
Steve Sakomaneba26452008-10-09 17:51:43 +0300488 if ((gpio_request(OVERO_GPIO_W2W_NRESET,
489 "OVERO_GPIO_W2W_NRESET") == 0) &&
490 (gpio_direction_output(OVERO_GPIO_W2W_NRESET, 1) == 0)) {
491 gpio_export(OVERO_GPIO_W2W_NRESET, 0);
492 gpio_set_value(OVERO_GPIO_W2W_NRESET, 0);
493 udelay(10);
494 gpio_set_value(OVERO_GPIO_W2W_NRESET, 1);
495 } else {
496 printk(KERN_ERR "could not obtain gpio for "
497 "OVERO_GPIO_W2W_NRESET\n");
498 }
499
500 if ((gpio_request(OVERO_GPIO_BT_XGATE, "OVERO_GPIO_BT_XGATE") == 0) &&
501 (gpio_direction_output(OVERO_GPIO_BT_XGATE, 0) == 0))
502 gpio_export(OVERO_GPIO_BT_XGATE, 0);
503 else
504 printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_BT_XGATE\n");
505
506 if ((gpio_request(OVERO_GPIO_BT_NRESET, "OVERO_GPIO_BT_NRESET") == 0) &&
507 (gpio_direction_output(OVERO_GPIO_BT_NRESET, 1) == 0)) {
508 gpio_export(OVERO_GPIO_BT_NRESET, 0);
509 gpio_set_value(OVERO_GPIO_BT_NRESET, 0);
510 mdelay(6);
511 gpio_set_value(OVERO_GPIO_BT_NRESET, 1);
512 } else {
513 printk(KERN_ERR "could not obtain gpio for "
514 "OVERO_GPIO_BT_NRESET\n");
515 }
516
517 if ((gpio_request(OVERO_GPIO_USBH_CPEN, "OVERO_GPIO_USBH_CPEN") == 0) &&
518 (gpio_direction_output(OVERO_GPIO_USBH_CPEN, 1) == 0))
519 gpio_export(OVERO_GPIO_USBH_CPEN, 0);
520 else
521 printk(KERN_ERR "could not obtain gpio for "
522 "OVERO_GPIO_USBH_CPEN\n");
Steve Sakomaneba26452008-10-09 17:51:43 +0300523}
524
525static void __init overo_map_io(void)
526{
527 omap2_set_globals_343x();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800528 omap34xx_map_common_io();
Steve Sakomaneba26452008-10-09 17:51:43 +0300529}
530
531MACHINE_START(OVERO, "Gumstix Overo")
532 .phys_io = 0x48000000,
Santosh Shilimkarb4224b22009-10-19 17:25:55 -0700533 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
Steve Sakomaneba26452008-10-09 17:51:43 +0300534 .boot_params = 0x80000100,
535 .map_io = overo_map_io,
536 .init_irq = overo_init_irq,
537 .init_machine = overo_init,
538 .timer = &omap_timer,
539MACHINE_END