[U-Boot] [PATCH 2/5] arm64: mvebu: a8k: Add support for NAND clock get
kostap at marvell.com
kostap at marvell.com
Tue Mar 28 15:16:55 UTC 2017
From: Konstantin Porotchkin <kostap at marvell.com>
Implement mvebu_get_nand_clock call for A8K family.
This function is used by PXA3XX NAND driver.
Signed-off-by: Konstantin Porotchkin <kostap at marvell.com>
Cc: Stefan Roese <sr at denx.de>
Cc: Igal Liberman <igall at marvell.com>
Cc: Nadav Haklai <nadavh at marvell.com>
---
arch/arm/mach-mvebu/armada8k/cpu.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm/mach-mvebu/armada8k/cpu.c b/arch/arm/mach-mvebu/armada8k/cpu.c
index 2325e9a..e18ca6b 100644
--- a/arch/arm/mach-mvebu/armada8k/cpu.c
+++ b/arch/arm/mach-mvebu/armada8k/cpu.c
@@ -110,3 +110,19 @@ void reset_cpu(ulong ignored)
reg &= ~(1 << RFU_SW_RESET_OFFSET);
writel(reg, RFU_GLOBAL_SW_RST);
}
+
+#ifdef CONFIG_NAND_PXA3XX
+/* Return NAND clock in Hz */
+u32 mvebu_get_nand_clock(void)
+{
+ unsigned long NAND_FLASH_CLK_CTRL = 0xF2440700UL;
+ unsigned long NF_CLOCK_SEL_MASK = 0x1;
+ u32 reg;
+
+ reg = readl(NAND_FLASH_CLK_CTRL);
+ if (reg & NF_CLOCK_SEL_MASK)
+ return 400 * 1000000;
+ else
+ return 250 * 1000000;
+}
+#endif
--
2.7.4
More information about the U-Boot
mailing list