coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
variants.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef __BASEBOARD_VARIANTS_H__
4 #define __BASEBOARD_VARIANTS_H__
5 
6 #include <amdblocks/gpio.h>
7 #include <soc/pci_devs.h>
8 #include <platform_descriptors.h>
9 
10 #define WLAN_DEVFN PCIE_GPP_2_0_DEVFN
11 #define SD_DEVFN PCIE_GPP_2_1_DEVFN
12 #define WWAN_DEVFN PCIE_GPP_2_2_DEVFN
13 #define NVME_DEVFN PCIE_GPP_2_3_DEVFN
14 
15 /*
16  * This function provides base GPIO configuration table. It is typically provided by
17  * baseboard using a weak implementation. If GPIO configuration for a variant differs
18  * significantly from the baseboard, then the variant can also provide a strong implementation
19  * of this function.
20  */
21 const struct soc_amd_gpio *variant_base_gpio_table(size_t *size);
22 /*
23  * These functions allow variants to override any GPIOs that are different than the base GPIO
24  * configuration provided without having to replace the entire file.
25  */
26 const struct soc_amd_gpio *variant_override_gpio_table(size_t *size);
27 const struct soc_amd_gpio *variant_early_override_gpio_table(size_t *size);
28 const struct soc_amd_gpio *variant_bootblock_override_gpio_table(size_t *size);
29 const struct soc_amd_gpio *variant_pcie_override_gpio_table(size_t *size);
30 
31 /* This function provides early GPIO init in early bootblock or psp. */
32 const struct soc_amd_gpio *variant_early_gpio_table(size_t *size);
33 
34 /* This function provides GPIO settings at the end of bootblock. */
35 const struct soc_amd_gpio *variant_bootblock_gpio_table(size_t *size);
36 
37 /* This function provides GPIO settings before PCIe enumeration. */
38 const struct soc_amd_gpio *variant_pcie_gpio_table(size_t *size);
39 
40 /* This function provides GPIO settings before entering sleep. */
41 const struct soc_amd_gpio *variant_sleep_gpio_table(size_t *size);
42 
43 /* This function provides GPIO settings for eSPI bus. */
44 const struct soc_amd_gpio *variant_espi_gpio_table(size_t *size);
45 
46 /* This function provides GPIO settings for TPM i2c bus. */
47 const struct soc_amd_gpio *variant_tpm_gpio_table(size_t *size);
48 
49 bool variant_has_pcie_wwan(void);
50 
51 void variant_update_dxio_descriptors(fsp_dxio_descriptor *dxio_descriptors);
52 void variant_update_ddi_descriptors(fsp_ddi_descriptor *ddi_descriptors);
53 
56  SD,
58  NVME
59 };
60 
62 
63 void variant_devtree_update(void);
64 #endif /* __BASEBOARD_VARIANTS_H__ */
static const fsp_dxio_descriptor dxio_descriptors[]
void variant_devtree_update(void)
Definition: mainboard.c:86
const struct pad_config * variant_early_gpio_table(size_t *num)
Definition: gpio.c:204
const struct pad_config * variant_override_gpio_table(size_t *num)
Definition: gpio.c:450
const struct pad_config * variant_sleep_gpio_table(size_t *num)
Definition: gpio.c:466
const struct pad_config * variant_base_gpio_table(size_t *num)
Definition: gpio.c:444
const struct soc_amd_gpio * variant_pcie_override_gpio_table(size_t *size)
Definition: gpio.c:330
const struct soc_amd_gpio * variant_tpm_gpio_table(size_t *size)
Definition: gpio.c:354
const struct soc_amd_gpio * variant_early_override_gpio_table(size_t *size)
Definition: gpio.c:317
const struct soc_amd_gpio * variant_espi_gpio_table(size_t *size)
Definition: gpio.c:348
uint8_t variant_sd_aux_reset_gpio(void)
Definition: helpers.c:12
bool variant_has_pcie_wwan(void)
Definition: helpers.c:7
void variant_update_ddi_descriptors(fsp_ddi_descriptor *ddi_descriptors)
const struct soc_amd_gpio * variant_pcie_gpio_table(size_t *size)
Definition: gpio.c:294
dxio_port_id
Definition: variants.h:54
@ WLAN
Definition: variants.h:55
@ WWAN_NVME
Definition: variants.h:57
@ SD
Definition: variants.h:56
@ NVME
Definition: variants.h:58
void variant_update_dxio_descriptors(fsp_dxio_descriptor *dxio_descriptors)
const struct soc_amd_gpio * variant_bootblock_override_gpio_table(size_t *size)
Definition: gpio.c:324
const struct soc_amd_gpio * variant_bootblock_gpio_table(size_t *size)
Definition: gpio.c:300
unsigned char uint8_t
Definition: stdint.h:8