aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-h3.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/board-h3.c')
-rw-r--r--arch/arm/mach-omap1/board-h3.c66
1 files changed, 50 insertions, 16 deletions
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index f5cc0a730524..6a7f9c391cf1 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -28,6 +28,7 @@
28#include <linux/input.h> 28#include <linux/input.h>
29#include <linux/spi/spi.h> 29#include <linux/spi/spi.h>
30#include <linux/i2c/tps65010.h> 30#include <linux/i2c/tps65010.h>
31#include <linux/smc91x.h>
31 32
32#include <asm/setup.h> 33#include <asm/setup.h>
33#include <asm/page.h> 34#include <asm/page.h>
@@ -42,7 +43,6 @@
42#include <mach/irqs.h> 43#include <mach/irqs.h>
43#include <plat/mux.h> 44#include <plat/mux.h>
44#include <plat/tc.h> 45#include <plat/tc.h>
45#include <plat/nand.h>
46#include <plat/usb.h> 46#include <plat/usb.h>
47#include <plat/keypad.h> 47#include <plat/keypad.h>
48#include <plat/dma.h> 48#include <plat/dma.h>
@@ -181,11 +181,43 @@ static struct mtd_partition nand_partitions[] = {
181 }, 181 },
182}; 182};
183 183
184/* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 184static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
185static struct omap_nand_platform_data nand_data = { 185{
186 .options = NAND_SAMSUNG_LP_OPTIONS, 186 struct nand_chip *this = mtd->priv;
187 .parts = nand_partitions, 187 unsigned long mask;
188 .nr_parts = ARRAY_SIZE(nand_partitions), 188
189 if (cmd == NAND_CMD_NONE)
190 return;
191
192 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
193 if (ctrl & NAND_ALE)
194 mask |= 0x04;
195 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
196}
197
198#define H3_NAND_RB_GPIO_PIN 10
199
200static int nand_dev_ready(struct mtd_info *mtd)
201{
202 return gpio_get_value(H3_NAND_RB_GPIO_PIN);
203}
204
205static const char *part_probes[] = { "cmdlinepart", NULL };
206
207struct platform_nand_data nand_platdata = {
208 .chip = {
209 .nr_chips = 1,
210 .chip_offset = 0,
211 .nr_partitions = ARRAY_SIZE(nand_partitions),
212 .partitions = nand_partitions,
213 .options = NAND_SAMSUNG_LP_OPTIONS,
214 .part_probe_types = part_probes,
215 },
216 .ctrl = {
217 .cmd_ctrl = nand_cmd_ctl,
218 .dev_ready = nand_dev_ready,
219
220 },
189}; 221};
190 222
191static struct resource nand_resource = { 223static struct resource nand_resource = {
@@ -193,15 +225,21 @@ static struct resource nand_resource = {
193}; 225};
194 226
195static struct platform_device nand_device = { 227static struct platform_device nand_device = {
196 .name = "omapnand", 228 .name = "gen_nand",
197 .id = 0, 229 .id = 0,
198 .dev = { 230 .dev = {
199 .platform_data = &nand_data, 231 .platform_data = &nand_platdata,
200 }, 232 },
201 .num_resources = 1, 233 .num_resources = 1,
202 .resource = &nand_resource, 234 .resource = &nand_resource,
203}; 235};
204 236
237static struct smc91x_platdata smc91x_info = {
238 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
239 .leda = RPC_LED_100_10,
240 .ledb = RPC_LED_TX_RX,
241};
242
205static struct resource smc91x_resources[] = { 243static struct resource smc91x_resources[] = {
206 [0] = { 244 [0] = {
207 .start = OMAP1710_ETHR_START, /* Physical */ 245 .start = OMAP1710_ETHR_START, /* Physical */
@@ -218,6 +256,9 @@ static struct resource smc91x_resources[] = {
218static struct platform_device smc91x_device = { 256static struct platform_device smc91x_device = {
219 .name = "smc91x", 257 .name = "smc91x",
220 .id = 0, 258 .id = 0,
259 .dev = {
260 .platform_data = &smc91x_info,
261 },
221 .num_resources = ARRAY_SIZE(smc91x_resources), 262 .num_resources = ARRAY_SIZE(smc91x_resources),
222 .resource = smc91x_resources, 263 .resource = smc91x_resources,
223}; 264};
@@ -332,13 +373,6 @@ static struct i2c_board_info __initdata h3_i2c_board_info[] = {
332 }, 373 },
333}; 374};
334 375
335#define H3_NAND_RB_GPIO_PIN 10
336
337static int nand_dev_ready(struct omap_nand_platform_data *data)
338{
339 return gpio_get_value(H3_NAND_RB_GPIO_PIN);
340}
341
342static void __init h3_init(void) 376static void __init h3_init(void)
343{ 377{
344 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 378 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
@@ -356,7 +390,7 @@ static void __init h3_init(void)
356 nand_resource.end += SZ_4K - 1; 390 nand_resource.end += SZ_4K - 1;
357 if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0) 391 if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0)
358 BUG(); 392 BUG();
359 nand_data.dev_ready = nand_dev_ready; 393 gpio_direction_input(H3_NAND_RB_GPIO_PIN);
360 394
361 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ 395 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
362 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ 396 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */