coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
finalize.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /*
4  * This file is created based on Intel Tiger Lake Processor PCH Datasheet
5  * Document number: 575857
6  * Chapter number: 4, 29
7  */
8 
9 #include <bootstate.h>
11 #include <console/console.h>
12 #include <cpu/x86/smm.h>
13 #include <device/mmio.h>
14 #include <device/pci.h>
15 #include <intelblocks/cse.h>
16 #include <intelblocks/lpc_lib.h>
17 #include <intelblocks/pcr.h>
18 #include <intelblocks/pmclib.h>
20 #include <intelblocks/tco.h>
21 #include <soc/p2sb.h>
22 #include <soc/pci_devs.h>
23 #include <soc/pcr_ids.h>
24 #include <soc/pm.h>
25 #include <soc/smbus.h>
26 #include <soc/soc_chip.h>
27 #include <soc/systemagent.h>
28 #include <spi-generic.h>
29 
30 static void pch_finalize(void)
31 {
32  /* TCO Lock down */
33  tco_lockdown();
34 
35  /* TODO: Add Thermal Configuration */
36 
38 }
39 
40 static void tbt_finalize(void)
41 {
42  int i;
43  const struct device *dev;
44 
45  /* Disable Thunderbolt PCIe root ports bus master */
46  for (i = 0; i < NUM_TBT_FUNCTIONS; i++) {
48  if (dev)
50  }
51 }
52 
53 static void soc_finalize(void *unused)
54 {
55  printk(BIOS_DEBUG, "Finalizing chipset.\n");
56 
57  pch_finalize();
59  tbt_finalize();
60  if (CONFIG(DISABLE_HECI1_AT_PRE_BOOT))
61  heci1_disable();
62 
63  /* Indicate finalize step with post code */
65 }
66 
@ BS_PAYLOAD_LOAD
Definition: bootstate.h:88
@ BS_OS_RESUME
Definition: bootstate.h:86
@ BS_ON_ENTRY
Definition: bootstate.h:95
@ BS_ON_EXIT
Definition: bootstate.h:96
#define printk(level,...)
Definition: stdlib.h:16
DEVTREE_CONST struct device * pcidev_path_on_root(pci_devfn_t devfn)
Definition: device_const.c:255
void heci1_disable(void)
Definition: disable_heci.c:84
@ CONFIG
Definition: dsi_common.h:201
#define APM_CNT_FINALIZE
Definition: smm.h:24
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
void pci_dev_disable_bus_master(const struct device *dev)
Definition: pci_device.c:1616
#define post_code(value)
Definition: post_code.h:12
#define POST_OS_BOOT
Final code before OS boots.
Definition: post_codes.h:414
int apm_control(u8 cmd)
Definition: smi_trigger.c:31
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, soc_finalize, NULL)
#define SA_DEVFN_TBT(x)
Definition: pci_devs.h:48
#define NUM_TBT_FUNCTIONS
Definition: pci_devs.h:49
void pmc_clear_pmcon_sts(void)
void tco_lockdown(void)
Definition: tco.c:50
static void soc_finalize(void *unused)
Definition: finalize.c:53
static void pch_finalize(void)
Definition: finalize.c:30
static void tbt_finalize(void)
Definition: finalize.c:40
#define NULL
Definition: stddef.h:19
Definition: device.h:107