blob: 668e278433c28701762f28b9531b0ecc489406f8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Tony Lindgrendbdf9ced2005-07-10 19:58:11 +01002 * linux/arch/arm/mach-omap1/board-h3.c
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 *
4 * This file contains OMAP1710 H3 specific code.
5 *
6 * Copyright (C) 2004 Texas Instruments, Inc.
7 * Copyright (C) 2002 MontaVista Software, Inc.
8 * Copyright (C) 2001 RidgeRun, Inc.
9 * Author: RidgeRun, Inc.
10 * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#include <linux/config.h>
18#include <linux/types.h>
19#include <linux/init.h>
20#include <linux/major.h>
21#include <linux/kernel.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010022#include <linux/platform_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include <linux/errno.h>
24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h>
26
27#include <asm/setup.h>
28#include <asm/page.h>
29#include <asm/hardware.h>
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/flash.h>
33#include <asm/mach/map.h>
34
35#include <asm/arch/gpio.h>
36#include <asm/arch/irqs.h>
37#include <asm/arch/mux.h>
38#include <asm/arch/tc.h>
39#include <asm/arch/usb.h>
Tony Lindgrend48af152005-07-10 19:58:17 +010040#include <asm/arch/common.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42extern int omap_gpio_init(void);
43
Linus Torvalds1da177e2005-04-16 15:20:36 -070044static struct mtd_partition h3_partitions[] = {
45 /* bootloader (U-Boot, etc) in first sector */
46 {
47 .name = "bootloader",
48 .offset = 0,
49 .size = SZ_128K,
50 .mask_flags = MTD_WRITEABLE, /* force read-only */
51 },
52 /* bootloader params in the next sector */
53 {
54 .name = "params",
55 .offset = MTDPART_OFS_APPEND,
56 .size = SZ_128K,
57 .mask_flags = 0,
58 },
59 /* kernel */
60 {
61 .name = "kernel",
62 .offset = MTDPART_OFS_APPEND,
63 .size = SZ_2M,
64 .mask_flags = 0
65 },
66 /* file system */
67 {
68 .name = "filesystem",
69 .offset = MTDPART_OFS_APPEND,
70 .size = MTDPART_SIZ_FULL,
71 .mask_flags = 0
72 }
73};
74
75static struct flash_platform_data h3_flash_data = {
76 .map_name = "cfi_probe",
77 .width = 2,
78 .parts = h3_partitions,
79 .nr_parts = ARRAY_SIZE(h3_partitions),
80};
81
82static struct resource h3_flash_resource = {
Tony Lindgren7c38cf02005-09-08 23:07:38 +010083 /* This is on CS3, wherever it's mapped */
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 .flags = IORESOURCE_MEM,
85};
86
87static struct platform_device flash_device = {
88 .name = "omapflash",
89 .id = 0,
90 .dev = {
91 .platform_data = &h3_flash_data,
92 },
93 .num_resources = 1,
94 .resource = &h3_flash_resource,
95};
96
97static struct resource smc91x_resources[] = {
98 [0] = {
99 .start = OMAP1710_ETHR_START, /* Physical */
100 .end = OMAP1710_ETHR_START + 0xf,
101 .flags = IORESOURCE_MEM,
102 },
103 [1] = {
104 .start = OMAP_GPIO_IRQ(40),
105 .end = OMAP_GPIO_IRQ(40),
106 .flags = IORESOURCE_IRQ,
107 },
108};
109
110static struct platform_device smc91x_device = {
111 .name = "smc91x",
112 .id = 0,
113 .num_resources = ARRAY_SIZE(smc91x_resources),
114 .resource = smc91x_resources,
115};
116
117#define GPTIMER_BASE 0xFFFB1400
118#define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800))
119#define GPTIMER_REGS_SIZE 0x46
120
121static struct resource intlat_resources[] = {
122 [0] = {
123 .start = GPTIMER_REGS(0), /* Physical */
124 .end = GPTIMER_REGS(0) + GPTIMER_REGS_SIZE,
125 .flags = IORESOURCE_MEM,
126 },
127 [1] = {
128 .start = INT_1610_GPTIMER1,
129 .end = INT_1610_GPTIMER1,
130 .flags = IORESOURCE_IRQ,
131 },
132};
133
134static struct platform_device intlat_device = {
135 .name = "omap_intlat",
136 .id = 0,
137 .num_resources = ARRAY_SIZE(intlat_resources),
138 .resource = intlat_resources,
139};
140
141static struct platform_device *devices[] __initdata = {
142 &flash_device,
143 &smc91x_device,
144 &intlat_device,
145};
146
147static struct omap_usb_config h3_usb_config __initdata = {
148 /* usb1 has a Mini-AB port and external isp1301 transceiver */
149 .otg = 2,
150
151#ifdef CONFIG_USB_GADGET_OMAP
152 .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */
153#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
154 /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
155 .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */
156#endif
157
158 .pins[1] = 3,
159};
160
Tony Lindgren7c38cf02005-09-08 23:07:38 +0100161static struct omap_mmc_config h3_mmc_config __initdata = {
162 .mmc[0] = {
163 .enabled = 1,
164 .power_pin = -1, /* tps65010 GPIO4 */
165 .switch_pin = OMAP_MPUIO(1),
166 },
167};
168
Tony Lindgren3179a012005-11-10 14:26:48 +0000169static struct omap_uart_config h3_uart_config __initdata = {
170 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
171};
172
173static struct omap_lcd_config h3_lcd_config __initdata = {
174 .panel_name = "h3",
175 .ctrl_name = "internal",
176};
177
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178static struct omap_board_config_kernel h3_config[] = {
Tony Lindgren3179a012005-11-10 14:26:48 +0000179 { OMAP_TAG_USB, &h3_usb_config },
180 { OMAP_TAG_MMC, &h3_mmc_config },
181 { OMAP_TAG_UART, &h3_uart_config },
182 { OMAP_TAG_LCD, &h3_lcd_config },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183};
184
185static void __init h3_init(void)
186{
Tony Lindgren7c38cf02005-09-08 23:07:38 +0100187 h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys();
188 h3_flash_resource.end += OMAP_CS3_SIZE - 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
Tony Lindgren7c38cf02005-09-08 23:07:38 +0100190 omap_board_config = h3_config;
191 omap_board_config_size = ARRAY_SIZE(h3_config);
Tony Lindgren3179a012005-11-10 14:26:48 +0000192 omap_serial_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193}
194
195static void __init h3_init_smc91x(void)
196{
197 omap_cfg_reg(W15_1710_GPIO40);
198 if (omap_request_gpio(40) < 0) {
199 printk("Error requesting gpio 40 for smc91x irq\n");
200 return;
201 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202}
203
204void h3_init_irq(void)
205{
206 omap_init_irq();
207 omap_gpio_init();
208 h3_init_smc91x();
209}
210
211static void __init h3_map_io(void)
212{
Tony Lindgrend48af152005-07-10 19:58:17 +0100213 omap_map_common_io();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214}
215
216MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
Russell Kinge9dea0c2005-07-03 17:38:58 +0100217 /* Maintainer: Texas Instruments, Inc. */
218 .phys_ram = 0x10000000,
219 .phys_io = 0xfff00000,
220 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
221 .boot_params = 0x10000100,
222 .map_io = h3_map_io,
223 .init_irq = h3_init_irq,
224 .init_machine = h3_init,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 .timer = &omap_timer,
226MACHINE_END