-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carl-Daniel Hailfinger wrote:
> Add QWord support to acpigen.
> 
> Add TOM2 to the K8 DSDT.
> 
> Signed-off-by: Carl-Daniel Hailfinger <[email protected]>
> 
> Compile tested only.

Hi, thanks for doing this. However there are two issues.

1) the opcode is 0xe and not 0xd
2) the << 32 must be cast to unit64_t first.

I'm attaching patch here. It works otherwise!

Rudolf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmZ8k8ACgkQ3J9wPJqZRNUbtQCguWFybWRu5NoGZtXY02mpPghE
SqwAnAkGb1IVX6STwU3z/TNr2CaMG7Of
=azgs
-----END PGP SIGNATURE-----
Index: coreboot-v2/src/northbridge/amd/amdk8/amdk8_acpi.c
===================================================================
--- coreboot-v2.orig/src/northbridge/amd/amdk8/amdk8_acpi.c	2009-02-14 13:07:16.176883367 +0100
+++ coreboot-v2/src/northbridge/amd/amdk8/amdk8_acpi.c	2009-02-16 23:56:49.804682464 +0100
@@ -302,6 +302,8 @@
 	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
Index: coreboot-v2/src/arch/i386/boot/acpigen.c
===================================================================
--- coreboot-v2.orig/src/arch/i386/boot/acpigen.c	2009-02-14 14:09:30.964883906 +0100
+++ coreboot-v2/src/arch/i386/boot/acpigen.c	2009-02-16 23:47:34.172886068 +0100
@@ -97,6 +97,21 @@
 	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 @@
 	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++) {
Index: coreboot-v2/src/arch/i386/include/arch/acpigen.h
===================================================================
--- coreboot-v2.orig/src/arch/i386/include/arch/acpigen.h	2009-02-14 13:10:03.225880015 +0100
+++ coreboot-v2/src/arch/i386/include/arch/acpigen.h	2009-02-16 23:22:01.174225628 +0100
@@ -30,8 +30,10 @@
 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);

Attachment: from_carldani.patch.sig
Description: Binary data

--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to