diff options
author | Lin Ming <ming.m.lin@intel.com> | 2010-03-31 23:14:12 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-04-20 10:43:16 -0400 |
commit | 69ec87efa815d69140423014bb5f91e034faac22 (patch) | |
tree | 4619ef009c68e1061c41e6081b7967da67974970 /drivers/acpi | |
parent | 729df0f848daf2f17d02107199fa92efe909d995 (diff) |
ACPICA: Add subsystem option to force copy of DSDT to local memory
Optionally copy the entire DSDT to local memory (instead of
simply mapping it.) There are some BIOSs that corrupt or replace
the original DSDT, creating the need for this option. Default is
FALSE, do not copy the DSDT.
https://bugzilla.kernel.org/show_bug.cgi?id=14679
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/acglobal.h | 8 | ||||
-rw-r--r-- | drivers/acpi/acpica/actables.h | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/psxface.c | 1 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbutils.c | 35 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxface.c | 10 |
5 files changed, 56 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index a419fe98a5fc..e3813d290b4f 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -117,6 +117,14 @@ u8 ACPI_INIT_GLOBAL(acpi_gbl_use_default_register_widths, TRUE); | |||
117 | */ | 117 | */ |
118 | u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE); | 118 | u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE); |
119 | 119 | ||
120 | /* | ||
121 | * Optionally copy the entire DSDT to local memory (instead of simply | ||
122 | * mapping it.) There are some BIOSs that corrupt or replace the original | ||
123 | * DSDT, creating the need for this option. Default is FALSE, do not copy | ||
124 | * the DSDT. | ||
125 | */ | ||
126 | u8 ACPI_INIT_GLOBAL(acpi_gbl_copy_dsdt_locally, FALSE); | ||
127 | |||
120 | /* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */ | 128 | /* acpi_gbl_FADT is a local copy of the FADT, converted to a common format. */ |
121 | 129 | ||
122 | struct acpi_table_fadt acpi_gbl_FADT; | 130 | struct acpi_table_fadt acpi_gbl_FADT; |
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h index fc52b6f2d69c..b7197bf4af0b 100644 --- a/drivers/acpi/acpica/actables.h +++ b/drivers/acpi/acpica/actables.h | |||
@@ -109,6 +109,8 @@ acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length); | |||
109 | 109 | ||
110 | void acpi_tb_check_dsdt_header(void); | 110 | void acpi_tb_check_dsdt_header(void); |
111 | 111 | ||
112 | void acpi_tb_copy_dsdt(struct acpi_table_desc *table_desc); | ||
113 | |||
112 | void | 114 | void |
113 | acpi_tb_install_table(acpi_physical_address address, | 115 | acpi_tb_install_table(acpi_physical_address address, |
114 | char *signature, u32 table_index); | 116 | char *signature, u32 table_index); |
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c index 67e7ad517051..c42f067cff9d 100644 --- a/drivers/acpi/acpica/psxface.c +++ b/drivers/acpi/acpica/psxface.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "acparser.h" | 46 | #include "acparser.h" |
47 | #include "acdispat.h" | 47 | #include "acdispat.h" |
48 | #include "acinterp.h" | 48 | #include "acinterp.h" |
49 | #include "actables.h" | ||
49 | #include "amlcode.h" | 50 | #include "amlcode.h" |
50 | 51 | ||
51 | #define _COMPONENT ACPI_PARSER | 52 | #define _COMPONENT ACPI_PARSER |
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index 07bc7437f82b..1efb0940e8b2 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c | |||
@@ -387,6 +387,41 @@ void acpi_tb_check_dsdt_header(void) | |||
387 | 387 | ||
388 | /******************************************************************************* | 388 | /******************************************************************************* |
389 | * | 389 | * |
390 | * FUNCTION: acpi_tb_copy_dsdt | ||
391 | * | ||
392 | * PARAMETERS: table_desc - Installed table to copy | ||
393 | * | ||
394 | * RETURN: None | ||
395 | * | ||
396 | * DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory. | ||
397 | * Some very bad BIOSs are known to either corrupt the DSDT or | ||
398 | * install a new, bad DSDT. This copy works around the problem. | ||
399 | * | ||
400 | ******************************************************************************/ | ||
401 | |||
402 | void acpi_tb_copy_dsdt(struct acpi_table_desc *table_desc) | ||
403 | { | ||
404 | struct acpi_table_header *new_table; | ||
405 | |||
406 | new_table = ACPI_ALLOCATE(table_desc->length); | ||
407 | if (!new_table) { | ||
408 | ACPI_ERROR((AE_INFO, "Could not copy DSDT of length 0x%X", | ||
409 | table_desc->length)); | ||
410 | return; | ||
411 | } | ||
412 | |||
413 | ACPI_MEMCPY(new_table, table_desc->pointer, table_desc->length); | ||
414 | acpi_tb_delete_table(table_desc); | ||
415 | table_desc->pointer = new_table; | ||
416 | table_desc->flags = ACPI_TABLE_ORIGIN_ALLOCATED; | ||
417 | |||
418 | ACPI_INFO((AE_INFO, | ||
419 | "Forced DSDT copy: length 0x%05X copied locally, original unmapped", | ||
420 | new_table->length)); | ||
421 | } | ||
422 | |||
423 | /******************************************************************************* | ||
424 | * | ||
390 | * FUNCTION: acpi_tb_install_table | 425 | * FUNCTION: acpi_tb_install_table |
391 | * | 426 | * |
392 | * PARAMETERS: Address - Physical address of DSDT or FACS | 427 | * PARAMETERS: Address - Physical address of DSDT or FACS |
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 30565100b94c..f5378fc302b3 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -532,6 +532,16 @@ static acpi_status acpi_tb_load_namespace(void) | |||
532 | } | 532 | } |
533 | 533 | ||
534 | /* | 534 | /* |
535 | * Optionally copy the entire DSDT to local memory (instead of simply | ||
536 | * mapping it.) There are some BIOSs that corrupt or replace the original | ||
537 | * DSDT, creating the need for this option. Default is FALSE, do not copy | ||
538 | * the DSDT. | ||
539 | */ | ||
540 | if (acpi_gbl_copy_dsdt_locally) { | ||
541 | acpi_tb_copy_dsdt(acpi_gbl_DSDT); | ||
542 | } | ||
543 | |||
544 | /* | ||
535 | * Save the original DSDT header for detection of table corruption | 545 | * Save the original DSDT header for detection of table corruption |
536 | * and/or replacement of the DSDT from outside the OS. | 546 | * and/or replacement of the DSDT from outside the OS. |
537 | */ | 547 | */ |