diff mbox

AM3517: NAND: Adding NAND support and specifying NAND partitions.

Message ID ADF30F4D7BDE934D9B632CE7D5C7ACA4047C4D08A0B9@dbde03.ent.ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hrishikesh Bhandiwad Aug. 19, 2011, 10:14 a.m. UTC
Hi Tony,

As this patch is trivial , can it be upstreamed .

Thanks & Regards,
Hrishikesh
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 63af417..dceb996 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -24,6 +24,8 @@ 
 #include <linux/i2c/pca953x.h>
 #include <linux/can/platform/ti_hecc.h>
 #include <linux/davinci_emac.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/nand.h>

 #include <mach/hardware.h>
 #include <mach/am35xx.h>
@@ -39,6 +41,7 @@ 

 #include "mux.h"
 #include "control.h"
+#include "common-board-devices.h"

 #define AM35XX_EVM_MDIO_FREQUENCY      (1000000)

@@ -460,6 +463,37 @@  static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)
 static struct omap_board_config_kernel am3517_evm_config[] __initdata = {
 };

+static struct mtd_partition am3517_nand_partitions[] = {
+       /* All the partition sizes are listed in terms of NAND block size */
+       {
+               .name           = "X-Loader",
+               .offset         = 0,
+               .size           = 4 * NAND_BLOCK_SIZE,
+               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
+       },
+       {
+               .name           = "U-Boot",
+               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x80000 */
+               .size           = 15 * NAND_BLOCK_SIZE,
+               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
+       },
+       {
+               .name           = "U-Boot Env",
+               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x260000 */
+               .size           = 1 * NAND_BLOCK_SIZE,
+       },
+       {
+               .name           = "Kernel",
+               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x280000 */
+               .size           = 32 * NAND_BLOCK_SIZE,
+       },
+       {
+               .name           = "File System",
+               .offset         = MTDPART_OFS_APPEND,   /* Offset = 0x680000 */
+               .size           = MTDPART_SIZ_FULL,
+       },
+};
+
 static void __init am3517_evm_init(void)
 {
        omap_board_config = am3517_evm_config;
@@ -473,6 +507,10 @@  static void __init am3517_evm_init(void)
        /* Configure GPIO for EHCI port */
        omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
        usbhs_init(&usbhs_bdata);
+       /*NAND*/
+       omap_nand_flash_init(NAND_BUSWIDTH_16, am3517_nand_partitions,
+                               ARRAY_SIZE(am3517_nand_partitions));
+
        am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
        /* DSS */
        am3517_evm_display_init();