WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH V3 1/6] firmware, Change ACPI IO addresses and values

To: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH V3 1/6] firmware, Change ACPI IO addresses and values to match QEMU BIOS.
From: anthony.perard@xxxxxxxxxx
Date: Fri, 29 Oct 2010 13:08:34 +0100
Cc: anthony.perard@xxxxxxxxxx
Delivery-date: Fri, 29 Oct 2010 05:11:29 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1288354119-1916-1-git-send-email-anthony.perard@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1288354119-1916-1-git-send-email-anthony.perard@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Anthony PERARD <anthony.perard@xxxxxxxxxx>

As part of the QEMU/Xen merge, this patch comes to change the IO Port
adresses, the value of sleep states and add some information in the PCI
registers to match the implementation of the BIOS of QEMU.

This patch must be applied at the same time with an other patch for the
piix4acpi of qemu-xen.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/firmware/hvmloader/acpi/dsdt.asl |   12 ++++++------
 tools/firmware/hvmloader/hvmloader.c   |    4 ++++
 xen/include/public/hvm/ioreq.h         |   16 +++++++++++++---
 3 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl 
b/tools/firmware/hvmloader/acpi/dsdt.asl
index 03799d3..ea8e324 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -33,22 +33,22 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
      */
     Name (\_S3, Package (0x04)
     {
-        0x05,  /* PM1a_CNT.SLP_TYP */
-        0x05,  /* PM1b_CNT.SLP_TYP */
+        0x01,  /* PM1a_CNT.SLP_TYP */
+        0x01,  /* PM1b_CNT.SLP_TYP */
         0x0,   /* reserved */
         0x0    /* reserved */
     })
     Name (\_S4, Package (0x04)
     {
-        0x06,  /* PM1a_CNT.SLP_TYP */
-        0x06,  /* PM1b_CNT.SLP_TYP */
+        0x00,  /* PM1a_CNT.SLP_TYP */
+        0x00,  /* PM1b_CNT.SLP_TYP */
         0x00,  /* reserved */
         0x00   /* reserved */
     })
     Name (\_S5, Package (0x04)
     {
-        0x07,  /* PM1a_CNT.SLP_TYP */
-        0x07,  /* PM1b_CNT.SLP_TYP */
+        0x00,  /* PM1a_CNT.SLP_TYP */
+        0x00,  /* PM1b_CNT.SLP_TYP */
         0x00,  /* reserved */
         0x00   /* reserved */
     })
diff --git a/tools/firmware/hvmloader/hvmloader.c 
b/tools/firmware/hvmloader/hvmloader.c
index c4c5ddc..cfe026f 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -31,6 +31,7 @@
 #include "option_rom.h"
 #include <xen/version.h>
 #include <xen/hvm/params.h>
+#include <xen/hvm/ioreq.h>
 #include <xen/memory.h>
 
 asm (
@@ -222,9 +223,12 @@ static void pci_setup(void)
             /* PIIX4 ACPI PM. Special device with special PCI config space. */
             ASSERT((vendor_id == 0x8086) && (device_id == 0x7113));
             pci_writew(devfn, 0x20, 0x0000); /* No smb bus IO enable */
+            pci_writew(devfn, 0xd2, 0x0000); /* No smb bus IO enable */
             pci_writew(devfn, 0x22, 0x0000);
             pci_writew(devfn, 0x3c, 0x0009); /* Hardcoded IRQ9 */
             pci_writew(devfn, 0x3d, 0x0001);
+            pci_writel(devfn, 0x40, ACPI_PM1A_EVT_BLK_ADDRESS | 1);
+            pci_writeb(devfn, 0x80, 0x01); /* enable PM io space */
             break;
         case 0x0101:
             if ( vendor_id == 0x8086 )
diff --git a/xen/include/public/hvm/ioreq.h b/xen/include/public/hvm/ioreq.h
index 0c10c08..8c11767 100644
--- a/xen/include/public/hvm/ioreq.h
+++ b/xen/include/public/hvm/ioreq.h
@@ -100,11 +100,21 @@ struct buffered_piopage {
 };
 #endif /* defined(__ia64__) */
 
-#define ACPI_PM1A_EVT_BLK_ADDRESS           0x0000000000001f40
+/*
+ * Value used by old qemu-dm, there have been replace to match
+ * the QEMU BIOS.
+ */
+#define ACPI_PM1A_EVT_BLK_ADDRESS_OLD       0x0000000000001f40
+#define ACPI_PM1A_CNT_BLK_ADDRESS_OLD       (ACPI_PM1A_EVT_BLK_ADDRESS_OLD + 
0x04)
+#define ACPI_PM_TMR_BLK_ADDRESS_OLD         (ACPI_PM1A_EVT_BLK_ADDRESS_OLD + 
0x08)
+#define ACPI_GPE0_BLK_ADDRESS_OLD           (ACPI_PM_TMR_BLK_ADDRESS_OLD + 
0x20)
+#define ACPI_GPE0_BLK_LEN_OLD               0x08
+
+#define ACPI_PM1A_EVT_BLK_ADDRESS           0x000000000000b000
 #define ACPI_PM1A_CNT_BLK_ADDRESS           (ACPI_PM1A_EVT_BLK_ADDRESS + 0x04)
 #define ACPI_PM_TMR_BLK_ADDRESS             (ACPI_PM1A_EVT_BLK_ADDRESS + 0x08)
-#define ACPI_GPE0_BLK_ADDRESS               (ACPI_PM_TMR_BLK_ADDRESS + 0x20)
-#define ACPI_GPE0_BLK_LEN                   0x08
+#define ACPI_GPE0_BLK_ADDRESS               (0x000000000000afe0)
+#define ACPI_GPE0_BLK_LEN                   0x04
 
 #endif /* _IOREQ_H_ */
 
-- 
1.7.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel