]> git.sur5r.net Git - u-boot/blobdiff - drivers/cpu/cpu-uclass.c
clk: Add Actions Semi OWL clock support
[u-boot] / drivers / cpu / cpu-uclass.c
index a2814a8dcf5b0f7e04a8db6e8e14bdadffed16b4..f362eb11e7220ab7b9ae370f14a82c64a2e7cff9 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2015 Google, Inc
  * Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -42,6 +41,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,
@@ -51,11 +60,11 @@ U_BOOT_DRIVER(cpu_bus) = {
 static int uclass_cpu_init(struct uclass *uc)
 {
        struct udevice *dev;
-       int node;
+       ofnode node;
        int ret;
 
-       node = fdt_path_offset(gd->fdt_blob, "/cpus");
-       if (node < 0)
+       node = ofnode_path("/cpus");
+       if (!ofnode_valid(node))
                return 0;
 
        ret = device_bind_driver_to_node(dm_root(), "cpu_bus", "cpus", node,