common: Move checkcpu() out of common.h
authorSimon Glass <sjg@chromium.org>
Thu, 14 Nov 2019 19:57:34 +0000 (12:57 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 2 Dec 2019 23:23:14 +0000 (18:23 -0500)
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>
17 files changed:
arch/powerpc/cpu/mpc83xx/cpu.c
arch/powerpc/cpu/mpc8xx/cpu.c
arch/sh/cpu/sh4/cpu.c
arch/x86/cpu/broadwell/cpu_from_spl.c
arch/x86/cpu/coreboot/coreboot.c
arch/x86/cpu/efi/app.c
arch/x86/cpu/efi/payload.c
arch/x86/cpu/ivybridge/cpu.c
arch/x86/cpu/qemu/qemu.c
arch/x86/cpu/quark/quark.c
arch/x86/cpu/slimbootloader/slimbootloader.c
arch/x86/cpu/tangier/tangier.c
arch/x86/cpu/x86_64/cpu.c
arch/x86/lib/fsp/fsp_common.c
common/board_f.c
include/common.h
include/cpu_func.h

index 363c0ffd2859e4ac36997f52cc40e875fcdfada5..0710f5ab36070c5a5b35811c2939f83aefbf4728 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
index 6ad86e9a1d72aab3a416bc541099e99a281aa06c..2b7c5d4301340371b0ea1cf8d4a416fd8a6da7f6 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
index a8b50a9ff5c082ae7c826fc8131b533d2feaf6d6..ee36aca407d2fac0923c6564b7e4f65221c6e409 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <netdev.h>
 #include <asm/processor.h>
 
index c3d4a8d5477717fe5e49d09ac330dd80ae4de9c7..2aa6f245e7d3a55c02cbbf23f89d27d281682513 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <bloblist.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 #include <handoff.h>
 #include <asm/mtrr.h>
index 9686f8ed5b41c2b5f6efabb250cb34688c2b56e6..0c4c6348d1d902b07aab90ac1f7f6517c64d1cb8 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <fdtdec.h>
 #include <usb.h>
 #include <asm/io.h>
index ba7c02bd7e874c23cb89691840f6ea17ec6c08bd..13077411dc06d14b14d7c10b94934c4fd9c1822e 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <fdtdec.h>
 #include <netdev.h>
 
index 225aef7bf6a0c7c5634226837612f3925138c6b3..af6dd2f7434d2c650e02333e194ca551dcb137fd 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <efi.h>
 #include <errno.h>
 #include <usb.h>
index 6db9da81b71b0e7a58dfa7e7c517b14d9fceec99..8f30cdbe2475420630a6609f33bde8dc8660cc0b 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <fdtdec.h>
index 5e8b4f068e1f5ecdc3dfb5d52ec791e8f40f619d..716351ad7ff6afd46cf7df1426acadcc571e5402 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <pci.h>
 #include <qfw.h>
 #include <asm/irq.h>
index d39edb2271b2d3d3baa0239cff0c786aed94a865..d6611eea5dc9e08b03cf405fef69efcd1401b50e 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <mmc.h>
 #include <asm/io.h>
 #include <asm/ioapic.h>
index e6b174ca88627114e8d0e17b7dfc224e8e953739..21dcfb2142e4aaf2114cd9768812353b1825ab28 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/arch/slimbootloader.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index df2c600be334bbe2109f8fb0a7e6e88867f9908e..43bee1fb704ddcc4976d6c298a13c89468b98a59 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/u-boot-x86.h>
 
 /*
index 42abb23a9edb2154f16679022d92aee26d882f38..90925e46ea2195b3b6312f8f22efcb69ec56e99d 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 
 /*
index 40ba866d77c0845a0044eecfb881c9d0887b3d30..a5efe35f593ef6b1ae7bfc6463ee44ec49517d8d 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <acpi_s3.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <rtc.h>
index 01044452bf27e3790b2741cfb711d7a21ba644c3..05f4b73c6ed3db2ad666f16b9187baa1440b3331 100644 (file)
@@ -13,6 +13,7 @@
 #include <bloblist.h>
 #include <console.h>
 #include <cpu.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <env.h>
 #include <env_internal.h>
index ce08bfe11fee0bf84035cbc4fbc52974bb79dd2d..96bb42ce71c4206e754c41e57c8f11144ebe8355 100644 (file)
@@ -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);
index a99b69b97648e0af9d38c5b4fe3385b17b8151e6..03feaa63e96bfc0dd28391b6b527303902504bb2 100644 (file)
@@ -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