acpi: ignore FACS table missing, if HW_REDUCED_ACPI is set. (ACPI Revision 5.1 Errata A)
Signed-off-by: Fu Wei fu.wei@linaro.org --- src/lib/include/fwts_acpi.h | 1 + src/lib/src/fwts_acpi_tables.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index 24ebc84..73a3461 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -46,6 +46,7 @@ extern const char *fwts_acpi_fadt_preferred_pm_profile[];
#define FWTS_ACPI_FADT_PREFERRED_PM_PROFILE(x) \ ((x) > 8) ? "Reserved" : fwts_acpi_fadt_preferred_pm_profile[x] +#define FWTS_ACPI_FADT_FLAGS_HW_REDUCED_ACPI (1<<20)
/* 5.2.3.1 Generic Address Structure */ typedef struct { diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index 56498e0..41cf6ea 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -311,7 +311,7 @@ static int fwts_acpi_handle_fadt_tables( } /* Is it sane? */ if (addr == 0) { - fwts_log_error(fw, "Failed to load %s: Cannot determine " + fwts_log_warning(fw, "Failed to load %s: Cannot determine " "address of %s from FADT, fields %s and %s are zero.", name, name, name_addr32, name_addr64); return FWTS_ERROR; @@ -320,7 +320,7 @@ static int fwts_acpi_handle_fadt_tables( addr = (off_t)*addr32; /* Is it sane? */ if (addr == 0) { - fwts_log_error(fw, "Failed to load %s: Cannot determine " + fwts_log_warning(fw, "Failed to load %s: Cannot determine " "address of %s from FADT, field %s is zero.", name, name, name_addr32); return FWTS_ERROR; @@ -375,12 +375,19 @@ static int fwts_acpi_handle_fadt( "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", &fadt->firmware_control, &fadt->x_firmware_ctrl, provenance) != FWTS_OK) { - return FWTS_ERROR; + if (fadt->flags && FWTS_ACPI_FADT_FLAGS_HW_REDUCED_ACPI) { + fwts_log_info(fw, "IGNORE the missing FACS " + "in Hardware-reduced ACPI"); + } else { + fwts_log_error(fw, "Missing FACS!"); + return FWTS_ERROR; + } } /* Determine DSDT addr and load it */ if (fwts_acpi_handle_fadt_tables(fw, fadt, "DSDT", "DSTD", "X_DSDT", &fadt->dsdt, &fadt->x_dsdt, provenance) != FWTS_OK) { + fwts_log_error(fw, "Failed to load DSDT!"); return FWTS_ERROR; } return FWTS_OK;
For internal review only! Please provide some suggestion, Great thanks in advance.
On 11/13/2014 03:32 PM, Fu Wei wrote:
acpi: ignore FACS table missing, if HW_REDUCED_ACPI is set. (ACPI Revision 5.1 Errata A)
Is it right for this Specification revision?
Signed-off-by: Fu Wei fu.wei@linaro.org
src/lib/include/fwts_acpi.h | 1 + src/lib/src/fwts_acpi_tables.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h index 24ebc84..73a3461 100644 --- a/src/lib/include/fwts_acpi.h +++ b/src/lib/include/fwts_acpi.h @@ -46,6 +46,7 @@ extern const char *fwts_acpi_fadt_preferred_pm_profile[]; #define FWTS_ACPI_FADT_PREFERRED_PM_PROFILE(x) \ ((x) > 8) ? "Reserved" : fwts_acpi_fadt_preferred_pm_profile[x] +#define FWTS_ACPI_FADT_FLAGS_HW_REDUCED_ACPI (1<<20) /* 5.2.3.1 Generic Address Structure */ typedef struct { diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index 56498e0..41cf6ea 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -311,7 +311,7 @@ static int fwts_acpi_handle_fadt_tables( } /* Is it sane? */ if (addr == 0) {
fwts_log_error(fw, "Failed to load %s: Cannot determine "
fwts_log_warning(fw, "Failed to load %s: Cannot determine " "address of %s from FADT, fields %s and %s are zero.", name, name, name_addr32, name_addr64); return FWTS_ERROR;
@@ -320,7 +320,7 @@ static int fwts_acpi_handle_fadt_tables( addr = (off_t)*addr32; /* Is it sane? */ if (addr == 0) {
fwts_log_error(fw, "Failed to load %s: Cannot determine "
fwts_log_warning(fw, "Failed to load %s: Cannot determine " "address of %s from FADT, field %s is zero.", name, name, name_addr32); return FWTS_ERROR;
@@ -375,12 +375,19 @@ static int fwts_acpi_handle_fadt( "FACS", "FIRMWARE_CTRL", "X_FIRMWARE_CTRL", &fadt->firmware_control, &fadt->x_firmware_ctrl, provenance) != FWTS_OK) {
return FWTS_ERROR;
if (fadt->flags && FWTS_ACPI_FADT_FLAGS_HW_REDUCED_ACPI) {
Maybe we can have a inline function like : is_hw_reduced_ACPI(const fwts_acpi_table_fadt *fadt)
but I am not sure if it is worth.
fwts_log_info(fw, "IGNORE the missing FACS "
"in Hardware-reduced ACPI");
} else {
fwts_log_error(fw, "Missing FACS!");
return FWTS_ERROR;
} /* Determine DSDT addr and load it */ if (fwts_acpi_handle_fadt_tables(fw, fadt, "DSDT", "DSTD", "X_DSDT", &fadt->dsdt, &fadt->x_dsdt, provenance) != FWTS_OK) {}
return FWTS_ERROR; } return FWTS_OK;fwts_log_error(fw, "Failed to load DSDT!");