common: Move some CPU functions out of common.h
authorSimon Glass <sjg@chromium.org>
Thu, 14 Nov 2019 19:57:32 +0000 (12:57 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 2 Dec 2019 23:23:13 +0000 (18:23 -0500)
These functions belong in cpu_func.h since they do not use driver model.
Move them over. Don't bother adding comments since these functions should
be deleted.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/cpu/armv8/fsl-layerscape/cpu.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch3_speed.c
arch/arm/cpu/armv8/s32v234/cpu.c
arch/powerpc/cpu/mpc85xx/speed.c
arch/powerpc/cpu/mpc86xx/cpu.c
arch/powerpc/cpu/mpc8xxx/cpu.c
arch/powerpc/cpu/mpc8xxx/fdt.c
board/freescale/qemu-ppce500/qemu-ppce500.c
include/common.h

index 374fde6b65c0717ffe8d2933001e9cc60c07a3da..6c87c1b11accafd6f1af101d162dc06e2de3ed1a 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fsl_ddr_sdram.h>
 #include <vsprintf.h>
index 6d82cfeb58ec781630e03c82fca3ff23d0a5f0f0..25e9a495f7fc845fc7519f45e74f6d890a6d19b8 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 #include <asm/io.h>
 #include <asm/processor.h>
index ede96742aad160d7cba23302368926f707594995..4b047a39c079dae02d9c16ca0f2d8efe15ea6d2d 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/compiler.h>
 #include <fsl_ifc.h>
 #include <asm/processor.h>
index b4cb67a66a3b9754f685da5d766b50fc03c6a975..b5a9513eadc345c94be3bb30c7b39d2b67ade024 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <asm/io.h>
 #include <asm/system.h>
 #include <asm/armv8/mmu.h>
index acc2f2bb81842dc30bc3c1a7c2814a64acb881c7..15b05fcc513f2af26d25f520d6140b38a4912b07 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <ppc_asm.tmpl>
 #include <linux/compiler.h>
 #include <asm/processor.h>
index 1c3c78217cb9c11674be4d0bd62f314f4092ece6..bb14444a2e7efa0522c3917bd5c32d5b77ab66f1 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <vsprintf.h>
 #include <watchdog.h>
 #include <command.h>
index 467eac4a2e21ac49b2ef7a3ef4fa7e63d03c9321..ed482a9c0984af6d66620db6bf4de9775464bb1d 100644 (file)
@@ -10,6 +10,7 @@
 #include <config.h>
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <tsec.h>
 #include <fm_eth.h>
 #include <netdev.h>
index 0d877c43be81aefb28a3f6af8b6f533646246731..485c2d4feb0eefd4f3e9a5c682be2013a86e66b5 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <cpu_func.h>
 #include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/mp.h>
index fb36d8366c98b6b9eb2deba59cb02ee3e9c19af8..4a5ab72b1f72e1d9c6bf2bc0b9891df1ddb5a2b8 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <pci.h>
 #include <asm/processor.h>
index 992675100d54c9976040275160d46e876a56e6a9..4de05032b2b8fde8105f9ce319063984db00c77b 100644 (file)
@@ -203,26 +203,6 @@ void       relocate_code(ulong, gd_t *, ulong) __attribute__ ((noreturn));
 ulong  get_endaddr   (void);
 void   trap_init     (ulong);
 
-/* $(CPU)/cpu.c */
-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);
-
 void s_init(void);
 
 int    checkcpu      (void);