aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-h2.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/board-h2.c')
-rw-r--r--arch/arm/mach-omap1/board-h2.c82
1 files changed, 61 insertions, 21 deletions
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index aab860307dca..d1100e4f65ac 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -26,25 +26,26 @@
26#include <linux/mtd/mtd.h> 26#include <linux/mtd/mtd.h>
27#include <linux/mtd/nand.h> 27#include <linux/mtd/nand.h>
28#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
29#include <linux/mtd/physmap.h>
29#include <linux/input.h> 30#include <linux/input.h>
30#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h>
31 33
32#include <mach/hardware.h> 34#include <mach/hardware.h>
33#include <asm/gpio.h> 35#include <asm/gpio.h>
34 36
35#include <asm/mach-types.h> 37#include <asm/mach-types.h>
36#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
37#include <asm/mach/flash.h>
38#include <asm/mach/map.h> 39#include <asm/mach/map.h>
39 40
40#include <mach/mux.h> 41#include <plat/mux.h>
41#include <mach/dma.h> 42#include <plat/dma.h>
42#include <mach/tc.h> 43#include <plat/tc.h>
43#include <mach/nand.h> 44#include <plat/irda.h>
44#include <mach/irda.h> 45#include <plat/usb.h>
45#include <mach/usb.h> 46#include <plat/keypad.h>
46#include <mach/keypad.h> 47#include <plat/common.h>
47#include <mach/common.h> 48#include <plat/flash.h>
48 49
49#include "board-h2.h" 50#include "board-h2.h"
50 51
@@ -121,9 +122,9 @@ static struct mtd_partition h2_nor_partitions[] = {
121 } 122 }
122}; 123};
123 124
124static struct flash_platform_data h2_nor_data = { 125static struct physmap_flash_data h2_nor_data = {
125 .map_name = "cfi_probe",
126 .width = 2, 126 .width = 2,
127 .set_vpp = omap1_set_vpp,
127 .parts = h2_nor_partitions, 128 .parts = h2_nor_partitions,
128 .nr_parts = ARRAY_SIZE(h2_nor_partitions), 129 .nr_parts = ARRAY_SIZE(h2_nor_partitions),
129}; 130};
@@ -134,7 +135,7 @@ static struct resource h2_nor_resource = {
134}; 135};
135 136
136static struct platform_device h2_nor_device = { 137static struct platform_device h2_nor_device = {
137 .name = "omapflash", 138 .name = "physmap-flash",
138 .id = 0, 139 .id = 0,
139 .dev = { 140 .dev = {
140 .platform_data = &h2_nor_data, 141 .platform_data = &h2_nor_data,
@@ -179,11 +180,43 @@ static struct mtd_partition h2_nand_partitions[] = {
179 }, 180 },
180}; 181};
181 182
182/* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 183static void h2_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
183static struct omap_nand_platform_data h2_nand_data = { 184{
184 .options = NAND_SAMSUNG_LP_OPTIONS, 185 struct nand_chip *this = mtd->priv;
185 .parts = h2_nand_partitions, 186 unsigned long mask;
186 .nr_parts = ARRAY_SIZE(h2_nand_partitions), 187
188 if (cmd == NAND_CMD_NONE)
189 return;
190
191 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
192 if (ctrl & NAND_ALE)
193 mask |= 0x04;
194 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
195}
196
197#define H2_NAND_RB_GPIO_PIN 62
198
199static int h2_nand_dev_ready(struct mtd_info *mtd)
200{
201 return gpio_get_value(H2_NAND_RB_GPIO_PIN);
202}
203
204static const char *h2_part_probes[] = { "cmdlinepart", NULL };
205
206struct platform_nand_data h2_nand_platdata = {
207 .chip = {
208 .nr_chips = 1,
209 .chip_offset = 0,
210 .nr_partitions = ARRAY_SIZE(h2_nand_partitions),
211 .partitions = h2_nand_partitions,
212 .options = NAND_SAMSUNG_LP_OPTIONS,
213 .part_probe_types = h2_part_probes,
214 },
215 .ctrl = {
216 .cmd_ctrl = h2_nand_cmd_ctl,
217 .dev_ready = h2_nand_dev_ready,
218
219 },
187}; 220};
188 221
189static struct resource h2_nand_resource = { 222static struct resource h2_nand_resource = {
@@ -191,15 +224,21 @@ static struct resource h2_nand_resource = {
191}; 224};
192 225
193static struct platform_device h2_nand_device = { 226static struct platform_device h2_nand_device = {
194 .name = "omapnand", 227 .name = "gen_nand",
195 .id = 0, 228 .id = 0,
196 .dev = { 229 .dev = {
197 .platform_data = &h2_nand_data, 230 .platform_data = &h2_nand_platdata,
198 }, 231 },
199 .num_resources = 1, 232 .num_resources = 1,
200 .resource = &h2_nand_resource, 233 .resource = &h2_nand_resource,
201}; 234};
202 235
236static struct smc91x_platdata h2_smc91x_info = {
237 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
238 .leda = RPC_LED_100_10,
239 .ledb = RPC_LED_TX_RX,
240};
241
203static struct resource h2_smc91x_resources[] = { 242static struct resource h2_smc91x_resources[] = {
204 [0] = { 243 [0] = {
205 .start = OMAP1610_ETHR_START, /* Physical */ 244 .start = OMAP1610_ETHR_START, /* Physical */
@@ -216,6 +255,9 @@ static struct resource h2_smc91x_resources[] = {
216static struct platform_device h2_smc91x_device = { 255static struct platform_device h2_smc91x_device = {
217 .name = "smc91x", 256 .name = "smc91x",
218 .id = 0, 257 .id = 0,
258 .dev = {
259 .platform_data = &h2_smc91x_info,
260 },
219 .num_resources = ARRAY_SIZE(h2_smc91x_resources), 261 .num_resources = ARRAY_SIZE(h2_smc91x_resources),
220 .resource = h2_smc91x_resources, 262 .resource = h2_smc91x_resources,
221}; 263};
@@ -368,8 +410,6 @@ static struct omap_board_config_kernel h2_config[] __initdata = {
368 { OMAP_TAG_LCD, &h2_lcd_config }, 410 { OMAP_TAG_LCD, &h2_lcd_config },
369}; 411};
370 412
371#define H2_NAND_RB_GPIO_PIN 62
372
373static void __init h2_init(void) 413static void __init h2_init(void)
374{ 414{
375 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 415 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped