/openbmc/qemu/tests/qtest/ |
H A D | fw_cfg-test.c | 2 * qtest fw_cfg test case 17 #include "libqos/fw_cfg.h" 28 QFWCFG *fw_cfg; in test_fw_cfg_signature() local 33 fw_cfg = pc_fw_cfg_init(s); in test_fw_cfg_signature() 35 qfw_cfg_get(fw_cfg, FW_CFG_SIGNATURE, buf, 4); in test_fw_cfg_signature() 39 pc_fw_cfg_uninit(fw_cfg); in test_fw_cfg_signature() 45 QFWCFG *fw_cfg; in test_fw_cfg_id() local 50 fw_cfg = pc_fw_cfg_init(s); in test_fw_cfg_id() 52 id = qfw_cfg_get_u32(fw_cfg, FW_CFG_ID); in test_fw_cfg_id() 55 pc_fw_cfg_uninit(fw_cfg); in test_fw_cfg_id() [all …]
|
H A D | boot-order-test.c | 14 #include "libqos/fw_cfg.h" 115 g_autoptr(QFWCFG) fw_cfg = mm_fw_cfg_init(qts, 0xf0000510); in read_boot_order_pmac() 117 return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); in read_boot_order_pmac() 140 g_autoptr(QFWCFG) fw_cfg = mm_fw_cfg_init(qts, 0xd00000510ULL); in read_boot_order_sun4m() 142 return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); in read_boot_order_sun4m() 152 g_autoptr(QFWCFG) fw_cfg = io_fw_cfg_init(qts, 0x510); in read_boot_order_sun4u() 154 return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); in read_boot_order_sun4u()
|
/openbmc/qemu/tests/qtest/libqos/ |
H A D | fw_cfg.c | 2 * libqos fw_cfg support 16 #include "fw_cfg.h" 19 #include "hw/nvram/fw_cfg.h" 21 void qfw_cfg_select(QFWCFG *fw_cfg, uint16_t key) in qfw_cfg_select() argument 23 fw_cfg->select(fw_cfg, key); in qfw_cfg_select() 26 void qfw_cfg_read_data(QFWCFG *fw_cfg, void *data, size_t len) in qfw_cfg_read_data() argument 28 fw_cfg->read(fw_cfg, data, len); in qfw_cfg_read_data() 31 void qfw_cfg_get(QFWCFG *fw_cfg, uint16_t key, void *data, size_t len) in qfw_cfg_get() argument 33 qfw_cfg_select(fw_cfg, key); in qfw_cfg_get() 34 qfw_cfg_read_data(fw_cfg, data, len); in qfw_cfg_get() [all …]
|
H A D | fw_cfg.h | 2 * libqos fw_cfg support 24 void (*select)(QFWCFG *fw_cfg, uint16_t key); 25 void (*read)(QFWCFG *fw_cfg, void *data, size_t len); 28 void qfw_cfg_select(QFWCFG *fw_cfg, uint16_t key); 29 void qfw_cfg_read_data(QFWCFG *fw_cfg, void *data, size_t len); 30 void qfw_cfg_get(QFWCFG *fw_cfg, uint16_t key, void *data, size_t len); 31 uint16_t qfw_cfg_get_u16(QFWCFG *fw_cfg, uint16_t key); 32 uint32_t qfw_cfg_get_u32(QFWCFG *fw_cfg, uint16_t key); 33 uint64_t qfw_cfg_get_u64(QFWCFG *fw_cfg, uint16_t key); 34 size_t qfw_cfg_get_file(QFWCFG *fw_cfg, const char *filename, [all …]
|
H A D | malloc-pc.c | 15 #include "fw_cfg.h" 24 QFWCFG *fw_cfg = pc_fw_cfg_init(qts); in pc_alloc_init() local 26 ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE); in pc_alloc_init() 30 pc_fw_cfg_uninit(fw_cfg); in pc_alloc_init()
|
/openbmc/qemu/include/hw/nvram/ |
H A D | fw_cfg.h | 10 #define TYPE_FW_CFG "fw_cfg" 13 #define TYPE_FW_CFG_DATA_GENERATOR_INTERFACE "fw_cfg-data-generator" 15 OBJECT_DECLARE_SIMPLE_TYPE(FWCfgState, FW_CFG) 49 void fw_cfg_set_order_override(FWCfgState *fw_cfg, int order); 50 void fw_cfg_reset_order_override(FWCfgState *fw_cfg); 111 * @s: fw_cfg device being modified 112 * @key: selector key value for new fw_cfg item 116 * Add a new fw_cfg item, available by selecting the given key, as a raw 118 * is only linked, NOT copied, into the data structure of the fw_cfg device. 124 * @s: fw_cfg device being modified [all …]
|
/openbmc/linux/Documentation/ABI/testing/ |
H A D | sysfs-firmware-qemu_fw_cfg | 7 (fw_cfg) device, originally intended as a way for the host to 9 with QEMU v2.4, arbitrary fw_cfg file entries may be specified 10 by the user on the command line, which makes fw_cfg additionally 15 to the fw_cfg device can be found in "docs/specs/fw_cfg.rst" 17 https://qemu-project.gitlab.io/qemu/specs/fw_cfg.html 19 **SysFS fw_cfg Interface** 21 The fw_cfg sysfs interface described in this document is only 27 All fw_cfg information is shown under: 31 The only legacy blob displayed is the fw_cfg device revision: 35 **Discoverable fw_cfg blobs by selector key** [all …]
|
/openbmc/qemu/hw/i386/ |
H A D | fw_cfg.c | 2 * QEMU fw_cfg helpers (X86 specific) 20 #include "hw/i386/fw_cfg.h" 22 #include "hw/nvram/fw_cfg.h" 52 void fw_cfg_add_e820(FWCfgState *fw_cfg) in fw_cfg_add_e820() argument 57 fw_cfg_add_file(fw_cfg, "etc/e820", table, nr_e820 * sizeof(*table)); in fw_cfg_add_e820() 60 void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, in fw_cfg_build_smbios() argument 85 fw_cfg_add_bytes(fw_cfg, FW_CFG_SMBIOS_ENTRIES, in fw_cfg_build_smbios() 109 fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-tables", in fw_cfg_build_smbios() 111 fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor", in fw_cfg_build_smbios() 121 FWCfgState *fw_cfg; in fw_cfg_arch_create() local [all …]
|
H A D | fw_cfg.h | 2 * QEMU fw_cfg helpers (X86 specific) 14 #include "hw/nvram/fw_cfg.h" 26 void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg, 28 void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg); 29 void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg); 30 void fw_cfg_add_e820(FWCfgState *fw_cfg);
|
H A D | x86-common.c | 181 if (x86ms->fw_cfg) { in x86_cpu_plug() 182 fw_cfg_modify_i16(x86ms->fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); in x86_cpu_plug() 235 fw_cfg_modify_i16(x86ms->fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); in x86_cpu_unplug_cb() 580 FWCfgState *fw_cfg) in load_elfboot() argument 619 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ENTRY, pvh_start_addr); in load_elfboot() 620 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, mh_load_addr); in load_elfboot() 621 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, elf_kernel_size); in load_elfboot() 627 FWCfgState *fw_cfg, in x86_load_linux() argument 682 if (load_multiboot(x86ms, fw_cfg, f, kernel_filename, initrd_filename, in x86_load_linux() 689 * If load_elfboot() is successful, populate the fw_cfg info. in x86_load_linux() [all …]
|
/openbmc/qemu/hw/loongarch/ |
H A D | fw_cfg.c | 3 * QEMU fw_cfg helpers (LoongArch specific) 9 #include "hw/loongarch/fw_cfg.h" 11 #include "hw/nvram/fw_cfg.h" 22 FWCfgState *fw_cfg; in virt_fw_cfg_init() local 26 fw_cfg = fw_cfg_init_mem_wide(VIRT_FWCFG_BASE + 8, VIRT_FWCFG_BASE, 8, in virt_fw_cfg_init() 28 fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus); in virt_fw_cfg_init() 29 fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); in virt_fw_cfg_init() 30 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); in virt_fw_cfg_init() 32 qemu_register_boot_set(fw_cfg_boot_set, fw_cfg); in virt_fw_cfg_init() 33 return fw_cfg; in virt_fw_cfg_init()
|
/openbmc/qemu/hw/ppc/ |
H A D | mac_oldworld.c | 41 #include "hw/nvram/fw_cfg.h" 108 void *fw_cfg; in ppc_heathrow_init() local 309 fw_cfg = FW_CFG(dev); in ppc_heathrow_init() 312 object_property_add_child(OBJECT(machine), TYPE_FW_CFG, OBJECT(fw_cfg)); in ppc_heathrow_init() 318 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); in ppc_heathrow_init() 319 fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpus); in ppc_heathrow_init() 320 fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); in ppc_heathrow_init() 321 fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_HEATHROW); in ppc_heathrow_init() 322 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base); in ppc_heathrow_init() 323 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); in ppc_heathrow_init() [all …]
|
H A D | prep.c | 242 void *fw_cfg; in ibm_40p_init() local 344 fw_cfg = FW_CFG(dev); in ibm_40p_init() 348 OBJECT(fw_cfg)); in ibm_40p_init() 365 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base); in ibm_40p_init() 366 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); in ibm_40p_init() 378 fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, initrd_base); in ibm_40p_init() 379 fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); in ibm_40p_init() 382 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_CMDLINE, CMDLINE_ADDR); in ibm_40p_init() 385 fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, in ibm_40p_init() 387 fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, in ibm_40p_init() [all …]
|
H A D | mac_newworld.c | 63 #include "hw/nvram/fw_cfg.h" 152 void *fw_cfg; in ppc_core99_init() local 467 fw_cfg = FW_CFG(dev); in ppc_core99_init() 470 object_property_add_child(OBJECT(machine), TYPE_FW_CFG, OBJECT(fw_cfg)); in ppc_core99_init() 476 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); in ppc_core99_init() 477 fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpus); in ppc_core99_init() 478 fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); in ppc_core99_init() 479 fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, machine_arch); in ppc_core99_init() 480 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_base); in ppc_core99_init() 481 fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); in ppc_core99_init() [all …]
|
/openbmc/qemu/docs/specs/ |
H A D | fw_cfg.rst | 2 QEMU Firmware Configuration (fw_cfg) Device 37 As of QEMU v2.4, writes to the fw_cfg data register are no 100 The fw_cfg device is defined with ACPI ID ``QEMU0002``. Since we expect 101 ACPI tables to be passed into the guest through the fw_cfg device itself, 102 the guest-side firmware can not use ACPI to find fw_cfg. However, once the 104 guest kernel, the latter can use the fw_cfg ACPI node for a more accurate 113 The presence of the fw_cfg selector and data registers can be verified 115 and reading four bytes from the data register. If the fw_cfg device is 138 and retrieve them. The format of this file directory (from ``fw_cfg.h`` in 141 struct FWCfgFiles { /* the entire file directory fw_cfg item */ [all …]
|
/openbmc/linux/drivers/firmware/ |
H A D | qemu_fw_cfg.c | 6 * Expose entries from QEMU's firmware configuration (fw_cfg) device in 9 * The fw_cfg device may be instantiated via either an ACPI node (on x86 43 MODULE_DESCRIPTION("QEMU fw_cfg sysfs support"); 46 /* fw_cfg revision attribute, in /sys/firmware/qemu_fw_cfg top-level dir. */ 49 /* fw_cfg device i/o register addresses */ 58 /* atomic access to fw_cfg device (potentially slow i/o, so using mutex) */ 76 /* qemu fw_cfg device is sync today, but spec says it may become async */ 103 /* fw_cfg device does not need IOMMU protection, so use physical addresses */ in fw_cfg_dma_transfer() 130 /* read chunk of given fw_cfg blob (caller responsible for sanity-check) */ 160 /* write chunk of given fw_cfg blob (caller responsible for sanity-check) */ [all …]
|
/openbmc/qemu/hw/acpi/ |
H A D | vmgenid.c | 19 #include "hw/nvram/fw_cfg.h" 39 /* The GUID is written at a fixed offset into the fw_cfg file in vmgenid_build_acpi() 70 * upper halves * of the physical address of the fw_cfg blob in vmgenid_build_acpi() 95 /* Allocate guest memory for the Data fw_cfg blob */ in vmgenid_build_acpi() 99 /* Patch address of GUID fw_cfg blob into the ADDR fw_cfg blob in vmgenid_build_acpi() 110 /* Patch address of GUID fw_cfg blob into the AML so OSPM can retrieve in vmgenid_build_acpi() 125 /* Create a read-only fw_cfg file for GUID */ in vmgenid_add_fw_cfg() 128 /* Create a read-write fw_cfg file for Address */ in vmgenid_add_fw_cfg() 154 /* The GUID is written at a fixed offset into the fw_cfg file in vmgenid_update_guest() 199 error_setg(errp, "%s requires DMA write support in fw_cfg, " in vmgenid_realize()
|
/openbmc/qemu/hw/misc/ |
H A D | vmcoreinfo.c | 17 #include "hw/nvram/fw_cfg.h" 41 FWCfgState *fw_cfg = fw_cfg_find(); in vmcoreinfo_realize() local 54 if (!fw_cfg || !fw_cfg->dma_enabled) { in vmcoreinfo_realize() 55 error_setg(errp, "%s device requires fw_cfg with DMA", in vmcoreinfo_realize() 60 fw_cfg_add_file_callback(fw_cfg, FW_CFG_VMCOREINFO_FILENAME, in vmcoreinfo_realize()
|
/openbmc/linux/drivers/nfc/s3fwrn5/ |
H A D | nci.c | 52 struct nci_prop_fw_cfg_cmd fw_cfg; in s3fwrn5_nci_rf_configure() local 71 fw_cfg.clk_type = 0x01; in s3fwrn5_nci_rf_configure() 72 fw_cfg.clk_speed = 0xff; in s3fwrn5_nci_rf_configure() 73 fw_cfg.clk_req = 0xff; in s3fwrn5_nci_rf_configure() 75 sizeof(fw_cfg), (__u8 *)&fw_cfg); in s3fwrn5_nci_rf_configure()
|
/openbmc/linux/include/uapi/linux/ |
H A D | qemu_fw_cfg.h | 9 /* selector key values for "well-known" fw_cfg entries */ 46 /* width in bytes of fw_cfg control register */ 49 /* fw_cfg "file name" is up to 56 characters (including terminating nul) */ 52 /* size in bytes of fw_cfg signature */ 59 /* fw_cfg file directory entry type */
|
/openbmc/qemu/include/standard-headers/linux/ |
H A D | qemu_fw_cfg.h | 9 /* selector key values for "well-known" fw_cfg entries */ 46 /* width in bytes of fw_cfg control register */ 49 /* fw_cfg "file name" is up to 56 characters (including terminating nul) */ 52 /* size in bytes of fw_cfg signature */ 59 /* fw_cfg file directory entry type */
|
/openbmc/qemu/hw/hppa/ |
H A D | machine.c | 196 FWCfgState *fw_cfg; in create_fw_cfg() local 203 fw_cfg = fw_cfg_init_mem(addr, addr + 4); in create_fw_cfg() 204 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus); in create_fw_cfg() 205 fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS); in create_fw_cfg() 206 fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size); in create_fw_cfg() 209 fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version", in create_fw_cfg() 213 fw_cfg_add_file(fw_cfg, "/etc/cpu/tlb_entries", in create_fw_cfg() 217 fw_cfg_add_file(fw_cfg, "/etc/cpu/btlb_entries", in create_fw_cfg() 221 fw_cfg_add_file(fw_cfg, "/etc/hppa/machine", in create_fw_cfg() 225 fw_cfg_add_file(fw_cfg, "/etc/hppa/power-button-addr", in create_fw_cfg() [all …]
|
/openbmc/qemu/hw/display/ |
H A D | ramfb.c | 3 * configured using fw_cfg 140 FWCfgState *fw_cfg = fw_cfg_find(); in ramfb_setup() local 143 if (!fw_cfg || !fw_cfg->dma_enabled) { in ramfb_setup() 144 error_setg(errp, "ramfb device requires fw_cfg with DMA"); in ramfb_setup() 151 fw_cfg_add_file_callback(fw_cfg, "etc/ramfb", in ramfb_setup()
|
/openbmc/qemu/hw/sparc64/ |
H A D | sun4u.c | 52 #include "hw/nvram/fw_cfg.h" 569 FWCfgState *fw_cfg; in sun4uv_init() local 705 fw_cfg = FW_CFG(dev); in sun4uv_init() 706 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); in sun4uv_init() 707 fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpus); in sun4uv_init() 708 fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); in sun4uv_init() 709 fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id); in sun4uv_init() 710 fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_entry); in sun4uv_init() 711 fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size); in sun4uv_init() 713 fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, in sun4uv_init() [all …]
|
/openbmc/qemu/hw/nvram/ |
H A D | fw_cfg.c | 32 #include "hw/nvram/fw_cfg.h" 308 * of the big endian interpretation of the fw_cfg string. in fw_cfg_data_read() 558 FWCfgState *s = FW_CFG(d); in fw_cfg_reset() 658 .name = "fw_cfg/dma", 667 .name = "fw_cfg/acpi_mr", 681 .name = "fw_cfg", 836 * the fw_cfg in the order defined below, by the "order" value. Note 977 error_report("duplicate fw_cfg file name: %s", in fw_cfg_add_file_callback() 1113 FWCfgState *s = FW_CFG(dev); in fw_cfg_common_realize() 1162 s = FW_CFG(dev); in fw_cfg_init_io_dma() [all …]
|