public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: u-boot@lists.denx.de
Subject: [PATCH V3 2/9] cpu: sandbox: support is_current
Date: Sun,  3 May 2020 21:58:48 +0800	[thread overview]
Message-ID: <20200503135855.11484-2-peng.fan@nxp.com> (raw)
In-Reply-To: <20200503135855.11484-1-peng.fan@nxp.com>

Support querying whether U-Boot is running on current cpu

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
V3:
 Add R-b
V2:
 New

 drivers/cpu/cpu_sandbox.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/cpu/cpu_sandbox.c b/drivers/cpu/cpu_sandbox.c
index 05b384f6a4..30a12e5a53 100644
--- a/drivers/cpu/cpu_sandbox.c
+++ b/drivers/cpu/cpu_sandbox.c
@@ -36,11 +36,20 @@ int cpu_sandbox_get_vendor(struct udevice *dev, char *buf, int size)
 	return 0;
 }
 
+int cpu_sandbox_is_current(struct udevice *dev)
+{
+	if (!strcmp(dev->name, "cpu-test1"))
+		return 1;
+
+	return 0;
+}
+
 static const struct cpu_ops cpu_sandbox_ops = {
 	.get_desc = cpu_sandbox_get_desc,
 	.get_info = cpu_sandbox_get_info,
 	.get_count = cpu_sandbox_get_count,
 	.get_vendor = cpu_sandbox_get_vendor,
+	.is_current = cpu_sandbox_is_current,
 };
 
 int cpu_sandbox_probe(struct udevice *dev)
-- 
2.16.4

  reply	other threads:[~2020-05-03 13:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 13:58 [PATCH V3 1/9] uclass: cpu: Add new API to get udevice for current CPU Peng Fan
2020-05-03 13:58 ` Peng Fan [this message]
2020-05-04  7:35   ` [PATCH V3 2/9] cpu: sandbox: support is_current sbabic at denx.de
2020-05-03 13:58 ` [PATCH V3 3/9] test: cpu: test current cpu Peng Fan
2020-05-04  7:34   ` sbabic at denx.de
2020-05-03 13:58 ` [PATCH V3 4/9] common: board_f: Use cpu_get_current_dev in print_cpuinfo Peng Fan
2020-05-04  7:34   ` sbabic at denx.de
2020-05-03 13:58 ` [PATCH V3 5/9] cpu: imx8: reimplement get cpu count Peng Fan
2020-05-04  7:34   ` sbabic at denx.de
2020-05-03 13:58 ` [PATCH V3 6/9] cpu: imx8: support a72 as boot cpu Peng Fan
2020-05-04  7:35   ` sbabic at denx.de
2020-05-03 13:58 ` [PATCH V3 7/9] cpu: imx8: fix get core name and rate Peng Fan
2020-05-04  7:35   ` sbabic at denx.de
2020-05-03 13:58 ` [PATCH V3 8/9] cpu: imx_cpu: Print the CPU temperature for iMX8QM A72 Peng Fan
2020-05-04  7:35   ` sbabic at denx.de
2020-05-03 13:58 ` [PATCH V3 9/9] cpu: imx8: show RevC instead of Rev? at boot log Peng Fan
2020-05-04  7:35   ` sbabic at denx.de
2020-05-04  7:34 ` [PATCH V3 1/9] uclass: cpu: Add new API to get udevice for current CPU sbabic at denx.de

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=20200503135855.11484-2-peng.fan@nxp.com \
    --to=peng.fan@nxp.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox