]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-mvebu/armada8k/cpu.c
Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTR
[u-boot] / arch / arm / mach-mvebu / armada8k / cpu.c
index 2325e9a180ba8d7159729630b614878b45ce58b0..2b3419be03858dcdf9babb6d0c344dfd7c9d4c50 100644 (file)
@@ -7,15 +7,13 @@
 #include <common.h>
 #include <dm.h>
 #include <fdtdec.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
 #include <asm/armv8/mmu.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Armada 7k/8k */
 #define MVEBU_RFU_BASE                 (MVEBU_REGISTER(0x6f0000))
 #define RFU_GLOBAL_SW_RST              (MVEBU_RFU_BASE + 0x84)
@@ -110,3 +108,21 @@ void reset_cpu(ulong ignored)
        reg &= ~(1 << RFU_SW_RESET_OFFSET);
        writel(reg, RFU_GLOBAL_SW_RST);
 }
+
+/*
+ * TODO - implement this functionality using platform
+ *        clock driver once it gets available
+ * 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;
+}