armv8: sec_firmware: return job ring status as true in TFABOOT
[oweals/u-boot.git] / arch / arm / cpu / armv8 / fsl-layerscape / fsl_lsch2_speed.c
index 3da7037aea5cd3f537dff4c19d96c7a3317b30ff..723d7eac5dd2d9ec72a0cfffcce60679f22226a9 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2015 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -22,10 +21,6 @@ DECLARE_GLOBAL_DATA_PTR;
 void get_sys_info(struct sys_info *sys_info)
 {
        struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
-#ifdef CONFIG_FSL_IFC
-       struct fsl_ifc ifc_regs = {(void *)CONFIG_SYS_IFC_ADDR, (void *)NULL};
-       u32 ccr;
-#endif
 #if (defined(CONFIG_FSL_ESDHC) &&\
        defined(CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK)) ||\
        defined(CONFIG_SYS_DPAA_FMAN)
@@ -156,13 +151,27 @@ void get_sys_info(struct sys_info *sys_info)
 #endif
 
 #if defined(CONFIG_FSL_IFC)
-       ccr = ifc_in32(&ifc_regs.gregs->ifc_ccr);
-       ccr = ((ccr & IFC_CCR_CLK_DIV_MASK) >> IFC_CCR_CLK_DIV_SHIFT) + 1;
-
-       sys_info->freq_localbus = sys_info->freq_systembus / ccr;
+       sys_info->freq_localbus = sys_info->freq_systembus /
+                                               CONFIG_SYS_FSL_IFC_CLK_DIV;
+#endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+       sys_info->freq_qman = (sys_info->freq_systembus /
+                               CONFIG_SYS_FSL_PCLK_DIV) /
+                               CONFIG_SYS_FSL_QMAN_CLK_DIV;
 #endif
 }
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+unsigned long get_qman_freq(void)
+{
+       struct sys_info sys_info;
+
+       get_sys_info(&sys_info);
+
+       return sys_info.freq_qman;
+}
+#endif
+
 int get_clocks(void)
 {
        struct sys_info sys_info;