summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-17 08:48:09 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-07-20 09:46:43 +0800
commite624858407039ffeb4e4007bb2677d8e4fa6536c (patch)
treefdea602aae298cc5767462c3495c7121b1be726a
parent78d57d63d7f3711b2f66ba7b39560e5250df0115 (diff)
x86: mp_init: Avoid declarations in header files
The functions used by the flight plan are declared in the header file but are not used in any other file. Move the flight plan steps down to just above where it is used so that we can make these function static. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r--arch/x86/cpu/mp_init.c40
-rw-r--r--arch/x86/include/asm/mp.h3
2 files changed, 20 insertions, 23 deletions
diff --git a/arch/x86/cpu/mp_init.c b/arch/x86/cpu/mp_init.c
index 831fd7035d..e77d7f2cd6 100644
--- a/arch/x86/cpu/mp_init.c
+++ b/arch/x86/cpu/mp_init.c
@@ -41,10 +41,6 @@ struct saved_msr {
uint32_t hi;
} __packed;
-static struct mp_flight_record mp_steps[] = {
- MP_FR_BLOCK_APS(mp_init_cpu, NULL, mp_init_cpu, NULL),
-};
-
struct mp_flight_plan {
int num_records;
struct mp_flight_record *records;
@@ -423,6 +419,26 @@ static int init_bsp(struct udevice **devp)
return 0;
}
+static int mp_init_cpu(struct udevice *cpu, void *unused)
+{
+ struct cpu_platdata *plat = dev_get_parent_platdata(cpu);
+
+ /*
+ * Multiple APs are brought up simultaneously and they may get the same
+ * seq num in the uclass_resolve_seq() during device_probe(). To avoid
+ * this, set req_seq to the reg number in the device tree in advance.
+ */
+ cpu->req_seq = dev_read_u32_default(cpu, "reg", -1);
+ plat->ucode_version = microcode_read_rev();
+ plat->device_id = gd->arch.x86_device;
+
+ return device_probe(cpu);
+}
+
+static struct mp_flight_record mp_steps[] = {
+ MP_FR_BLOCK_APS(mp_init_cpu, NULL, mp_init_cpu, NULL),
+};
+
int mp_init(void)
{
int num_aps;
@@ -495,19 +511,3 @@ int mp_init(void)
return 0;
}
-
-int mp_init_cpu(struct udevice *cpu, void *unused)
-{
- struct cpu_platdata *plat = dev_get_parent_platdata(cpu);
-
- /*
- * Multiple APs are brought up simultaneously and they may get the same
- * seq num in the uclass_resolve_seq() during device_probe(). To avoid
- * this, set req_seq to the reg number in the device tree in advance.
- */
- cpu->req_seq = dev_read_u32_default(cpu, "reg", -1);
- plat->ucode_version = microcode_read_rev();
- plat->device_id = gd->arch.x86_device;
-
- return device_probe(cpu);
-}
diff --git a/arch/x86/include/asm/mp.h b/arch/x86/include/asm/mp.h
index db02904ecb..94af819ad9 100644
--- a/arch/x86/include/asm/mp.h
+++ b/arch/x86/include/asm/mp.h
@@ -72,9 +72,6 @@ struct mp_flight_record {
*/
int mp_init(void);
-/* Probes the CPU device */
-int mp_init_cpu(struct udevice *cpu, void *unused);
-
/* Set up additional CPUs */
int x86_mp_init(void);