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.c58
1 files changed, 46 insertions, 12 deletions
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index ca7df1e93efc..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>
@@ -30,7 +31,6 @@
30#include <mach/gpio.h> 31#include <mach/gpio.h>
31#include <plat/mux.h> 32#include <plat/mux.h>
32#include <plat/fpga.h> 33#include <plat/fpga.h>
33#include <plat/nand.h>
34#include <plat/keypad.h> 34#include <plat/keypad.h>
35#include <plat/common.h> 35#include <plat/common.h>
36#include <plat/board.h> 36#include <plat/board.h>
@@ -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 */
@@ -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,6 +195,9 @@ 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};
@@ -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);