summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2014-06-03 17:20:06 +0800
committerYe.Li <B37916@freescale.com>2014-06-17 11:13:40 +0800
commit525a935a20a81c60595c899439d5bf3d608d985c (patch)
treefcbf580b9b48a58bb3e7edf1bd42e4906feae6c9 /include
parent0d1d042ec0016e40d3a2dbd35278b1456f04c9cb (diff)
downloadu-boot-imx-525a935a20a81c60595c899439d5bf3d608d985c.zip
u-boot-imx-525a935a20a81c60595c899439d5bf3d608d985c.tar.gz
u-boot-imx-525a935a20a81c60595c899439d5bf3d608d985c.tar.bz2
ENGR00315894-10 i.mx6:sabreauto: Add the GPMI nand support
Add the GPMI nand support to the iMX6 sabreauto: --Enable the GPMI NAND at default. --Enable the clocks --Set the default environment for nand boot Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Jason Liu <r64343@freescale.com> Signed-off-by: Ye.Li <B37916@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/configs/mx6qsabreauto.h2
-rw-r--r--include/configs/mx6sabre_common.h48
2 files changed, 50 insertions, 0 deletions
diff --git a/include/configs/mx6qsabreauto.h b/include/configs/mx6qsabreauto.h
index 8b7328c..3b601d0 100644
--- a/include/configs/mx6qsabreauto.h
+++ b/include/configs/mx6qsabreauto.h
@@ -26,6 +26,8 @@
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#define CONFIG_MXC_USB_FLAGS 0
+#define CONFIG_SYS_USE_NAND
+
#include "mx6sabre_common.h"
#include <asm/imx-common/gpio.h>
diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index 125026a..a514615 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -128,6 +128,28 @@
"initrd_high=0xffffffff\0" \
"bootcmd_mfg=run mfgtool_args;bootm ${loadaddr} ${initrd_addr} ${fdt_addr};\0" \
+#if defined(CONFIG_SYS_BOOT_NAND)
+ /*
+ * The dts also enables the WEIN NOR which is mtd0.
+ * So the partions' layout for NAND is:
+ * mtd1: 16M (uboot)
+ * mtd2: 16M (kernel)
+ * mtd3: 16M (dtb)
+ * mtd4: left (rootfs)
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ CONFIG_MFG_ENV_SETTINGS \
+ "fdt_addr=0x18000000\0" \
+ "fdt_high=0xffffffff\0" \
+ "bootargs=console=" CONFIG_CONSOLE_DEV ",115200 ubi.mtd=4 " \
+ "root=ubi0:rootfs rootfstype=ubifs " \
+ "mtdparts=gpmi-nand:16m(boot),16m(kernel),16m(dtb),-(rootfs)\0"\
+ "bootcmd=nand read ${loadaddr} 0x1000000 0x800000;"\
+ "nand read ${fdt_addr} 0x2000000 0x100000;"\
+ "bootm ${loadaddr} - ${fdt_addr}\0"
+
+#else /* the following is used by the non-NAND boot. */
+
#define CONFIG_EXTRA_ENV_SETTINGS \
CONFIG_MFG_ENV_SETTINGS \
"script=boot.scr\0" \
@@ -217,6 +239,7 @@
"fi; " \
"fi; " \
"else run netboot; fi"
+#endif
#define CONFIG_ARP_TIMEOUT 200UL
@@ -269,6 +292,9 @@
#elif defined CONFIG_SYS_BOOT_EIMNOR
#define CONFIG_SYS_USE_EIMNOR
#define CONFIG_ENV_IS_IN_FLASH
+#elif defined CONFIG_SYS_BOOT_NAND
+#define CONFIG_SYS_USE_NAND
+#define CONFIG_ENV_IS_IN_NAND
#else
#define CONFIG_ENV_IS_IN_MMC
#endif
@@ -296,6 +322,23 @@
#define CONFIG_SYS_FLASH_PROTECTION
#endif
+#ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_CMD_NAND
+#define CONFIG_CMD_NAND_TRIMFFS
+
+/* NAND stuff */
+#define CONFIG_NAND_MXS
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define CONFIG_SYS_NAND_BASE 0x40000000
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+
+/* DMA stuff, needed for GPMI/MXS NAND support */
+#define CONFIG_APBH_DMA
+#define CONFIG_APBH_DMA_BURST
+#define CONFIG_APBH_DMA_BURST8
+#endif
+
#if defined(CONFIG_ENV_IS_IN_MMC)
#define CONFIG_ENV_OFFSET (6 * 64 * 1024)
#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
@@ -310,6 +353,11 @@
#define CONFIG_ENV_SIZE CONFIG_SYS_FLASH_SECT_SIZE
#define CONFIG_ENV_SECT_SIZE CONFIG_SYS_FLASH_SECT_SIZE
#define CONFIG_ENV_OFFSET (4 * CONFIG_SYS_FLASH_SECT_SIZE)
+#elif defined(CONFIG_ENV_IS_IN_NAND)
+#undef CONFIG_ENV_SIZE
+#define CONFIG_ENV_OFFSET (8 << 20)
+#define CONFIG_ENV_SECT_SIZE (128 << 10)
+#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
#endif
#define CONFIG_OF_LIBFDT