
Version 3 of this series moves the QFW driver into a uclass, UCLASS_QFW, and splits the driver into qfw_pio and qfw_mmio. The ugly arch-specific ifdefs are now gone, since regular Makefile conditional compilation of each driver takes care of it for us.
As before, on x86 a U_BOOT_DRVINFO is used to configure the qfw_pio driver, otherwise we configure qfw_mmio from device tree if present.
I continue to test this on arm64 and x86_64 qemu. A sandbox driver is also included, and a DM unit test for it.
A test that runs in the qemu platform is still yet to come -- I wanted to submit this ahead of that for more feedback. One question: how much should I roll these patches together? The first introduces a few changes that are immediately superceded by the second, but maybe it's helpful for review?
To view the changes online, see: https://git.src.kameliya.ee/~kameliya/u-boot/log/qfw-priv
Changes in v3: - ARCH_QEMU now implies CMD_QFW, not QFW - rename qemu_fwcfg_read_entry_pio to ..._io
Asherah Connor (4): arm: x86: qemu: move qfw to DM, include Arm support arm: x86: qemu: add UCLASS_QFW, split driver into _pio and _mmio arm: x86: qemu: unify qfw driver functions as qfw_ qemu: add sandbox driver and tests
arch/arm/Kconfig | 1 + arch/sandbox/dts/sandbox.dtsi | 4 + arch/sandbox/dts/test.dts | 4 + arch/x86/cpu/qemu/cpu.c | 7 +- arch/x86/cpu/qemu/qemu.c | 52 ++------ arch/x86/cpu/qfw_cpu.c | 11 +- cmd/qfw.c | 56 ++++---- common/Makefile | 2 + common/qfw.c | 111 ++++++++++++++++ drivers/misc/Makefile | 7 +- drivers/misc/qfw.c | 239 ++++++++++++---------------------- drivers/misc/qfw_mmio.c | 101 ++++++++++++++ drivers/misc/qfw_pio.c | 66 ++++++++++ drivers/misc/qfw_sandbox.c | 129 ++++++++++++++++++ include/dm/uclass-id.h | 1 + include/qfw.h | 90 +++++++++---- test/dm/Makefile | 1 + test/dm/qfw.c | 42 ++++++ 18 files changed, 665 insertions(+), 259 deletions(-) create mode 100644 common/qfw.c create mode 100644 drivers/misc/qfw_mmio.c create mode 100644 drivers/misc/qfw_pio.c create mode 100644 drivers/misc/qfw_sandbox.c create mode 100644 test/dm/qfw.c