John Looney has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32081
Change subject: Patch SSDTs into qemu, and add VPD area to the fmap for q35 as a proof of concept ......................................................................
Patch SSDTs into qemu, and add VPD area to the fmap for q35 as a proof of concept
Change-Id: I8c31fa79e13be237a752f47e72a6a7025fe9dffd --- M src/arch/x86/acpi.c M src/mainboard/emulation/qemu-i440fx/fw_cfg.c M src/mainboard/emulation/qemu-i440fx/fw_cfg.h M src/mainboard/emulation/qemu-q35/Kconfig 4 files changed, 21 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/32081/1
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c index f08a401..7bbbd2f 100644 --- a/src/arch/x86/acpi.c +++ b/src/arch/x86/acpi.c @@ -38,7 +38,6 @@ */
#include <console/console.h> -#include <string.h> #include <arch/acpi.h> #include <arch/acpi_ivrs.h> #include <arch/acpigen.h> diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c index 3acb11e..2c5124b 100644 --- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.c +++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.c @@ -225,6 +225,8 @@ BiosLinkerLoaderEntry *s; unsigned long *addrs, current; uint8_t *ptr; + acpi_rsdp_t *rsdp = NULL; + acpi_header_t *ssdt; int i, j, src, dst, max;
if (fw_cfg_check_file(&f, "etc/table-loader")) @@ -251,6 +253,10 @@
printk(BIOS_DEBUG, "QEMU: loading "%s" to 0x%lx (len %d)\n", s[i].alloc.file, current, f.size); + if(!strncmp(s[i].alloc.file, "etc/acpi/rsdp", 13)) { + printk(BIOS_DEBUG, "Found RSDP at 0x%lx\n", current); + rsdp = (acpi_rsdp_t *) current; + } fw_cfg_get(f.select, (void *)current, f.size); addrs[i] = current; current += f.size; @@ -322,6 +328,16 @@ }; }
+ if(rsdp) { + ssdt = (acpi_header_t *)current; + acpi_create_ssdt_generator(ssdt, ACPI_TABLE_CREATOR); + if (ssdt->length > sizeof(acpi_header_t)) { + current += ssdt->length; + acpi_add_table(rsdp, ssdt); + current = acpi_align_current(current); + } + } + printk(BIOS_DEBUG, "QEMU: loaded ACPI tables from fw_cfg.\n"); free(s); free(addrs); diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.h b/src/mainboard/emulation/qemu-i440fx/fw_cfg.h index 975801b..070d61d 100644 --- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.h +++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.h @@ -14,6 +14,7 @@ #define FW_CFG_H #include "fw_cfg_if.h"
+int is_rsdp(char *); void fw_cfg_get(uint16_t entry, void *dst, int dstlen); int fw_cfg_check_file(FWCfgFile *file, const char *name); int fw_cfg_max_cpus(void); diff --git a/src/mainboard/emulation/qemu-q35/Kconfig b/src/mainboard/emulation/qemu-q35/Kconfig index 815b93b..0672092 100644 --- a/src/mainboard/emulation/qemu-q35/Kconfig +++ b/src/mainboard/emulation/qemu-q35/Kconfig @@ -54,4 +54,8 @@ hex default 0x4000
+config FMDFILE + string + default "src/mainboard/$(CONFIG_MAINBOARD_DIR)/board.fmd" + endif # BOARD_EMULATION_QEMU_X86_Q35
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32081 )
Change subject: Patch SSDTs into qemu, and add VPD area to the fmap for q35 as a proof of concept ......................................................................
Patch Set 1:
(21 comments)
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... File src/mainboard/emulation/qemu-i440fx/fw_cfg.h:
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 17: int is_rsdp(char *); function definition argument 'char *' should also have an identifier name
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... File src/mainboard/emulation/qemu-i440fx/fw_cfg.c:
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 256: if(!strncmp(s[i].alloc.file, "etc/acpi/rsdp", 13)) { space required before the open parenthesis '('
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 257: printk(BIOS_DEBUG, "Found RSDP at 0x%lx\n", current); line over 80 characters
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 331: if(rsdp) { please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 331: if(rsdp) { space required before the open parenthesis '('
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 332: ssdt = (acpi_header_t *)current; code indent should use tabs where possible
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 332: ssdt = (acpi_header_t *)current; please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 333: acpi_create_ssdt_generator(ssdt, ACPI_TABLE_CREATOR); code indent should use tabs where possible
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 333: acpi_create_ssdt_generator(ssdt, ACPI_TABLE_CREATOR); please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 334: if (ssdt->length > sizeof(acpi_header_t)) { code indent should use tabs where possible
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 334: if (ssdt->length > sizeof(acpi_header_t)) { please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 334: if (ssdt->length > sizeof(acpi_header_t)) { suspect code indent for conditional statements (8, 12)
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 335: current += ssdt->length; code indent should use tabs where possible
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 335: current += ssdt->length; please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 336: acpi_add_table(rsdp, ssdt); code indent should use tabs where possible
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 336: acpi_add_table(rsdp, ssdt); please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 337: current = acpi_align_current(current); code indent should use tabs where possible
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 337: current = acpi_align_current(current); please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 338: } code indent should use tabs where possible
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 338: } please, no spaces at the start of a line
https://review.coreboot.org/#/c/32081/1/src/mainboard/emulation/qemu-i440fx/... PS1, Line 339: } please, no spaces at the start of a line
John Looney has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/32081 )
Change subject: Patch SSDTs into qemu, and add VPD area to the fmap for q35 as a proof of concept ......................................................................
Abandoned
I messed up commit-id - this is commit #32087