From 3a4e43921d2599453ea87c623099e5f347c9e54a Mon Sep 17 00:00:00 2001 From: Nick Thompson Date: Mon, 8 Feb 2010 11:36:16 -0500 Subject: DA830 EVM: Enable NAND support on Spectrum Digital EVM 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 Signed-off-by: Sandeep Paulraj --- board/davinci/da830evm/da830evm.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'board') diff --git a/board/davinci/da830evm/da830evm.c b/board/davinci/da830evm/da830evm.c index 12df1f8183..aac5c5cbe1 100644 --- a/board/davinci/da830evm/da830evm.c +++ b/board/davinci/da830evm/da830evm.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #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; -- cgit v1.2.1