Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / cpu / armv8 / fsl-layerscape / mp.c
index 80fe1ade2e61097a34b0981afd89379f5f3849be..1ea887b3319f89b288f8699e405189c7a33f3276 100644 (file)
@@ -1,14 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014-2015 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <cpu_func.h>
+#include <image.h>
+#include <asm/cache.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/arch/mp.h>
 #include <asm/arch/soc.h>
+#include <linux/delay.h>
 #include "cpu.h"
 #include <asm/arch-fsl-layerscape/soc.h>
 
@@ -29,9 +32,14 @@ void update_os_arch_secondary_cores(uint8_t os_arch)
        u64 *table = get_spin_tbl_addr();
        int i;
 
-       for (i = 1; i < CONFIG_MAX_CPUS; i++)
-               table[i * WORDS_PER_SPIN_TABLE_ENTRY +
-                       SPIN_TABLE_ELEM_OS_ARCH_IDX] = os_arch;
+       for (i = 1; i < CONFIG_MAX_CPUS; i++) {
+               if (os_arch == IH_ARCH_DEFAULT)
+                       table[i * WORDS_PER_SPIN_TABLE_ENTRY +
+                               SPIN_TABLE_ELEM_ARCH_COMP_IDX] = OS_ARCH_SAME;
+               else
+                       table[i * WORDS_PER_SPIN_TABLE_ENTRY +
+                               SPIN_TABLE_ELEM_ARCH_COMP_IDX] = OS_ARCH_DIFF;
+       }
 }
 
 #ifdef CONFIG_FSL_LSCH3
@@ -187,14 +195,14 @@ int is_core_online(u64 cpu_id)
        return table[SPIN_TABLE_ELEM_STATUS_IDX] == 1;
 }
 
-int cpu_reset(int nr)
+int cpu_reset(u32 nr)
 {
        puts("Feature is not implemented.\n");
 
        return 0;
 }
 
-int cpu_disable(int nr)
+int cpu_disable(u32 nr)
 {
        puts("Feature is not implemented.\n");
 
@@ -227,7 +235,7 @@ static int core_to_pos(int nr)
        return i;
 }
 
-int cpu_status(int nr)
+int cpu_status(u32 nr)
 {
        u64 *table;
        int pos;
@@ -253,7 +261,7 @@ int cpu_status(int nr)
        return 0;
 }
 
-int cpu_release(int nr, int argc, char * const argv[])
+int cpu_release(u32 nr, int argc, char *const argv[])
 {
        u64 boot_addr;
        u64 *table = (u64 *)get_spin_tbl_addr();