From 3337e56b50505166fc82bcc28de99a9e8fc4b38d Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Wed, 18 Feb 2026 21:25:18 -0800 Subject: [PATCH] soc/intel/alderlake: Use common UART device list driver Remove platform-specific uart.c and switch to the common UART device list driver. This eliminates 18 lines of duplicate code. The Alder Lake uart.c simply defined uart_devices[] array with PCH_DEVFN_UART* macros. The common driver now handles this using the PCI_UART_DEVFNn macro 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: Iafd4881c44dd9ccf7e204378bbafafbd1c884db0 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/91242 Reviewed-by: Werner Zeh Tested-by: build bot (Jenkins) --- src/soc/intel/alderlake/Kconfig | 2 ++ src/soc/intel/alderlake/Makefile.mk | 2 -- src/soc/intel/alderlake/include/soc/pci_devs.h | 5 +++++ src/soc/intel/alderlake/uart.c | 18 ------------------ 4 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 src/soc/intel/alderlake/uart.c diff --git a/src/soc/intel/alderlake/Kconfig b/src/soc/intel/alderlake/Kconfig index 34c9baf544..9034f5d252 100644 --- a/src/soc/intel/alderlake/Kconfig +++ b/src/soc/intel/alderlake/Kconfig @@ -84,6 +84,8 @@ config SOC_INTEL_ALDERLAKE select SOC_INTEL_COMMON_BLOCK_VTD select SOC_INTEL_COMMON_BLOCK_XHCI 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_RESET diff --git a/src/soc/intel/alderlake/Makefile.mk b/src/soc/intel/alderlake/Makefile.mk index 6262cf2999..eafba3cbd6 100644 --- a/src/soc/intel/alderlake/Makefile.mk +++ b/src/soc/intel/alderlake/Makefile.mk @@ -9,7 +9,6 @@ all-y += gspi.c all-y += i2c.c all-y += pmutil.c all-y += spi.c -all-y += uart.c bootblock-y += bootblock/bootblock.c bootblock-y += bootblock/pch.c @@ -50,7 +49,6 @@ smm-y += elog.c smm-y += p2sb.c smm-y += pmutil.c smm-y += smihandler.c -smm-y += uart.c smm-y += xhci.c ifeq ($(CONFIG_SOC_INTEL_ALDERLAKE_PCH_S),y) diff --git a/src/soc/intel/alderlake/include/soc/pci_devs.h b/src/soc/intel/alderlake/include/soc/pci_devs.h index 010a2101ea..9876397219 100644 --- a/src/soc/intel/alderlake/include/soc/pci_devs.h +++ b/src/soc/intel/alderlake/include/soc/pci_devs.h @@ -278,4 +278,9 @@ #define PCH_DEV_GBE _PCH_DEV(ESPI, 6) #define PCH_DEV_TRACEHUB _PCH_DEV(ESPI, 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 diff --git a/src/soc/intel/alderlake/uart.c b/src/soc/intel/alderlake/uart.c deleted file mode 100644 index 2344a6a717..0000000000 --- a/src/soc/intel/alderlake/uart.c +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -/* - * This file is created based on Intel Alder Lake Processor PCH Datasheet - * Document number: 621483 - * Chapter number: 9 - */ - -#include -#include - -const unsigned int uart_devices[] = { - PCH_DEVFN_UART0, - PCH_DEVFN_UART1, - PCH_DEVFN_UART2, -}; - -const int uart_devices_size = ARRAY_SIZE(uart_devices);