2 * linux/arch/arm/mach-omap1/board-innovator.c
4 * Board specific inits for OMAP-1510 and OMAP-1610 Innovator
6 * Copyright (C) 2001 RidgeRun, Inc.
7 * Author: Greg Lonnon <glonnon@ridgerun.com>
9 * Copyright (C) 2002 MontaVista Software, Inc.
11 * Separated FPGA interrupts from innovator1510.c and cleaned up for 2.6
12 * Copyright (C) 2004 Nokia Corporation by Tony Lindrgen <tony@atomide.com>
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/platform_device.h>
22 #include <linux/delay.h>
23 #include <linux/mtd/mtd.h>
24 #include <linux/mtd/partitions.h>
25 #include <linux/input.h>
27 #include <asm/hardware.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/flash.h>
31 #include <asm/mach/map.h>
33 #include <asm/arch/mux.h>
34 #include <asm/arch/fpga.h>
35 #include <asm/arch/gpio.h>
36 #include <asm/arch/tc.h>
37 #include <asm/arch/usb.h>
38 #include <asm/arch/keypad.h>
39 #include <asm/arch/common.h>
41 static int innovator_keymap
[] = {
54 static struct mtd_partition innovator_partitions
[] = {
55 /* bootloader (U-Boot, etc) in first sector */
60 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
62 /* bootloader params in the next sector */
65 .offset
= MTDPART_OFS_APPEND
,
72 .offset
= MTDPART_OFS_APPEND
,
76 /* rest of flash1 is a file system */
79 .offset
= MTDPART_OFS_APPEND
,
80 .size
= SZ_16M
- SZ_2M
- 2 * SZ_128K
,
86 .offset
= MTDPART_OFS_APPEND
,
87 .size
= MTDPART_SIZ_FULL
,
92 static struct flash_platform_data innovator_flash_data
= {
93 .map_name
= "cfi_probe",
95 .parts
= innovator_partitions
,
96 .nr_parts
= ARRAY_SIZE(innovator_partitions
),
99 static struct resource innovator_flash_resource
= {
100 .start
= OMAP_CS0_PHYS
,
101 .end
= OMAP_CS0_PHYS
+ SZ_32M
- 1,
102 .flags
= IORESOURCE_MEM
,
105 static struct platform_device innovator_flash_device
= {
109 .platform_data
= &innovator_flash_data
,
112 .resource
= &innovator_flash_resource
,
115 static struct resource innovator_kp_resources
[] = {
117 .start
= INT_KEYBOARD
,
119 .flags
= IORESOURCE_IRQ
,
123 static struct omap_kp_platform_data innovator_kp_data
= {
126 .keymap
= innovator_keymap
,
129 static struct platform_device innovator_kp_device
= {
130 .name
= "omap-keypad",
133 .platform_data
= &innovator_kp_data
,
135 .num_resources
= ARRAY_SIZE(innovator_kp_resources
),
136 .resource
= innovator_kp_resources
,
140 #ifdef CONFIG_ARCH_OMAP15XX
142 /* Only FPGA needs to be mapped here. All others are done with ioremap */
143 static struct map_desc innovator1510_io_desc
[] __initdata
= {
145 .virtual = OMAP1510_FPGA_BASE
,
146 .pfn
= __phys_to_pfn(OMAP1510_FPGA_START
),
147 .length
= OMAP1510_FPGA_SIZE
,
152 static struct resource innovator1510_smc91x_resources
[] = {
154 .start
= OMAP1510_FPGA_ETHR_START
, /* Physical */
155 .end
= OMAP1510_FPGA_ETHR_START
+ 0xf,
156 .flags
= IORESOURCE_MEM
,
159 .start
= OMAP1510_INT_ETHER
,
160 .end
= OMAP1510_INT_ETHER
,
161 .flags
= IORESOURCE_IRQ
,
165 static struct platform_device innovator1510_smc91x_device
= {
168 .num_resources
= ARRAY_SIZE(innovator1510_smc91x_resources
),
169 .resource
= innovator1510_smc91x_resources
,
172 static struct platform_device innovator1510_lcd_device
= {
173 .name
= "lcd_inn1510",
177 static struct platform_device
*innovator1510_devices
[] __initdata
= {
178 &innovator_flash_device
,
179 &innovator1510_smc91x_device
,
180 &innovator_kp_device
,
181 &innovator1510_lcd_device
,
184 #endif /* CONFIG_ARCH_OMAP15XX */
186 #ifdef CONFIG_ARCH_OMAP16XX
188 static struct resource innovator1610_smc91x_resources
[] = {
190 .start
= INNOVATOR1610_ETHR_START
, /* Physical */
191 .end
= INNOVATOR1610_ETHR_START
+ 0xf,
192 .flags
= IORESOURCE_MEM
,
195 .start
= OMAP_GPIO_IRQ(0),
196 .end
= OMAP_GPIO_IRQ(0),
197 .flags
= IORESOURCE_IRQ
,
201 static struct platform_device innovator1610_smc91x_device
= {
204 .num_resources
= ARRAY_SIZE(innovator1610_smc91x_resources
),
205 .resource
= innovator1610_smc91x_resources
,
208 static struct platform_device innovator1610_lcd_device
= {
209 .name
= "inn1610_lcd",
213 static struct platform_device
*innovator1610_devices
[] __initdata
= {
214 &innovator_flash_device
,
215 &innovator1610_smc91x_device
,
216 &innovator_kp_device
,
217 &innovator1610_lcd_device
,
220 #endif /* CONFIG_ARCH_OMAP16XX */
222 static void __init
innovator_init_smc91x(void)
224 if (cpu_is_omap1510()) {
225 fpga_write(fpga_read(OMAP1510_FPGA_RST
) & ~1,
229 if ((omap_request_gpio(0)) < 0) {
230 printk("Error requesting gpio 0 for smc91x irq\n");
236 void innovator_init_irq(void)
238 omap1_init_common_hw();
241 #ifdef CONFIG_ARCH_OMAP15XX
242 if (cpu_is_omap1510()) {
243 omap1510_fpga_init_irq();
246 innovator_init_smc91x();
249 #ifdef CONFIG_ARCH_OMAP15XX
250 static struct omap_usb_config innovator1510_usb_config __initdata
= {
251 /* for bundled non-standard host and peripheral cables */
256 .pins
[2] = 6, /* Conflicts with UART2 */
262 static struct omap_lcd_config innovator1510_lcd_config __initdata
= {
263 .ctrl_name
= "internal",
267 #ifdef CONFIG_ARCH_OMAP16XX
268 static struct omap_usb_config h2_usb_config __initdata
= {
269 /* usb1 has a Mini-AB port and external isp1301 transceiver */
272 #ifdef CONFIG_USB_GADGET_OMAP
273 .hmc_mode
= 19, // 0:host(off) 1:dev|otg 2:disabled
274 // .hmc_mode = 21, // 0:host(off) 1:dev(loopback) 2:host(loopback)
275 #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
276 /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
277 .hmc_mode
= 20, // 1:dev|otg(off) 1:host 2:disabled
283 static struct omap_lcd_config innovator1610_lcd_config __initdata
= {
284 .ctrl_name
= "internal",
288 static struct omap_mmc_config innovator_mmc_config __initdata
= {
292 .wp_pin
= OMAP_MPUIO(3),
293 .power_pin
= -1, /* FPGA F3 UIO42 */
294 .switch_pin
= -1, /* FPGA F4 UIO43 */
298 static struct omap_uart_config innovator_uart_config __initdata
= {
299 .enabled_uarts
= ((1 << 0) | (1 << 1) | (1 << 2)),
302 static struct omap_board_config_kernel innovator_config
[] = {
303 { OMAP_TAG_USB
, NULL
},
304 { OMAP_TAG_LCD
, NULL
},
305 { OMAP_TAG_MMC
, &innovator_mmc_config
},
306 { OMAP_TAG_UART
, &innovator_uart_config
},
309 static void __init
innovator_init(void)
311 #ifdef CONFIG_ARCH_OMAP15XX
312 if (cpu_is_omap1510()) {
313 platform_add_devices(innovator1510_devices
, ARRAY_SIZE(innovator1510_devices
));
316 #ifdef CONFIG_ARCH_OMAP16XX
317 if (!cpu_is_omap1510()) {
318 platform_add_devices(innovator1610_devices
, ARRAY_SIZE(innovator1610_devices
));
322 #ifdef CONFIG_ARCH_OMAP15XX
323 if (cpu_is_omap1510()) {
324 innovator_config
[0].data
= &innovator1510_usb_config
;
325 innovator_config
[1].data
= &innovator1510_lcd_config
;
328 #ifdef CONFIG_ARCH_OMAP16XX
329 if (cpu_is_omap1610()) {
330 innovator_config
[0].data
= &h2_usb_config
;
331 innovator_config
[1].data
= &innovator1610_lcd_config
;
334 omap_board_config
= innovator_config
;
335 omap_board_config_size
= ARRAY_SIZE(innovator_config
);
339 static void __init
innovator_map_io(void)
341 omap1_map_common_io();
343 #ifdef CONFIG_ARCH_OMAP15XX
344 if (cpu_is_omap1510()) {
345 iotable_init(innovator1510_io_desc
, ARRAY_SIZE(innovator1510_io_desc
));
346 udelay(10); /* Delay needed for FPGA */
348 /* Dump the Innovator FPGA rev early - useful info for support. */
349 printk("Innovator FPGA Rev %d.%d Board Rev %d\n",
350 fpga_read(OMAP1510_FPGA_REV_HIGH
),
351 fpga_read(OMAP1510_FPGA_REV_LOW
),
352 fpga_read(OMAP1510_FPGA_BOARD_REV
));
357 MACHINE_START(OMAP_INNOVATOR
, "TI-Innovator")
358 /* Maintainer: MontaVista Software, Inc. */
359 .phys_io
= 0xfff00000,
360 .io_pg_offst
= ((0xfef00000) >> 18) & 0xfffc,
361 .boot_params
= 0x10000100,
362 .map_io
= innovator_map_io
,
363 .init_irq
= innovator_init_irq
,
364 .init_machine
= innovator_init
,
365 .timer
= &omap_timer
,