Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10637
-gerrit
commit 76d63478c1c0bf7d73767c7cb637c5256eb88649 Author: Patrick Georgi pgeorgi@chromium.org Date: Mon Jun 22 21:10:34 2015 +0200
acpi: bring back ability to link DSDT into ramstage
Bring back the ability to link in the DSDT. This is to help Chrome OS to switch over to a new upstream quickly (because some of the custom built mechanisms are a pain with tons of files).
This is supposed to be temporary (famous last words), but I'd rather fix the lack of CBFS awareness in CrOS bit for good in the time I usually spend on keeping upstream and CrOS branches close.
Change-Id: I7fa5540bbf5c568c4adca56a09c83b6c7e358ad5 Signed-off-by: Patrick Georgi pgeorgi@chromium.org --- src/arch/x86/Kconfig | 4 ++++ src/arch/x86/Makefile.inc | 17 +++++++++++++++++ src/arch/x86/boot/acpi.c | 7 +++++++ 3 files changed, 28 insertions(+)
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 1e35846..88b2592 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -134,3 +134,7 @@ config HPET_ADDRESS config ID_SECTION_OFFSET hex default 0x80 + +config COMPILE_IN_DSDT + bool "compile in DSDT and use that over DSDT in CBFS" + default n diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index 4c00162..68c5ac4 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -245,6 +245,23 @@ endif # CONFIG_ARCH_ROMSTAGE_X86_32 / CONFIG_ARCH_ROMSTAGE_X86_64
ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y)
+ifeq ($(CONFIG_COMPILE_IN_DSDT),y) +ramstage-srcs += $(obj)/dsdt.aml + +ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) +target-objcopy=-O elf32-i386 -B i386 +endif +ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_64),y) +target-objcopy=-O elf64-x86_64 -B x86_64 +endif + +define ramstage-objs_aml_template +$(call src-to-obj,ramstage,$(1).aml): $(1).aml + @printf " OBJCOPY $$(subst $$(obj)/,,$$(@))\n" + cd $$(dir $$@) && $$(OBJCOPY_ramstage) -I binary $$(target-objcopy) $$(notdir $$<) $$(notdir $$@) +endef +endif + ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) ifeq ($(CONFIG_GENERATE_MP_TABLE),y) ifneq ($(wildcard src/mainboard/$(MAINBOARDDIR)/mptable.c),) diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c index 208411e..cf33e40 100644 --- a/src/arch/x86/boot/acpi.c +++ b/src/arch/x86/boot/acpi.c @@ -757,9 +757,16 @@ unsigned long write_acpi_tables(unsigned long start) if (fw) return fw;
+#if CONFIG_COMPILE_IN_DSDT + extern char _binary_dsdt_aml_start; + extern char _binary_dsdt_aml_end; + dsdt_file = (acpi_header_t *)&_binary_dsdt_aml_start; + dsdt_size = (size_t)(&_binary_dsdt_aml_end - &_binary_dsdt_aml_start); +#else dsdt_file = cbfs_boot_map_with_leak( CONFIG_CBFS_PREFIX "/dsdt.aml", CBFS_TYPE_RAW, &dsdt_size); +#endif if (!dsdt_file) { printk(BIOS_ERR, "No DSDT file, skipping ACPI tables\n"); return current;