Makefile.inc: Ignore IASL empty resource template warnings

As I mention in the comment, this is valid ASL, which was added as
a warning with the comment "This would appear to be worthless in
real-world ASL code."  While code using empty resource templates
could probably be rewritten, this seems like an arbitrary choice
to generate this as a warning, since it's valid.

This gets rid of warnings such as this one:
dsdt.aml   2975:    Return (ResourceTemplate() {})
Warning  3150 - Empty Resource Template (END_TAG only)

Which is generated by this code in google/rambi/acpi/mainboard.asl:
Method (_CRS)
{
  /* Only return interrupt if I2C1 is PCI mode */
  If (LEqual (\S1EN, 0)) {
    Return (^RBUF)
  }
  /* Return empty resource template otherwise */
  Return (ResourceTemplate() {})
}

Change-Id: I9cfe9069c738a284aa85feada9d58e1aee97e433
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/26352
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Martin Roth 2018-05-17 10:18:01 -06:00
parent e8604b8da6
commit 3abdeb0af0
1 changed files with 10 additions and 1 deletions

View File

@ -241,6 +241,15 @@ endef
# Add handler to compile ACPI's ASL
# arg1: base file name
# arg2: y or n for including in cbfs. defaults to y
# Empty resource templates were marked as a warning in IASL with the comment
# "This would appear to be worthless in real-world ASL code.", which is
# possibly true in many cases. In other cases it seems that an empty
# ResourceTemplate is the correct code.
# As it's valid ASL, disable the warning.
EMPTY_RESOURCE_TEMPLATE_WARNING = 3150
IGNORED_IASL_WARNINGS = -vw $(EMPTY_RESOURCE_TEMPLATE_WARNING)
define asl_template
$(CONFIG_CBFS_PREFIX)/$(1).aml-file = $(obj)/$(1).aml
$(CONFIG_CBFS_PREFIX)/$(1).aml-type = raw
@ -250,7 +259,7 @@ cbfs-files-$(if $(2),$(2),y) += $(CONFIG_CBFS_PREFIX)/$(1).aml
$(obj)/$(1).aml: $(src)/mainboard/$(MAINBOARDDIR)/$(1).asl $(obj)/config.h
@printf " IASL $$(subst $(top)/,,$$(@))\n"
$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) $$(CPPFLAGS_ramstage) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-ramstage-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$@
cd $$(dir $$@); $(IASL) -we -p $$(notdir $$@) $$(notdir $$@)
cd $$(dir $$@); $(IASL) $(IGNORED_IASL_WARNINGS) -we -p $$(notdir $$@) $$(notdir $$@)
if [ -z "$$$$($(IASL) -d $$@ 2>&1 | grep 'ACPI Warning')" ]; then echo " IASL $$@ disassembled correctly."; true; else echo "Error: Could not correctly disassemble $$@"; $(IASL) -d $$@; false; fi
endef