summaryrefslogtreecommitdiff
path: root/src/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'src/acpi')
-rw-r--r--src/acpi/acpigen.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c
index 793841cc5b..efc5a16195 100644
--- a/src/acpi/acpigen.c
+++ b/src/acpi/acpigen.c
@@ -339,6 +339,18 @@ void acpigen_write_scope(const char *name)
acpigen_emit_namestring(name);
}
+void acpigen_get_package_op_element(uint8_t package_op, unsigned int element, uint8_t dest_op)
+{
+ /* <dest_op> = DeRefOf (<package_op>[<element]) */
+ acpigen_write_store();
+ acpigen_emit_byte(DEREF_OP);
+ acpigen_emit_byte(INDEX_OP);
+ acpigen_emit_byte(package_op);
+ acpigen_write_integer(element);
+ acpigen_emit_byte(ZERO_OP); /* Ignore Index() Destination */
+ acpigen_emit_byte(dest_op);
+}
+
void acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len)
{
/*
@@ -1269,6 +1281,20 @@ void acpigen_write_if_and(uint8_t arg1, uint8_t arg2)
}
/*
+ * Generates ACPI code for checking if operand1 and operand2 are equal.
+ * Both operand1 and operand2 are ACPI ops.
+ *
+ * If (Lequal (op,1 op2))
+ */
+void acpigen_write_if_lequal_op_op(uint8_t op1, uint8_t op2)
+{
+ acpigen_write_if();
+ acpigen_emit_byte(LEQUAL_OP);
+ acpigen_emit_byte(op1);
+ acpigen_emit_byte(op2);
+}
+
+/*
* Generates ACPI code for checking if operand1 and operand2 are equal, where,
* operand1 is ACPI op and operand2 is an integer.
*
@@ -1341,6 +1367,12 @@ void acpigen_write_return_singleton_buffer(uint8_t arg)
acpigen_write_return_byte_buffer(&arg, 1);
}
+void acpigen_write_return_op(uint8_t arg)
+{
+ acpigen_emit_byte(RETURN_OP);
+ acpigen_emit_byte(arg);
+}
+
void acpigen_write_return_byte(uint8_t arg)
{
acpigen_emit_byte(RETURN_OP);
@@ -1790,6 +1822,14 @@ void acpigen_get_rx_gpio(struct acpi_gpio *gpio)
acpigen_write_xor(LOCAL0_OP, 1, LOCAL0_OP);
}
+void acpigen_get_tx_gpio(struct acpi_gpio *gpio)
+{
+ acpigen_soc_get_tx_gpio(gpio->pins[0]);
+
+ if (gpio->polarity == ACPI_GPIO_ACTIVE_LOW)
+ acpigen_write_xor(LOCAL0_OP, 1, LOCAL0_OP);
+}
+
/* refer to ACPI 6.4.3.5.3 Word Address Space Descriptor section for details */
void acpigen_resource_word(u16 res_type, u16 gen_flags, u16 type_flags, u16 gran,
u16 range_min, u16 range_max, u16 translation, u16 length)