blob: f7d751f98eb4fcdd28a6264c994f0711e4e9125f [file] [log] [blame]
Ravi Sarawadi91ffac82022-05-07 16:37:09 -07001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <intelblocks/fast_spi.h>
4#include <intelblocks/spi.h>
5#include <soc/pci_devs.h>
6
7#define PSF_SPI_DESTINATION_ID 0x5140
8
9int spi_soc_devfn_to_bus(unsigned int devfn)
10{
11 switch (devfn) {
Ravi Sarawadi91ffac82022-05-07 16:37:09 -070012 case PCI_DEVFN_GSPI0:
13 return 1;
14 case PCI_DEVFN_GSPI1:
15 return 2;
Angel Ponsc7c746c2022-07-16 12:37:38 +020016 case PCI_DEVFN_GSPI2:
17 return 3;
Ravi Sarawadi91ffac82022-05-07 16:37:09 -070018 }
19 return -1;
20}
21
22uint32_t soc_get_spi_psf_destination_id(void)
23{
24 return PSF_SPI_DESTINATION_ID;
25}