From f62bfa56daf17e3e8fac85795196c0ffad42e444 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sat, 15 Aug 2015 11:55:26 +0200 Subject: sunxi_nand_spl: Use SYS_NAND_SELF_INIT and only do nand init when necessary Use SYS_NAND_SELF_INIT and only setup the pinmux and clocks when we are actually using the nand. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- drivers/mtd/nand/Kconfig | 1 + drivers/mtd/nand/sunxi_nand_spl.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index b6dfb0e8351..28597f0c8b4 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig @@ -95,6 +95,7 @@ config SPL_NAND_DENALI config SPL_NAND_SUNXI bool "Support for NAND on Allwinner A20 in SPL" depends on MACH_SUN7I + select SYS_NAND_SELF_INIT ---help--- Enable support for NAND. This option allows SPL to read from sunxi NAND using DMA transfers. diff --git a/drivers/mtd/nand/sunxi_nand_spl.c b/drivers/mtd/nand/sunxi_nand_spl.c index f6f49289f8f..9efe904cc7f 100644 --- a/drivers/mtd/nand/sunxi_nand_spl.c +++ b/drivers/mtd/nand/sunxi_nand_spl.c @@ -153,6 +153,8 @@ void nand_init(void) { uint32_t val; + board_nand_init(); + val = readl(SUNXI_NFC_BASE + NFC_CTL); /* enable and reset CTL */ writel(val | NFC_CTL_EN | NFC_CTL_RESET, -- cgit v1.3.1