diff --git a/src/soc/intel/common/feature/uart/Kconfig b/src/soc/intel/common/feature/uart/Kconfig new file mode 100644 index 0000000000..73429af335 --- /dev/null +++ b/src/soc/intel/common/feature/uart/Kconfig @@ -0,0 +1,9 @@ +## SPDX-License-Identifier: GPL-2.0-only + +config SOC_INTEL_COMMON_FEATURE_UART_DEVICES + bool + help + Include common UART device list support. This option eliminates + per-platform duplication of uart.c files by providing a common + implementation. Platforms must define PCI_UART_DEVFN* macro in + their soc/pci_devs.h header. diff --git a/src/soc/intel/common/feature/uart/Makefile.mk b/src/soc/intel/common/feature/uart/Makefile.mk new file mode 100644 index 0000000000..dfc36965ba --- /dev/null +++ b/src/soc/intel/common/feature/uart/Makefile.mk @@ -0,0 +1,3 @@ +## SPDX-License-Identifier: GPL-2.0-only +all-$(CONFIG_SOC_INTEL_COMMON_FEATURE_UART_DEVICES) += uart_devices.c +smm-$(CONFIG_SOC_INTEL_COMMON_FEATURE_UART_DEVICES) += uart_devices.c diff --git a/src/soc/intel/common/feature/uart/uart_devices.c b/src/soc/intel/common/feature/uart/uart_devices.c new file mode 100644 index 0000000000..9f549c5ae8 --- /dev/null +++ b/src/soc/intel/common/feature/uart/uart_devices.c @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include + +const unsigned int uart_devices[] = { + PCI_DEVFN_UART0, + PCI_DEVFN_UART1, + PCI_DEVFN_UART2, +}; + +const int uart_devices_size = ARRAY_SIZE(uart_devices);