From 56ede20f103fd30307447f66c26e630382e2205f Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Wed, 25 Feb 2026 11:00:08 -0800 Subject: [PATCH] soc/intel/pantherlake: Use common SPI device function driver Switch to the common SPI device function driver implementation. This eliminates platform-specific SPI code by leveraging the common driver with platform-specific Kconfig and macros. This commit: - Selects SOC_INTEL_COMMON_FEATURE_SPI_DEVFN and SOC_INTEL_COMMON_FEATURE_SPI_DEVFN_PSF in Kconfig - Adds CONFIG_SOC_INTEL_SPI_DEV_MAX=3 - Adds CONFIG_SOC_INTEL_SPI_PSF_DESTINATION_ID=0x5140 - Removes src/soc/intel/pantherlake/spi.c - Updates Makefile.mk to remove spi.c compilation The common code uses SOC_GSPI_DEVFN(n) macro directly. TEST=Panther Lake Fatcat OS boots properly Change-Id: Id7462deeb80c1efe32accf0ab7fc9fa68494ddfd Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/91328 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- src/soc/intel/pantherlake/Kconfig | 10 ++++++++++ src/soc/intel/pantherlake/Makefile.mk | 1 - src/soc/intel/pantherlake/spi.c | 25 ------------------------- 3 files changed, 10 insertions(+), 26 deletions(-) delete mode 100644 src/soc/intel/pantherlake/spi.c diff --git a/src/soc/intel/pantherlake/Kconfig b/src/soc/intel/pantherlake/Kconfig index 133a0b8684..33a592cb07 100644 --- a/src/soc/intel/pantherlake/Kconfig +++ b/src/soc/intel/pantherlake/Kconfig @@ -98,6 +98,8 @@ config SOC_INTEL_PANTHERLAKE_BASE select SOC_INTEL_COMMON_BLOCK_XHCI_ELOG select SOC_INTEL_COMMON_FEATURE select SOC_INTEL_COMMON_FEATURE_GSPI_DEVFN + select SOC_INTEL_COMMON_FEATURE_SPI_DEVFN + select SOC_INTEL_COMMON_FEATURE_SPI_DEVFN_PSF select SOC_INTEL_COMMON_FEATURE_I2C_DEVFN select SOC_INTEL_COMMON_FEATURE_UART_DEVICES select SOC_INTEL_COMMON_FSP_RESET @@ -479,4 +481,12 @@ config RAMSTAGE_CBFS_CACHE_SIZE config CBFS_CACHE_ALIGN default 1024 +config SOC_INTEL_SPI_DEV_MAX + int + default 3 + +config SOC_INTEL_SPI_PSF_DESTINATION_ID + hex + default 0x5140 + endif diff --git a/src/soc/intel/pantherlake/Makefile.mk b/src/soc/intel/pantherlake/Makefile.mk index 5f956db228..857e7ab648 100644 --- a/src/soc/intel/pantherlake/Makefile.mk +++ b/src/soc/intel/pantherlake/Makefile.mk @@ -8,7 +8,6 @@ subdirs-y += ../../../cpu/intel/turbo # all (bootblock, verstage, romstage, postcar, ramstage) all-y += pmutil.c -all-y += spi.c all-y += gpio.c bootblock-y += bootblock/bootblock.c diff --git a/src/soc/intel/pantherlake/spi.c b/src/soc/intel/pantherlake/spi.c deleted file mode 100644 index f7d751f98e..0000000000 --- a/src/soc/intel/pantherlake/spi.c +++ /dev/null @@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#include -#include -#include - -#define PSF_SPI_DESTINATION_ID 0x5140 - -int spi_soc_devfn_to_bus(unsigned int devfn) -{ - switch (devfn) { - case PCI_DEVFN_GSPI0: - return 1; - case PCI_DEVFN_GSPI1: - return 2; - case PCI_DEVFN_GSPI2: - return 3; - } - return -1; -} - -uint32_t soc_get_spi_psf_destination_id(void) -{ - return PSF_SPI_DESTINATION_ID; -}