All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v6 03/25] x86: mp_init: Avoid declarations in header files
Date: Fri, 17 Jul 2020 08:48:09 -0600	[thread overview]
Message-ID: <20200717144831.309167-4-sjg@chromium.org> (raw)
In-Reply-To: <20200717144831.309167-1-sjg@chromium.org>

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>
---

(no changes since v1)

 arch/x86/cpu/mp_init.c    | 40 +++++++++++++++++++--------------------
 arch/x86/include/asm/mp.h |  3 ---
 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);
 
-- 
2.28.0.rc0.105.gf9edc3c819-goog

  parent reply	other threads:[~2020-07-17 14:48 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 14:48 [PATCH v6 00/25] x86: Enhance MTRR functionality to support multiple CPUs Simon Glass
2020-07-17 14:48 ` [PATCH v6 01/25] x86: mp_init: Switch to livetree Simon Glass
2020-07-17 14:48 ` [PATCH v6 02/25] x86: Move MP code into mp_init Simon Glass
2020-07-17 14:48 ` Simon Glass [this message]
2020-07-17 14:48 ` [PATCH v6 04/25] x86: mp_init: Switch parameter names in start_aps() Simon Glass
2020-07-17 14:48 ` [PATCH v6 05/25] x86: mp_init: Drop the num_cpus static variable Simon Glass
2020-07-17 14:48 ` [PATCH v6 06/25] x86: mtrr: Fix 'ensable' typo Simon Glass
2020-07-17 14:48 ` [PATCH v6 07/25] x86: mp_init: Set up the CPU numbers at the start Simon Glass
2020-07-17 14:48 ` [PATCH v6 08/25] x86: mp_init: Adjust bsp_init() to return more information Simon Glass
2020-07-17 14:48 ` [PATCH v6 09/25] x86: cpu: Remove unnecessary #ifdefs Simon Glass
2020-07-17 14:48 ` [PATCH v6 10/25] x86: mp: Support APs waiting for instructions Simon Glass
2020-07-20  1:22   ` Bin Meng
2020-07-17 14:48 ` [PATCH v6 11/25] global_data: Add a generic global_data flag for SMP state Simon Glass
2020-07-20  1:23   ` Bin Meng
2020-07-17 14:48 ` [PATCH v6 12/25] x86: Set the SMP flag when MP init is complete Simon Glass
2020-07-17 14:48 ` [PATCH v6 13/25] x86: mp: Allow running functions on multiple CPUs Simon Glass
2020-07-20  1:25   ` Bin Meng
2020-07-17 14:48 ` [PATCH v6 14/25] x86: mp: Park CPUs before running the OS Simon Glass
2020-07-20  1:26   ` Bin Meng
2020-07-17 14:48 ` [PATCH v6 15/25] x86: mp: Add iterators for CPUs Simon Glass
2020-07-20  1:26   ` Bin Meng
2020-07-17 14:48 ` [PATCH v6 16/25] x86: mtrr: Use MP calls to list the MTRRs Simon Glass
2020-07-17 14:48 ` [PATCH v6 17/25] x86: Don't enable SMP in SPL Simon Glass
2020-07-17 14:48 ` [PATCH v6 18/25] x86: coral: Update the memory map Simon Glass
2020-07-17 14:48 ` [PATCH v6 19/25] x86: mtrr: Update MTRRs on all CPUs Simon Glass
2020-07-20  1:27   ` Bin Meng
2020-07-17 14:48 ` [PATCH v6 20/25] x86: mtrr: Add support for writing to MTRRs on any CPU Simon Glass
2020-07-17 14:48 ` [PATCH v6 21/25] x86: mtrr: Update the command to use the new mtrr calls Simon Glass
2020-07-17 14:48 ` [PATCH v6 22/25] x86: mtrr: Restructure so command execution is in one place Simon Glass
2020-07-17 14:48 ` [PATCH v6 23/25] x86: mtrr: Update 'mtrr' to allow setting MTRRs on any CPU Simon Glass
2020-07-17 14:48 ` [PATCH v6 24/25] x86: mp: Add more comments to the module Simon Glass
2020-07-17 14:48 ` [PATCH v6 25/25] x86: mtrr: Enhance 'mtrr' command to list MTRRs on any CPU Simon Glass
2020-07-20  1:28   ` Bin Meng
2020-07-20  1:46 ` [PATCH v6 00/25] x86: Enhance MTRR functionality to support multiple CPUs Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200717144831.309167-4-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.