From: Piotr Zierhoffer <piotr.zierhof...@cs.put.poznan.pl>

When SPL_NAND_SUNXI option is selected in config, set some configuration
options for sunxi NAND.

This commit also introduces the configurable options in Kconfig.

Signed-off-by: Peter Gielda <pgie...@antmicro.com>
Signed-off-by: Tomasz Gorochowik <tgorocho...@antmicro.com>
Signed-off-by: Mateusz Holenko <mhole...@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhof...@antmicro.com>
Signed-off-by: Karol Gugala <kgug...@antmicro.com>
---

Changes in v2:
- removed traces of non-SPL specific code
- renamed defines to be more relevant
- moved Kconfig entry for the driver to drivers/mtd/nand
- reworded Kconfig entry help

 drivers/mtd/nand/Kconfig       |  7 +++++++
 include/configs/sunxi-common.h | 11 +++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 3024357..2f8dbaf 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -85,6 +85,13 @@ config SPL_NAND_DENALI
          This is a small implementation of the Denali NAND controller
          for use on SPL.
 
+config SPL_NAND_SUNXI
+       bool "Support for NAND on Allwinner A20 in SPL"
+       depends on MACH_SUN7I
+       ---help---
+       Enable support for internal NAND. This option allows SPL to read from
+       sunxi NAND using DMA transfers. Writing is not supported.
+
 endif
 
 endmenu
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 9576bc1..c230cff 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -139,6 +139,17 @@
 #define CONFIG_INITRD_TAG
 #define CONFIG_SERIAL_TAG
 
+#if defined(CONFIG_SPL_NAND_SUNXI)
+#define CONFIG_SPL_NAND_DRIVERS
+#define CONFIG_SPL_NAND_SUPPORT
+
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
+#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x008000
+
+#define CONFIG_SYS_NAND_PAGE_SIZE 0x000400 /* 1kb */
+#define CONFIG_SYS_NAND_BLOCK_SIZE 0x002000 /* 8kb*/
+#endif
+
 /* mmc config */
 #if !defined(CONFIG_UART0_PORT_F)
 #define CONFIG_MMC
-- 
2.3.6

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to