2 * Copyright (C) 2015, Miao Yan <yanmiaobest@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0+
12 #include <asm/fw_cfg.h>
14 DECLARE_GLOBAL_DATA_PTR;
16 int cpu_qemu_bind(struct udevice *dev)
18 struct cpu_platdata *plat = dev_get_parent_platdata(dev);
20 plat->cpu_id = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
26 int cpu_qemu_get_desc(struct udevice *dev, char *buf, int size)
28 if (size < CPU_MAX_NAME_LEN)
36 static int cpu_qemu_get_count(struct udevice *dev)
38 return qemu_fwcfg_online_cpus();
41 static const struct cpu_ops cpu_qemu_ops = {
42 .get_desc = cpu_qemu_get_desc,
43 .get_count = cpu_qemu_get_count,
46 static const struct udevice_id cpu_qemu_ids[] = {
47 { .compatible = "cpu-qemu" },
51 U_BOOT_DRIVER(cpu_qemu_drv) = {
54 .of_match = cpu_qemu_ids,
55 .bind = cpu_qemu_bind,