[U-Boot] [PATCH 0/2] i.MX31: Activate NAND support for PDK board.

Hi all,
These patches applies on the previously submitted NAND patches for the i.MX31 (http://lists.denx.de/pipermail/u-boot/2009-November/064213.html).
The patches (including the above mentioned patches), applies on the current U-boot tip.
The series add support for large page NAND, using the same layout as the latest Linux driver, for i.MX31 and finally activates general NAND support and specifically NAND environment for the i.MX31 PDK board.
Magnus Lilja (2): MXC: Add large page oob layout for i.MX31 NAND controller. MX31: Activate NAND environment on i.MX31 PDK board.
drivers/mtd/nand/mxc_nand.c | 12 ++++++++++++ include/configs/mx31pdk.h | 25 +++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-)

Import the large page oob layout from Linux mxc_nand.c driver.
The CONFIG_SYS_NAND_LARGEPAGE option is used to activate the large page oob layout. Run time detection is not supported as this moment.
This has been tested on the i.MX31 PDK board with a large page NAND device.
Signed-off-by: Magnus Lilja lilja.magnus@gmail.com --- drivers/mtd/nand/mxc_nand.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 3ce3adb..800ee9c 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -149,6 +149,13 @@ static struct nand_ecclayout nand_soft_eccoob = { }; #endif
+static struct nand_ecclayout nand_hw_eccoob_largepage = { + .eccbytes = 20, + .eccpos = {6, 7, 8, 9, 10, 22, 23, 24, 25, 26, + 38, 39, 40, 41, 42, 54, 55, 56, 57, 58}, + .oobfree = {{2, 4}, {11, 10}, {27, 10}, {43, 10}, {59, 5}, } +}; + #ifdef CONFIG_MX27 static int is_16bit_nand(void) { @@ -902,7 +909,12 @@ int board_nand_init(struct nand_chip *this) if (is_16bit_nand()) this->options |= NAND_BUSWIDTH_16;
+#ifdef CONFIG_SYS_NAND_LARGEPAGE + host->pagesize_2k = 1; + this->ecc.layout = &nand_hw_eccoob_largepage; +#else host->pagesize_2k = 0; +#endif
return err; }

Signed-off-by: Magnus Lilja lilja.magnus@gmail.com --- include/configs/mx31pdk.h | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h index fb61432..bee2f45 100644 --- a/include/configs/mx31pdk.h +++ b/include/configs/mx31pdk.h @@ -30,6 +30,8 @@ #ifndef __CONFIG_H #define __CONFIG_H
+#include <asm/arch/mx31-regs.h> + /* High Level Configuration Options */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ #define CONFIG_MX31 1 /* in a mx31 */ @@ -51,7 +53,7 @@ /* * Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128 * 1024) +#define CONFIG_SYS_MALLOC_LEN (2*CONFIG_ENV_SIZE + 2 * 128 * 1024) /* Bytes reserved for initial data */ #define CONFIG_SYS_GBL_DATA_SIZE 128
@@ -89,6 +91,7 @@ #define CONFIG_CMD_PING #define CONFIG_CMD_SPI #define CONFIG_CMD_DATE +#define CONFIG_CMD_NAND
/* * Disabled due to compilation errors in cmd_bootm.c (IMLS seems to require @@ -104,7 +107,10 @@ "ip=dhcp nfsroot=$(serverip):$(nfsrootfs),v3,tcp\0" \ "bootcmd=run bootcmd_net\0" \ "bootcmd_net=run bootargs_base bootargs_mtd bootargs_nfs; " \ - "tftpboot 0x81000000 uImage-mx31; bootm\0" + "tftpboot 0x81000000 uImage-mx31; bootm\0" \ + "prg_uboot=tftpboot 0x81000000 u-boot-nand.bin; " \ + "nand erase 0x0 0x40000; " \ + "nand write 0x81000000 0x0 0x40000\0"
#define CONFIG_NET_MULTI #define CONFIG_SMC911X 1 @@ -156,9 +162,20 @@ /* No NOR flash present */ #define CONFIG_SYS_NO_FLASH 1
-#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_OFFSET 0x40000 +#define CONFIG_ENV_OFFSET_REDUND 0x60000 +#define CONFIG_ENV_SIZE (128 * 1024)
-#define CONFIG_ENV_SIZE (128 * 1024) +/* + * NAND driver + */ +#define CONFIG_NAND_MXC +#define CONFIG_MXC_NAND_REGS_BASE NFC_BASE_ADDR +#define CONFIG_SYS_MAX_NAND_DEVICE 1 +#define CONFIG_SYS_NAND_BASE NFC_BASE_ADDR +#define CONFIG_MXC_NAND_HWECC +#define CONFIG_SYS_NAND_LARGEPAGE
/* NAND configuration for the NAND_SPL */

On Sun, Jan 17, 2010 at 05:46:09PM +0100, Magnus Lilja wrote:
Hi all,
These patches applies on the previously submitted NAND patches for the i.MX31 (http://lists.denx.de/pipermail/u-boot/2009-November/064213.html).
The patches (including the above mentioned patches), applies on the current U-boot tip.
The series add support for large page NAND, using the same layout as the latest Linux driver, for i.MX31 and finally activates general NAND support and specifically NAND environment for the i.MX31 PDK board.
Magnus Lilja (2): MXC: Add large page oob layout for i.MX31 NAND controller. MX31: Activate NAND environment on i.MX31 PDK board.
drivers/mtd/nand/mxc_nand.c | 12 ++++++++++++ include/configs/mx31pdk.h | 25 +++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-)
Applied both patchsets.
-Scott
participants (2)
-
Magnus Lilja
-
Scott Wood