
Version 2 of this series explores moving the QFW driver to the driver model. We configure QFW on Arm from the device tree, while x86 uses a U_BOOT_DRVINFO. All the logic for talking PIO/MMIO/DMA now lives in the QFW driver.
I've moved all the static variables from the qfw driver into its priv data section. Is this preferable? It adds some complexity to callers, as they need to obtain and then pass the `struct udevice *' around.
I haven't changed much of the calling convention into the driver yet, and so for the most part we still "skip" the device model, instead relying on it just to help us bring the device up and locate it again later. Where we go from here depends on whether we keep it in UCLASS_MISC and whether we feel like it's useful to change the way we call into it further.
There are some #ifdef hacks surrounding pause/yield and use of outw/inb/etc. in the driver. It feels like these should still be in arch-specific parts somehow.
This is tested as building and working correctly on arm64 and x86_64 qemu.
To view the main driver file as of this change in a non-diffed format, see: https://git.src.kameliya.ee/~kameliya/u-boot/tree/qfw-priv/item/drivers/misc...
(no changes since v1)
Asherah Connor (1): arm: x86: qemu: move qfw to DM, include Arm support
arch/arm/Kconfig | 1 + arch/x86/cpu/qemu/cpu.c | 7 +- arch/x86/cpu/qemu/qemu.c | 54 ++------ arch/x86/cpu/qfw_cpu.c | 11 +- cmd/qfw.c | 44 +++--- drivers/misc/Kconfig | 1 + drivers/misc/qfw.c | 287 +++++++++++++++++++++++++++------------ include/qfw.h | 63 +++++---- 8 files changed, 291 insertions(+), 177 deletions(-)