soc/intel/common/block: Add LPC BIOS decode lock

The LPC BIOS decode lock bit is defined in EBG EDS documentation.

Signed-off-by: Tim Chu <Tim.Chu@quantatw.com>
Change-Id: I60df7e6da2b22b8eeb2094aeb5ee9667043bb30b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71954
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Tim Chu 2022-12-08 06:37:06 +00:00 committed by Felix Held
parent 2c1511a461
commit dbbcc578c3
3 changed files with 14 additions and 0 deletions

View File

@ -61,6 +61,8 @@ void lpc_set_bios_interface_lock_down(void);
void lpc_set_lock_enable(void);
/* Set LPC BIOS Control EISS bit. */
void lpc_set_eiss(void);
/* Set LPC BIOS Decode LE bit */
void lpc_set_bde(void);
/* Set LPC Serial IRQ mode. */
void lpc_set_serirq_mode(enum serirq_mode mode);
/* Enable CLKRUN_EN for power gating LPC. */

View File

@ -27,6 +27,8 @@
#define LPC_LGMR_ADDR_MASK 0xffff0000
#define LPC_LGMR_EN (1 << 0)
#define LPC_LGMR_WINDOW_SIZE (64 * KiB)
#define LPC_BIOS_DECODE_EN 0xd8
#define LPC_BIOS_DECODE_LOCK (1 << 31)
#define LPC_BIOS_CNTL 0xdc
#define LPC_BC_BILD (1 << 7) /* BILD */
#define LPC_BC_LE (1 << 1) /* LE */

View File

@ -298,6 +298,16 @@ void lpc_disable_wp(void)
lpc_configure_write_protect(false);
}
void lpc_set_bde(void)
{
const pci_devfn_t dev = PCH_DEV_LPC;
uint32_t bde;
bde = pci_read_config32(dev, LPC_BIOS_DECODE_EN);
bde |= LPC_BIOS_DECODE_LOCK;
pci_write_config32(dev, LPC_BIOS_DECODE_EN, bde);
}
/*
* Set LPC Serial IRQ mode.
*/