From 1f57bc12d87dda2d56b564d35f21b9e6bdb2bb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 28 Feb 2018 16:06:11 +0100 Subject: fw_cfg: add a public uapi header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a common header file for well-known values and structures to be shared by the Linux kernel with qemu or other projects. It is based from qemu/docs/specs/fw_cfg.txt which references qemu/include/hw/nvram/fw_cfg_keys.h "for the most up-to-date and authoritative list" & vmcoreinfo.txt. Those files don't have an explicit license, but qemu/hw/nvram/fw_cfg.c is BSD-license, so Michael S. Tsirkin suggested to use the same license. The patch intentionally left out DMA & vmcoreinfo structures & defines, which are added in the commits making usage of it. Suggested-by: Michael S. Tsirkin Signed-off-by: Marc-André Lureau Signed-off-by: Michael S. Tsirkin --- drivers/firmware/qemu_fw_cfg.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index 45bfc389b226..5de6bb406fb6 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -32,30 +32,12 @@ #include #include #include +#include MODULE_AUTHOR("Gabriel L. Somlo "); MODULE_DESCRIPTION("QEMU fw_cfg sysfs support"); MODULE_LICENSE("GPL"); -/* selector key values for "well-known" fw_cfg entries */ -#define FW_CFG_SIGNATURE 0x00 -#define FW_CFG_ID 0x01 -#define FW_CFG_FILE_DIR 0x19 - -/* size in bytes of fw_cfg signature */ -#define FW_CFG_SIG_SIZE 4 - -/* fw_cfg "file name" is up to 56 characters (including terminating nul) */ -#define FW_CFG_MAX_FILE_PATH 56 - -/* fw_cfg file directory entry type */ -struct fw_cfg_file { - u32 size; - u16 select; - u16 reserved; - char name[FW_CFG_MAX_FILE_PATH]; -}; - /* fw_cfg device i/o register addresses */ static bool fw_cfg_is_mmio; static phys_addr_t fw_cfg_p_base; @@ -616,7 +598,7 @@ MODULE_DEVICE_TABLE(of, fw_cfg_sysfs_mmio_match); #ifdef CONFIG_ACPI static const struct acpi_device_id fw_cfg_sysfs_acpi_match[] = { - { "QEMU0002", }, + { FW_CFG_ACPI_DEVICE_ID, }, {}, }; MODULE_DEVICE_TABLE(acpi, fw_cfg_sysfs_acpi_match); -- cgit v1.2.3