diff options
Diffstat (limited to 'arch/arm/mach-omap1/board-fsample.c')
-rw-r--r-- | arch/arm/mach-omap1/board-fsample.c | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index f4b72c1654f5..7e70c3c08da6 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.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> |
@@ -100,6 +100,12 @@ static int fsample_keymap[] = { | |||
100 | 0 | 100 | 0 |
101 | }; | 101 | }; |
102 | 102 | ||
103 | static struct smc91x_platdata smc91x_info = { | ||
104 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, | ||
105 | .leda = RPC_LED_100_10, | ||
106 | .ledb = RPC_LED_TX_RX, | ||
107 | }; | ||
108 | |||
103 | static struct resource smc91x_resources[] = { | 109 | static struct resource smc91x_resources[] = { |
104 | [0] = { | 110 | [0] = { |
105 | .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ | 111 | .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ |
@@ -167,8 +173,40 @@ static struct platform_device nor_device = { | |||
167 | .resource = &nor_resource, | 173 | .resource = &nor_resource, |
168 | }; | 174 | }; |
169 | 175 | ||
170 | static struct omap_nand_platform_data nand_data = { | 176 | static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
171 | .options = NAND_SAMSUNG_LP_OPTIONS, | 177 | { |
178 | struct nand_chip *this = mtd->priv; | ||
179 | unsigned long mask; | ||
180 | |||
181 | if (cmd == NAND_CMD_NONE) | ||
182 | return; | ||
183 | |||
184 | mask = (ctrl & NAND_CLE) ? 0x02 : 0; | ||
185 | if (ctrl & NAND_ALE) | ||
186 | mask |= 0x04; | ||
187 | writeb(cmd, (unsigned long)this->IO_ADDR_W | mask); | ||
188 | } | ||
189 | |||
190 | #define FSAMPLE_NAND_RB_GPIO_PIN 62 | ||
191 | |||
192 | static int nand_dev_ready(struct mtd_info *mtd) | ||
193 | { | ||
194 | return gpio_get_value(FSAMPLE_NAND_RB_GPIO_PIN); | ||
195 | } | ||
196 | |||
197 | static const char *part_probes[] = { "cmdlinepart", NULL }; | ||
198 | |||
199 | static struct platform_nand_data nand_data = { | ||
200 | .chip = { | ||
201 | .nr_chips = 1, | ||
202 | .chip_offset = 0, | ||
203 | .options = NAND_SAMSUNG_LP_OPTIONS, | ||
204 | .part_probe_types = part_probes, | ||
205 | }, | ||
206 | .ctrl = { | ||
207 | .cmd_ctrl = nand_cmd_ctl, | ||
208 | .dev_ready = nand_dev_ready, | ||
209 | }, | ||
172 | }; | 210 | }; |
173 | 211 | ||
174 | static struct resource nand_resource = { | 212 | static struct resource nand_resource = { |
@@ -178,7 +216,7 @@ static struct resource nand_resource = { | |||
178 | }; | 216 | }; |
179 | 217 | ||
180 | static struct platform_device nand_device = { | 218 | static struct platform_device nand_device = { |
181 | .name = "omapnand", | 219 | .name = "gen_nand", |
182 | .id = 0, | 220 | .id = 0, |
183 | .dev = { | 221 | .dev = { |
184 | .platform_data = &nand_data, | 222 | .platform_data = &nand_data, |
@@ -190,6 +228,9 @@ static struct platform_device nand_device = { | |||
190 | static struct platform_device smc91x_device = { | 228 | static struct platform_device smc91x_device = { |
191 | .name = "smc91x", | 229 | .name = "smc91x", |
192 | .id = 0, | 230 | .id = 0, |
231 | .dev = { | ||
232 | .platform_data = &smc91x_info, | ||
233 | }, | ||
193 | .num_resources = ARRAY_SIZE(smc91x_resources), | 234 | .num_resources = ARRAY_SIZE(smc91x_resources), |
194 | .resource = smc91x_resources, | 235 | .resource = smc91x_resources, |
195 | }; | 236 | }; |
@@ -233,13 +274,6 @@ static struct platform_device *devices[] __initdata = { | |||
233 | &lcd_device, | 274 | &lcd_device, |
234 | }; | 275 | }; |
235 | 276 | ||
236 | #define P2_NAND_RB_GPIO_PIN 62 | ||
237 | |||
238 | static int nand_dev_ready(struct omap_nand_platform_data *data) | ||
239 | { | ||
240 | return gpio_get_value(P2_NAND_RB_GPIO_PIN); | ||
241 | } | ||
242 | |||
243 | static struct omap_lcd_config fsample_lcd_config __initdata = { | 277 | static struct omap_lcd_config fsample_lcd_config __initdata = { |
244 | .ctrl_name = "internal", | 278 | .ctrl_name = "internal", |
245 | }; | 279 | }; |
@@ -250,9 +284,9 @@ static struct omap_board_config_kernel fsample_config[] = { | |||
250 | 284 | ||
251 | static void __init omap_fsample_init(void) | 285 | static void __init omap_fsample_init(void) |
252 | { | 286 | { |
253 | if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) | 287 | if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) |
254 | BUG(); | 288 | BUG(); |
255 | nand_data.dev_ready = nand_dev_ready; | 289 | gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN); |
256 | 290 | ||
257 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 291 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
258 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 292 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |