diff options
author | Peng Fan <peng.fan@nxp.com> | 2020-05-03 21:58:48 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2020-05-03 15:45:49 +0200 |
commit | b1e894ff500819654cea82ab2f20cd4d91b4c5c2 (patch) | |
tree | eda7071b295dd64e703fb8b4537267a84660cf0b /drivers/cpu | |
parent | 4c809aee50f5128f815a7f272cdf2d30a1e1e76e (diff) |
cpu: sandbox: support is_current
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>
Diffstat (limited to 'drivers/cpu')
-rw-r--r-- | drivers/cpu/cpu_sandbox.c | 9 |
1 files changed, 9 insertions, 0 deletions
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) |