diff options
Diffstat (limited to 'src/soc/intel/skylake/uart.c')
-rw-r--r-- | src/soc/intel/skylake/uart.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/soc/intel/skylake/uart.c b/src/soc/intel/skylake/uart.c index 07326d5eb3..4e65859ea7 100644 --- a/src/soc/intel/skylake/uart.c +++ b/src/soc/intel/skylake/uart.c @@ -14,22 +14,20 @@ * GNU General Public License for more details. */ +#include <cbmem.h> #include <device/pci.h> #include <intelblocks/uart.h> #include <soc/iomap.h> +#include <soc/nvs.h> #include <soc/pci_devs.h> -static int pch_uart_is_debug(struct device *dev) -{ - return dev->path.pci.devfn == PCH_DEVFN_UART2; -} - +#if !ENV_SMM void pch_uart_read_resources(struct device *dev) { pci_dev_read_resources(dev); /* Set the configured UART base address for the debug port */ - if (IS_ENABLED(CONFIG_UART_DEBUG) && pch_uart_is_debug(dev)) { + if (IS_ENABLED(CONFIG_UART_DEBUG) && uart_is_debug_controller(dev)) { struct resource *res = find_resource(dev, PCI_BASE_ADDRESS_0); /* Need to set the base and size for the resource allocator. */ res->base = UART_DEBUG_BASE_ADDRESS; @@ -38,3 +36,19 @@ void pch_uart_read_resources(struct device *dev) IORESOURCE_FIXED; } } +#endif + +bool pch_uart_init_debug_controller_on_resume(void) +{ + global_nvs_t *gnvs = cbmem_find(CBMEM_ID_ACPI_GNVS); + + if (gnvs) + return !!gnvs->uior; + + return false; +} + +device_t pch_uart_get_debug_controller(void) +{ + return PCH_DEV_UART2; +} |