aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-h3.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /arch/arm/mach-omap1/board-h3.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/arm/mach-omap1/board-h3.c')
-rw-r--r--arch/arm/mach-omap1/board-h3.c87
1 files changed, 61 insertions, 26 deletions
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 89586b80b8d5..a53ab8297d25 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -25,9 +25,11 @@
25#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
26#include <linux/mtd/nand.h> 26#include <linux/mtd/nand.h>
27#include <linux/mtd/partitions.h> 27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
28#include <linux/input.h> 29#include <linux/input.h>
29#include <linux/spi/spi.h> 30#include <linux/spi/spi.h>
30#include <linux/i2c/tps65010.h> 31#include <linux/i2c/tps65010.h>
32#include <linux/smc91x.h>
31 33
32#include <asm/setup.h> 34#include <asm/setup.h>
33#include <asm/page.h> 35#include <asm/page.h>
@@ -36,17 +38,16 @@
36 38
37#include <asm/mach-types.h> 39#include <asm/mach-types.h>
38#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
39#include <asm/mach/flash.h>
40#include <asm/mach/map.h> 41#include <asm/mach/map.h>
41 42
42#include <mach/irqs.h> 43#include <mach/irqs.h>
43#include <mach/mux.h> 44#include <plat/mux.h>
44#include <mach/tc.h> 45#include <plat/tc.h>
45#include <mach/nand.h> 46#include <plat/usb.h>
46#include <mach/usb.h> 47#include <plat/keypad.h>
47#include <mach/keypad.h> 48#include <plat/dma.h>
48#include <mach/dma.h> 49#include <plat/common.h>
49#include <mach/common.h> 50#include <plat/flash.h>
50 51
51#include "board-h3.h" 52#include "board-h3.h"
52 53
@@ -126,9 +127,9 @@ static struct mtd_partition nor_partitions[] = {
126 } 127 }
127}; 128};
128 129
129static struct flash_platform_data nor_data = { 130static struct physmap_flash_data nor_data = {
130 .map_name = "cfi_probe",
131 .width = 2, 131 .width = 2,
132 .set_vpp = omap1_set_vpp,
132 .parts = nor_partitions, 133 .parts = nor_partitions,
133 .nr_parts = ARRAY_SIZE(nor_partitions), 134 .nr_parts = ARRAY_SIZE(nor_partitions),
134}; 135};
@@ -139,7 +140,7 @@ static struct resource nor_resource = {
139}; 140};
140 141
141static struct platform_device nor_device = { 142static struct platform_device nor_device = {
142 .name = "omapflash", 143 .name = "physmap-flash",
143 .id = 0, 144 .id = 0,
144 .dev = { 145 .dev = {
145 .platform_data = &nor_data, 146 .platform_data = &nor_data,
@@ -181,11 +182,43 @@ static struct mtd_partition nand_partitions[] = {
181 }, 182 },
182}; 183};
183 184
184/* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 185static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
185static struct omap_nand_platform_data nand_data = { 186{
186 .options = NAND_SAMSUNG_LP_OPTIONS, 187 struct nand_chip *this = mtd->priv;
187 .parts = nand_partitions, 188 unsigned long mask;
188 .nr_parts = ARRAY_SIZE(nand_partitions), 189
190 if (cmd == NAND_CMD_NONE)
191 return;
192
193 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
194 if (ctrl & NAND_ALE)
195 mask |= 0x04;
196 writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
197}
198
199#define H3_NAND_RB_GPIO_PIN 10
200
201static int nand_dev_ready(struct mtd_info *mtd)
202{
203 return gpio_get_value(H3_NAND_RB_GPIO_PIN);
204}
205
206static const char *part_probes[] = { "cmdlinepart", NULL };
207
208struct platform_nand_data nand_platdata = {
209 .chip = {
210 .nr_chips = 1,
211 .chip_offset = 0,
212 .nr_partitions = ARRAY_SIZE(nand_partitions),
213 .partitions = nand_partitions,
214 .options = NAND_SAMSUNG_LP_OPTIONS,
215 .part_probe_types = part_probes,
216 },
217 .ctrl = {
218 .cmd_ctrl = nand_cmd_ctl,
219 .dev_ready = nand_dev_ready,
220
221 },
189}; 222};
190 223
191static struct resource nand_resource = { 224static struct resource nand_resource = {
@@ -193,15 +226,21 @@ static struct resource nand_resource = {
193}; 226};
194 227
195static struct platform_device nand_device = { 228static struct platform_device nand_device = {
196 .name = "omapnand", 229 .name = "gen_nand",
197 .id = 0, 230 .id = 0,
198 .dev = { 231 .dev = {
199 .platform_data = &nand_data, 232 .platform_data = &nand_platdata,
200 }, 233 },
201 .num_resources = 1, 234 .num_resources = 1,
202 .resource = &nand_resource, 235 .resource = &nand_resource,
203}; 236};
204 237
238static struct smc91x_platdata smc91x_info = {
239 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
240 .leda = RPC_LED_100_10,
241 .ledb = RPC_LED_TX_RX,
242};
243
205static struct resource smc91x_resources[] = { 244static struct resource smc91x_resources[] = {
206 [0] = { 245 [0] = {
207 .start = OMAP1710_ETHR_START, /* Physical */ 246 .start = OMAP1710_ETHR_START, /* Physical */
@@ -218,6 +257,9 @@ static struct resource smc91x_resources[] = {
218static struct platform_device smc91x_device = { 257static struct platform_device smc91x_device = {
219 .name = "smc91x", 258 .name = "smc91x",
220 .id = 0, 259 .id = 0,
260 .dev = {
261 .platform_data = &smc91x_info,
262 },
221 .num_resources = ARRAY_SIZE(smc91x_resources), 263 .num_resources = ARRAY_SIZE(smc91x_resources),
222 .resource = smc91x_resources, 264 .resource = smc91x_resources,
223}; 265};
@@ -332,13 +374,6 @@ static struct i2c_board_info __initdata h3_i2c_board_info[] = {
332 }, 374 },
333}; 375};
334 376
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) 377static void __init h3_init(void)
343{ 378{
344 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped 379 /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped
@@ -356,7 +391,7 @@ static void __init h3_init(void)
356 nand_resource.end += SZ_4K - 1; 391 nand_resource.end += SZ_4K - 1;
357 if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0) 392 if (gpio_request(H3_NAND_RB_GPIO_PIN, "NAND ready") < 0)
358 BUG(); 393 BUG();
359 nand_data.dev_ready = nand_dev_ready; 394 gpio_direction_input(H3_NAND_RB_GPIO_PIN);
360 395
361 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */ 396 /* GPIO10 Func_MUX_CTRL reg bit 29:27, Configure V2 to mode1 as GPIO */
362 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */ 397 /* GPIO10 pullup/down register, Enable pullup on GPIO10 */