diff options
author | Alexander Graf <agraf@suse.de> | 2016-08-19 01:23:27 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2016-10-19 09:01:51 +0200 |
commit | 94eaa79cecf98300974c99d935ff653c9418de21 (patch) | |
tree | 1d74ec8d17be5db3f8b7b0842ee2c39cdd88b471 /drivers/cpu | |
parent | 6f192ddcbd8e13351a8f13365e7c714e7b61a79e (diff) | |
download | u-boot-imx-94eaa79cecf98300974c99d935ff653c9418de21.zip u-boot-imx-94eaa79cecf98300974c99d935ff653c9418de21.tar.gz u-boot-imx-94eaa79cecf98300974c99d935ff653c9418de21.tar.bz2 |
cpu: Add get_vendor callback
The CPU udevice already has a few callbacks to retreive information
about the currently running CPUs. This patch adds a new get_vendor()
call that returns the vendor of the main CPUs.
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/cpu')
-rw-r--r-- | drivers/cpu/cpu-uclass.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/cpu/cpu-uclass.c b/drivers/cpu/cpu-uclass.c index 7660f99..c57ac16 100644 --- a/drivers/cpu/cpu-uclass.c +++ b/drivers/cpu/cpu-uclass.c @@ -44,6 +44,16 @@ int cpu_get_count(struct udevice *dev) return ops->get_count(dev); } +int cpu_get_vendor(struct udevice *dev, char *buf, int size) +{ + struct cpu_ops *ops = cpu_get_ops(dev); + + if (!ops->get_vendor) + return -ENOSYS; + + return ops->get_vendor(dev, buf, size); +} + U_BOOT_DRIVER(cpu_bus) = { .name = "cpu_bus", .id = UCLASS_SIMPLE_BUS, |