From 47f3e7e3cca3719a10bb00c1c22f5c48c1561d37 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Wed, 25 Feb 2026 11:00:07 -0800 Subject: [PATCH] soc/intel/jasperlake: 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 in Kconfig - Adds CONFIG_SOC_INTEL_SPI_DEV_MAX=3 - Removes src/soc/intel/jasperlake/spi.c - Updates Makefile.mk to remove spi.c compilation Note: This platform does not use PSF destination ID. The common code uses SOC_GSPI_DEVFN(n) macro directly. Change-Id: If42aa1f955bc0aae2698aac35dbe23b79c68bf09 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/91324 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- src/soc/intel/jasperlake/Kconfig | 5 +++++ src/soc/intel/jasperlake/Makefile.mk | 1 - src/soc/intel/jasperlake/spi.c | 17 ----------------- 3 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 src/soc/intel/jasperlake/spi.c diff --git a/src/soc/intel/jasperlake/Kconfig b/src/soc/intel/jasperlake/Kconfig index 7f6831e9c1..df65e73a78 100644 --- a/src/soc/intel/jasperlake/Kconfig +++ b/src/soc/intel/jasperlake/Kconfig @@ -57,6 +57,7 @@ config SOC_INTEL_JASPERLAKE 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_I2C_DEVFN select SOC_INTEL_COMMON_FEATURE_UART_DEVICES select SOC_INTEL_COMMON_FSP_RESET @@ -215,4 +216,8 @@ config INTEL_GMA_BCLM_OFFSET config INTEL_GMA_BCLM_WIDTH default 32 + +config SOC_INTEL_SPI_DEV_MAX + int + default 3 endif diff --git a/src/soc/intel/jasperlake/Makefile.mk b/src/soc/intel/jasperlake/Makefile.mk index 73765deb13..cb3ebfacd2 100644 --- a/src/soc/intel/jasperlake/Makefile.mk +++ b/src/soc/intel/jasperlake/Makefile.mk @@ -7,7 +7,6 @@ subdirs-y += ../../../cpu/intel/turbo # all (bootblock, verstage, romstage, postcar, ramstage) all-y += pmutil.c -all-y += spi.c bootblock-y += bootblock/bootblock.c bootblock-y += bootblock/pch.c diff --git a/src/soc/intel/jasperlake/spi.c b/src/soc/intel/jasperlake/spi.c deleted file mode 100644 index 8a7ed73b47..0000000000 --- a/src/soc/intel/jasperlake/spi.c +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#include -#include - -int spi_soc_devfn_to_bus(unsigned int devfn) -{ - switch (devfn) { - case PCH_DEVFN_GSPI0: - return 1; - case PCH_DEVFN_GSPI1: - return 2; - case PCH_DEVFN_GSPI2: - return 3; - } - return -1; -}