ARM: OMAP1: Make omap1 boards to use omap_nand_platform_data

This patch adds omap_nand_platform data based on a patch
by Shahrom Sharif-Kashani <sshahrom@micron.com>, and makes
omap1 boards to use omap_nand_platform_data instead of
nand_platform_data used earlier.

Signed-off-by: Tony Lindgren <tony@atomide.com>

+39 -16
+3 -2
arch/arm/mach-omap1/board-fsample.c
··· 30 30 #include <asm/arch/gpio.h> 31 31 #include <asm/arch/mux.h> 32 32 #include <asm/arch/fpga.h> 33 + #include <asm/arch/nand.h> 33 34 #include <asm/arch/keypad.h> 34 35 #include <asm/arch/common.h> 35 36 #include <asm/arch/board.h> ··· 135 134 .resource = &nor_resource, 136 135 }; 137 136 138 - static struct nand_platform_data nand_data = { 137 + static struct omap_nand_platform_data nand_data = { 139 138 .options = NAND_SAMSUNG_LP_OPTIONS, 140 139 }; 141 140 ··· 203 202 204 203 #define P2_NAND_RB_GPIO_PIN 62 205 204 206 - static int nand_dev_ready(struct nand_platform_data *data) 205 + static int nand_dev_ready(struct omap_nand_platform_data *data) 207 206 { 208 207 return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); 209 208 }
+6 -10
arch/arm/mach-omap1/board-h2.c
··· 39 39 40 40 #include <asm/arch/mux.h> 41 41 #include <asm/arch/tc.h> 42 + #include <asm/arch/nand.h> 42 43 #include <asm/arch/irda.h> 43 44 #include <asm/arch/usb.h> 44 45 #include <asm/arch/keypad.h> ··· 141 140 .resource = &h2_nor_resource, 142 141 }; 143 142 144 - #if 0 /* REVISIT: Enable when nand_platform_data is applied */ 145 - 146 143 static struct mtd_partition h2_nand_partitions[] = { 147 144 #if 0 148 145 /* REVISIT: enable these partitions if you make NAND BOOT ··· 178 179 }; 179 180 180 181 /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 181 - static struct nand_platform_data h2_nand_data = { 182 + static struct omap_nand_platform_data h2_nand_data = { 182 183 .options = NAND_SAMSUNG_LP_OPTIONS, 183 184 .parts = h2_nand_partitions, 184 185 .nr_parts = ARRAY_SIZE(h2_nand_partitions), ··· 197 198 .num_resources = 1, 198 199 .resource = &h2_nand_resource, 199 200 }; 200 - #endif 201 201 202 202 static struct resource h2_smc91x_resources[] = { 203 203 [0] = { ··· 333 335 334 336 static struct platform_device *h2_devices[] __initdata = { 335 337 &h2_nor_device, 336 - //&h2_nand_device, 338 + &h2_nand_device, 337 339 &h2_smc91x_device, 338 340 &h2_irda_device, 339 341 &h2_kp_device, ··· 407 409 }; 408 410 409 411 static struct omap_board_config_kernel h2_config[] __initdata = { 410 - { OMAP_TAG_USB, &h2_usb_config }, 411 - { OMAP_TAG_MMC, &h2_mmc_config }, 412 + { OMAP_TAG_USB, &h2_usb_config }, 413 + { OMAP_TAG_MMC, &h2_mmc_config }, 412 414 { OMAP_TAG_UART, &h2_uart_config }, 413 415 { OMAP_TAG_LCD, &h2_lcd_config }, 414 416 }; 415 417 416 418 #define H2_NAND_RB_GPIO_PIN 62 417 419 418 - static int h2_nand_dev_ready(struct nand_platform_data *data) 420 + static int h2_nand_dev_ready(struct omap_nand_platform_data *data) 419 421 { 420 422 return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); 421 423 } ··· 434 436 h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); 435 437 h2_nor_resource.end += SZ_32M - 1; 436 438 437 - #if 0 /* REVISIT: Enable when nand_platform_data is applied */ 438 439 h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; 439 440 h2_nand_resource.end += SZ_4K - 1; 440 441 if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) 441 442 h2_nand_data.dev_ready = h2_nand_dev_ready; 442 - #endif 443 443 444 444 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 445 445 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
+3 -2
arch/arm/mach-omap1/board-h3.c
··· 42 42 #include <asm/arch/irqs.h> 43 43 #include <asm/arch/mux.h> 44 44 #include <asm/arch/tc.h> 45 + #include <asm/arch/nand.h> 45 46 #include <asm/arch/irda.h> 46 47 #include <asm/arch/usb.h> 47 48 #include <asm/arch/keypad.h> ··· 180 179 }; 181 180 182 181 /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 183 - static struct nand_platform_data nand_data = { 182 + static struct omap_nand_platform_data nand_data = { 184 183 .options = NAND_SAMSUNG_LP_OPTIONS, 185 184 .parts = nand_partitions, 186 185 .nr_parts = ARRAY_SIZE(nand_partitions), ··· 473 472 474 473 #define H3_NAND_RB_GPIO_PIN 10 475 474 476 - static int nand_dev_ready(struct nand_platform_data *data) 475 + static int nand_dev_ready(struct omap_nand_platform_data *data) 477 476 { 478 477 return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); 479 478 }
+3 -2
arch/arm/mach-omap1/board-perseus2.c
··· 30 30 #include <asm/arch/gpio.h> 31 31 #include <asm/arch/mux.h> 32 32 #include <asm/arch/fpga.h> 33 + #include <asm/arch/nand.h> 33 34 #include <asm/arch/keypad.h> 34 35 #include <asm/arch/common.h> 35 36 #include <asm/arch/board.h> ··· 134 133 .resource = &nor_resource, 135 134 }; 136 135 137 - static struct nand_platform_data nand_data = { 136 + static struct omap_nand_platform_data nand_data = { 138 137 .options = NAND_SAMSUNG_LP_OPTIONS, 139 138 }; 140 139 ··· 203 202 204 203 #define P2_NAND_RB_GPIO_PIN 62 205 204 206 - static int nand_dev_ready(struct nand_platform_data *data) 205 + static int nand_dev_ready(struct omap_nand_platform_data *data) 207 206 { 208 207 return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); 209 208 }
+24
include/asm-arm/arch-omap/nand.h
··· 1 + /* 2 + * include/asm-arm/arch-omap/nand.h 3 + * 4 + * Copyright (C) 2006 Micron Technology Inc. 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/mtd/partitions.h> 12 + 13 + struct omap_nand_platform_data { 14 + unsigned int options; 15 + int cs; 16 + int gpio_irq; 17 + struct mtd_partition *parts; 18 + int nr_parts; 19 + int (*nand_setup)(void __iomem *); 20 + int (*dev_ready)(struct omap_nand_platform_data *); 21 + int dma_channel; 22 + void __iomem *gpmc_cs_baseaddr; 23 + void __iomem *gpmc_baseaddr; 24 + };