aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-fsample.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/board-fsample.c')
-rw-r--r--arch/arm/mach-omap1/board-fsample.c99
1 files changed, 67 insertions, 32 deletions
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index a7ead1b93226..096f2ed102cb 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -18,22 +18,23 @@
18#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
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/mtd/physmap.h>
21#include <linux/input.h> 22#include <linux/input.h>
23#include <linux/smc91x.h>
22 24
23#include <mach/hardware.h> 25#include <mach/hardware.h>
24#include <asm/mach-types.h> 26#include <asm/mach-types.h>
25#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
26#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/flash.h>
33#include <mach/nand.h> 34#include <plat/fpga.h>
34#include <mach/keypad.h> 35#include <plat/keypad.h>
35#include <mach/common.h> 36#include <plat/common.h>
36#include <mach/board.h> 37#include <plat/board.h>
37 38
38/* fsample is pretty close to p2-sample */ 39/* fsample is pretty close to p2-sample */
39 40
@@ -100,6 +101,12 @@ static int fsample_keymap[] = {
100 0 101 0
101}; 102};
102 103
104static struct smc91x_platdata smc91x_info = {
105 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
106 .leda = RPC_LED_100_10,
107 .ledb = RPC_LED_TX_RX,
108};
109
103static struct resource smc91x_resources[] = { 110static struct resource smc91x_resources[] = {
104 [0] = { 111 [0] = {
105 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */ 112 .start = H2P2_DBG_FPGA_ETHR_START, /* Physical */
@@ -107,7 +114,7 @@ static struct resource smc91x_resources[] = {
107 .flags = IORESOURCE_MEM, 114 .flags = IORESOURCE_MEM,
108 }, 115 },
109 [1] = { 116 [1] = {
110 .start = INT_730_MPU_EXT_NIRQ, 117 .start = INT_7XX_MPU_EXT_NIRQ,
111 .end = 0, 118 .end = 0,
112 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, 119 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
113 }, 120 },
@@ -144,9 +151,9 @@ static struct mtd_partition nor_partitions[] = {
144 }, 151 },
145}; 152};
146 153
147static struct flash_platform_data nor_data = { 154static struct physmap_flash_data nor_data = {
148 .map_name = "cfi_probe",
149 .width = 2, 155 .width = 2,
156 .set_vpp = omap1_set_vpp,
150 .parts = nor_partitions, 157 .parts = nor_partitions,
151 .nr_parts = ARRAY_SIZE(nor_partitions), 158 .nr_parts = ARRAY_SIZE(nor_partitions),
152}; 159};
@@ -158,7 +165,7 @@ static struct resource nor_resource = {
158}; 165};
159 166
160static struct platform_device nor_device = { 167static struct platform_device nor_device = {
161 .name = "omapflash", 168 .name = "physmap-flash",
162 .id = 0, 169 .id = 0,
163 .dev = { 170 .dev = {
164 .platform_data = &nor_data, 171 .platform_data = &nor_data,
@@ -167,8 +174,40 @@ static struct platform_device nor_device = {
167 .resource = &nor_resource, 174 .resource = &nor_resource,
168}; 175};
169 176
170static struct omap_nand_platform_data nand_data = { 177static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
171 .options = NAND_SAMSUNG_LP_OPTIONS, 178{
179 struct nand_chip *this = mtd->priv;
180 unsigned long mask;
181
182 if (cmd == NAND_CMD_NONE)
183 return;
184
185 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
186 if (ctrl & NAND_ALE)
187 mask |= 0x04;
188 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
189}
190
191#define FSAMPLE_NAND_RB_GPIO_PIN 62
192
193static int nand_dev_ready(struct mtd_info *mtd)
194{
195 return gpio_get_value(FSAMPLE_NAND_RB_GPIO_PIN);
196}
197
198static const char *part_probes[] = { "cmdlinepart", NULL };
199
200static struct platform_nand_data nand_data = {
201 .chip = {
202 .nr_chips = 1,
203 .chip_offset = 0,
204 .options = NAND_SAMSUNG_LP_OPTIONS,
205 .part_probe_types = part_probes,
206 },
207 .ctrl = {
208 .cmd_ctrl = nand_cmd_ctl,
209 .dev_ready = nand_dev_ready,
210 },
172}; 211};
173 212
174static struct resource nand_resource = { 213static struct resource nand_resource = {
@@ -178,7 +217,7 @@ static struct resource nand_resource = {
178}; 217};
179 218
180static struct platform_device nand_device = { 219static struct platform_device nand_device = {
181 .name = "omapnand", 220 .name = "gen_nand",
182 .id = 0, 221 .id = 0,
183 .dev = { 222 .dev = {
184 .platform_data = &nand_data, 223 .platform_data = &nand_data,
@@ -190,14 +229,17 @@ static struct platform_device nand_device = {
190static struct platform_device smc91x_device = { 229static struct platform_device smc91x_device = {
191 .name = "smc91x", 230 .name = "smc91x",
192 .id = 0, 231 .id = 0,
232 .dev = {
233 .platform_data = &smc91x_info,
234 },
193 .num_resources = ARRAY_SIZE(smc91x_resources), 235 .num_resources = ARRAY_SIZE(smc91x_resources),
194 .resource = smc91x_resources, 236 .resource = smc91x_resources,
195}; 237};
196 238
197static struct resource kp_resources[] = { 239static struct resource kp_resources[] = {
198 [0] = { 240 [0] = {
199 .start = INT_730_MPUIO_KEYPAD, 241 .start = INT_7XX_MPUIO_KEYPAD,
200 .end = INT_730_MPUIO_KEYPAD, 242 .end = INT_7XX_MPUIO_KEYPAD,
201 .flags = IORESOURCE_IRQ, 243 .flags = IORESOURCE_IRQ,
202 }, 244 },
203}; 245};
@@ -233,13 +275,6 @@ static struct platform_device *devices[] __initdata = {
233 &lcd_device, 275 &lcd_device,
234}; 276};
235 277
236#define P2_NAND_RB_GPIO_PIN 62
237
238static int nand_dev_ready(struct omap_nand_platform_data *data)
239{
240 return gpio_get_value(P2_NAND_RB_GPIO_PIN);
241}
242
243static struct omap_lcd_config fsample_lcd_config __initdata = { 278static struct omap_lcd_config fsample_lcd_config __initdata = {
244 .ctrl_name = "internal", 279 .ctrl_name = "internal",
245}; 280};
@@ -250,9 +285,9 @@ static struct omap_board_config_kernel fsample_config[] = {
250 285
251static void __init omap_fsample_init(void) 286static void __init omap_fsample_init(void)
252{ 287{
253 if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) 288 if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0)
254 BUG(); 289 BUG();
255 nand_data.dev_ready = nand_dev_ready; 290 gpio_direction_input(FSAMPLE_NAND_RB_GPIO_PIN);
256 291
257 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 292 omap_cfg_reg(L3_1610_FLASH_CS2B_OE);
258 omap_cfg_reg(M8_1610_FLASH_CS2B_WE); 293 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
@@ -309,7 +344,7 @@ static void __init omap_fsample_map_io(void)
309 /* 344 /*
310 * Hold GSM Reset until needed 345 * Hold GSM Reset until needed
311 */ 346 */
312 omap_writew(omap_readw(OMAP730_DSP_M_CTL) & ~1, OMAP730_DSP_M_CTL); 347 omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
313 348
314 /* 349 /*
315 * UARTs -> done automagically by 8250 driver 350 * UARTs -> done automagically by 8250 driver
@@ -320,21 +355,21 @@ static void __init omap_fsample_map_io(void)
320 */ 355 */
321 356
322 /* Flash: CS0 timings setup */ 357 /* Flash: CS0 timings setup */
323 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_0); 358 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
324 omap_writel(0x00000088, OMAP730_FLASH_ACFG_0); 359 omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
325 360
326 /* 361 /*
327 * Ethernet support through the debug board 362 * Ethernet support through the debug board
328 * CS1 timings setup 363 * CS1 timings setup
329 */ 364 */
330 omap_writel(0x0000fff3, OMAP730_FLASH_CFG_1); 365 omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
331 omap_writel(0x00000000, OMAP730_FLASH_ACFG_1); 366 omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
332 367
333 /* 368 /*
334 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register, 369 * Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
335 * It is used as the Ethernet controller interrupt 370 * It is used as the Ethernet controller interrupt
336 */ 371 */
337 omap_writel(omap_readl(OMAP730_IO_CONF_9) & 0x1FFFFFFF, OMAP730_IO_CONF_9); 372 omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
338} 373}
339 374
340MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") 375MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")