[coreboot-gerrit] Change in coreboot[master]: soc/intel/apollolake: Add support for SPI device

Subrata Banik (Code Review) gerrit at coreboot.org
Tue Nov 7 13:44:36 CET 2017


Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/22363


Change subject: soc/intel/apollolake: Add support for SPI device
......................................................................

soc/intel/apollolake: Add support for SPI device

Provide a translation table to convert SPI device structure
into SPI bus number and vice versa.

Change-Id: I4c8b23c7d6f289927cd7545f3875ee4352603afa
Signed-off-by: Subrata Banik <subrata.banik at intel.com>
---
M src/soc/intel/apollolake/include/soc/pci_devs.h
1 file changed, 20 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/22363/1

diff --git a/src/soc/intel/apollolake/include/soc/pci_devs.h b/src/soc/intel/apollolake/include/soc/pci_devs.h
index 6aa2520..3b36292 100644
--- a/src/soc/intel/apollolake/include/soc/pci_devs.h
+++ b/src/soc/intel/apollolake/include/soc/pci_devs.h
@@ -158,4 +158,24 @@
 #define  PCH_DEV_LPC		_PCH_DEV(LPC, 0)
 #define  PCH_DEV_SMBUS		_PCH_DEV(LPC, 1)
 
+static inline int spi_devfn_to_bus(unsigned int devfn)
+{
+	switch (devfn) {
+	case PCH_DEVFN_SPI0: return 0;
+	case PCH_DEVFN_SPI1: return 1;
+	case PCH_DEVFN_SPI2: return 2;
+	}
+	return -1;
+}
+
+static inline int spi_bus_to_devfn(unsigned int bus)
+{
+	switch (bus) {
+	case 0: return PCH_DEVFN_SPI0;
+	case 1: return PCH_DEVFN_SPI1;
+	case 2: return PCH_DEVFN_SPI2;
+	}
+	return -1;
+}
+
 #endif

-- 
To view, visit https://review.coreboot.org/22363
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c8b23c7d6f289927cd7545f3875ee4352603afa
Gerrit-Change-Number: 22363
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171107/bc2de7c3/attachment-0001.html>


More information about the coreboot-gerrit mailing list