coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
spi.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /*
4  * This file is created based on Intel Tiger Lake Processor PCH Datasheet
5  * Document number: 575857
6  * Chapter number: 7
7  */
8 
9 #include <intelblocks/spi.h>
10 #include <intelblocks/fast_spi.h>
11 #include <soc/pci_devs.h>
12 
13 #define PSF_SPI_DESTINATION_ID_H 0x23b0
14 #define PSF_SPI_DESTINATION_ID 0x23a8
15 
16 int spi_soc_devfn_to_bus(unsigned int devfn)
17 {
18  switch (devfn) {
19  case PCH_DEVFN_SPI:
20  return 0;
21  case PCH_DEVFN_GSPI0:
22  return 1;
23  case PCH_DEVFN_GSPI1:
24  return 2;
25  case PCH_DEVFN_GSPI2:
26  return 3;
27  }
28  return -1;
29 }
30 
32 {
33  if (CONFIG(SOC_INTEL_TIGERLAKE_PCH_H))
36 }
@ CONFIG
Definition: dsi_common.h:201
#define PCH_DEVFN_GSPI0
Definition: pci_devs.h:206
#define PCH_DEVFN_SPI
Definition: pci_devs.h:220
#define PCH_DEVFN_GSPI2
Definition: pci_devs.h:107
#define PCH_DEVFN_GSPI1
Definition: pci_devs.h:207
int spi_soc_devfn_to_bus(unsigned int devfn)
Definition: spi.c:15
uint32_t soc_get_spi_psf_destination_id(void)
Definition: spi.c:32
#define PSF_SPI_DESTINATION_ID_H
Definition: spi.c:13
#define PSF_SPI_DESTINATION_ID
Definition: spi.c:14
unsigned int uint32_t
Definition: stdint.h:14