arm/acpi: Prepare STAO table for Dom0

Create STAO table for Dom0. This table is used to tell Dom0 whether it
should ignore UART defined in SPCR table or the ACPI namespace names.

Look at below url for details:
http://wiki.xenproject.org/mediawiki/images/0/02/Status-override-table.pdf

Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
This commit is contained in:
Shannon Zhao authored and Jan Beulich committed 2016-03-30 17:00:01 +02:00
1 parent 17a8ba3804
commit d58035cb85
1 file changed
+41
+41
View File
@@ -1357,6 +1357,43 @@ static int prepare_dtb(struct domain *d, struct kernel_info *kinfo)
}
#ifdef CONFIG_ACPI
static int acpi_create_stao(struct domain *d, struct membank tbl_add[])
{
struct acpi_table_header *table = NULL;
struct acpi_table_stao *stao = NULL;
u32 table_size = sizeof(struct acpi_table_stao);
u32 offset = acpi_get_table_offset(tbl_add, TBL_STAO);
acpi_status status;
u8 *base_ptr, checksum;
/* Copy OEM and ASL compiler fields from another table, use MADT */
status = acpi_get_table(ACPI_SIG_MADT, 0, &table);
if ( ACPI_FAILURE(status) )
{
const char *msg = acpi_format_exception(status);
printk("STAO: Failed to get MADT table, %s\n", msg);
return -EINVAL;
}
base_ptr = d->arch.efi_acpi_table + offset;
ACPI_MEMCPY(base_ptr, table, sizeof(struct acpi_table_header));
stao = (struct acpi_table_stao *)base_ptr;
ACPI_MEMCPY(stao->header.signature, ACPI_SIG_STAO, 4);
stao->header.revision = 1;
stao->header.length = table_size;
stao->ignore_uart = 1;
checksum = acpi_tb_checksum(ACPI_CAST_PTR(u8, stao), table_size);
stao->header.checksum -= checksum;
tbl_add[TBL_STAO].start = d->arch.efi_acpi_gpa + offset;
tbl_add[TBL_STAO].size = table_size;
return 0;
}
static int acpi_create_madt(struct domain *d, struct membank tbl_add[])
{
struct acpi_table_header *table = NULL;
@@ -1544,6 +1581,10 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
if ( rc != 0 )
return rc;
rc = acpi_create_stao(d, tbl_add);
if ( rc != 0 )
return rc;
return 0;
}
#else
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.