Aaron Durbin (adurbin@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17650
-gerrit
commit 43277c43cb3450b500c537e2c01cc4599e92d063 Author: Aaron Durbin adurbin@chromium.org Date: Tue Nov 29 23:14:25 2016 -0600
lib/nhlt: add support for setting the oem_revision
In the ACPI header there's an OEM revision field that was previously just being implicitly set to 0. Allow for a board to provide a non-zero value for this field.
Change-Id: Icd40c1c162c2645b3990a6f3361c592706251f82 Signed-off-by: Aaron Durbin adurbin@chromium.org --- src/include/nhlt.h | 6 ++++-- src/lib/nhlt.c | 6 ++++-- src/mainboard/google/reef/mainboard.c | 3 ++- src/mainboard/intel/kunimitsu/mainboard.c | 2 +- src/soc/intel/common/nhlt.c | 7 ++++--- 5 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/src/include/nhlt.h b/src/include/nhlt.h index 17b7d11..5b72320 100644 --- a/src/include/nhlt.h +++ b/src/include/nhlt.h @@ -162,7 +162,8 @@ uintptr_t nhlt_serialize(struct nhlt *nhlt, uintptr_t acpi_addr); * valid after thisfunction is called. */ uintptr_t nhlt_serialize_oem_overrides(struct nhlt *nhlt, uintptr_t acpi_addr, - const char *oem_id, const char *oem_table_id); + const char *oem_id, const char *oem_table_id, + uint32_t oem_revision);
/* * While very similar to nhlt_serialize() the SoC specific function allows @@ -177,7 +178,8 @@ uintptr_t nhlt_soc_serialize(struct nhlt *nhlt, uintptr_t acpi_addr); * as updating ACPI field references for the serialized structure. */ uintptr_t nhlt_soc_serialize_oem_overrides(struct nhlt *nhlt, - uintptr_t acpi_addr, const char *oem_id, const char *oem_table_id); + uintptr_t acpi_addr, const char *oem_id, const char *oem_table_id, + uint32_t oem_revision);
/* Link and device types. */ enum { diff --git a/src/lib/nhlt.c b/src/lib/nhlt.c index 7bf8ce8..da94415 100644 --- a/src/lib/nhlt.c +++ b/src/lib/nhlt.c @@ -390,11 +390,12 @@ static void nhlt_serialize_endpoints(struct nhlt *nhlt, struct cursor *cur)
uintptr_t nhlt_serialize(struct nhlt *nhlt, uintptr_t acpi_addr) { - return nhlt_serialize_oem_overrides(nhlt, acpi_addr, NULL, NULL); + return nhlt_serialize_oem_overrides(nhlt, acpi_addr, NULL, NULL, 0); }
uintptr_t nhlt_serialize_oem_overrides(struct nhlt *nhlt, - uintptr_t acpi_addr, const char *oem_id, const char *oem_table_id) + uintptr_t acpi_addr, const char *oem_id, const char *oem_table_id, + uint32_t oem_revision) { struct cursor cur; acpi_header_t *header; @@ -424,6 +425,7 @@ uintptr_t nhlt_serialize_oem_overrides(struct nhlt *nhlt,
memcpy(header->oem_id, oem_id, oem_id_len); memcpy(header->oem_table_id, oem_table_id, oem_table_id_len); + write_le32(&header->oem_revision, oem_revision); memcpy(header->asl_compiler_id, ASLC, 4);
cur.buf = (void *)(acpi_addr + sizeof(acpi_header_t)); diff --git a/src/mainboard/google/reef/mainboard.c b/src/mainboard/google/reef/mainboard.c index 4d4ef53..44858d4 100644 --- a/src/mainboard/google/reef/mainboard.c +++ b/src/mainboard/google/reef/mainboard.c @@ -54,6 +54,7 @@ static unsigned long mainboard_write_acpi_tables( struct nhlt *nhlt; const char *oem_id = NULL; const char *oem_table_id = NULL; + uint32_t oem_revision = 0;
start_addr = current;
@@ -66,7 +67,7 @@ static unsigned long mainboard_write_acpi_tables( variant_nhlt_oem_strings(&oem_id, &oem_table_id);
end_addr = nhlt_soc_serialize_oem_overrides(nhlt, start_addr, - oem_id, oem_table_id); + oem_id, oem_table_id, oem_revision);
if (end_addr != start_addr) acpi_add_table(rsdp, (void *)start_addr); diff --git a/src/mainboard/intel/kunimitsu/mainboard.c b/src/mainboard/intel/kunimitsu/mainboard.c index 9f79db6..cbadc2e 100644 --- a/src/mainboard/intel/kunimitsu/mainboard.c +++ b/src/mainboard/intel/kunimitsu/mainboard.c @@ -84,7 +84,7 @@ static unsigned long mainboard_write_acpi_tables( printk(BIOS_ERR, "Couldn't add headset codec.\n");
end_addr = nhlt_soc_serialize_oem_overrides(nhlt, start_addr, - oem_id, oem_table_id); + oem_id, oem_table_id, 0);
if (end_addr != start_addr) acpi_add_table(rsdp, (void *)start_addr); diff --git a/src/soc/intel/common/nhlt.c b/src/soc/intel/common/nhlt.c index 03a4b4f..a268ea6 100644 --- a/src/soc/intel/common/nhlt.c +++ b/src/soc/intel/common/nhlt.c @@ -19,11 +19,12 @@
uintptr_t nhlt_soc_serialize(struct nhlt *nhlt, uintptr_t acpi_addr) { - return nhlt_soc_serialize_oem_overrides(nhlt, acpi_addr, NULL, NULL); + return nhlt_soc_serialize_oem_overrides(nhlt, acpi_addr, NULL, NULL, 0); }
uintptr_t nhlt_soc_serialize_oem_overrides(struct nhlt *nhlt, - uintptr_t acpi_addr, const char *oem_id, const char *oem_table_id) + uintptr_t acpi_addr, const char *oem_id, const char *oem_table_id, + uint32_t oem_revision) { global_nvs_t *gnvs;
@@ -37,5 +38,5 @@ uintptr_t nhlt_soc_serialize_oem_overrides(struct nhlt *nhlt, gnvs->nhll = nhlt_current_size(nhlt);
return nhlt_serialize_oem_overrides(nhlt, acpi_addr, - oem_id, oem_table_id); + oem_id, oem_table_id, oem_revision); }