aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware/hvmloader
diff options
context:
space:
mode:
authorPaul Durrant <paul.durrant@citrix.com>2011-11-18 13:32:50 +0000
committerPaul Durrant <paul.durrant@citrix.com>2011-11-18 13:32:50 +0000
commit95ad9f65c972a3439ae6d11243373be16f71cb94 (patch)
tree8771c5b7fcfde7bd8e824d9854308b3d7d92077b /tools/firmware/hvmloader
parent93073357470ec76aa1e07672934719d5542b24ad (diff)
downloadxen-95ad9f65c972a3439ae6d11243373be16f71cb94.tar.gz
xen-95ad9f65c972a3439ae6d11243373be16f71cb94.tar.bz2
xen-95ad9f65c972a3439ae6d11243373be16f71cb94.zip
hvmloader: Add configuration options to selectively disable S3 and S4 ACPI power states.
Introduce acpi_s3 and acpi_s4 configuration options (default=1). The S3 and S4 packages are moved into separate SSDTs and their inclusion is controlled by the new configuration options. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/firmware/hvmloader')
-rw-r--r--tools/firmware/hvmloader/acpi/Makefile4
-rw-r--r--tools/firmware/hvmloader/acpi/build.c22
-rw-r--r--tools/firmware/hvmloader/acpi/dsdt.asl19
-rw-r--r--tools/firmware/hvmloader/acpi/ssdt_s3.asl32
-rw-r--r--tools/firmware/hvmloader/acpi/ssdt_s4.asl32
5 files changed, 89 insertions, 20 deletions
diff --git a/tools/firmware/hvmloader/acpi/Makefile b/tools/firmware/hvmloader/acpi/Makefile
index c602b569a3..2c50851a64 100644
--- a/tools/firmware/hvmloader/acpi/Makefile
+++ b/tools/firmware/hvmloader/acpi/Makefile
@@ -26,7 +26,7 @@ CFLAGS += $(CFLAGS_xeninclude)
vpath iasl $(PATH)
all: acpi.a
-ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
+ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h: %.h: %.asl iasl
iasl -vs -p $* -tc $<
sed -e 's/AmlCode/$*/g' $*.hex >$@
rm -f $*.hex $*.aml
@@ -57,7 +57,7 @@ iasl:
@echo
@exit 1
-build.o: ssdt_pm.h ssdt_tpm.h
+build.o: ssdt_s3.h ssdt_s4.h ssdt_pm.h ssdt_tpm.h
acpi.a: $(OBJS)
$(AR) rc $@ $(OBJS)
diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c
index 02cdf14ad1..837e3442ea 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -17,6 +17,8 @@
*/
#include "acpi2_0.h"
+#include "ssdt_s3.h"
+#include "ssdt_s4.h"
#include "ssdt_tpm.h"
#include "ssdt_pm.h"
#include "../config.h"
@@ -235,6 +237,26 @@ static int construct_secondary_tables(unsigned long *table_ptrs,
table_ptrs[nr_tables++] = (unsigned long)ssdt;
}
+ if ( !strncmp(xenstore_read("platform/acpi_s3", "1"), "1", 1) )
+ {
+ ssdt = mem_alloc(sizeof(ssdt_s3), 16);
+ if (!ssdt) return -1;
+ memcpy(ssdt, ssdt_s3, sizeof(ssdt_s3));
+ table_ptrs[nr_tables++] = (unsigned long)ssdt;
+ } else {
+ printf("S3 disabled\n");
+ }
+
+ if ( !strncmp(xenstore_read("platform/acpi_s4", "1"), "1", 1) )
+ {
+ ssdt = mem_alloc(sizeof(ssdt_s4), 16);
+ if (!ssdt) return -1;
+ memcpy(ssdt, ssdt_s4, sizeof(ssdt_s4));
+ table_ptrs[nr_tables++] = (unsigned long)ssdt;
+ } else {
+ printf("S4 disabled\n");
+ }
+
/* TPM TCPA and SSDT. */
tis_hdr = (uint16_t *)0xFED40F00;
if ( (tis_hdr[0] == tis_signature[0]) &&
diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index 8ae90db2b1..d8a67b35f9 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -27,24 +27,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
Name (\APCL, 0x00010000)
Name (\PUID, 0x00)
- /*
- * S3 (suspend-to-ram), S4 (suspend-to-disc) and S5 (power-off) type codes:
- * must match piix4 emulation.
- */
- Name (\_S3, Package (0x04)
- {
- 0x01, /* PM1a_CNT.SLP_TYP */
- 0x01, /* PM1b_CNT.SLP_TYP */
- 0x0, /* reserved */
- 0x0 /* reserved */
- })
- Name (\_S4, Package (0x04)
- {
- 0x00, /* PM1a_CNT.SLP_TYP */
- 0x00, /* PM1b_CNT.SLP_TYP */
- 0x00, /* reserved */
- 0x00 /* reserved */
- })
+ /* _S3 and _S4 are in separate SSDTs */
Name (\_S5, Package (0x04)
{
0x00, /* PM1a_CNT.SLP_TYP */
diff --git a/tools/firmware/hvmloader/acpi/ssdt_s3.asl b/tools/firmware/hvmloader/acpi/ssdt_s3.asl
new file mode 100644
index 0000000000..dad1db5760
--- /dev/null
+++ b/tools/firmware/hvmloader/acpi/ssdt_s3.asl
@@ -0,0 +1,32 @@
+/*
+ * ssdt_s3.asl
+ *
+ * Copyright (c) 2011 Citrix Systems, Inc.
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+DefinitionBlock ("SSDT_S3.aml", "SSDT", 2, "Xen", "HVM", 0)
+{
+ /* Must match piix emulation */
+ Name (\_S3, Package (0x04)
+ {
+ 0x01, /* PM1a_CNT.SLP_TYP */
+ 0x01, /* PM1b_CNT.SLP_TYP */
+ 0x0, /* reserved */
+ 0x0 /* reserved */
+ })
+}
+
diff --git a/tools/firmware/hvmloader/acpi/ssdt_s4.asl b/tools/firmware/hvmloader/acpi/ssdt_s4.asl
new file mode 100644
index 0000000000..0a843816e1
--- /dev/null
+++ b/tools/firmware/hvmloader/acpi/ssdt_s4.asl
@@ -0,0 +1,32 @@
+/*
+ * ssdt_s4.asl
+ *
+ * Copyright (c) 2011 Citrix Systems, Inc.
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+DefinitionBlock ("SSDT_S4.aml", "SSDT", 2, "Xen", "HVM", 0)
+{
+ /* Must match piix emulation */
+ Name (\_S4, Package (0x04)
+ {
+ 0x00, /* PM1a_CNT.SLP_TYP */
+ 0x00, /* PM1b_CNT.SLP_TYP */
+ 0x00, /* reserved */
+ 0x00 /* reserved */
+ })
+}
+