coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pcie.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <device/device.h>
4 #include <soc/pci_devs.h>
5 #include <soc/reg_access.h>
6 #include <soc/romstage.h>
7 
8 /* Minimum time in microseconds for assertion of PERST# signal */
9 #define PCIEXP_PERST_MIN_ASSERT_US 100
10 
11 /* Microsecond delay post issuing common lane reset */
12 #define PCIEXP_DELAY_US_POST_CMNRESET_RESET 1
13 
14 /* Microsecond delay to wait for PLL to lock */
15 #define PCIEXP_DELAY_US_WAIT_PLL_LOCK 80
16 
17 /* Microsecond delay post issuing sideband interface reset */
18 #define PCIEXP_DELAY_US_POST_SBI_RESET 20
19 
20 /* Microsecond delay post deasserting PERST# */
21 #define PCIEXP_DELAY_US_POST_PERST_DEASSERT 10
22 
23 const struct reg_script pcie_init_script[] = {
24  /* Assert PCIe reset# */
26 
27  /* PHY Common lane reset */
30 
31  /* Wait post common lane reset */
33 
34  /* PHY Sideband interface reset.
35  * Controller main reset
36  */
41 
42  /* Controller sideband interface reset */
45 
46  /* Wait post sideband interface reset */
48 
49  /* Deassert PCIe reset# */
51 
52  /* Wait post de assert PERST#. */
54 
55  /* Controller primary interface reset */
58 
59  /* Set the mixer load resistance */
65 };
66 
67 static const struct reg_script pcie_bus_init_script[] = {
68  /* Setup Message Bus Idle Counter (SBIC) values */
72 
73  /* Set the IPF bit in MCR2 */
76 
77  /* Set up the Posted and Non Posted Request sizes for PCIe */
82 };
83 
84 void pcie_init(void)
85 {
86  /* Initialize the PCIe bridges */
90 }
#define V_PCIE_ROOT_PORT_SBIC_VALUE
#define B_QNC_PCIE_CCFG_UNRS
Definition: QuarkNcSocId.h:748
#define SOCCLKEN_CONFIG_PHY_I_CMNRESET_L
Definition: QuarkNcSocId.h:363
#define B_QNC_PCIE_CCFG_UPSD
Definition: QuarkNcSocId.h:747
#define QUARK_PCIE_AFE_PCIE_RXPICTRL0_L0
Definition: QuarkNcSocId.h:402
#define SOCCLKEN_CONFIG_PHY_I_SIDE_RST_L
Definition: QuarkNcSocId.h:362
#define QUARK_SCSS_SOC_UNIT_SOCCLKEN_CONFIG
Definition: QuarkNcSocId.h:368
#define B_QNC_PCIE_IOSFSBCTL_SBIC_MASK
Definition: QuarkNcSocId.h:760
#define R_QNC_PCIE_IOSFSBCTL
Definition: QuarkNcSocId.h:758
#define R_QNC_PCIE_MPC2
Definition: QuarkNcSocId.h:750
#define R_QNC_PCIE_CCFG
Definition: QuarkNcSocId.h:745
#define SOCCLKEN_CONFIG_BB_RST_B
Definition: QuarkNcSocId.h:366
#define B_QNC_PCIE_MPC2_IPF
Definition: QuarkNcSocId.h:751
#define QUARK_PCIE_AFE_PCIE_RXPICTRL0_L1
Definition: QuarkNcSocId.h:403
#define SOCCLKEN_CONFIG_SBI_BB_RST_B
Definition: QuarkNcSocId.h:364
#define B_QNC_PCIE_CCFG_UPRS
Definition: QuarkNcSocId.h:749
#define SOCCLKEN_CONFIG_SBI_RST_100_CORE_B
Definition: QuarkNcSocId.h:365
#define OCFGPIMIXLOAD_1_0_MASK
Definition: QuarkNcSocId.h:405
#define REG_PCI_OR32(reg_, value_)
Definition: reg_script.h:187
#define REG_PCI_READ32(reg_)
Definition: reg_script.h:163
void reg_script_run(const struct reg_script *script)
Definition: reg_script.c:700
void reg_script_run_on_dev(struct device *dev, const struct reg_script *step)
Definition: reg_script.c:689
#define REG_PCI_RMW8(reg_, mask_, value_)
Definition: reg_script.h:171
#define REG_PCI_READ8(reg_)
Definition: reg_script.h:159
#define REG_PCI_RMW32(reg_, mask_, value_)
Definition: reg_script.h:175
#define REG_SCRIPT_END
Definition: reg_script.h:427
#define PCIE_PORT1_BDF
Definition: pci_devs.h:48
#define PCIE_PORT0_BDF
Definition: pci_devs.h:44
#define REG_PCIE_AFE_AND(reg_, value_)
Definition: reg_access.h:149
#define MAINBOARD_PCIE_RESET(pin_value_)
Definition: reg_access.h:163
#define REG_SOC_UNIT_OR(reg_, value_)
Definition: reg_access.h:201
#define TIME_DELAY_USEC(value_)
Definition: reg_access.h:209
#define PCIEXP_DELAY_US_WAIT_PLL_LOCK
Definition: pcie.c:15
void pcie_init(void)
Definition: pcie.c:84
#define PCIEXP_DELAY_US_POST_PERST_DEASSERT
Definition: pcie.c:21
const struct reg_script pcie_init_script[]
Definition: pcie.c:23
#define PCIEXP_DELAY_US_POST_SBI_RESET
Definition: pcie.c:18
static const struct reg_script pcie_bus_init_script[]
Definition: pcie.c:67
#define PCIEXP_DELAY_US_POST_CMNRESET_RESET
Definition: pcie.c:12