summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/boot/acpigen.c22
-rw-r--r--src/arch/i386/include/arch/acpigen.h2
-rw-r--r--src/northbridge/amd/amdk8/amdk8_acpi.c2
3 files changed, 26 insertions, 0 deletions
diff --git a/src/arch/i386/boot/acpigen.c b/src/arch/i386/boot/acpigen.c
index 6342a69572..53bf6d0841 100644
--- a/src/arch/i386/boot/acpigen.c
+++ b/src/arch/i386/boot/acpigen.c
@@ -97,6 +97,21 @@ int acpigen_write_dword(unsigned int data)
return 5;
}
+int acpigen_write_qword(uint64_t data)
+{
+ /* qword op */
+ acpigen_emit_byte(0xe);
+ acpigen_emit_byte(data & 0xff);
+ acpigen_emit_byte((data >> 8) & 0xff);
+ acpigen_emit_byte((data >> 16) & 0xff);
+ acpigen_emit_byte((data >> 24) & 0xff);
+ acpigen_emit_byte((data >> 32) & 0xff);
+ acpigen_emit_byte((data >> 40) & 0xff);
+ acpigen_emit_byte((data >> 48) & 0xff);
+ acpigen_emit_byte((data >> 56) & 0xff);
+ return 9;
+}
+
int acpigen_write_name_byte(char *name, uint8_t val) {
int len;
len = acpigen_write_name(name);
@@ -111,6 +126,13 @@ int acpigen_write_name_dword(char *name, uint32_t val) {
return len;
}
+int acpigen_write_name_qword(char *name, uint64_t val) {
+ int len;
+ len = acpigen_write_name(name);
+ len += acpigen_write_qword(val);
+ return len;
+}
+
int acpigen_emit_stream(char *data, int size) {
int i;
for (i = 0; i < size; i++) {
diff --git a/src/arch/i386/include/arch/acpigen.h b/src/arch/i386/include/arch/acpigen.h
index e024f67d64..074f6415bb 100644
--- a/src/arch/i386/include/arch/acpigen.h
+++ b/src/arch/i386/include/arch/acpigen.h
@@ -30,8 +30,10 @@ int acpigen_write_byte(unsigned int data);
int acpigen_emit_byte(unsigned char data);
int acpigen_emit_stream(char *data, int size);
int acpigen_write_dword(unsigned int data);
+int acpigen_write_qword(uint64_t data);
int acpigen_write_name(char *name);
int acpigen_write_name_dword(char *name, uint32_t val);
+int acpigen_write_name_qword(char *name, uint64_t val);
int acpigen_write_name_byte(char *name, uint8_t val);
int acpigen_write_scope(char *name);
int acpigen_write_PPC(u8 nr);
diff --git a/src/northbridge/amd/amdk8/amdk8_acpi.c b/src/northbridge/amd/amdk8/amdk8_acpi.c
index 2d56a4f605..ca71c379d7 100644
--- a/src/northbridge/amd/amdk8/amdk8_acpi.c
+++ b/src/northbridge/amd/amdk8/amdk8_acpi.c
@@ -302,6 +302,8 @@ int k8acpi_write_vars(void)
lens += acpigen_write_name_dword("SBDN", sysconf.sbdn);
msr = rdmsr(TOP_MEM);
lens += acpigen_write_name_dword("TOM1", msr.lo);
+ msr = rdmsr(TOP_MEM2);
+ lens += acpigen_write_name_qword("TOM2", (((uint64_t) msr.hi) << 32) | msr.lo);
lens += k8acpi_write_HT();
//minus opcode