ACPI 5.0: Implement hardware-reduced option
authorBob Moore <robert.moore@intel.com>
Wed, 16 Nov 2011 02:57:28 +0000 (10:57 +0800)
committerLen Brown <len.brown@intel.com>
Tue, 17 Jan 2012 08:36:28 +0000 (03:36 -0500)
If HW-reduced flag is set in the FADT, do not attempt to access
or initialize any ACPI hardware, including SCI and global lock.
No FACS will be present.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/acpica/acglobal.h
drivers/acpi/acpica/evevent.c
drivers/acpi/acpica/evglock.c
drivers/acpi/acpica/tbfadt.c
drivers/acpi/acpica/tbutils.c
include/acpi/acpixf.h

index 76dc02f155748af02278d465e3948e7c1a214cf0..25912a93dea7ef62d3b146fb86c5525850102fa7 100644 (file)
@@ -140,8 +140,19 @@ u32 acpi_gbl_trace_flags;
 acpi_name acpi_gbl_trace_method_name;
 u8 acpi_gbl_system_awake_and_running;
 
+/*
+ * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning
+ * that the ACPI hardware is no longer required. A flag in the FADT indicates
+ * a reduced HW machine, and that flag is duplicated here for convenience.
+ */
+u8 acpi_gbl_reduced_hardware;
+
 #endif
 
+/* Do not disassemble buffers to resource descriptors */
+
+ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_no_resource_disassembly, FALSE);
+
 /*****************************************************************************
  *
  * Debug support
@@ -207,7 +218,7 @@ ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;
 
 /*****************************************************************************
  *
- * Mutual exlusion within ACPICA subsystem
+ * Mutual exclusion within ACPICA subsystem
  *
  ****************************************************************************/
 
index d458b041e6510aec0c91cd4b20c0080147975524..1f43be4701999e46c0273afa40f597d9be2d4f7d 100644 (file)
@@ -71,6 +71,12 @@ acpi_status acpi_ev_initialize_events(void)
 
        ACPI_FUNCTION_TRACE(ev_initialize_events);
 
+       /* If Hardware Reduced flag is set, there are no fixed events */
+
+       if (acpi_gbl_reduced_hardware) {
+               return_ACPI_STATUS(AE_OK);
+       }
+
        /*
         * Initialize the Fixed and General Purpose Events. This is done prior to
         * enabling SCIs to prevent interrupts from occurring before the handlers
@@ -111,6 +117,12 @@ acpi_status acpi_ev_install_xrupt_handlers(void)
 
        ACPI_FUNCTION_TRACE(ev_install_xrupt_handlers);
 
+       /* If Hardware Reduced flag is set, there is no ACPI h/w */
+
+       if (acpi_gbl_reduced_hardware) {
+               return_ACPI_STATUS(AE_OK);
+       }
+
        /* Install the SCI handler */
 
        status = acpi_ev_install_sci_handler();
index 56a562a1e5d7bde44f5d15b40dc250843b2de41f..af1e71af1b64f1e7bebd5035b489aaf2bbb9321a 100644 (file)
@@ -70,6 +70,12 @@ acpi_status acpi_ev_init_global_lock_handler(void)
 
        ACPI_FUNCTION_TRACE(ev_init_global_lock_handler);
 
+       /* If Hardware Reduced flag is set, there is no global lock */
+
+       if (acpi_gbl_reduced_hardware) {
+               return_ACPI_STATUS(AE_OK);
+       }
+
        /* Attempt installation of the global lock handler */
 
        status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL,
index 536fd2bc7a4731ff3ba685f2e199786638a930e2..1e1a7de34439678fbb8f7cad23335f43f6bab907 100644 (file)
@@ -253,8 +253,13 @@ void acpi_tb_parse_fadt(u32 table_index)
        acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xdsdt,
                              ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT);
 
-       acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.Xfacs,
-                             ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS);
+       /* If Hardware Reduced flag is set, there is no FACS */
+
+       if (!acpi_gbl_reduced_hardware) {
+               acpi_tb_install_table((acpi_physical_address) acpi_gbl_FADT.
+                                     Xfacs, ACPI_SIG_FACS,
+                                     ACPI_TABLE_INDEX_FACS);
+       }
 }
 
 /*******************************************************************************
@@ -297,6 +302,13 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
        ACPI_MEMCPY(&acpi_gbl_FADT, table,
                    ACPI_MIN(length, sizeof(struct acpi_table_fadt)));
 
+       /* Take a copy of the Hardware Reduced flag */
+
+       acpi_gbl_reduced_hardware = FALSE;
+       if (acpi_gbl_FADT.flags & ACPI_FADT_HW_REDUCED) {
+               acpi_gbl_reduced_hardware = TRUE;
+       }
+
        /* Convert the local copy of the FADT to the common internal format */
 
        acpi_tb_convert_fadt();
@@ -502,6 +514,12 @@ static void acpi_tb_validate_fadt(void)
                acpi_gbl_FADT.Xdsdt = (u64) acpi_gbl_FADT.dsdt;
        }
 
+       /* If Hardware Reduced flag is set, we are all done */
+
+       if (acpi_gbl_reduced_hardware) {
+               return;
+       }
+
        /* Examine all of the 64-bit extended address fields (X fields) */
 
        for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) {
index 0f2d395feabadb20e8ce47d88f53ff8d786e2427..da56a19089667acceddc97f008b700a20e6af583 100644 (file)
@@ -135,6 +135,13 @@ acpi_status acpi_tb_initialize_facs(void)
 {
        acpi_status status;
 
+       /* If Hardware Reduced flag is set, there is no FACS */
+
+       if (acpi_gbl_reduced_hardware) {
+               acpi_gbl_FACS = NULL;
+               return (AE_OK);
+       }
+
        status = acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
                                         ACPI_CAST_INDIRECT_PTR(struct
                                                                acpi_table_header,
index f554a9313b43d7b2bbc50d599cb5f9363bfe8868..9ba2e3aff5c64775d9b96d3f4dabab64b43fd0fa 100644 (file)
@@ -74,6 +74,7 @@ extern u8 acpi_gbl_disable_auto_repair;
 extern u32 acpi_current_gpe_count;
 extern struct acpi_table_fadt acpi_gbl_FADT;
 extern u8 acpi_gbl_system_awake_and_running;
+extern u8 acpi_gbl_reduced_hardware;   /* ACPI 5.0 */
 
 extern u32 acpi_rsdt_forced;
 /*