Felipe,

One comment on the NAND resources below -

Thanks
Sneha

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Felipe Balbi
> Sent: Tuesday, December 09, 2008 6:42 PM
> To: [email protected]
> Cc: Felipe Balbi
> Subject: [PATCH 6/6] arch: davinci: add nand flash support to dm355
> 
> From: Felipe Balbi <[EMAIL PROTECTED]>
> 
> Make dm355's nand flash probe with current driver.
> For some reason, the current driver marks way too many
> blocks as bad blocks. Later patches will be needed to
> fix it.
> 
> Signed-off-by: Felipe Balbi <[EMAIL PROTECTED]>
> ---
>  arch/arm/mach-davinci/board-dm355-evm.c |   65
> +++++++++++++++++++++++++++++++
>  1 files changed, 65 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-
> davinci/board-dm355-evm.c
> index 051f458..3767628 100644
> --- a/arch/arm/mach-davinci/board-dm355-evm.c
> +++ b/arch/arm/mach-davinci/board-dm355-evm.c
> @@ -13,6 +13,10 @@
>  #include <linux/init.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/platform_device.h>
> +#include <linux/mtd/mtd.h>
> +#include <linux/mtd/partitions.h>
> +#include <linux/mtd/nand.h>
> +#include <linux/mtd/onenand_regs.h>
>  #include <linux/i2c.h>
>  #include <linux/io.h>
>  #include <linux/gpio.h>
> @@ -31,6 +35,66 @@
>  #include <mach/i2c.h>
>  #include <mach/serial.h>
> 
> +#define DAVINCI_ASYNC_EMIF_CONTROL_BASE              0x01e10000
> +#define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE     0x02000000
> +
> +struct mtd_partition davinci_nand_partitions[] = {
> +     {
> +             .name           = "bootloader",
> +             .offset         = 0,
> +             .size           = 0x3c0000,
> +             .mask_flags     = MTD_WRITEABLE, /* force read-only */
> +     }, {
> +             .name           = "params",
> +             .offset         = MTDPART_OFS_APPEND,
> +             .size           = SZ_256K,
> +             .mask_flags     = 0,
> +     }, {
> +             .name           = "kernel",
> +             .offset         = MTDPART_OFS_APPEND,
> +             .size           = SZ_4M,
> +             .mask_flags     = 0,
> +     }, {
> +             .name           = "filesystem1",
> +             .offset         = MTDPART_OFS_APPEND,
> +             .size           = SZ_512M,
> +             .mask_flags     = 0,
> +     }, {
> +             .name           = "filesystem2",
> +             .offset         = MTDPART_OFS_APPEND,
> +             .size           = MTDPART_SIZ_FULL,
> +             .mask_flags     = 0,
> +     }
> +};
> +
> +static struct flash_platform_data davinci_nand_data = {
> +     .parts                  = davinci_nand_partitions,
> +     .nr_parts               = ARRAY_SIZE(davinci_nand_partitions),
> +};
> +
> +static struct resource davinci_nand_resources[] = {
> +     {
> +             .start          = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE,
> +             .end            = DAVINCI_ASYNC_EMIF_DATA_CE0_BASE + SZ_32M - 1,
> +             .flags          = IORESOURCE_MEM,
> +     }, {
> +             .start          = DAVINCI_ASYNC_EMIF_CONTROL_BASE,
> +             .end            = DAVINCI_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
> +             .flags          = IORESOURCE_MEM,
> +     },
> +};

The NAND device that comes with the DM355 EVM requires another resource here 
for the second NAND chip select, to be able to use the 2GB space. Has this 
configuration been tested on the EVM?

> +
> +static struct platform_device davinci_nand_device = {
> +     .name                   = "davinci_nand",
> +     .id                     = -1,
> +
> +     .num_resources          = ARRAY_SIZE(davinci_nand_resources),
> +     .resource               = davinci_nand_resources,
> +
> +     .dev                    = {
> +             .platform_data  = &davinci_nand_data,
> +     },
> +};
> 
>  static struct davinci_i2c_platform_data i2c_pdata = {
>       .bus_freq       = 400   /* kHz */,
> @@ -81,6 +145,7 @@ static struct platform_device dm355evm_dm9000 = {
> 
>  static struct platform_device *davinci_evm_devices[] __initdata = {
>       &dm355evm_dm9000,
> +     &davinci_nand_device,
>  };
> 
>  static struct davinci_uart_config davinci_evm_uart_config __initdata = {
> --
> 1.6.0.4.617.g2baf1
> 
> 
> _______________________________________________
> Davinci-linux-open-source mailing list
> [email protected]
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to