mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-26 20:37:16 +00:00
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>
This commit is contained in:
parent
4c809aee50
commit
b1e894ff50
1 changed files with 9 additions and 0 deletions
|
@ -36,11 +36,20 @@ int cpu_sandbox_get_vendor(struct udevice *dev, char *buf, int size)
|
||||||
return 0;
|
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 = {
|
static const struct cpu_ops cpu_sandbox_ops = {
|
||||||
.get_desc = cpu_sandbox_get_desc,
|
.get_desc = cpu_sandbox_get_desc,
|
||||||
.get_info = cpu_sandbox_get_info,
|
.get_info = cpu_sandbox_get_info,
|
||||||
.get_count = cpu_sandbox_get_count,
|
.get_count = cpu_sandbox_get_count,
|
||||||
.get_vendor = cpu_sandbox_get_vendor,
|
.get_vendor = cpu_sandbox_get_vendor,
|
||||||
|
.is_current = cpu_sandbox_is_current,
|
||||||
};
|
};
|
||||||
|
|
||||||
int cpu_sandbox_probe(struct udevice *dev)
|
int cpu_sandbox_probe(struct udevice *dev)
|
||||||
|
|
Loading…
Add table
Reference in a new issue