arm: imx: Switch mx6cuboxi to use config_distro_bootcmd.h.
[oweals/u-boot.git] / drivers / cpu / cpu-uclass.c
index ab18ee2ea9346415af7ba0924929ac31dfb698a5..7660f99ef5956804685b6cd7b3789fa1b99a82fc 100644 (file)
@@ -8,9 +8,12 @@
 #include <common.h>
 #include <cpu.h>
 #include <dm.h>
+#include <errno.h>
 #include <dm/lists.h>
 #include <dm/root.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int cpu_get_desc(struct udevice *dev, char *buf, int size)
 {
        struct cpu_ops *ops = cpu_get_ops(dev);
@@ -25,12 +28,22 @@ int cpu_get_info(struct udevice *dev, struct cpu_info *info)
 {
        struct cpu_ops *ops = cpu_get_ops(dev);
 
-       if (!ops->get_desc)
+       if (!ops->get_info)
                return -ENOSYS;
 
        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,