]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
c7e9b5c382a58e011240978b48ea5ccad436f715
[mirror_edk2.git] / OvmfPkg / Include / IndustryStandard / QemuFwCfg.h
1 /** @file
2 Macro and type definitions corresponding to the QEMU fw_cfg interface.
3
4 Refer to "docs/specs/fw_cfg.txt" in the QEMU source directory.
5
6 Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
7 Copyright (C) 2013 - 2017, Red Hat, Inc.
8
9 This program and the accompanying materials are licensed and made available
10 under the terms and conditions of the BSD License which accompanies this
11 distribution. The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
15 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 **/
17
18 #ifndef __FW_CFG_H__
19 #define __FW_CFG_H__
20
21 #include <Base.h>
22
23 //
24 // The size, in bytes, of names of firmware configuration files, including at
25 // least one terminating NUL byte.
26 //
27 #define QEMU_FW_CFG_FNAME_SIZE 56
28
29 //
30 // If the following bit is set in the UINT32 fw_cfg revision / feature bitmap
31 // -- read from key 0x0001 with the basic IO Port or MMIO method --, then the
32 // DMA interface is available.
33 //
34 #define FW_CFG_F_DMA BIT1
35
36 //
37 // Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encoding).
38 //
39 #define FW_CFG_DMA_CTL_ERROR BIT0
40 #define FW_CFG_DMA_CTL_READ BIT1
41 #define FW_CFG_DMA_CTL_SKIP BIT2
42 #define FW_CFG_DMA_CTL_SELECT BIT3
43 #define FW_CFG_DMA_CTL_WRITE BIT4
44
45 //
46 // Numerically defined keys.
47 //
48 typedef enum {
49 QemuFwCfgItemSignature = 0x0000,
50 QemuFwCfgItemInterfaceVersion = 0x0001,
51 QemuFwCfgItemSystemUuid = 0x0002,
52 QemuFwCfgItemRamSize = 0x0003,
53 QemuFwCfgItemGraphicsEnabled = 0x0004,
54 QemuFwCfgItemSmpCpuCount = 0x0005,
55 QemuFwCfgItemMachineId = 0x0006,
56 QemuFwCfgItemKernelAddress = 0x0007,
57 QemuFwCfgItemKernelSize = 0x0008,
58 QemuFwCfgItemKernelCommandLine = 0x0009,
59 QemuFwCfgItemInitrdAddress = 0x000a,
60 QemuFwCfgItemInitrdSize = 0x000b,
61 QemuFwCfgItemBootDevice = 0x000c,
62 QemuFwCfgItemNumaData = 0x000d,
63 QemuFwCfgItemBootMenu = 0x000e,
64 QemuFwCfgItemMaximumCpuCount = 0x000f,
65 QemuFwCfgItemKernelEntry = 0x0010,
66 QemuFwCfgItemKernelData = 0x0011,
67 QemuFwCfgItemInitrdData = 0x0012,
68 QemuFwCfgItemCommandLineAddress = 0x0013,
69 QemuFwCfgItemCommandLineSize = 0x0014,
70 QemuFwCfgItemCommandLineData = 0x0015,
71 QemuFwCfgItemKernelSetupAddress = 0x0016,
72 QemuFwCfgItemKernelSetupSize = 0x0017,
73 QemuFwCfgItemKernelSetupData = 0x0018,
74 QemuFwCfgItemFileDir = 0x0019,
75
76 QemuFwCfgItemX86AcpiTables = 0x8000,
77 QemuFwCfgItemX86SmbiosTables = 0x8001,
78 QemuFwCfgItemX86Irq0Override = 0x8002,
79 QemuFwCfgItemX86E820Table = 0x8003,
80 QemuFwCfgItemX86HpetData = 0x8004,
81
82 } FIRMWARE_CONFIG_ITEM;
83
84 //
85 // Communication structure for the DMA access method. All fields are encoded in
86 // big endian.
87 //
88 #pragma pack (1)
89 typedef struct {
90 UINT32 Control;
91 UINT32 Length;
92 UINT64 Address;
93 } FW_CFG_DMA_ACCESS;
94 #pragma pack ()
95
96 #endif