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 <device/pci_ops.h>
4 #include <spi-generic.h>
5 #include <soc/pci_devs.h>
6 #include <soc/lpc.h>
7 #include <soc/pch.h>
8 #include <soc/rcba.h>
9 #include <soc/spi.h>
11 
13 {
15 
16  /* Lock SPIBAR */
17  if (!CONFIG(EM100PRO_SPI_CONSOLE))
19 
20  /* TC Lockdown */
21  RCBA32_OR(0x0050, 1 << 31);
22 
23  /* BIOS Interface Lockdown */
24  RCBA32_OR(GCS, 1 << 0);
25 
26  /* Function Disable SUS Well Lockdown */
27  RCBA8(FDSW) |= 1 << 7;
28 
29  /* Global SMI Lock */
31 
32  /* GEN_PMCON Lock */
34 
35  /* PMSYNC */
36  RCBA32_OR(PMSYNC_CONFIG, 1 << 31);
37 
38  /* Lock */
39  RCBA32_OR(0x3a6c, 0x00000001);
40 
41  /* Read+Write this R/WO register */
42  RCBA32(LCAP) = RCBA32(LCAP);
43 }
@ CONFIG
Definition: dsi_common.h:201
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
#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 LCAP
Definition: pcie.h:16
#define PCH_DEV_LPC
Definition: pci_devs.h:224
#define GCS
Definition: lpc.h:36
#define GEN_PMCON_1
Definition: lpc.h:56
#define GEN_PMCON_LOCK
Definition: lpc.h:69
#define PMSYNC_CONFIG
Definition: rcba.h:111
#define FDSW
Definition: rcba.h:126
#define SPIBAR_HSFS_FLOCKDN
Definition: spi.h:21
#define SPIBAR_HSFS
Definition: spi.h:20
#define SPIBAR_OFFSET
Definition: spi.h:11
void broadwell_pch_finalize(void)
Definition: finalize.c:12
#define RCBA32_OR(x, or)
Definition: rcba.h:22
#define RCBA8(x)
Definition: rcba.h:12
#define RCBA32(x)
Definition: rcba.h:14
void spi_finalize_ops(void)
Definition: spi.c:1039