Ravi Sarawadi | 91ffac8 | 2022-05-07 16:37:09 -0700 | [diff] [blame] | 1 | /* 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 | |
| 9 | int spi_soc_devfn_to_bus(unsigned int devfn) |
| 10 | { |
| 11 | switch (devfn) { |
Ravi Sarawadi | 91ffac8 | 2022-05-07 16:37:09 -0700 | [diff] [blame] | 12 | case PCI_DEVFN_GSPI0: |
| 13 | return 1; |
| 14 | case PCI_DEVFN_GSPI1: |
| 15 | return 2; |
Angel Pons | c7c746c | 2022-07-16 12:37:38 +0200 | [diff] [blame] | 16 | case PCI_DEVFN_GSPI2: |
| 17 | return 3; |
Ravi Sarawadi | 91ffac8 | 2022-05-07 16:37:09 -0700 | [diff] [blame] | 18 | } |
| 19 | return -1; |
| 20 | } |
| 21 | |
| 22 | uint32_t soc_get_spi_psf_destination_id(void) |
| 23 | { |
| 24 | return PSF_SPI_DESTINATION_ID; |
| 25 | } |