diff options
Diffstat (limited to 'arch/arm/mach-omap1/board-h2.c')
-rw-r--r-- | arch/arm/mach-omap1/board-h2.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 2f8f6ecf111f..b0921622566f 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -140,6 +140,66 @@ static struct platform_device h2_nor_device = { | |||
140 | .resource = &h2_nor_resource, | 140 | .resource = &h2_nor_resource, |
141 | }; | 141 | }; |
142 | 142 | ||
143 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
144 | |||
145 | static struct mtd_partition h2_nand_partitions[] = { | ||
146 | #if 0 | ||
147 | /* REVISIT: enable these partitions if you make NAND BOOT | ||
148 | * work on your H2 (rev C or newer); published versions of | ||
149 | * x-load only support P2 and H3. | ||
150 | */ | ||
151 | { | ||
152 | .name = "xloader", | ||
153 | .offset = 0, | ||
154 | .size = 64 * 1024, | ||
155 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
156 | }, | ||
157 | { | ||
158 | .name = "bootloader", | ||
159 | .offset = MTDPART_OFS_APPEND, | ||
160 | .size = 256 * 1024, | ||
161 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
162 | }, | ||
163 | { | ||
164 | .name = "params", | ||
165 | .offset = MTDPART_OFS_APPEND, | ||
166 | .size = 192 * 1024, | ||
167 | }, | ||
168 | { | ||
169 | .name = "kernel", | ||
170 | .offset = MTDPART_OFS_APPEND, | ||
171 | .size = 2 * SZ_1M, | ||
172 | }, | ||
173 | #endif | ||
174 | { | ||
175 | .name = "filesystem", | ||
176 | .size = MTDPART_SIZ_FULL, | ||
177 | .offset = MTDPART_OFS_APPEND, | ||
178 | }, | ||
179 | }; | ||
180 | |||
181 | /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ | ||
182 | static struct nand_platform_data h2_nand_data = { | ||
183 | .options = NAND_SAMSUNG_LP_OPTIONS, | ||
184 | .parts = h2_nand_partitions, | ||
185 | .nr_parts = ARRAY_SIZE(h2_nand_partitions), | ||
186 | }; | ||
187 | |||
188 | static struct resource h2_nand_resource = { | ||
189 | .flags = IORESOURCE_MEM, | ||
190 | }; | ||
191 | |||
192 | static struct platform_device h2_nand_device = { | ||
193 | .name = "omapnand", | ||
194 | .id = 0, | ||
195 | .dev = { | ||
196 | .platform_data = &h2_nand_data, | ||
197 | }, | ||
198 | .num_resources = 1, | ||
199 | .resource = &h2_nand_resource, | ||
200 | }; | ||
201 | #endif | ||
202 | |||
143 | static struct resource h2_smc91x_resources[] = { | 203 | static struct resource h2_smc91x_resources[] = { |
144 | [0] = { | 204 | [0] = { |
145 | .start = OMAP1610_ETHR_START, /* Physical */ | 205 | .start = OMAP1610_ETHR_START, /* Physical */ |
@@ -219,11 +279,15 @@ static struct resource h2_irda_resources[] = { | |||
219 | .flags = IORESOURCE_IRQ, | 279 | .flags = IORESOURCE_IRQ, |
220 | }, | 280 | }, |
221 | }; | 281 | }; |
282 | |||
283 | static u64 irda_dmamask = 0xffffffff; | ||
284 | |||
222 | static struct platform_device h2_irda_device = { | 285 | static struct platform_device h2_irda_device = { |
223 | .name = "omapirda", | 286 | .name = "omapirda", |
224 | .id = 0, | 287 | .id = 0, |
225 | .dev = { | 288 | .dev = { |
226 | .platform_data = &h2_irda_data, | 289 | .platform_data = &h2_irda_data, |
290 | .dma_mask = &irda_dmamask, | ||
227 | }, | 291 | }, |
228 | .num_resources = ARRAY_SIZE(h2_irda_resources), | 292 | .num_resources = ARRAY_SIZE(h2_irda_resources), |
229 | .resource = h2_irda_resources, | 293 | .resource = h2_irda_resources, |
@@ -271,6 +335,7 @@ static struct platform_device h2_mcbsp1_device = { | |||
271 | 335 | ||
272 | static struct platform_device *h2_devices[] __initdata = { | 336 | static struct platform_device *h2_devices[] __initdata = { |
273 | &h2_nor_device, | 337 | &h2_nor_device, |
338 | //&h2_nand_device, | ||
274 | &h2_smc91x_device, | 339 | &h2_smc91x_device, |
275 | &h2_irda_device, | 340 | &h2_irda_device, |
276 | &h2_kp_device, | 341 | &h2_kp_device, |
@@ -348,6 +413,13 @@ static struct omap_board_config_kernel h2_config[] __initdata = { | |||
348 | { OMAP_TAG_LCD, &h2_lcd_config }, | 413 | { OMAP_TAG_LCD, &h2_lcd_config }, |
349 | }; | 414 | }; |
350 | 415 | ||
416 | #define H2_NAND_RB_GPIO_PIN 62 | ||
417 | |||
418 | static int h2_nand_dev_ready(struct nand_platform_data *data) | ||
419 | { | ||
420 | return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); | ||
421 | } | ||
422 | |||
351 | static void __init h2_init(void) | 423 | static void __init h2_init(void) |
352 | { | 424 | { |
353 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped | 425 | /* Here we assume the NOR boot config: NOR on CS3 (possibly swapped |
@@ -362,6 +434,13 @@ static void __init h2_init(void) | |||
362 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); | 434 | h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); |
363 | h2_nor_resource.end += SZ_32M - 1; | 435 | h2_nor_resource.end += SZ_32M - 1; |
364 | 436 | ||
437 | #if 0 /* REVISIT: Enable when nand_platform_data is applied */ | ||
438 | h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; | ||
439 | h2_nand_resource.end += SZ_4K - 1; | ||
440 | if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) | ||
441 | h2_nand_data.dev_ready = h2_nand_dev_ready; | ||
442 | #endif | ||
443 | |||
365 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); | 444 | omap_cfg_reg(L3_1610_FLASH_CS2B_OE); |
366 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); | 445 | omap_cfg_reg(M8_1610_FLASH_CS2B_WE); |
367 | 446 | ||