summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/pi
diff options
context:
space:
mode:
Diffstat (limited to 'src/northbridge/amd/pi')
-rw-r--r--src/northbridge/amd/pi/00630F01/northbridge.c16
-rw-r--r--src/northbridge/amd/pi/00660F01/northbridge.c16
-rw-r--r--src/northbridge/amd/pi/00730F01/northbridge.c16
3 files changed, 48 insertions, 0 deletions
diff --git a/src/northbridge/amd/pi/00630F01/northbridge.c b/src/northbridge/amd/pi/00630F01/northbridge.c
index 28502b0017..e90848a36b 100644
--- a/src/northbridge/amd/pi/00630F01/northbridge.c
+++ b/src/northbridge/amd/pi/00630F01/northbridge.c
@@ -447,6 +447,21 @@ static void northbridge_fill_ssdt_generator(struct device *device)
acpigen_pop_len();
}
+static void patch_ssdt_processor_scope(acpi_header_t *ssdt)
+{
+ unsigned int len = ssdt->length - sizeof(acpi_header_t);
+ unsigned int i;
+
+ for (i = sizeof(acpi_header_t); i < len; i++) {
+ /* Search for _PR_ scope and replace it with _SB_ */
+ if (*(uint32_t *)((unsigned long)ssdt + i) == 0x5f52505f)
+ *(uint32_t *)((unsigned long)ssdt + i) = 0x5f42535f;
+ }
+ /* Recalculate checksum */
+ ssdt->checksum = 0;
+ ssdt->checksum = acpi_checksum((void *)ssdt, ssdt->length);
+}
+
static unsigned long agesa_write_acpi_tables(struct device *device,
unsigned long current,
acpi_rsdp_t *rsdp)
@@ -521,6 +536,7 @@ static unsigned long agesa_write_acpi_tables(struct device *device,
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr (PICK_PSTATE);
if (ssdt != NULL) {
+ patch_ssdt_processor_scope(ssdt);
memcpy((void *)current, ssdt, ssdt->length);
ssdt = (acpi_header_t *) current;
current += ssdt->length;
diff --git a/src/northbridge/amd/pi/00660F01/northbridge.c b/src/northbridge/amd/pi/00660F01/northbridge.c
index 0a1b0ba1a4..200508617c 100644
--- a/src/northbridge/amd/pi/00660F01/northbridge.c
+++ b/src/northbridge/amd/pi/00660F01/northbridge.c
@@ -435,6 +435,21 @@ static void northbridge_fill_ssdt_generator(struct device *device)
acpigen_pop_len();
}
+static void patch_ssdt_processor_scope(acpi_header_t *ssdt)
+{
+ unsigned int len = ssdt->length - sizeof(acpi_header_t);
+ unsigned int i;
+
+ for (i = sizeof(acpi_header_t); i < len; i++) {
+ /* Search for _PR_ scope and replace it with _SB_ */
+ if (*(uint32_t *)((unsigned long)ssdt + i) == 0x5f52505f)
+ *(uint32_t *)((unsigned long)ssdt + i) = 0x5f42535f;
+ }
+ /* Recalculate checksum */
+ ssdt->checksum = 0;
+ ssdt->checksum = acpi_checksum((void *)ssdt, ssdt->length);
+}
+
static unsigned long agesa_write_acpi_tables(struct device *device,
unsigned long current,
acpi_rsdp_t *rsdp)
@@ -511,6 +526,7 @@ static unsigned long agesa_write_acpi_tables(struct device *device,
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr (PICK_PSTATE);
if (ssdt != NULL) {
+ patch_ssdt_processor_scope(ssdt);
memcpy((void *)current, ssdt, ssdt->length);
ssdt = (acpi_header_t *) current;
current += ssdt->length;
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index c87d8fffba..f611bd6e3e 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -671,6 +671,21 @@ static void northbridge_fill_ssdt_generator(struct device *device)
acpigen_pop_len();
}
+static void patch_ssdt_processor_scope(acpi_header_t *ssdt)
+{
+ unsigned int len = ssdt->length - sizeof(acpi_header_t);
+ unsigned int i;
+
+ for (i = sizeof(acpi_header_t); i < len; i++) {
+ /* Search for _PR_ scope and replace it with _SB_ */
+ if (*(uint32_t *)((unsigned long)ssdt + i) == 0x5f52505f)
+ *(uint32_t *)((unsigned long)ssdt + i) = 0x5f42535f;
+ }
+ /* Recalculate checksum */
+ ssdt->checksum = 0;
+ ssdt->checksum = acpi_checksum((void *)ssdt, ssdt->length);
+}
+
static unsigned long agesa_write_acpi_tables(struct device *device,
unsigned long current,
acpi_rsdp_t *rsdp)
@@ -741,6 +756,7 @@ static unsigned long agesa_write_acpi_tables(struct device *device,
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)agesawrapper_getlateinitptr (PICK_PSTATE);
if (ssdt != NULL) {
+ patch_ssdt_processor_scope(ssdt);
memcpy((void *)current, ssdt, ssdt->length);
ssdt = (acpi_header_t *) current;
current += ssdt->length;