soc/intel/alderlake: 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=4
- Adds CONFIG_SOC_INTEL_SPI_PSF_DESTINATION_ID=0x23a8
- Removes src/soc/intel/alderlake/spi.c
- Updates Makefile.mk to remove spi.c compilation

The common code uses SOC_GSPI_DEVFN(n) macro directly.

Change-Id: I346e6c6cbe95c8608009e5f9fc53dbcff5edba4e
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91326
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jeremy Compostella 2026-02-25 11:00:08 -08:00 committed by Matt DeVillier
commit 8ecff12528
3 changed files with 10 additions and 34 deletions

View file

@ -86,6 +86,8 @@ config SOC_INTEL_ALDERLAKE
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
@ -574,4 +576,12 @@ config SOC_INTEL_COMMON_BLOCK_ACPI_SLP_S0_FREQ_HZ
help
slp_s0_residency granularity in 122us ticks (i.e. ~8.2KHz).
config SOC_INTEL_SPI_DEV_MAX
int
default 4
config SOC_INTEL_SPI_PSF_DESTINATION_ID
hex
default 0x23a8
endif

View file

@ -6,7 +6,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

View file

@ -1,33 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* This file is created based on Intel Alder Lake Processor PCH Datasheet
* Document number: 621483
* Chapter number: 7
*/
#include <intelblocks/fast_spi.h>
#include <intelblocks/spi.h>
#include <soc/pci_devs.h>
#define PSF_SPI_DESTINATION_ID 0x23a8
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;
case PCH_DEVFN_GSPI3:
return 4;
}
return -1;
}
uint32_t soc_get_spi_psf_destination_id(void)
{
return PSF_SPI_DESTINATION_ID;
}