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 #include <asm/arch/gpio.h> 31 #include <asm/arch/mux.h> 32 #include <asm/arch/fpga.h> 33 #include <asm/arch/keypad.h> 34 #include <asm/arch/common.h> 35 #include <asm/arch/board.h> ··· 135 .resource = &nor_resource, 136 }; 137 138 - static struct nand_platform_data nand_data = { 139 .options = NAND_SAMSUNG_LP_OPTIONS, 140 }; 141 ··· 203 204 #define P2_NAND_RB_GPIO_PIN 62 205 206 - static int nand_dev_ready(struct nand_platform_data *data) 207 { 208 return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); 209 }
··· 30 #include <asm/arch/gpio.h> 31 #include <asm/arch/mux.h> 32 #include <asm/arch/fpga.h> 33 + #include <asm/arch/nand.h> 34 #include <asm/arch/keypad.h> 35 #include <asm/arch/common.h> 36 #include <asm/arch/board.h> ··· 134 .resource = &nor_resource, 135 }; 136 137 + static struct omap_nand_platform_data nand_data = { 138 .options = NAND_SAMSUNG_LP_OPTIONS, 139 }; 140 ··· 202 203 #define P2_NAND_RB_GPIO_PIN 62 204 205 + static int nand_dev_ready(struct omap_nand_platform_data *data) 206 { 207 return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); 208 }
+6 -10
arch/arm/mach-omap1/board-h2.c
··· 39 40 #include <asm/arch/mux.h> 41 #include <asm/arch/tc.h> 42 #include <asm/arch/irda.h> 43 #include <asm/arch/usb.h> 44 #include <asm/arch/keypad.h> ··· 141 .resource = &h2_nor_resource, 142 }; 143 144 - #if 0 /* REVISIT: Enable when nand_platform_data is applied */ 145 - 146 static struct mtd_partition h2_nand_partitions[] = { 147 #if 0 148 /* REVISIT: enable these partitions if you make NAND BOOT ··· 178 }; 179 180 /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 181 - static struct nand_platform_data h2_nand_data = { 182 .options = NAND_SAMSUNG_LP_OPTIONS, 183 .parts = h2_nand_partitions, 184 .nr_parts = ARRAY_SIZE(h2_nand_partitions), ··· 197 .num_resources = 1, 198 .resource = &h2_nand_resource, 199 }; 200 - #endif 201 202 static struct resource h2_smc91x_resources[] = { 203 [0] = { ··· 333 334 static struct platform_device *h2_devices[] __initdata = { 335 &h2_nor_device, 336 - //&h2_nand_device, 337 &h2_smc91x_device, 338 &h2_irda_device, 339 &h2_kp_device, ··· 407 }; 408 409 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_UART, &h2_uart_config }, 413 { OMAP_TAG_LCD, &h2_lcd_config }, 414 }; 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 } ··· 434 h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); 435 h2_nor_resource.end += SZ_32M - 1; 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 444 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 445 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
··· 39 40 #include <asm/arch/mux.h> 41 #include <asm/arch/tc.h> 42 + #include <asm/arch/nand.h> 43 #include <asm/arch/irda.h> 44 #include <asm/arch/usb.h> 45 #include <asm/arch/keypad.h> ··· 140 .resource = &h2_nor_resource, 141 }; 142 143 static struct mtd_partition h2_nand_partitions[] = { 144 #if 0 145 /* REVISIT: enable these partitions if you make NAND BOOT ··· 179 }; 180 181 /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 182 + static struct omap_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), ··· 198 .num_resources = 1, 199 .resource = &h2_nand_resource, 200 }; 201 202 static struct resource h2_smc91x_resources[] = { 203 [0] = { ··· 335 336 static struct platform_device *h2_devices[] __initdata = { 337 &h2_nor_device, 338 + &h2_nand_device, 339 &h2_smc91x_device, 340 &h2_irda_device, 341 &h2_kp_device, ··· 409 }; 410 411 static struct omap_board_config_kernel h2_config[] __initdata = { 412 + { OMAP_TAG_USB, &h2_usb_config }, 413 + { OMAP_TAG_MMC, &h2_mmc_config }, 414 { OMAP_TAG_UART, &h2_uart_config }, 415 { OMAP_TAG_LCD, &h2_lcd_config }, 416 }; 417 418 #define H2_NAND_RB_GPIO_PIN 62 419 420 + static int h2_nand_dev_ready(struct omap_nand_platform_data *data) 421 { 422 return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); 423 } ··· 436 h2_nor_resource.end = h2_nor_resource.start = omap_cs3_phys(); 437 h2_nor_resource.end += SZ_32M - 1; 438 439 h2_nand_resource.end = h2_nand_resource.start = OMAP_CS2B_PHYS; 440 h2_nand_resource.end += SZ_4K - 1; 441 if (!(omap_request_gpio(H2_NAND_RB_GPIO_PIN))) 442 h2_nand_data.dev_ready = h2_nand_dev_ready; 443 444 omap_cfg_reg(L3_1610_FLASH_CS2B_OE); 445 omap_cfg_reg(M8_1610_FLASH_CS2B_WE);
+3 -2
arch/arm/mach-omap1/board-h3.c
··· 42 #include <asm/arch/irqs.h> 43 #include <asm/arch/mux.h> 44 #include <asm/arch/tc.h> 45 #include <asm/arch/irda.h> 46 #include <asm/arch/usb.h> 47 #include <asm/arch/keypad.h> ··· 180 }; 181 182 /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 183 - static struct nand_platform_data nand_data = { 184 .options = NAND_SAMSUNG_LP_OPTIONS, 185 .parts = nand_partitions, 186 .nr_parts = ARRAY_SIZE(nand_partitions), ··· 473 474 #define H3_NAND_RB_GPIO_PIN 10 475 476 - static int nand_dev_ready(struct nand_platform_data *data) 477 { 478 return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); 479 }
··· 42 #include <asm/arch/irqs.h> 43 #include <asm/arch/mux.h> 44 #include <asm/arch/tc.h> 45 + #include <asm/arch/nand.h> 46 #include <asm/arch/irda.h> 47 #include <asm/arch/usb.h> 48 #include <asm/arch/keypad.h> ··· 179 }; 180 181 /* dip switches control NAND chip access: 8 bit, 16 bit, or neither */ 182 + static struct omap_nand_platform_data nand_data = { 183 .options = NAND_SAMSUNG_LP_OPTIONS, 184 .parts = nand_partitions, 185 .nr_parts = ARRAY_SIZE(nand_partitions), ··· 472 473 #define H3_NAND_RB_GPIO_PIN 10 474 475 + static int nand_dev_ready(struct omap_nand_platform_data *data) 476 { 477 return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); 478 }
+3 -2
arch/arm/mach-omap1/board-perseus2.c
··· 30 #include <asm/arch/gpio.h> 31 #include <asm/arch/mux.h> 32 #include <asm/arch/fpga.h> 33 #include <asm/arch/keypad.h> 34 #include <asm/arch/common.h> 35 #include <asm/arch/board.h> ··· 134 .resource = &nor_resource, 135 }; 136 137 - static struct nand_platform_data nand_data = { 138 .options = NAND_SAMSUNG_LP_OPTIONS, 139 }; 140 ··· 203 204 #define P2_NAND_RB_GPIO_PIN 62 205 206 - static int nand_dev_ready(struct nand_platform_data *data) 207 { 208 return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); 209 }
··· 30 #include <asm/arch/gpio.h> 31 #include <asm/arch/mux.h> 32 #include <asm/arch/fpga.h> 33 + #include <asm/arch/nand.h> 34 #include <asm/arch/keypad.h> 35 #include <asm/arch/common.h> 36 #include <asm/arch/board.h> ··· 133 .resource = &nor_resource, 134 }; 135 136 + static struct omap_nand_platform_data nand_data = { 137 .options = NAND_SAMSUNG_LP_OPTIONS, 138 }; 139 ··· 202 203 #define P2_NAND_RB_GPIO_PIN 62 204 205 + static int nand_dev_ready(struct omap_nand_platform_data *data) 206 { 207 return omap_get_gpio_datain(P2_NAND_RB_GPIO_PIN); 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 + };