2 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0+
13 DECLARE_GLOBAL_DATA_PTR;
15 int cpu_x86_bind(struct udevice *dev)
17 struct cpu_platdata *plat = dev_get_parent_platdata(dev);
19 plat->cpu_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
25 int cpu_x86_get_desc(struct udevice *dev, char *buf, int size)
27 if (size < CPU_MAX_NAME_LEN)
35 static int cpu_x86_get_count(struct udevice *dev)
40 node = fdt_path_offset(gd->fdt_blob, "/cpus");
44 for (cpu = fdt_first_subnode(gd->fdt_blob, node);
46 cpu = fdt_next_subnode(gd->fdt_blob, cpu)) {
47 const char *device_type;
49 device_type = fdt_getprop(gd->fdt_blob, cpu,
53 if (strcmp(device_type, "cpu") == 0)
60 static const struct cpu_ops cpu_x86_ops = {
61 .get_desc = cpu_x86_get_desc,
62 .get_count = cpu_x86_get_count,
65 static const struct udevice_id cpu_x86_ids[] = {
66 { .compatible = "cpu-x86" },
70 U_BOOT_DRIVER(cpu_x86_drv) = {
73 .of_match = cpu_x86_ids,