]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
DA830 EVM: Enable NAND support on Spectrum Digital EVM
authorNick Thompson <nick.thompson@ge.com>
Mon, 8 Feb 2010 16:36:16 +0000 (11:36 -0500)
committerTom Rix <Tom.Rix@windriver.com>
Fri, 12 Feb 2010 18:31:54 +0000 (12:31 -0600)
The EVM UI extender card has a NAND device. This change will enable
saveenv to work with NAND and Linux to be booted using:

mtdparts default
nboot kernel
bootm

Signed-off-by: Nick Thompson <nick.thompson@ge.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
board/davinci/da830evm/da830evm.c
include/configs/da830evm.h

index 12df1f81837f7ab2202a708ee6f5981f8e57eb28..aac5c5cbe1a51ec0b7495f2604702f3a97cd5597 100644 (file)
@@ -35,6 +35,7 @@
 #include <common.h>
 #include <i2c.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/emif_defs.h>
 #include <asm/io.h>
 #include "../common/misc.h"
 
@@ -51,6 +52,23 @@ static const struct pinmux_config spi0_pins[] = {
        { pinmux[7], 1, 7 }
 };
 
+/* EMIF-A bus pins for 8-bit NAND support on CS3 */
+static const struct pinmux_config emifa_nand_pins[] = {
+       { pinmux[13], 1, 6 },
+       { pinmux[13], 1, 7 },
+       { pinmux[14], 1, 0 },
+       { pinmux[14], 1, 1 },
+       { pinmux[14], 1, 2 },
+       { pinmux[14], 1, 3 },
+       { pinmux[14], 1, 4 },
+       { pinmux[14], 1, 5 },
+       { pinmux[15], 1, 7 },
+       { pinmux[16], 1, 0 },
+       { pinmux[18], 1, 1 },
+       { pinmux[18], 1, 4 },
+       { pinmux[18], 1, 5 },
+};
+
 /* UART pin muxer settings */
 static const struct pinmux_config uart_pins[] = {
        { pinmux[8], 2, 7 },
@@ -77,6 +95,9 @@ static const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_USB_DA8XX
        PINMUX_ITEM(usb_pins),
 #endif
+#ifdef CONFIG_USE_NAND
+       PINMUX_ITEM(emifa_nand_pins),
+#endif
 };
 
 int board_init(void)
@@ -96,6 +117,22 @@ int board_init(void)
        writel(0xffffffff, &davinci_aintc_regs->ecr3);
 #endif
 
+#ifdef CONFIG_NAND_DAVINCI
+       /* EMIFA 100MHz clock select */
+       writel(readl(&davinci_syscfg_regs->cfgchip3) & ~2,
+              &davinci_syscfg_regs->cfgchip3);
+       /* NAND CS setup */
+       writel((DAVINCI_ABCR_WSETUP(0) |
+               DAVINCI_ABCR_WSTROBE(2) |
+               DAVINCI_ABCR_WHOLD(0) |
+               DAVINCI_ABCR_RSETUP(0) |
+               DAVINCI_ABCR_RSTROBE(2) |
+               DAVINCI_ABCR_RHOLD(0) |
+               DAVINCI_ABCR_TA(2) |
+               DAVINCI_ABCR_ASIZE_8BIT),
+              &davinci_emif_regs->AB2CR);
+#endif
+
        /* arch number of the board */
        gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DA830_EVM;
 
index 432cd57a70a40b7c9b9a35f80b2dccdf2331cf89..65747fba508768c27b192e6024a62b3967e71a72 100644 (file)
 #define CONFIG_NAND_DAVINCI
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND          /* U-Boot env in NAND Flash  */
-#define CONFIG_ENV_OFFSET              0x0 /* Block 0--not used by bootcode */
-#define CONFIG_ENV_SIZE                        (128 << 10)
+#define CONFIG_ENV_OFFSET              (512 << 10)
+#define CONFIG_ENV_SIZE                        (512 << 10)
 #define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
 #define CONFIG_SYS_NAND_CS             3
 #define CONFIG_SYS_NAND_BASE           DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
+#define CONFIG_SYS_NAND_PAGE_2K
+#define CONFIG_SYS_64BIT_VSPRINTF      /* needed for nand_util.c */
 #define CONFIG_SYS_CLE_MASK            0x10
 #define CONFIG_SYS_ALE_MASK            0x8
-#define CONFIG_SYS_NAND_HW_ECC
 #define CONFIG_SYS_MAX_NAND_DEVICE     1 /* Max number of NAND devices */
 #define NAND_MAX_CHIPS                 1
 #define DEF_BOOTM                      ""
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_MTD_PARTITIONS
-#define CONFIG_CMD_UBI
-#define CONFIG_RBTREE
+#define CONFIG_MTD_DEVICE
 #endif
 
 #ifdef CONFIG_USE_SPIFLASH
 #endif /* CONFIG_MUSB_UDC */
 
 #endif /* CONFIG_USB_DA8XX */
+
+#ifdef CONFIG_MTD_PARTITIONS
+#define MTDIDS_DEFAULT         "nand0=davinci_nand.1"
+#define PART_BOOT              "512k(bootloader)ro,"
+#define PART_PARAMS            "512k(params)ro,"
+#define PART_KERNEL            "4m(kernel),"
+#define PART_REST              "-(filesystem)"
+#define MTDPARTS_DEFAULT        \
+       "mtdparts=davinci_nand.1:" PART_BOOT PART_PARAMS PART_KERNEL PART_REST
+#endif
+
 #endif /* __CONFIG_H */