[PATCH 4/6] Nand driver for Nomadik 8815 SoC (on NHK8815 board)

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Thu Apr 23 16:57:03 EDT 2009


On 09:41 Wed 22 Apr     , Alessandro Rubini wrote:
> From: Alessandro Rubini <rubini at unipv.it>
> 
> The patch is incremental over base Nomadik support
> as posted to linux-arm-kernel.
> 
> Signed-off-by: Alessandro Rubini <rubini at unipv.it>
> Acked-by: Andrea Gallo <andrea.gallo at stericsson.com>
> ---
> 
> This and one-nand are Cc: to the mtd list, the other patches
> have been sent only to linux-arm-kernel.
> 
>  arch/arm/configs/nhk15_defconfig              |    1 +
>  arch/arm/mach-nomadik/board-8815nhk.c         |   98 ++++++++-
>  arch/arm/mach-nomadik/include/mach/fsmc.h     |   29 +++
>  arch/arm/mach-nomadik/include/mach/hardware.h |    5 +-
>  arch/arm/mach-nomadik/include/mach/nand.h     |   16 ++
>  drivers/mtd/nand/Kconfig                      |    6 +
>  drivers/mtd/nand/Makefile                     |    1 +
>  drivers/mtd/nand/nomadik_nand.c               |  329 +++++++++++++++++++++++++
>  8 files changed, 482 insertions(+), 3 deletions(-)
>  create mode 100644 arch/arm/mach-nomadik/include/mach/fsmc.h
>  create mode 100644 arch/arm/mach-nomadik/include/mach/nand.h
>  create mode 100644 drivers/mtd/nand/nomadik_nand.c
> 
> diff --git a/arch/arm/configs/nhk15_defconfig b/arch/arm/configs/nhk15_defconfig
> index cf11d79..1697efe 100644
> --- a/arch/arm/configs/nhk15_defconfig
> +++ b/arch/arm/configs/nhk15_defconfig
> @@ -476,6 +476,7 @@ CONFIG_MTD_NAND_IDS=y
>  # CONFIG_MTD_NAND_DISKONCHIP is not set
>  # CONFIG_MTD_NAND_NANDSIM is not set
>  # CONFIG_MTD_NAND_PLATFORM is not set
> +CONFIG_MTD_NAND_NOMADIK=y
>  # CONFIG_MTD_ONENAND is not set
>  
>  #
> diff --git a/arch/arm/mach-nomadik/board-8815nhk.c b/arch/arm/mach-nomadik/board-8815nhk.c
> index d6483bf..b7be6c2 100644
> --- a/arch/arm/mach-nomadik/board-8815nhk.c
> +++ b/arch/arm/mach-nomadik/board-8815nhk.c
> @@ -19,12 +19,107 @@
>  #include <linux/io.h>
>  #include <linux/param.h>
>  #include <asm/setup.h>
> +#include <linux/mtd/mtd.h>
> +#include <linux/mtd/nand.h>
> +#include <linux/mtd/partitions.h>
> +#include <asm/sizes.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
>  #include <asm/mach/irq.h>
>  
>  #include <mach/hardware.h>
>  #include <mach/setup.h>
> +#include <mach/nand.h>
> +#include <mach/fsmc.h>
> +
> +/* These adresses span 16MB, so use three individual pages */
> +static struct resource nhk8815_nand_resources[] = {
> +	{
> +		.name = "nand_addr",
> +		.start = NAND_IO_ADDR,
> +		.end = NAND_IO_ADDR + 0xfff,
> +		.flags = IORESOURCE_MEM,
> +	}, {
> +		.name = "nand_cmd",
> +		.start = NAND_IO_CMD,
> +		.end = NAND_IO_CMD + 0xfff,
> +		.flags = IORESOURCE_MEM,
> +	}, {
> +		.name = "nand_data",
> +		.start = NAND_IO_DATA,
> +		.end = NAND_IO_DATA + 0xfff,
> +		.flags = IORESOURCE_MEM,
> +	}
> +};
> +
> +static int nhk8815_nand_init(void)
> +{
> +	/* FSMC setup for nand chip select (8-bit nand in 8815NHK) */
use macro to generate these FSMC will make ore readable and easier to update
> +	writel(0x0000000E, FSMC_PCR(0));
> +	writel(0x000D0A00, FSMC_PMEM(0));
> +	writel(0x00100A00, FSMC_PATT(0));
> +
otherwise looks fine

Best Regards,
J.



More information about the linux-mtd mailing list