Hi Tristan,
The following patch supports ACPI Serial Port Console
Redirection(SPCR) table, by which we can use Windows Special
Administration Console(SAC).
Thanks,
KAZ
Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
# HG changeset patch
# User Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
# Date 1206681923 -32400
# Node ID c5bbf82de136f80f67ce863ee3412e5de4f11e9f
# Parent 7097ce08e5befea698f130279ccdcd3e1e08545e
Supports ACPI Serial Port Console Redirection(SPCR) table, by which we
can use Windows Special Administration Console(SAC).
Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>
diff -r 7097ce08e5be -r c5bbf82de136 edk2-sparse/EdkXenPkg/Dxe/XenAcpi/acpi2_0.h
--- a/edk2-sparse/EdkXenPkg/Dxe/XenAcpi/acpi2_0.h Fri Mar 28 02:50:55
2008 +0100
+++ b/edk2-sparse/EdkXenPkg/Dxe/XenAcpi/acpi2_0.h Fri Mar 28 14:25:23
2008 +0900
@@ -263,6 +263,34 @@ struct acpi_20_hpet {
#define ACPI_HPET_ADDRESS 0xFED00000UL
/*
+ * SPCR - Serial Port Console Redirection table
+ */
+struct acpi_20_spcr {
+ struct acpi_header header; /* Common ACPI table header */
+ uint8_t interface_type; /* 0=full 16550, 1=subset of 16550 */
+ uint8_t reserved[3];
+ struct acpi_20_generic_address addr;
+ uint8_t interrupt_type;
+ uint8_t pc_interrupt;
+ uint32_t interrupt;
+ uint8_t baud_rate;
+ uint8_t parity;
+ uint8_t stop_bits;
+ uint8_t flow_control;
+ uint8_t terminal_type;
+ uint8_t reserved1;
+ uint16_t pci_device_id;
+ uint16_t pci_vendor_id;
+ uint8_t pci_bus;
+ uint8_t pci_device;
+ uint8_t pci_function;
+ uint32_t pci_flags;
+ uint8_t pci_segment;
+ uint32_t reserved2;
+};
+#define ACPI_SPCR_ADDRESS 0x000003F8UL
+
+/*
* Multiple APIC Flags.
*/
#define ACPI_PCAT_COMPAT (1 << 0)
@@ -351,6 +379,7 @@ struct acpi_20_madt_iosapic {
#define ACPI_2_0_XSDT_SIGNATURE ASCII32('X','S','D','T')
#define ACPI_2_0_TCPA_SIGNATURE ASCII32('T','C','P','A')
#define ACPI_2_0_HPET_SIGNATURE ASCII32('H','P','E','T')
+#define ACPI_2_0_SPCR_SIGNATURE ASCII32('S','P','C','R')
/*
* Table revision numbers.
@@ -362,6 +391,7 @@ struct acpi_20_madt_iosapic {
#define ACPI_2_0_XSDT_REVISION 0x01
#define ACPI_2_0_TCPA_REVISION 0x02
#define ACPI_2_0_HPET_REVISION 0x01
+#define ACPI_2_0_SPCR_REVISION 0x01
#pragma pack ()
diff -r 7097ce08e5be -r c5bbf82de136 edk2-sparse/EdkXenPkg/Dxe/XenAcpi/build.c
--- a/edk2-sparse/EdkXenPkg/Dxe/XenAcpi/build.c Fri Mar 28 02:50:55 2008 +0100
+++ b/edk2-sparse/EdkXenPkg/Dxe/XenAcpi/build.c Fri Mar 28 14:25:23 2008 +0900
@@ -187,11 +187,53 @@ int construct_hpet(struct acpi_20_hpet *
return offset;
}
+int construct_spcr(struct acpi_20_spcr *spcr)
+{
+ int offset;
+
+ memset(spcr, 0, sizeof(*spcr));
+ spcr->header.signature = ACPI_2_0_SPCR_SIGNATURE;
+ spcr->header.revision = ACPI_2_0_SPCR_REVISION;
+ strncpy(spcr->header.oem_id, ACPI_OEM_ID, 6);
+ strncpy(spcr->header.oem_table_id, ACPI_OEM_TABLE_ID, 8);
+ spcr->header.oem_revision = ACPI_OEM_REVISION;
+ spcr->header.creator_id = ACPI_CREATOR_ID;
+ spcr->header.creator_revision = ACPI_CREATOR_REVISION;
+ spcr->interface_type = 0;
+ spcr->addr.address_space_id = 1;
+ spcr->addr.register_bit_width = 8;
+ spcr->addr.register_bit_offset = 0;
+ spcr->addr.address = ACPI_SPCR_ADDRESS;;
+ spcr->interrupt_type = 5;
+ spcr->pc_interrupt = 4;
+ spcr->interrupt = 4;
+ spcr->baud_rate = 7;
+ spcr->parity = 0;
+ spcr->stop_bits = 1;
+ spcr->flow_control = 3;
+ spcr->terminal_type = 2;
+ spcr->pci_device_id = 0xffff;
+ spcr->pci_vendor_id = 0xffff;
+ spcr->pci_bus = 0;
+ spcr->pci_device = 0;
+ spcr->pci_function = 0;
+ spcr->pci_flags = 0;
+ spcr->pci_segment = 0;
+
+ offset = sizeof(*spcr);
+
+ spcr->header.length = offset;
+ set_checksum(spcr, offsetof(struct acpi_header, checksum), offset);
+
+ return offset;
+}
+
int construct_secondary_tables(uint8_t *buf, unsigned long *table_ptrs)
{
int offset = 0, nr_tables = 0;
struct acpi_20_madt *madt;
struct acpi_20_hpet *hpet;
+ struct acpi_20_spcr *spcr;
#if 0
struct acpi_20_tcpa *tcpa;
static const uint16_t tis_signature[] = {0x0001, 0x0001, 0x0001};
@@ -210,6 +252,11 @@ int construct_secondary_tables(uint8_t *
hpet = (struct acpi_20_hpet *)&buf[offset];
offset += construct_hpet(hpet);
table_ptrs[nr_tables++] = (unsigned long)hpet;
+
+ /* SPCR. */
+ spcr = (struct acpi_20_spcr *)&buf[offset];
+ offset += construct_spcr(spcr);
+ table_ptrs[nr_tables++] = (unsigned long)spcr;
#if 0
/* TPM TCPA and SSDT. */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|