98 lines · c
1/* SPDX-License-Identifier: BSD-3-Clause */2#ifndef _LINUX_FW_CFG_H3#define _LINUX_FW_CFG_H4 5#include <linux/types.h>6 7#define FW_CFG_ACPI_DEVICE_ID "QEMU0002"8 9/* selector key values for "well-known" fw_cfg entries */10#define FW_CFG_SIGNATURE 0x0011#define FW_CFG_ID 0x0112#define FW_CFG_UUID 0x0213#define FW_CFG_RAM_SIZE 0x0314#define FW_CFG_NOGRAPHIC 0x0415#define FW_CFG_NB_CPUS 0x0516#define FW_CFG_MACHINE_ID 0x0617#define FW_CFG_KERNEL_ADDR 0x0718#define FW_CFG_KERNEL_SIZE 0x0819#define FW_CFG_KERNEL_CMDLINE 0x0920#define FW_CFG_INITRD_ADDR 0x0a21#define FW_CFG_INITRD_SIZE 0x0b22#define FW_CFG_BOOT_DEVICE 0x0c23#define FW_CFG_NUMA 0x0d24#define FW_CFG_BOOT_MENU 0x0e25#define FW_CFG_MAX_CPUS 0x0f26#define FW_CFG_KERNEL_ENTRY 0x1027#define FW_CFG_KERNEL_DATA 0x1128#define FW_CFG_INITRD_DATA 0x1229#define FW_CFG_CMDLINE_ADDR 0x1330#define FW_CFG_CMDLINE_SIZE 0x1431#define FW_CFG_CMDLINE_DATA 0x1532#define FW_CFG_SETUP_ADDR 0x1633#define FW_CFG_SETUP_SIZE 0x1734#define FW_CFG_SETUP_DATA 0x1835#define FW_CFG_FILE_DIR 0x1936 37#define FW_CFG_FILE_FIRST 0x2038#define FW_CFG_FILE_SLOTS_MIN 0x1039 40#define FW_CFG_WRITE_CHANNEL 0x400041#define FW_CFG_ARCH_LOCAL 0x800042#define FW_CFG_ENTRY_MASK (~(FW_CFG_WRITE_CHANNEL | FW_CFG_ARCH_LOCAL))43 44#define FW_CFG_INVALID 0xffff45 46/* width in bytes of fw_cfg control register */47#define FW_CFG_CTL_SIZE 0x0248 49/* fw_cfg "file name" is up to 56 characters (including terminating nul) */50#define FW_CFG_MAX_FILE_PATH 5651 52/* size in bytes of fw_cfg signature */53#define FW_CFG_SIG_SIZE 454 55/* FW_CFG_ID bits */56#define FW_CFG_VERSION 0x0157#define FW_CFG_VERSION_DMA 0x0258 59/* fw_cfg file directory entry type */60struct fw_cfg_file {61 __be32 size;62 __be16 select;63 __u16 reserved;64 char name[FW_CFG_MAX_FILE_PATH];65};66 67/* FW_CFG_DMA_CONTROL bits */68#define FW_CFG_DMA_CTL_ERROR 0x0169#define FW_CFG_DMA_CTL_READ 0x0270#define FW_CFG_DMA_CTL_SKIP 0x0471#define FW_CFG_DMA_CTL_SELECT 0x0872#define FW_CFG_DMA_CTL_WRITE 0x1073 74#define FW_CFG_DMA_SIGNATURE 0x51454d5520434647ULL /* "QEMU CFG" */75 76/* Control as first field allows for different structures selected by this77 * field, which might be useful in the future78 */79struct fw_cfg_dma_access {80 __be32 control;81 __be32 length;82 __be64 address;83};84 85#define FW_CFG_VMCOREINFO_FILENAME "etc/vmcoreinfo"86 87#define FW_CFG_VMCOREINFO_FORMAT_NONE 0x088#define FW_CFG_VMCOREINFO_FORMAT_ELF 0x189 90struct fw_cfg_vmcoreinfo {91 __le16 host_format;92 __le16 guest_format;93 __le32 size;94 __le64 paddr;95};96 97#endif98