From e9e75c7409c71c113a16de444f3e4c5a992d7609 Mon Sep 17 00:00:00 2001 From: Martin Fouts Date: Fri, 1 Jul 2005 12:04:19 -0700 Subject: [PATCH] [PATCH] ARM: OMAP: Nand support for Perseus2 Nand support for Perseus2 Signed-off-by: Martin Fouts Signed-off-by: Tony Lindgren --- drivers/mtd/nand/Kconfig | 6 +++--- drivers/mtd/nand/omap-nand-flash.c | 15 +++++++++++++-- include/asm-arm/arch-omap/board-perseus2.h | 4 ++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 802048ad064..c2e776bd468 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -50,10 +50,10 @@ config MTD_NAND_SPIA If you had to ask, you don't have one. Say 'N'. config MTD_NAND_OMAP - tristate "NAND Flash device on OMAP H3/H2 board" - depends on ARM && ARCH_OMAP1 && MTD_NAND && (MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_NETSTAR) + tristate "NAND Flash device on OMAP H3/H2/P2 or NETSTAR boards" + depends on ARM && ARCH_OMAP1 && MTD_NAND && (MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_NETSTAR || MACH_OMAP_PERSEUS2) help - Support for NAND flash on Texas Instruments H3/H2 platform. + Support for NAND flash on Texas Instruments H3/H2/P2/NETSTAR platforms. config MTD_NAND_TOTO tristate "NAND Flash device on TOTO board" diff --git a/drivers/mtd/nand/omap-nand-flash.c b/drivers/mtd/nand/omap-nand-flash.c index e28595bcf38..d6972962f3e 100644 --- a/drivers/mtd/nand/omap-nand-flash.c +++ b/drivers/mtd/nand/omap-nand-flash.c @@ -36,6 +36,7 @@ #define H3_NAND_RB_GPIO_PIN 10 #define H2_NAND_RB_GPIO_PIN 62 +#define P2_NAND_RB_GPIO_PIN 62 #define NETSTAR_NAND_RB_GPIO_PIN 1 /* * MTD structure for H3 board @@ -108,6 +109,8 @@ static int omap_nand_ready(struct mtd_info *mtd) return omap_get_gpio_datain(H3_NAND_RB_GPIO_PIN); if (machine_is_omap_h2()) return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); + if (machine_is_omap_perseus2()) + return omap_get_gpio_datain(H2_NAND_RB_GPIO_PIN); if (machine_is_netstar()) return omap_get_gpio_datain(NETSTAR_NAND_RB_GPIO_PIN); return 0; @@ -163,7 +166,7 @@ int __init omap_nand_init (void) int err = 0; int nandboot = 0; - if (!(machine_is_omap_h2() || machine_is_omap_h3() || machine_is_netstar())) + if (!(machine_is_omap_h2() || machine_is_omap_h3() || machine_is_netstar() || machine_is_omap_perseus2())) return -ENODEV; /* Allocate memory for MTD device structure and private data */ @@ -184,7 +187,7 @@ int __init omap_nand_init (void) /* Link the private data with the MTD structure */ omap_nand_mtd->priv = this; - if (machine_is_omap_h2()) { + if (machine_is_omap_h2() || machine_is_omap_perseus2()) { /* FIXME on H2, R/B needs M7_1610_GPIO62 ... */ this->chip_delay = 15; omap_cfg_reg(L3_1610_FLASH_CS2B_OE); @@ -236,6 +239,10 @@ int __init omap_nand_init (void) if (!(machine_is_netstar())) goto out_unsupported; /* fall through */ + case SZ_64M: + if (!(machine_is_netstar() || machine_is_omap_perseus2())) + goto out_unsupported; + /* fall through */ case SZ_32M: #ifdef CONFIG_MTD_PARTITIONS err = parse_mtd_partitions(omap_nand_mtd, part_probes, @@ -267,6 +274,8 @@ out_buf: if (this->dev_ready) { if (machine_is_omap_h2()) omap_free_gpio(H2_NAND_RB_GPIO_PIN); + else if (machine_is_omap_perseus2()) + omap_free_gpio(P2_NAND_RB_GPIO_PIN); else if (machine_is_omap_h3()) omap_free_gpio(H3_NAND_RB_GPIO_PIN); else if (machine_is_netstar()) @@ -291,6 +300,8 @@ static void __exit omap_nand_cleanup (void) if (this->dev_ready) { if (machine_is_omap_h2()) omap_free_gpio(H2_NAND_RB_GPIO_PIN); + else if (machine_is_omap_h2()) + omap_free_gpio(H2_NAND_RB_GPIO_PIN); else if (machine_is_omap_h3()) omap_free_gpio(H3_NAND_RB_GPIO_PIN); else if (machine_is_netstar()) diff --git a/include/asm-arm/arch-omap/board-perseus2.h b/include/asm-arm/arch-omap/board-perseus2.h index eb74420cb43..691e52a52b4 100644 --- a/include/asm-arm/arch-omap/board-perseus2.h +++ b/include/asm-arm/arch-omap/board-perseus2.h @@ -42,4 +42,8 @@ #define NR_IRQS (MAXIRQNUM + 1) +/* Samsung NAND flash at CS2B or CS3(NAND Boot) */ +#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ +#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ + #endif -- 2.41.1