diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/uart.h | 2 | ||||
-rw-r--r-- | src/soc/amd/common/block/uart/Makefile.inc | 2 | ||||
-rw-r--r-- | src/soc/amd/common/block/uart/uart_acpi.c | 15 | ||||
-rw-r--r-- | src/soc/amd/picasso/uart.c | 11 |
4 files changed, 19 insertions, 11 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/uart.h b/src/soc/amd/common/block/include/amdblocks/uart.h index 95d73237f7..4fd1b592cd 100644 --- a/src/soc/amd/common/block/include/amdblocks/uart.h +++ b/src/soc/amd/common/block/include/amdblocks/uart.h @@ -3,8 +3,10 @@ #ifndef AMD_BLOCK_UART_H #define AMD_BLOCK_UART_H +#include <device/device.h> #include <types.h> uintptr_t get_uart_base(unsigned int idx); /* get MMIO base address of FCH UART */ +void uart_inject_ssdt(const struct device *dev); #endif /* AMD_BLOCK_UART_H */ 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 */ +} diff --git a/src/soc/amd/picasso/uart.c b/src/soc/amd/picasso/uart.c index 24bc2c0f85..2767817bfb 100644 --- a/src/soc/amd/picasso/uart.c +++ b/src/soc/amd/picasso/uart.c @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include <acpi/acpigen.h> #include <console/console.h> #include <commonlib/helpers.h> #include <device/device.h> @@ -103,16 +102,6 @@ static void uart_enable(struct device *dev) } } -/* This gets called for both enabled and disabled devices. */ -static 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 */ -} - struct device_operations picasso_uart_mmio_ops = { .read_resources = noop_read_resources, .set_resources = noop_set_resources, |