From patchwork Sun Feb 28 22:12:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: generic ssdt rules Date: Sun, 28 Feb 2010 22:12:29 -0000 From: Patrick Georgi X-Patchwork-Id: 995 Message-Id: <4B8AEA4D.1090800@georgi-clan.de> To: coreboot@coreboot.org Hi, attached patch unifies the ACPI_SSDTX_NUM handling. - define meaning for ACPI_SSDTX_NUM: highest ssdtX.asl to build - add rules that build either 4 or 5 ssdts (which is what exists in the tree now) - change ACPI_SSDTX_NUM to either 4 or 5 for boards that have ssdtX.asl files, according to the ssdtX.asl in there. - remove custom ssdt rules I checked the tree and didn't find any occurrence where the value of ACPI_SSDTX_NUM was used for something else than a test for >= 1, so changing the values (within this constraint) won't affect behaviour. No idea what "31" was supposed to be good for, but it definitely doesn't affect the build. There is no simple way to do "greater than" tests in gnu make that I found. One solution would be some recursive macro that adds ssdtX rules for x down to 2 (ssdt1 doesn't exist by convention), which seems to require building mathematical functions first, etc. That seemed to be overkill for the three uses of the variable (which isn't even globally defined) Signed-off-by: Patrick Georgi Acked-by: Peter Stuge Index: src/mainboard/iwill/dk8_htx/Kconfig =================================================================== --- src/mainboard/iwill/dk8_htx/Kconfig (revision 5174) +++ src/mainboard/iwill/dk8_htx/Kconfig (working copy) @@ -122,5 +122,5 @@ config ACPI_SSDTX_NUM int - default 3 + default 5 depends on BOARD_IWILL_DK8_HTX Index: src/mainboard/iwill/dk8_htx/Makefile.inc =================================================================== --- src/mainboard/iwill/dk8_htx/Makefile.inc (revision 5174) +++ src/mainboard/iwill/dk8_htx/Makefile.inc (working copy) @@ -1,24 +0,0 @@ -## -## This file is part of the coreboot project. -## -## Copyright (C) 2007-2008 coresystems GmbH -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; version 2 of the License. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -## - -# Needed by irq_tables and mptable and acpi_tables. -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt2.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt3.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt4.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt5.o Index: src/mainboard/amd/serengeti_cheetah/Kconfig =================================================================== --- src/mainboard/amd/serengeti_cheetah/Kconfig (revision 5174) +++ src/mainboard/amd/serengeti_cheetah/Kconfig (working copy) @@ -128,5 +128,5 @@ config ACPI_SSDTX_NUM int - default 1 + default 4 depends on BOARD_AMD_SERENGETI_CHEETAH Index: src/mainboard/amd/serengeti_cheetah/Makefile.inc =================================================================== --- src/mainboard/amd/serengeti_cheetah/Makefile.inc (revision 5174) +++ src/mainboard/amd/serengeti_cheetah/Makefile.inc (working copy) @@ -17,9 +17,4 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# Needed by irq_tables and mptable and acpi_tables. -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt2.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt3.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt4.o - obj-y += ../../../drivers/i2c/i2cmux/i2cmux.o Index: src/mainboard/amd/serengeti_cheetah_fam10/Kconfig =================================================================== --- src/mainboard/amd/serengeti_cheetah_fam10/Kconfig (revision 5174) +++ src/mainboard/amd/serengeti_cheetah_fam10/Kconfig (working copy) @@ -116,7 +116,7 @@ config ACPI_SSDTX_NUM int - default 31 + default 5 depends on BOARD_AMD_SERENGETI_CHEETAH_FAM10 config MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID Index: src/mainboard/amd/serengeti_cheetah_fam10/Makefile.inc =================================================================== --- src/mainboard/amd/serengeti_cheetah_fam10/Makefile.inc (revision 5174) +++ src/mainboard/amd/serengeti_cheetah_fam10/Makefile.inc (working copy) @@ -17,12 +17,4 @@ ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## -# Needed by irq_tables and mptable and acpi_tables. - -# ./ssdt.o is in northbridge/amd/amdfam10/Makefile.inc -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt2.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt3.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt4.o -obj-$(CONFIG_GENERATE_ACPI_TABLES) += ssdt5.o - obj-y += ../../../drivers/i2c/i2cmux2/i2cmux2.o Index: src/mainboard/tyan/s2912/Kconfig =================================================================== --- src/mainboard/tyan/s2912/Kconfig (revision 5174) +++ src/mainboard/tyan/s2912/Kconfig (working copy) @@ -140,8 +140,3 @@ int default 11 depends on BOARD_TYAN_S2912 - -config ACPI_SSDTX_NUM - int - default 3 - depends on BOARD_TYAN_S2912 Index: src/mainboard/tyan/s2912_fam10/Kconfig =================================================================== --- src/mainboard/tyan/s2912_fam10/Kconfig (revision 5174) +++ src/mainboard/tyan/s2912_fam10/Kconfig (working copy) @@ -153,11 +153,6 @@ default n depends on BOARD_TYAN_S2912_FAM10 -config ACPI_SSDTX_NUM - int - default 31 - depends on BOARD_TYAN_S2912_FAM10 - config RAMBASE hex default 0x200000 Index: src/arch/i386/Makefile.inc =================================================================== --- src/arch/i386/Makefile.inc (revision 5175) +++ src/arch/i386/Makefile.inc (working copy) @@ -202,6 +202,15 @@ ifeq ($(CONFIG_GENERATE_ACPI_TABLES),y) objs += $(obj)/mainboard/$(MAINBOARDDIR)/acpi_tables.o objs += $(obj)/mainboard/$(MAINBOARDDIR)/dsdt.o +# make doesn't have arithmetic operators or greater-than comparisons +ifeq ($(subst 5,4,$(CONFIG_ACPI_SSDTX_NUM)),4) +objs += $(obj)/mainboard/$(MAINBOARDDIR)/ssdt2.o +objs += $(obj)/mainboard/$(MAINBOARDDIR)/ssdt3.o +objs += $(obj)/mainboard/$(MAINBOARDDIR)/ssdt4.o +endif +ifeq ($(CONFIG_ACPI_SSDTX_NUM),5) +objs += $(obj)/mainboard/$(MAINBOARDDIR)/ssdt5.o +endif ifeq ($(CONFIG_BOARD_HAS_FADT),y) objs += $(obj)/mainboard/$(MAINBOARDDIR)/fadt.o endif