Attention is currently required from: Lance Zhao, Tim Wawrzynczak. Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59729 )
Change subject: acpi/acpigen, drivers/tpm: Move definition of set_package_element_op ......................................................................
acpi/acpigen, drivers/tpm: Move definition of set_package_element_op
The patch moves set_package_element_op() function from drivers/tpm/ppi.c to acpi/acpigen.c, renames the function to acpigen_set_package_element_op() and make changas to all references.
The function definition is moved to acpi/acpigen.c so that soc/intel/common/acpi/cpu_hybrid.c can use the function.
TEST=Build and boot Brya
Signed-off-by: Sridhar Siricilla sridhar.siricilla@intel.com Change-Id: I4fe70a1f369c97c67bbc1717e6adc7c5f4ba5839 --- M src/acpi/acpigen.c M src/drivers/tpm/ppi.c M src/include/acpi/acpigen.h 3 files changed, 20 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/59729/1
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index ff04d0f..a1bbf24 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -63,6 +63,17 @@ (*gencurrent++) = b; }
+void acpigen_set_package_element_op(const char *package_name, unsigned int element, + uint8_t src_op) +{ + acpigen_write_store(); + acpigen_emit_byte(src_op); + acpigen_emit_byte(INDEX_OP); + acpigen_emit_namestring(package_name); + acpigen_write_integer(element); + acpigen_emit_byte(ZERO_OP); /* Ignore Index() Destination */ +} + void acpigen_emit_ext_op(uint8_t op) { acpigen_emit_byte(EXT_OP_PREFIX); diff --git a/src/drivers/tpm/ppi.c b/src/drivers/tpm/ppi.c index 88dd649..134aafe 100644 --- a/src/drivers/tpm/ppi.c +++ b/src/drivers/tpm/ppi.c @@ -12,17 +12,6 @@
#define BCD(x, y) (((x) << 4) | ((y) << 0))
-static void set_package_element_op(const char *package_name, unsigned int element, - uint8_t src_op) -{ - acpigen_write_store(); - acpigen_emit_byte(src_op); - acpigen_emit_byte(INDEX_OP); - acpigen_emit_namestring(package_name); - acpigen_write_integer(element); - acpigen_emit_byte(ZERO_OP); /* Ignore Index() Destination */ -} - static void set_package_element_name(const char *package_name, unsigned int element, const char *src) { @@ -182,10 +171,10 @@ acpigen_emit_byte(LOCAL0_OP);
/* ^TPM3 [0] = PPI3_RET_GENERAL_FAILURE */ - set_package_element_op("^TPM3", 0, LOCAL0_OP); + acpigen_set_package_element_op("^TPM3", 0, LOCAL0_OP);
/* ^TPM2 [0] = PPI3_RET_GENERAL_FAILURE */ - set_package_element_op("^TPM2", 0, LOCAL0_OP); + acpigen_set_package_element_op("^TPM2", 0, LOCAL0_OP);
acpigen_write_to_integer(ARG1_OP, LOCAL0_OP);
@@ -196,7 +185,7 @@ acpigen_write_store(); acpigen_write_integer(PPI3_RET_SUCCESS); acpigen_emit_byte(LOCAL1_OP); - set_package_element_op("^TPM2", 0, LOCAL1_OP); + acpigen_set_package_element_op("^TPM2", 0, LOCAL1_OP);
/* ^TPM2 [1] = ^CMDR */ set_package_element_name("^TPM2", 1, "^CMDR"); @@ -217,7 +206,7 @@ acpigen_write_store(); acpigen_write_integer(PPI3_RET_SUCCESS); acpigen_emit_byte(LOCAL1_OP); - set_package_element_op("^TPM3", 0, LOCAL1_OP); + acpigen_set_package_element_op("^TPM3", 0, LOCAL1_OP);
/* ^TPM3 [1] = ^CMDR */ set_package_element_name("^TPM3", 1, "^CMDR"); @@ -275,7 +264,7 @@ acpigen_write_store(); acpigen_write_integer(PPI5_RET_GENERAL_FAILURE); acpigen_emit_byte(LOCAL1_OP); - set_package_element_op("^TPM3", 0, LOCAL1_OP); + acpigen_set_package_element_op("^TPM3", 0, LOCAL1_OP);
acpigen_write_to_integer(ARG1_OP, LOCAL0_OP);
@@ -286,7 +275,7 @@ acpigen_write_store(); acpigen_write_integer(PPI5_RET_SUCCESS); acpigen_emit_byte(LOCAL1_OP); - set_package_element_op("^TPM3", 0, LOCAL1_OP); + acpigen_set_package_element_op("^TPM3", 0, LOCAL1_OP);
/* ^TPM3 [1] = ^LCMD */ set_package_element_name("^TPM3", 1, "^LCMD"); diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index 027a0e3..c6e0862 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -526,6 +526,9 @@ */ void acpigen_get_package_op_element(uint8_t package_op, unsigned int element, uint8_t dest_op);
+/* Set element of package to speicified op: <package>[<element>] = <src_op> */ +void acpigen_set_package_element_op(const char *package_name, unsigned int element, uint8_t src_op); + /* Set element of package op to specified op: DeRefOf (<package>[<element>]) = <src> */ void acpigen_set_package_op_element_int(uint8_t package_op, unsigned int element, uint64_t src);