summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-11-14 12:57:34 -0700
committerTom Rini <trini@konsulko.com>2019-12-02 18:23:14 -0500
commit30c7c4347307c807b0f9f9045053339507fd699e (patch)
treeea140904a4bbb1a63b72da032a10eef41960548e /include
parent2c629bd5c85ac2bd72f75cb2bce1ac1e5c505a73 (diff)
common: Move checkcpu() out of common.h
This function belongs in cpu_func.h so move it over. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/common.h1
-rw-r--r--include/cpu_func.h29
2 files changed, 29 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h
index ce08bfe11f..96bb42ce71 100644
--- a/include/common.h
+++ b/include/common.h
@@ -203,7 +203,6 @@ void trap_init (ulong);
void s_init(void);
-int checkcpu (void);
int checkicache (void);
int checkdcache (void);
void upmconfig (unsigned int, unsigned int *, unsigned int);
diff --git a/include/cpu_func.h b/include/cpu_func.h
index a99b69b976..03feaa63e9 100644
--- a/include/cpu_func.h
+++ b/include/cpu_func.h
@@ -20,4 +20,33 @@ int cpu_reset(u32 nr);
int cpu_disable(u32 nr);
int cpu_release(u32 nr, int argc, char * const argv[]);
+static inline int cpumask_next(int cpu, unsigned int mask)
+{
+ for (cpu++; !((1 << cpu) & mask); cpu++)
+ ;
+
+ return cpu;
+}
+
+#define for_each_cpu(iter, cpu, num_cpus, mask) \
+ for (iter = 0, cpu = cpumask_next(-1, mask); \
+ iter < num_cpus; \
+ iter++, cpu = cpumask_next(cpu, mask)) \
+
+int cpu_numcores(void);
+int cpu_num_dspcores(void);
+u32 cpu_mask(void);
+u32 cpu_dsp_mask(void);
+int is_core_valid(unsigned int core);
+
+/**
+ * checkcpu() - perform an early check of the CPU
+ *
+ * This is used on PowerPC, SH and X86 machines as a CPU init mechanism. It is
+ * called during the pre-relocation init sequence in board_init_f().
+ *
+ * @return 0 if oK, -ve on error
+ */
+int checkcpu(void);
+
#endif