soc/mediatek/mt8196: Initialize SSPM
[coreboot2.git] / src / soc / intel / tigerlake / spi.c
blob47b3b33ce2d43f8c73b0c915dc705bbc004dd339
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /*
4 * This file is created based on Intel Tiger Lake Processor PCH Datasheet
5 * Document number: 575857
6 * Chapter number: 7
7 */
9 #include <intelblocks/fast_spi.h>
10 #include <intelblocks/spi.h>
11 #include <soc/pci_devs.h>
12 #include <stdint.h>
14 #define PSF_SPI_DESTINATION_ID_H 0x23b0
15 #define PSF_SPI_DESTINATION_ID 0x23a8
17 int spi_soc_devfn_to_bus(unsigned int devfn)
19 switch (devfn) {
20 case PCH_DEVFN_GSPI0:
21 return 1;
22 case PCH_DEVFN_GSPI1:
23 return 2;
24 case PCH_DEVFN_GSPI2:
25 return 3;
27 return -1;
30 uint32_t soc_get_spi_psf_destination_id(void)
32 if (CONFIG(SOC_INTEL_TIGERLAKE_PCH_H))
33 return PSF_SPI_DESTINATION_ID_H;
34 return PSF_SPI_DESTINATION_ID;