Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriq
[oweals/u-boot.git] / arch / arm / cpu / armv8 / fsl-layerscape / cpu.c
index 8fd6c751c693852a7b6652b0904d73077f7d5882..b44389445369c852a6be3b2bcd63c29956221fad 100644 (file)
@@ -1,12 +1,16 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2017 NXP
+ * Copyright 2017-2019 NXP
  * Copyright 2014-2015 Freescale Semiconductor, Inc.
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fsl_ddr_sdram.h>
+#include <init.h>
+#include <hang.h>
+#include <vsprintf.h>
 #include <asm/io.h>
 #include <linux/errno.h>
 #include <asm/system.h>
@@ -38,6 +42,7 @@
 #include <fsl_validate.h>
 #endif
 #endif
+#include <linux/mii.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -1072,6 +1077,8 @@ static void config_core_prefetch(void)
 
        if (env_get_f("hwconfig", buffer, sizeof(buffer)) > 0)
                buf = buffer;
+       else
+               return;
 
        prefetch_arg = hwconfig_subarg_f("core_prefetch", "disable",
                                         &arglen, buf);
@@ -1096,6 +1103,12 @@ static void config_core_prefetch(void)
        }
 }
 
+#ifdef CONFIG_PCIE_ECAM_GENERIC
+__weak void set_ecam_icids(void)
+{
+}
+#endif
+
 int arch_early_init_r(void)
 {
 #ifdef CONFIG_SYS_FSL_ERRATUM_A009635
@@ -1147,6 +1160,9 @@ int arch_early_init_r(void)
 #endif
 #ifdef CONFIG_SYS_DPAA_QBMAN
        setup_qbman_portals();
+#endif
+#ifdef CONFIG_PCIE_ECAM_GENERIC
+       set_ecam_icids();
 #endif
        return 0;
 }
@@ -1221,7 +1237,7 @@ void __efi_runtime reset_cpu(ulong addr)
 #endif
 }
 
-#ifdef CONFIG_EFI_LOADER
+#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_PSCI_RESET)
 
 void __efi_runtime EFIAPI efi_reset_system(
                       enum efi_reset_type reset_type,
@@ -1616,3 +1632,17 @@ __weak int dram_init(void)
 
        return 0;
 }
+
+#ifdef CONFIG_ARCH_MISC_INIT
+__weak int serdes_misc_init(void)
+{
+       return 0;
+}
+
+int arch_misc_init(void)
+{
+       serdes_misc_init();
+
+       return 0;
+}
+#endif