projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c809ae
)
cpu: sandbox: support is_current
author
Peng Fan
<peng.fan@nxp.com>
Sun, 3 May 2020 13:58:48 +0000
(21:58 +0800)
committer
Stefano Babic
<sbabic@denx.de>
Sun, 3 May 2020 13:45:49 +0000
(15:45 +0200)
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>
drivers/cpu/cpu_sandbox.c
patch
|
blob
|
history
diff --git
a/drivers/cpu/cpu_sandbox.c
b/drivers/cpu/cpu_sandbox.c
index 05b384f6a4577127eabd5db3f3d65d8e382806c2..30a12e5a535de6646278d6b9ddf4dd04874eebd0 100644
(file)
--- 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)