Merge branch 'master' of git://www.denx.de/git/u-boot-socfpga
[oweals/u-boot.git] / arch / arm / cpu / armv8 / fsl-lsch3 / mp.c
index 94998bf37bbcfa2c90a8d39346375c59b9cf8a98..da7853a5af4043068624c1876009e58e614a62fd 100644 (file)
@@ -31,6 +31,13 @@ int fsl_lsch3_wake_seconday_cores(void)
        int i, timeout = 10;
        u64 *table = get_spin_tbl_addr();
 
+#ifdef COUNTER_FREQUENCY_REAL
+       /* update for secondary cores */
+       __real_cntfrq = COUNTER_FREQUENCY_REAL;
+       flush_dcache_range((unsigned long)&__real_cntfrq,
+                          (unsigned long)&__real_cntfrq + 8);
+#endif
+
        cores = cpu_mask();
        /* Clear spin table so that secondary processors
         * observe the correct value after waking up from wfe.
@@ -83,6 +90,14 @@ int is_core_valid(unsigned int core)
        return !!((1 << core) & cpu_mask());
 }
 
+int is_core_online(u64 cpu_id)
+{
+       u64 *table;
+       int pos = id_to_core(cpu_id);
+       table = (u64 *)get_spin_tbl_addr() + pos * WORDS_PER_SPIN_TABLE_ENTRY;
+       return table[SPIN_TABLE_ELEM_STATUS_IDX] == 1;
+}
+
 int cpu_reset(int nr)
 {
        puts("Feature is not implemented.\n");