diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2015-06-17 11:15:34 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-07-14 18:03:16 -0600 |
commit | 780bfdd3c72a058ba24cda0df66ca75f0a7d8b18 (patch) | |
tree | dd9f729d8aad1da238271df2be85d08c04ff7435 /drivers | |
parent | 4c71322b41a657596ee5e5777393ed83e80139c6 (diff) | |
download | u-boot-imx-780bfdd3c72a058ba24cda0df66ca75f0a7d8b18.zip u-boot-imx-780bfdd3c72a058ba24cda0df66ca75f0a7d8b18.tar.gz u-boot-imx-780bfdd3c72a058ba24cda0df66ca75f0a7d8b18.tar.bz2 |
dm: cpu: Add a new get_count method to cpu uclass
Introduce a new method 'get_count' in the UCLASS_CPU ops to get
the number of CPUs in the system.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-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 d6be9d4..a2814a8 100644 --- a/drivers/cpu/cpu-uclass.c +++ b/drivers/cpu/cpu-uclass.c @@ -32,6 +32,16 @@ int cpu_get_info(struct udevice *dev, struct cpu_info *info) return ops->get_info(dev, info); } +int cpu_get_count(struct udevice *dev) +{ + struct cpu_ops *ops = cpu_get_ops(dev); + + if (!ops->get_count) + return -ENOSYS; + + return ops->get_count(dev); +} + U_BOOT_DRIVER(cpu_bus) = { .name = "cpu_bus", .id = UCLASS_SIMPLE_BUS, |