soc/intel/skylake: Use common UART device list driver

Remove platform-specific uart.c and switch to the common UART device
list driver. This eliminates 12 lines of duplicate code.

The Skylake uart.c simply defined uart_devices[] array. The common
driver now handles this using the PCI_DEVFN_UARTn macros defined in
pci_devs.h.

This commit:
- Adds PCI_DEVFN_UART* aliases pointing to PCH_DEVFN_UART* for naming
  consistency with common code
- Selects SOC_INTEL_COMMON_FEATURE and
  SOC_INTEL_COMMON_FEATURE_UART_DEVICES in Kconfig
- Removes uart.c and updates Makefile.mk

Change-Id: Id686de6bb4dd9ccf78644817881b2abfb5ae0352
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91249
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
Jeremy Compostella 2026-02-19 08:23:33 -08:00 committed by Jérémy Compostella
commit acd8f42410
4 changed files with 7 additions and 18 deletions

View file

@ -58,6 +58,8 @@ config SOC_INTEL_COMMON_SKYLAKE_BASE
select SOC_INTEL_COMMON_BLOCK_THERMAL_PCI_DEV
select SOC_INTEL_COMMON_BLOCK_UART
select SOC_INTEL_COMMON_BLOCK_XHCI_ELOG
select SOC_INTEL_COMMON_FEATURE
select SOC_INTEL_COMMON_FEATURE_UART_DEVICES
select SOC_INTEL_COMMON_FSP_RESET
select SOC_INTEL_COMMON_PCH_CLIENT
select SOC_INTEL_COMMON_NHLT

View file

@ -17,14 +17,12 @@ bootblock-y += p2sb.c
bootblock-y += pmutil.c
bootblock-y += spi.c
bootblock-y += lpc.c
bootblock-y += uart.c
verstage-y += gpio.c
verstage-y += gspi.c
verstage-y += pmutil.c
verstage-y += i2c.c
verstage-y += spi.c
verstage-y += uart.c
romstage-y += gpio.c
romstage-y += gspi.c
@ -34,7 +32,6 @@ romstage-y += pcie_rp.c
romstage-y += pmutil.c
romstage-y += reset.c
romstage-y += spi.c
romstage-y += uart.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c
ramstage-y += chip.c
@ -58,7 +55,6 @@ ramstage-y += reset.c
ramstage-y += sd.c
ramstage-y += spi.c
ramstage-y += systemagent.c
ramstage-y += uart.c
ramstage-y += vr_config.c
ramstage-y += xhci.c
@ -67,13 +63,11 @@ smm-y += gpio.c
smm-y += p2sb.c
smm-y += pmutil.c
smm-y += smihandler.c
smm-y += uart.c
smm-y += xhci.c
postcar-y += gspi.c
postcar-y += spi.c
postcar-y += i2c.c
postcar-y += uart.c
ifeq ($(CONFIG_SKYLAKE_SOC_PCH_H),y)
ifeq ($(CONFIG_MAINBOARD_SUPPORTS_SKYLAKE_CPU),y)

View file

@ -187,4 +187,9 @@
#define PCH_DEV_GBE _PCH_DEV(LPC, 6)
#define PCH_DEV_TRACEHUB _PCH_DEV(LPC, 7)
/* for common code */
#define PCI_DEVFN_UART0 PCH_DEVFN_UART0
#define PCI_DEVFN_UART1 PCH_DEVFN_UART1
#define PCI_DEVFN_UART2 PCH_DEVFN_UART2
#endif

View file

@ -1,12 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <commonlib/helpers.h>
#include <soc/pci_devs.h>
const unsigned int uart_devices[] = {
PCH_DEVFN_UART0,
PCH_DEVFN_UART1,
PCH_DEVFN_UART2,
};
const int uart_devices_size = ARRAY_SIZE(uart_devices);