arm: agilex: Add clock handoff offset for Agilex
authorLey Foon Tan <ley.foon.tan@intel.com>
Wed, 27 Nov 2019 07:55:25 +0000 (15:55 +0800)
committerMarek Vasut <marex@denx.de>
Tue, 7 Jan 2020 13:38:33 +0000 (14:38 +0100)
Add clock handoff offset for Agilex. Remove S10 prefix to avoid confusion.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
arch/arm/mach-socfpga/include/mach/handoff_s10.h
arch/arm/mach-socfpga/wrap_pll_config_s10.c

index ba0f1fd1b2c3951f4335344816f9d08aec604cc2..3e9b606ce209086462e26f79fcc541a5e238ad07 100644 (file)
 #define S10_HANDOFF_OFFSET_LENGTH      0x4
 #define S10_HANDOFF_OFFSET_DATA        0x10
 
-#define S10_HANDOFF_CLOCK_OSC  (S10_HANDOFF_BASE + 0x608)
-#define S10_HANDOFF_CLOCK_FPGA (S10_HANDOFF_BASE + 0x60C)
+#ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
+#define HANDOFF_CLOCK_OSC      (S10_HANDOFF_BASE + 0x608)
+#define HANDOFF_CLOCK_FPGA     (S10_HANDOFF_BASE + 0x60C)
+#else
+#define HANDOFF_CLOCK_OSC      (S10_HANDOFF_BASE + 0x5fc)
+#define HANDOFF_CLOCK_FPGA     (S10_HANDOFF_BASE + 0x600)
+#endif
 
 #define S10_HANDOFF_SIZE       4096
 
index b266a5817b019e3402a2dbb68de9cbbd5f73fe41..3da85791a1ff7c792223af73bec7baa83a4527f8 100644 (file)
@@ -33,7 +33,8 @@ const struct cm_config * const cm_get_default_config(void)
 const unsigned int cm_get_osc_clk_hz(void)
 {
 #ifdef CONFIG_SPL_BUILD
-       u32 clock = readl(S10_HANDOFF_CLOCK_OSC);
+
+       u32 clock = readl(HANDOFF_CLOCK_OSC);
 
        writel(clock,
               socfpga_get_sysmgr_addr() + SYSMGR_SOC64_BOOT_SCRATCH_COLD1);
@@ -50,7 +51,7 @@ const unsigned int cm_get_intosc_clk_hz(void)
 const unsigned int cm_get_fpga_clk_hz(void)
 {
 #ifdef CONFIG_SPL_BUILD
-       u32 clock = readl(S10_HANDOFF_CLOCK_FPGA);
+       u32 clock = readl(HANDOFF_CLOCK_FPGA);
 
        writel(clock,
               socfpga_get_sysmgr_addr() + SYSMGR_SOC64_BOOT_SCRATCH_COLD2);