From: Tien Fong Chee <[email protected]>

Adding mechanism to retrieve base address for Agilex5 Clock Mananger.

Signed-off-by: Tien Fong Chee <[email protected]>
---
 arch/arm/mach-socfpga/misc.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index 495ba2a0d41..6cf2ee60038 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- *  Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
+ *  Copyright (C) 2012-2024 Altera Corporation <www.altera.com>
  */
 
 #include <config.h>
@@ -252,15 +252,19 @@ void socfpga_get_managers_addr(void)
        if (ret)
                hang();
 
-#ifdef CONFIG_TARGET_SOCFPGA_AGILEX
-       ret = socfpga_get_base_addr("intel,agilex-clkmgr",
-                                   &socfpga_clkmgr_base);
-#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
-       ret = socfpga_get_base_addr("intel,n5x-clkmgr",
-                                   &socfpga_clkmgr_base);
-#else
-       ret = socfpga_get_base_addr("altr,clk-mgr", &socfpga_clkmgr_base);
-#endif
+       if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX))
+               ret = socfpga_get_base_addr("intel,agilex-clkmgr",
+                                           &socfpga_clkmgr_base);
+       else if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X))
+               ret = socfpga_get_base_addr("intel,n5x-clkmgr",
+                                           &socfpga_clkmgr_base);
+       else if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5))
+               ret = socfpga_get_base_addr("intel,agilex5-clkmgr",
+                                           &socfpga_clkmgr_base);
+       else
+               ret = socfpga_get_base_addr("altr,clk-mgr",
+                                           &socfpga_clkmgr_base);
+
        if (ret)
                hang();
 }
-- 
2.25.1

Reply via email to