@@ -186,7 +186,7 @@ config RASPBERRYPI_FIRMWARE
config FW_CFG_SYSFS
tristate "QEMU fw_cfg device support in sysfs"
- depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || SPARC || X86)
+ depends on SYSFS && (ARM || ARM64 || PARISC || PPC_PMAC || SPARC || X86 || RISCV)
depends on HAS_IOPORT_MAP
default n
help
@@ -225,6 +225,10 @@ static void fw_cfg_io_cleanup(void)
# define FW_CFG_CTRL_OFF 0x00
# define FW_CFG_DATA_OFF 0x01
# define FW_CFG_DMA_OFF 0x04
+# elif defined(CONFIG_RISCV)
+# define FW_CFG_CTRL_OFF 0x08
+# define FW_CFG_DATA_OFF 0x00
+# define FW_CFG_DMA_OFF 0x10
# else
# error "QEMU FW_CFG not available on this architecture!"
# endif
In the latest release of qemu (qemu 6.0.0 or higher) riscv virt already supports fw_cfg, but drivers/firmware/qemu_fw_cfg not support. Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn> --- drivers/firmware/Kconfig | 2 +- drivers/firmware/qemu_fw_cfg.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)