soc/intel/common/feature/uart: Add common UART device list driver
This patch introduces a common UART device list implementation that eliminates duplication across multiple Intel SoC platforms. Instead of maintaining nearly identical uart.c files in each platform directory, this common driver uses platform-specific macros to define UART device function numbers. The common implementation expects each platform to define the following macros in their soc/pci_devs.h header: - PCI_DEVFN_UART0 - PCI_DEVFN_UART1 - PCI_DEVFN_UART2 This approach maintains platform flexibility while reducing code duplication and simplifying maintenance. The driver is compiled across all stages (bootblock, verstage, romstage, postcar, ramstage, smm) to support various UART usage scenarios. Change-Id: Iba82a2fe24dd9ccf704e4a0fadc481b63662b94d Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91241 Reviewed-by: Kim, Wonkyu <wonkyu.kim@intel.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Pranava Y N <pranavayn@google.com>
This commit is contained in:
parent
78295974f8
commit
bb941824ca
3 changed files with 24 additions and 0 deletions
9
src/soc/intel/common/feature/uart/Kconfig
Normal file
9
src/soc/intel/common/feature/uart/Kconfig
Normal file
|
|
@ -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.
|
||||
3
src/soc/intel/common/feature/uart/Makefile.mk
Normal file
3
src/soc/intel/common/feature/uart/Makefile.mk
Normal file
|
|
@ -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
|
||||
12
src/soc/intel/common/feature/uart/uart_devices.c
Normal file
12
src/soc/intel/common/feature/uart/uart_devices.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <commonlib/helpers.h>
|
||||
#include <soc/pci_devs.h>
|
||||
|
||||
const unsigned int uart_devices[] = {
|
||||
PCI_DEVFN_UART0,
|
||||
PCI_DEVFN_UART1,
|
||||
PCI_DEVFN_UART2,
|
||||
};
|
||||
|
||||
const int uart_devices_size = ARRAY_SIZE(uart_devices);
|
||||
Loading…
Add table
Add a link
Reference in a new issue