From 0de80da24cc39003f61f86452f46c9b48c95ae4d Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Sat, 11 Feb 2017 11:06:19 -0800 Subject: soc/intel/skylake: Add support for SPI device Add a new PCI driver for SPI devices with supported PCI ids. Also, provide a translation table to convert struct device structure into SPI bus number. BUG=chrome-os-partner:59832 BRANCH=None TEST=Compiles successfully Change-Id: If860eb819f2ce5ae5443f808b356af57f86c52be Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/18341 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie --- src/soc/intel/skylake/include/soc/pci_devs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/soc/intel/skylake/include') diff --git a/src/soc/intel/skylake/include/soc/pci_devs.h b/src/soc/intel/skylake/include/soc/pci_devs.h index 974f1d8e19..a19a7c6007 100644 --- a/src/soc/intel/skylake/include/soc/pci_devs.h +++ b/src/soc/intel/skylake/include/soc/pci_devs.h @@ -176,4 +176,14 @@ static inline int i2c_devfn_to_bus(unsigned devfn) return -1; } +static inline int spi_devfn_to_bus(unsigned devfn) +{ + switch (devfn) { + case PCH_DEVFN_SPI: return 0; + case PCH_DEVFN_GSPI0: return 1; + case PCH_DEVFN_GSPI1: return 2; + } + return -1; +} + #endif -- cgit v1.2.3