aboutsummaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block/uart
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-02-16 01:34:55 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-02-17 10:35:22 +0000
commitb1b0294e6fd565497ec8175986b4913b925fc587 (patch)
tree1d0e0ca8db2257fc5dc63ed77b9145f6f2a7bfd7 /src/soc/amd/common/block/uart
parent0bc878db192e585fa6bf73e81bbc10350d907c21 (diff)
soc/amd/picasso/uart: move uart_inject_ssdt to common code
Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ic033fc2817d44ff873f93a45e069c0e8aa0be99f Reviewed-on: https://review.coreboot.org/c/coreboot/+/50780 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src/soc/amd/common/block/uart')
-rw-r--r--src/soc/amd/common/block/uart/Makefile.inc2
-rw-r--r--src/soc/amd/common/block/uart/uart_acpi.c15
2 files changed, 17 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/uart/Makefile.inc b/src/soc/amd/common/block/uart/Makefile.inc
index 664c520180..6982fcf35d 100644
--- a/src/soc/amd/common/block/uart/Makefile.inc
+++ b/src/soc/amd/common/block/uart/Makefile.inc
@@ -6,4 +6,6 @@ ifeq ($(CONFIG_DEBUG_SMI),y)
smm-$(CONFIG_AMD_SOC_CONSOLE_UART) += uart_console.c
endif
+ramstage-$(CONFIG_HAVE_ACPI_TABLES) += uart_acpi.c
+
endif # CONFIG_SOC_AMD_COMMON_BLOCK_UART
diff --git a/src/soc/amd/common/block/uart/uart_acpi.c b/src/soc/amd/common/block/uart/uart_acpi.c
new file mode 100644
index 0000000000..eb17322741
--- /dev/null
+++ b/src/soc/amd/common/block/uart/uart_acpi.c
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpigen.h>
+#include <amdblocks/uart.h>
+#include <device/device.h>
+
+/* This gets called for both enabled and disabled devices. */
+void uart_inject_ssdt(const struct device *dev)
+{
+ acpigen_write_scope(acpi_device_path(dev));
+
+ acpigen_write_STA(acpi_device_status(dev));
+
+ acpigen_pop_len(); /* Scope */
+}