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 #include <console/console.h>
4 #include <device/pci_ops.h>
8 #include <spi-generic.h>
9 
10 #include "finalize.h"
11 
13 {
14  const pci_devfn_t lpc_dev = PCI_DEV(0, 0x1f, 0);
15 
16  /* Lock SPIBAR */
17  RCBA32_OR(0x3804, (1 << 15));
18 
19  if (CONFIG(SPI_FLASH_SMM))
20  /* Re-init SPI driver to handle locked BAR */
21  spi_init();
22 
23  /* TCLOCKDN: TC Lockdown */
24  RCBA32_OR(0x0050, (1UL << 31));
25 
26  /* BIOS Interface Lockdown */
27  RCBA32_OR(0x3410, (1 << 0));
28 
29  /* Function Disable SUS Well Lockdown */
30  RCBA_AND_OR(8, 0x3420, ~0U, (1 << 7));
31 
33 
36 
38 
39  if (CONFIG(SOUTHBRIDGE_INTEL_LYNXPOINT))
40  /* PMSYNC */
41  RCBA32_OR(0x33c4, (1UL << 31));
42 
43  /* R/WO registers */
44  RCBA32(0x21a4) = RCBA32(0x21a4);
45  pci_write_config32(PCI_DEV(0, 27, 0), 0x74,
46  pci_read_config32(PCI_DEV(0, 27, 0), 0x74));
47 
48  if (CONFIG(BOOTMEDIA_SMM_BWP))
50 
52 
54 }
#define SMI_EN
Definition: pm.h:32
#define TCO_EN
Definition: pm.h:211
@ CONFIG
Definition: dsi_common.h:201
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
Definition: pci_ops.h:76
static __always_inline void pci_update_config32(const struct device *dev, u16 reg, u32 mask, u32 or)
Definition: pci_ops.h:120
static __always_inline void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
Definition: pci_ops.h:180
static __always_inline void pci_or_config8(const struct device *dev, u16 reg, u8 ormask)
Definition: pci_ops.h:169
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
Definition: pci_ops.h:58
#define ACPI_BASE_LOCK
Definition: pmc.h:55
#define SMI_LOCK
Definition: pmc.h:60
#define SLP_STR_POL_LOCK
Definition: pmc.h:54
#define ETR3_CF9GR
CF9h Global Reset.
Definition: pmc.h:43
#define ETR3_CF9LOCK
CF9h Lockdown.
Definition: pmc.h:42
#define PCI_DEV(SEGBUS, DEV, FN)
Definition: pci_type.h:14
u32 pci_devfn_t
Definition: pci_type.h:8
void write_pmbase16(const u8 addr, const u16 val)
Definition: pmbase.c:43
u16 read_pmbase16(const u8 addr)
Definition: pmbase.c:64
#define D31F0_GEN_PMCON_1
Definition: pmutil.h:9
#define D31F0_GEN_PMCON_LOCK
Definition: pmutil.h:16
#define D31F0_ETR3
Definition: pmutil.h:19
#define post_code(value)
Definition: post_code.h:12
#define POST_OS_BOOT
Final code before OS boots.
Definition: post_codes.h:414
#define TCO1_CNT
Definition: smbus.h:12
#define TCO_LOCK
Definition: smbus.h:13
void intel_pch_finalize_smm(void)
Definition: finalize.c:12
#define RCBA32_OR(x, or)
Definition: rcba.h:22
#define RCBA_AND_OR(bits, x, and, or)
Definition: rcba.h:17
#define RCBA32(x)
Definition: rcba.h:14
void __weak spi_init(void)
Definition: spi-generic.c:117