aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-perseus2.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/board-perseus2.c')
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c88
1 files changed, 61 insertions, 27 deletions
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 83406699f310..1387a4f15da9 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -19,6 +19,7 @@
19#include <linux/mtd/nand.h> 19#include <linux/mtd/nand.h>
20#include <linux/mtd/partitions.h> 20#include <linux/mtd/partitions.h>
21#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/smc91x.h>
22 23
23#include <mach/hardware.h> 24#include <mach/hardware.h>
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
@@ -26,14 +27,13 @@
26#include <asm/mach/flash.h> 27#include <asm/mach/flash.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
28 29
29#include <mach/tc.h> 30#include <plat/tc.h>
30#include <mach/gpio.h> 31#include <mach/gpio.h>
31#include <mach/mux.h> 32#include <plat/mux.h>
32#include <mach/fpga.h> 33#include <plat/fpga.h>
33#include <mach/nand.h> 34#include <plat/keypad.h>
34#include <mach/keypad.h> 35#include <plat/common.h>
35#include <mach/common.h> 36#include <plat/board.h>
36#include <mach/board.h>
37 37
38static int p2_keymap[] = { 38static int p2_keymap[] = {
39 KEY(0,0,KEY_UP), 39 KEY(0,0,KEY_UP),
@@ -67,6 +67,12 @@ static int p2_keymap[] = {
67 0 67 0
68}; 68};
69 69
70static struct smc91x_platdata smc91x_info = {
71 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
72 .leda = RPC_LED_100_10,
73 .ledb = RPC_LED_TX_RX,
74};
75
70static struct resource smc91x_resources[] = { 76static struct resource smc91x_resources[] = {
71 [0] = { 77 [0] = {
72 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ 78 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */
@@ -74,7 +80,7 @@ static struct resource smc91x_resources[] = {
74 .flags = IORESOURCE_MEM, 80 .flags = IORESOURCE_MEM,
75 }, 81 },
76 [1] = { 82 [1] = {
77 .start = INT_730_MPU_EXT_NIRQ, 83 .start = INT_7XX_MPU_EXT_NIRQ,
78 .end = 0, 84 .end = 0,
79 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 85 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
80 }, 86 },
@@ -134,8 +140,40 @@ static struct platform_device nor_device = {
134 .resource = &nor_resource, 140 .resource = &nor_resource,
135}; 141};
136 142
137static struct omap_nand_platform_data nand_data = { 143static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
138 .options = NAND_SAMSUNG_LP_OPTIONS, 144{
145 struct nand_chip *this = mtd->priv;
146 unsigned long mask;
147
148 if (cmd == NAND_CMD_NONE)
149 return;
150
151 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
152 if (ctrl & NAND_ALE)
153 mask |= 0x04;
154 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
155}
156
157#define P2_NAND_RB_GPIO_PIN 62
158
159static int nand_dev_ready(struct mtd_info *mtd)
160{
161 return gpio_get_value(P2_NAND_RB_GPIO_PIN);
162}
163
164static const char *part_probes[] = { "cmdlinepart", NULL };
165
166static struct platform_nand_data nand_data = {
167 .chip = {
168 .nr_chips = 1,
169 .chip_offset = 0,
170 .options = NAND_SAMSUNG_LP_OPTIONS,
171 .part_probe_types = part_probes,
172 },
173 .ctrl = {
174 .cmd_ctrl = nand_cmd_ctl,
175 .dev_ready = nand_dev_ready,
176 },
139}; 177};
140 178
141static struct resource nand_resource = { 179static struct resource nand_resource = {
@@ -145,7 +183,7 @@ static struct resource nand_resource = {
145}; 183};
146 184
147static struct platform_device nand_device = { 185static struct platform_device nand_device = {
148 .name = "omapnand", 186 .name = "gen_nand",
149 .id = 0, 187 .id = 0,
150 .dev = { 188 .dev = {
151 .platform_data = &nand_data, 189 .platform_data = &nand_data,
@@ -157,14 +195,17 @@ static struct platform_device nand_device = {
157static struct platform_device smc91x_device = { 195static struct platform_device smc91x_device = {
158 .name = "smc91x", 196 .name = "smc91x",
159 .id = 0, 197 .id = 0,
198 .dev = {
199 .platform_data = &smc91x_info,
200 },
160 .num_resources = ARRAY_SIZE(smc91x_resources), 201 .num_resources = ARRAY_SIZE(smc91x_resources),
161 .resource = smc91x_resources, 202 .resource = smc91x_resources,
162}; 203};
163 204
164static struct resource kp_resources[] = { 205static struct resource kp_resources[] = {
165 [0] = { 206 [0] = {
166 .start = INT_730_MPUIO_KEYPAD, 207 .start = INT_7XX_MPUIO_KEYPAD,
167 .end = INT_730_MPUIO_KEYPAD, 208 .end = INT_7XX_MPUIO_KEYPAD,
168 .flags = IORESOURCE_IRQ, 209 .flags = IORESOURCE_IRQ,
169 }, 210 },
170}; 211};
@@ -201,13 +242,6 @@ static struct platform_device *devices[] __initdata = {
201 &lcd_device, 242 &lcd_device,
202}; 243};
203 244
204#define P2_NAND_RB_GPIO_PIN 62
205
206static int nand_dev_ready(struct omap_nand_platform_data *data)
207{
208 return gpio_get_value(P2_NAND_RB_GPIO_PIN);
209}
210
211static struct omap_lcd_config perseus2_lcd_config __initdata = { 245static struct omap_lcd_config perseus2_lcd_config __initdata = {
212 .ctrl_name = "internal", 246 .ctrl_name = "internal",
213}; 247};
@@ -220,7 +254,7 @@ static void __init omap_perseus2_init(void)
220{ 254{
221 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) 255 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
222 BUG(); 256 BUG();
223 nand_data.dev_ready = nand_dev_ready; 257 gpio_direction_input(P2_NAND_RB_GPIO_PIN);
224 258
225 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 259 omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
226 omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 260 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
@@ -270,7 +304,7 @@ static void __init omap_perseus2_map_io(void)
270 /* 304 /*
271 * Hold GSM Reset until needed 305 * Hold GSM Reset until needed
272 */ 306 */
273 omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL); 307 omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
274 308
275 /* 309 /*
276 * UARTs -> done automagically by 8250 driver 310 * UARTs -> done automagically by 8250 driver
@@ -281,21 +315,21 @@ static void __init omap_perseus2_map_io(void)
281 */ 315 */
282 316
283 /* Flash: CS0 timings setup */ 317 /* Flash: CS0 timings setup */
284 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0); 318 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
285 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0); 319 omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
286 320
287 /* 321 /*
288 * Ethernet support through the debug board 322 * Ethernet support through the debug board
289 * CS1 timings setup 323 * CS1 timings setup
290 */ 324 */
291 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1); 325 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
292 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1); 326 omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
293 327
294 /* 328 /*
295 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 329 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
296 * It is used as the Ethernet controller interrupt 330 * It is used as the Ethernet controller interrupt
297 */ 331 */
298 omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); 332 omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
299} 333}
300 334
301MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") 335MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")