]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sunxi_nand_spl: Add support for sun4i and sun5i SoCs
authorHans de Goede <hdegoede@redhat.com>
Sat, 15 Aug 2015 11:17:49 +0000 (13:17 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 10:19:13 +0000 (12:19 +0200)
Other then having a few less chip-select lines the nand controller
on sun4i, sun5i and sun7i is identical.

Note this patch also muxes GPC7 to the NAND on sun7i where as before
it was not muxed this way. GPC7 is a standard NAND pin, so it should
always be muxed to the NAND when in use.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
board/sunxi/board.c
drivers/mtd/nand/Kconfig

index 1ebd0a423d1e15692b16954eb26d17428c93668b..d411e96c761aa88f361535a12fbd7783839c6741 100644 (file)
@@ -112,13 +112,19 @@ int dram_init(void)
 static void nand_pinmux_setup(void)
 {
        unsigned int pin;
-       for (pin = SUNXI_GPC(0); pin <= SUNXI_GPC(6); pin++)
-               sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_NAND);
 
-       for (pin = SUNXI_GPC(8); pin <= SUNXI_GPC(22); pin++)
+       for (pin = SUNXI_GPC(0); pin <= SUNXI_GPC(19); pin++)
                sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_NAND);
 
+#if defined CONFIG_MACH_SUN4I || defined CONFIG_MACH_SUN7I
+       for (pin = SUNXI_GPC(20); pin <= SUNXI_GPC(22); pin++)
+               sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_NAND);
+#endif
+       /* sun4i / sun7i do have a PC23, but it is not used for nand,
+        * only sun7i has a PC24 */
+#ifdef CONFIG_MACH_SUN7I
        sunxi_gpio_set_cfgpin(SUNXI_GPC(24), SUNXI_GPC_NAND);
+#endif
 }
 
 static void nand_clock_setup(void)
index 50b91c452d77ededb7f46fc634dd1d5e9fdabca1..391dce2fa5183179b9c646034d435e8e125e6893 100644 (file)
@@ -99,8 +99,8 @@ config SPL_NAND_DENALI
          for use on SPL.
 
 config SPL_NAND_SUNXI
-       bool "Support for NAND on Allwinner A20 in SPL"
-       depends on MACH_SUN7I
+       bool "Support for NAND on Allwinner SoCs in SPL"
+       depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I
        select SYS_NAND_SELF_INIT
        ---help---
        Enable support for NAND. This option allows SPL to read from