diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2022-05-05 11:04:04 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-05-16 13:07:52 +0000 |
commit | bae84984860853f67d36b775c39171845be74b8b (patch) | |
tree | fa44ec7e40ee075d9758c804d3b963525ab182ea /src/soc/intel/common | |
parent | 8da3804430c1ac8a3187fb982f0718583b0b3ed4 (diff) |
soc/intel/cmn/spi: Separate fast SPI device from generic SPI driver
The fast SPI controller (usually handling the boot NOR flash) is a
different controller type than the generic SPI controllers as it
provides access to the boot flash and usually is not used for generic
SPI slave connections.
Though there is common code for the fast SPI controller it currently do
not uses the PCI driver structure. This patch adds the PCI driver
envelope to the fast SPI driver and moves Apollo Lake as the first
platform to this driver.
Change-Id: I31bf39ec1c622db887dec9ca8623a7f282402849
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64075
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r-- | src/soc/intel/common/block/fast_spi/fast_spi.c | 19 | ||||
-rw-r--r-- | src/soc/intel/common/block/spi/spi.c | 1 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi.c b/src/soc/intel/common/block/fast_spi/fast_spi.c index 63fb68c2f7..9788493e1e 100644 --- a/src/soc/intel/common/block/fast_spi/fast_spi.c +++ b/src/soc/intel/common/block/fast_spi/fast_spi.c @@ -5,7 +5,9 @@ #include <arch/romstage.h> #include <device/mmio.h> #include <assert.h> +#include <device/pci.h> #include <device/pci_def.h> +#include <device/pci_ids.h> #include <device/pci_ops.h> #include <console/console.h> #include <commonlib/helpers.h> @@ -453,3 +455,20 @@ void fast_spi_clear_outstanding_status(void) /* Make sure all W1C status bits get cleared. */ write32(spibar + SPIBAR_HSFSTS_CTL, SPIBAR_HSFSTS_W1C_BITS); } + +static struct device_operations fast_spi_dev_ops = { + .read_resources = pci_dev_read_resources, + .set_resources = pci_dev_set_resources, + .enable_resources = pci_dev_enable_resources, +}; + +static const unsigned short pci_device_ids[] = { + PCI_DID_INTEL_APL_HWSEQ_SPI, + 0 +}; + +static const struct pci_driver fast_spi __pci_driver = { + .ops = &fast_spi_dev_ops, + .vendor = PCI_VID_INTEL, + .devices = pci_device_ids, +}; diff --git a/src/soc/intel/common/block/spi/spi.c b/src/soc/intel/common/block/spi/spi.c index 0716e1ae90..256e01a342 100644 --- a/src/soc/intel/common/block/spi/spi.c +++ b/src/soc/intel/common/block/spi/spi.c @@ -130,7 +130,6 @@ static const unsigned short pci_device_ids[] = { PCI_DID_INTEL_APL_SPI0, PCI_DID_INTEL_APL_SPI1, PCI_DID_INTEL_APL_SPI2, - PCI_DID_INTEL_APL_HWSEQ_SPI, PCI_DID_INTEL_GLK_SPI0, PCI_DID_INTEL_GLK_SPI1, PCI_DID_INTEL_GLK_SPI2, |