aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/cpu/qfw_cpu.c
diff options
context:
space:
mode:
authorAsherah Connor <ashe@kivikakk.ee>2021-03-19 18:21:40 +1100
committerTom Rini <trini@konsulko.com>2021-04-12 17:44:55 -0400
commit5b0b43e0e25dbeed62a2155e7f3be562b9ceb9bd (patch)
tree309170036a9d09d9c65087c4b490f4605777abe6 /arch/x86/cpu/qfw_cpu.c
parent2a3f161c8b16ed4fe4bd215dddfa21f4ddbd3e37 (diff)
x86: qemu: move QFW to its own uclass
We move qfw into its own uclass and split the PIO functions into a specific driver for that uclass. The PIO driver is selected in the qemu-x86 board config (this covers x86 and x86_64). include/qfw.h is cleaned up and documentation added. Signed-off-by: Asherah Connor <ashe@kivikakk.ee> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu/qfw_cpu.c')
-rw-r--r--arch/x86/cpu/qfw_cpu.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/cpu/qfw_cpu.c b/arch/x86/cpu/qfw_cpu.c
index b959eaddde..ee00b8fe73 100644
--- a/arch/x86/cpu/qfw_cpu.c
+++ b/arch/x86/cpu/qfw_cpu.c
@@ -18,7 +18,7 @@ int qemu_cpu_fixup(void)
int cpu_num;
int cpu_online;
struct uclass *uc;
- struct udevice *dev, *pdev;
+ struct udevice *dev, *pdev, *qfwdev;
struct cpu_plat *plat;
char *cpu;
@@ -39,6 +39,13 @@ int qemu_cpu_fixup(void)
return -ENODEV;
}
+ /* get qfw dev */
+ ret = qfw_get_dev(&qfwdev);
+ if (ret) {
+ printf("unable to find qfw device\n");
+ return ret;
+ }
+
/* calculate cpus that are already bound */
cpu_num = 0;
for (uclass_find_first_device(UCLASS_CPU, &dev);
@@ -48,7 +55,7 @@ int qemu_cpu_fixup(void)
}
/* get actual cpu number */
- cpu_online = qemu_fwcfg_online_cpus();
+ cpu_online = qfw_online_cpus(qfwdev);
if (cpu_online < 0) {
printf("unable to get online cpu number: %d\n", cpu_online);
return cpu_online;