coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lpc.h File Reference
#include <types.h>
Include dependency graph for lpc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LPC_PCI_CONTROL   0x40
 
#define LEGACY_DMA_EN   BIT(2)
 
#define VW_ROM_SHARING_EN   BIT(3)
 
#define EXT_ROM_SHARING_EN   BIT(4)
 
#define SPI_ROM_BIOS_SEMAPHORE   BIT(5)
 
#define SPI_ROM_EC_SEMAPHORE   BIT(6)
 
#define LPC_IO_PORT_DECODE_ENABLE   0x44
 
#define DECODE_ENABLE_PARALLEL_PORT0   BIT(0)
 
#define DECODE_ENABLE_PARALLEL_PORT1   BIT(1)
 
#define DECODE_ENABLE_PARALLEL_PORT2   BIT(2)
 
#define DECODE_ENABLE_PARALLEL_PORT3   BIT(3)
 
#define DECODE_ENABLE_PARALLEL_PORT4   BIT(4)
 
#define DECODE_ENABLE_PARALLEL_PORT5   BIT(5)
 
#define DECODE_ENABLE_SERIAL_PORT0   BIT(6)
 
#define DECODE_ENABLE_SERIAL_PORT1   BIT(7)
 
#define DECODE_ENABLE_SERIAL_PORT2   BIT(8)
 
#define DECODE_ENABLE_SERIAL_PORT3   BIT(9)
 
#define DECODE_ENABLE_SERIAL_PORT4   BIT(10)
 
#define DECODE_ENABLE_SERIAL_PORT5   BIT(11)
 
#define DECODE_ENABLE_SERIAL_PORT6   BIT(12)
 
#define DECODE_ENABLE_SERIAL_PORT7   BIT(13)
 
#define DECODE_ENABLE_AUDIO_PORT0   BIT(14)
 
#define DECODE_ENABLE_AUDIO_PORT1   BIT(15)
 
#define DECODE_ENABLE_AUDIO_PORT2   BIT(16)
 
#define DECODE_ENABLE_AUDIO_PORT3   BIT(17)
 
#define DECODE_ENABLE_MIDI_PORT0   BIT(18)
 
#define DECODE_ENABLE_MIDI_PORT1   BIT(19)
 
#define DECODE_ENABLE_MIDI_PORT2   BIT(20)
 
#define DECODE_ENABLE_MIDI_PORT3   BIT(21)
 
#define DECODE_ENABLE_MSS_PORT0   BIT(22)
 
#define DECODE_ENABLE_MSS_PORT1   BIT(23)
 
#define DECODE_ENABLE_MSS_PORT2   BIT(24)
 
#define DECODE_ENABLE_MSS_PORT3   BIT(25)
 
#define DECODE_ENABLE_FDC_PORT0   BIT(26)
 
#define DECODE_ENABLE_FDC_PORT1   BIT(27)
 
#define DECODE_ENABLE_GAME_PORT   BIT(28)
 
#define DECODE_ENABLE_KBC_PORT   BIT(29)
 
#define DECODE_ENABLE_ACPIUC_PORT   BIT(30)
 
#define DECODE_ENABLE_ADLIB_PORT   BIT(31)
 
#define LPC_IO_OR_MEM_DECODE_ENABLE   0x48
 
#define LPC_WIDEIO2_ENABLE   BIT(25)
 
#define LPC_WIDEIO1_ENABLE   BIT(24)
 
#define DECODE_IO_PORT_ENABLE6   BIT(23)
 
#define DECODE_IO_PORT_ENABLE5   BIT(22)
 
#define DECODE_IO_PORT_ENABLE4   BIT(21)
 
#define DECODE_MEM_PORT_ENABLE1   BIT(20)
 
#define DECODE_IO_PORT_ENABLE3   BIT(19)
 
#define DECODE_IO_PORT_ENABLE2   BIT(18)
 
#define DECODE_IO_PORT_ENABLE1   BIT(17)
 
#define DECODE_IO_PORT_ENABLE0   BIT(16)
 
#define LPC_SYNC_TIMEOUT_COUNT_MASK   (0xff << 8)
 
#define LPC_SYNC_TIMEOUT_COUNT_ENABLE   BIT(7)
 
#define LPC_DECODE_RTC_IO_ENABLE   BIT(6)
 
#define DECODE_MEM_PORT_ENABLE0   BIT(5)
 
#define LPC_WIDEIO0_ENABLE   BIT(2)
 
#define DECODE_ALTERNATE_SIO_ENABLE   BIT(1)
 
#define DECODE_SIO_ENABLE   BIT(0)
 
#define LPC_SELECT_SIO_4E4F   1
 
#define LPC_SELECT_SIO_2E2F   0
 
#define WIDEIO_RANGE_ERROR   -1
 
#define LPC_MEM_PORT1   0x4c
 
#define ROM_PROTECT_RANGE0   0x50
 
#define ROM_BASE_MASK   0xfffff000 /* bits 31-12 */
 
#define ROM_RANGE_WP   BIT(10)
 
#define ROM_RANGE_RP   BIT(9)
 
#define RANGE_UNIT   BIT(8) /* 0: 4kiB, 1: 64kiB */
 
#define RANGE_ADDR_MASK   0x000000ff /* Range defined by bits 7-0 */
 
#define ROM_PROTECT_RANGE_REG(n)   (ROM_PROTECT_RANGE0 + (4 * n))
 
#define MAX_ROM_PROTECT_RANGES   4
 
#define LPC_MEM_PORT0   0x60
 
#define LPC_WIDEIO_GENERIC_PORT   0x64
 
#define LPC_WIDEIO1_GENERIC_PORT   0x66
 
#define ROM_ADDRESS_RANGE1_START   0x68
 
#define ROM_ADDRESS_RANGE1_END   0x6a
 
#define ROM_ADDRESS_RANGE2_START   0x6c
 
#define ROM_ADDRESS_RANGE2_END   0x6e
 
#define LPC_ALT_WIDEIO_RANGE_ENABLE   0x74
 
#define LPC_ALT_WIDEIO2_ENABLE   BIT(3)
 
#define LPC_ALT_WIDEIO1_ENABLE   BIT(2)
 
#define LPC_ALT_WIDEIO0_ENABLE   BIT(0)
 
#define LPC_MISC_CONTROL_BITS   0x78
 
#define LPC_LDRQ1_EN   BIT(3)
 
#define LPC_LDRQ0_EN   BIT(2)
 
#define LPC_NOHOG   BIT(0)
 
#define LPC_TRUSTED_PLATFORM_MODULE   0x7c
 
#define TPM_12_EN   BIT(0)
 
#define TPM_LEGACY_EN   BIT(2)
 
#define LPC_WIDEIO2_GENERIC_PORT   0x90
 
#define LPC_ROM_DMA_SRC_ADDR   0xb0
 
#define LPC_ROM_DMA_DST_ADDR   0xb4
 
#define LPC_ROM_DMA_EC_HOST_CONTROL   0xb8
 
#define SPI_FROM_HOST_PREFETCH_EN   BIT(24)
 
#define SPI_FROM_USB_PREFETCH_EN   BIT(23)
 
#define LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT   6
 
#define LPC_ROM_DMA_CTRL_DW_COUNT_MASK   (0x3ffUL << LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT)
 
#define LPC_ROM_DMA_CTRL_ERROR   BIT(1)
 
#define LPC_ROM_DMA_CTRL_START   BIT(0)
 
#define LPC_ROM_DMA_MIN_ALIGNMENT   (1 << 6)
 
#define LPC_ROM_DMA_CTRL_DW_COUNT(bytes)    (((bytes / LPC_ROM_DMA_MIN_ALIGNMENT) - 1) << LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT)
 
#define LPC_ROM_DMA_CTRL_MAX_BYTES
 
#define LPC_HOST_CONTROL   0xbb
 
#define PREFETCH_EN_SPI_FROM_HOST   BIT(0)
 
#define T_START_ENH   BIT(3)
 

Functions

void lpc_disable_decodes (void)
 
void lpc_enable_port80 (void)
 
void lpc_enable_decode (uint32_t decodes)
 
void lpc_enable_sio_decode (const bool addr)
 
uintptr_t lpc_spibase (void)
 
void lpc_tpm_decode (void)
 
void lpc_tpm_decode_spi (void)
 
void lpc_enable_rom (void)
 
void lpc_enable_spi_prefetch (void)
 
void lpc_disable_spi_rom_sharing (void)
 
uint16_t lpc_wideio_size (int index)
 Find the size of a particular wide IO. More...
 
int lpc_find_wideio_range (uint16_t start, uint16_t size)
 Identify if any LPC wide IO is covering the IO range. More...
 
int lpc_set_wideio_range (uint16_t start, uint16_t size)
 Program a LPC wide IO to support an IO range. More...
 
uintptr_t lpc_get_spibase (void)
 
void lpc_early_init (void)
 
void lpc_set_spibase (uint32_t base)
 
void lpc_enable_spi_rom (uint32_t enable)
 

Macro Definition Documentation

◆ DECODE_ALTERNATE_SIO_ENABLE

#define DECODE_ALTERNATE_SIO_ENABLE   BIT(1)

Definition at line 66 of file lpc.h.

◆ DECODE_ENABLE_ACPIUC_PORT

#define DECODE_ENABLE_ACPIUC_PORT   BIT(30)

Definition at line 47 of file lpc.h.

◆ DECODE_ENABLE_ADLIB_PORT

#define DECODE_ENABLE_ADLIB_PORT   BIT(31)

Definition at line 48 of file lpc.h.

◆ DECODE_ENABLE_AUDIO_PORT0

#define DECODE_ENABLE_AUDIO_PORT0   BIT(14)

Definition at line 31 of file lpc.h.

◆ DECODE_ENABLE_AUDIO_PORT1

#define DECODE_ENABLE_AUDIO_PORT1   BIT(15)

Definition at line 32 of file lpc.h.

◆ DECODE_ENABLE_AUDIO_PORT2

#define DECODE_ENABLE_AUDIO_PORT2   BIT(16)

Definition at line 33 of file lpc.h.

◆ DECODE_ENABLE_AUDIO_PORT3

#define DECODE_ENABLE_AUDIO_PORT3   BIT(17)

Definition at line 34 of file lpc.h.

◆ DECODE_ENABLE_FDC_PORT0

#define DECODE_ENABLE_FDC_PORT0   BIT(26)

Definition at line 43 of file lpc.h.

◆ DECODE_ENABLE_FDC_PORT1

#define DECODE_ENABLE_FDC_PORT1   BIT(27)

Definition at line 44 of file lpc.h.

◆ DECODE_ENABLE_GAME_PORT

#define DECODE_ENABLE_GAME_PORT   BIT(28)

Definition at line 45 of file lpc.h.

◆ DECODE_ENABLE_KBC_PORT

#define DECODE_ENABLE_KBC_PORT   BIT(29)

Definition at line 46 of file lpc.h.

◆ DECODE_ENABLE_MIDI_PORT0

#define DECODE_ENABLE_MIDI_PORT0   BIT(18)

Definition at line 35 of file lpc.h.

◆ DECODE_ENABLE_MIDI_PORT1

#define DECODE_ENABLE_MIDI_PORT1   BIT(19)

Definition at line 36 of file lpc.h.

◆ DECODE_ENABLE_MIDI_PORT2

#define DECODE_ENABLE_MIDI_PORT2   BIT(20)

Definition at line 37 of file lpc.h.

◆ DECODE_ENABLE_MIDI_PORT3

#define DECODE_ENABLE_MIDI_PORT3   BIT(21)

Definition at line 38 of file lpc.h.

◆ DECODE_ENABLE_MSS_PORT0

#define DECODE_ENABLE_MSS_PORT0   BIT(22)

Definition at line 39 of file lpc.h.

◆ DECODE_ENABLE_MSS_PORT1

#define DECODE_ENABLE_MSS_PORT1   BIT(23)

Definition at line 40 of file lpc.h.

◆ DECODE_ENABLE_MSS_PORT2

#define DECODE_ENABLE_MSS_PORT2   BIT(24)

Definition at line 41 of file lpc.h.

◆ DECODE_ENABLE_MSS_PORT3

#define DECODE_ENABLE_MSS_PORT3   BIT(25)

Definition at line 42 of file lpc.h.

◆ DECODE_ENABLE_PARALLEL_PORT0

#define DECODE_ENABLE_PARALLEL_PORT0   BIT(0)

Definition at line 17 of file lpc.h.

◆ DECODE_ENABLE_PARALLEL_PORT1

#define DECODE_ENABLE_PARALLEL_PORT1   BIT(1)

Definition at line 18 of file lpc.h.

◆ DECODE_ENABLE_PARALLEL_PORT2

#define DECODE_ENABLE_PARALLEL_PORT2   BIT(2)

Definition at line 19 of file lpc.h.

◆ DECODE_ENABLE_PARALLEL_PORT3

#define DECODE_ENABLE_PARALLEL_PORT3   BIT(3)

Definition at line 20 of file lpc.h.

◆ DECODE_ENABLE_PARALLEL_PORT4

#define DECODE_ENABLE_PARALLEL_PORT4   BIT(4)

Definition at line 21 of file lpc.h.

◆ DECODE_ENABLE_PARALLEL_PORT5

#define DECODE_ENABLE_PARALLEL_PORT5   BIT(5)

Definition at line 22 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT0

#define DECODE_ENABLE_SERIAL_PORT0   BIT(6)

Definition at line 23 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT1

#define DECODE_ENABLE_SERIAL_PORT1   BIT(7)

Definition at line 24 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT2

#define DECODE_ENABLE_SERIAL_PORT2   BIT(8)

Definition at line 25 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT3

#define DECODE_ENABLE_SERIAL_PORT3   BIT(9)

Definition at line 26 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT4

#define DECODE_ENABLE_SERIAL_PORT4   BIT(10)

Definition at line 27 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT5

#define DECODE_ENABLE_SERIAL_PORT5   BIT(11)

Definition at line 28 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT6

#define DECODE_ENABLE_SERIAL_PORT6   BIT(12)

Definition at line 29 of file lpc.h.

◆ DECODE_ENABLE_SERIAL_PORT7

#define DECODE_ENABLE_SERIAL_PORT7   BIT(13)

Definition at line 30 of file lpc.h.

◆ DECODE_IO_PORT_ENABLE0

#define DECODE_IO_PORT_ENABLE0   BIT(16)

Definition at line 60 of file lpc.h.

◆ DECODE_IO_PORT_ENABLE1

#define DECODE_IO_PORT_ENABLE1   BIT(17)

Definition at line 59 of file lpc.h.

◆ DECODE_IO_PORT_ENABLE2

#define DECODE_IO_PORT_ENABLE2   BIT(18)

Definition at line 58 of file lpc.h.

◆ DECODE_IO_PORT_ENABLE3

#define DECODE_IO_PORT_ENABLE3   BIT(19)

Definition at line 57 of file lpc.h.

◆ DECODE_IO_PORT_ENABLE4

#define DECODE_IO_PORT_ENABLE4   BIT(21)

Definition at line 55 of file lpc.h.

◆ DECODE_IO_PORT_ENABLE5

#define DECODE_IO_PORT_ENABLE5   BIT(22)

Definition at line 54 of file lpc.h.

◆ DECODE_IO_PORT_ENABLE6

#define DECODE_IO_PORT_ENABLE6   BIT(23)

Definition at line 53 of file lpc.h.

◆ DECODE_MEM_PORT_ENABLE0

#define DECODE_MEM_PORT_ENABLE0   BIT(5)

Definition at line 64 of file lpc.h.

◆ DECODE_MEM_PORT_ENABLE1

#define DECODE_MEM_PORT_ENABLE1   BIT(20)

Definition at line 56 of file lpc.h.

◆ DECODE_SIO_ENABLE

#define DECODE_SIO_ENABLE   BIT(0)

Definition at line 67 of file lpc.h.

◆ EXT_ROM_SHARING_EN

#define EXT_ROM_SHARING_EN   BIT(4)

Definition at line 12 of file lpc.h.

◆ LEGACY_DMA_EN

#define LEGACY_DMA_EN   BIT(2)

Definition at line 10 of file lpc.h.

◆ LPC_ALT_WIDEIO0_ENABLE

#define LPC_ALT_WIDEIO0_ENABLE   BIT(0)

Definition at line 95 of file lpc.h.

◆ LPC_ALT_WIDEIO1_ENABLE

#define LPC_ALT_WIDEIO1_ENABLE   BIT(2)

Definition at line 94 of file lpc.h.

◆ LPC_ALT_WIDEIO2_ENABLE

#define LPC_ALT_WIDEIO2_ENABLE   BIT(3)

Definition at line 93 of file lpc.h.

◆ LPC_ALT_WIDEIO_RANGE_ENABLE

#define LPC_ALT_WIDEIO_RANGE_ENABLE   0x74

Definition at line 92 of file lpc.h.

◆ LPC_DECODE_RTC_IO_ENABLE

#define LPC_DECODE_RTC_IO_ENABLE   BIT(6)

Definition at line 63 of file lpc.h.

◆ LPC_HOST_CONTROL

#define LPC_HOST_CONTROL   0xbb

Definition at line 127 of file lpc.h.

◆ LPC_IO_OR_MEM_DECODE_ENABLE

#define LPC_IO_OR_MEM_DECODE_ENABLE   0x48

Definition at line 50 of file lpc.h.

◆ LPC_IO_PORT_DECODE_ENABLE

#define LPC_IO_PORT_DECODE_ENABLE   0x44

Definition at line 16 of file lpc.h.

◆ LPC_LDRQ0_EN

#define LPC_LDRQ0_EN   BIT(2)

Definition at line 99 of file lpc.h.

◆ LPC_LDRQ1_EN

#define LPC_LDRQ1_EN   BIT(3)

Definition at line 98 of file lpc.h.

◆ LPC_MEM_PORT0

#define LPC_MEM_PORT0   0x60

Definition at line 81 of file lpc.h.

◆ LPC_MEM_PORT1

#define LPC_MEM_PORT1   0x4c

Definition at line 72 of file lpc.h.

◆ LPC_MISC_CONTROL_BITS

#define LPC_MISC_CONTROL_BITS   0x78

Definition at line 97 of file lpc.h.

◆ LPC_NOHOG

#define LPC_NOHOG   BIT(0)

Definition at line 100 of file lpc.h.

◆ LPC_PCI_CONTROL

#define LPC_PCI_CONTROL   0x40

Definition at line 9 of file lpc.h.

◆ LPC_ROM_DMA_CTRL_DW_COUNT

#define LPC_ROM_DMA_CTRL_DW_COUNT (   bytes)     (((bytes / LPC_ROM_DMA_MIN_ALIGNMENT) - 1) << LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT)

Definition at line 121 of file lpc.h.

◆ LPC_ROM_DMA_CTRL_DW_COUNT_MASK

#define LPC_ROM_DMA_CTRL_DW_COUNT_MASK   (0x3ffUL << LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT)

Definition at line 117 of file lpc.h.

◆ LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT

#define LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT   6

Definition at line 116 of file lpc.h.

◆ LPC_ROM_DMA_CTRL_ERROR

#define LPC_ROM_DMA_CTRL_ERROR   BIT(1)

Definition at line 118 of file lpc.h.

◆ LPC_ROM_DMA_CTRL_MAX_BYTES

#define LPC_ROM_DMA_CTRL_MAX_BYTES
Value:
#define LPC_ROM_DMA_CTRL_DW_COUNT_SHIFT
Definition: lpc.h:116
#define LPC_ROM_DMA_MIN_ALIGNMENT
Definition: lpc.h:120
#define LPC_ROM_DMA_CTRL_DW_COUNT_MASK
Definition: lpc.h:117

Definition at line 123 of file lpc.h.

◆ LPC_ROM_DMA_CTRL_START

#define LPC_ROM_DMA_CTRL_START   BIT(0)

Definition at line 119 of file lpc.h.

◆ LPC_ROM_DMA_DST_ADDR

#define LPC_ROM_DMA_DST_ADDR   0xb4

Definition at line 109 of file lpc.h.

◆ LPC_ROM_DMA_EC_HOST_CONTROL

#define LPC_ROM_DMA_EC_HOST_CONTROL   0xb8

Definition at line 113 of file lpc.h.

◆ LPC_ROM_DMA_MIN_ALIGNMENT

#define LPC_ROM_DMA_MIN_ALIGNMENT   (1 << 6)

Definition at line 120 of file lpc.h.

◆ LPC_ROM_DMA_SRC_ADDR

#define LPC_ROM_DMA_SRC_ADDR   0xb0

Definition at line 108 of file lpc.h.

◆ LPC_SELECT_SIO_2E2F

#define LPC_SELECT_SIO_2E2F   0

Definition at line 69 of file lpc.h.

◆ LPC_SELECT_SIO_4E4F

#define LPC_SELECT_SIO_4E4F   1

Definition at line 68 of file lpc.h.

◆ LPC_SYNC_TIMEOUT_COUNT_ENABLE

#define LPC_SYNC_TIMEOUT_COUNT_ENABLE   BIT(7)

Definition at line 62 of file lpc.h.

◆ LPC_SYNC_TIMEOUT_COUNT_MASK

#define LPC_SYNC_TIMEOUT_COUNT_MASK   (0xff << 8)

Definition at line 61 of file lpc.h.

◆ LPC_TRUSTED_PLATFORM_MODULE

#define LPC_TRUSTED_PLATFORM_MODULE   0x7c

Definition at line 102 of file lpc.h.

◆ LPC_WIDEIO0_ENABLE

#define LPC_WIDEIO0_ENABLE   BIT(2)

Definition at line 65 of file lpc.h.

◆ LPC_WIDEIO1_ENABLE

#define LPC_WIDEIO1_ENABLE   BIT(24)

Definition at line 52 of file lpc.h.

◆ LPC_WIDEIO1_GENERIC_PORT

#define LPC_WIDEIO1_GENERIC_PORT   0x66

Definition at line 86 of file lpc.h.

◆ LPC_WIDEIO2_ENABLE

#define LPC_WIDEIO2_ENABLE   BIT(25)

Definition at line 51 of file lpc.h.

◆ LPC_WIDEIO2_GENERIC_PORT

#define LPC_WIDEIO2_GENERIC_PORT   0x90

Definition at line 106 of file lpc.h.

◆ LPC_WIDEIO_GENERIC_PORT

#define LPC_WIDEIO_GENERIC_PORT   0x64

Definition at line 85 of file lpc.h.

◆ MAX_ROM_PROTECT_RANGES

#define MAX_ROM_PROTECT_RANGES   4

Definition at line 80 of file lpc.h.

◆ PREFETCH_EN_SPI_FROM_HOST

#define PREFETCH_EN_SPI_FROM_HOST   BIT(0)

Definition at line 128 of file lpc.h.

◆ RANGE_ADDR_MASK

#define RANGE_ADDR_MASK   0x000000ff /* Range defined by bits 7-0 */

Definition at line 78 of file lpc.h.

◆ RANGE_UNIT

#define RANGE_UNIT   BIT(8) /* 0: 4kiB, 1: 64kiB */

Definition at line 77 of file lpc.h.

◆ ROM_ADDRESS_RANGE1_END

#define ROM_ADDRESS_RANGE1_END   0x6a

Definition at line 88 of file lpc.h.

◆ ROM_ADDRESS_RANGE1_START

#define ROM_ADDRESS_RANGE1_START   0x68

Definition at line 87 of file lpc.h.

◆ ROM_ADDRESS_RANGE2_END

#define ROM_ADDRESS_RANGE2_END   0x6e

Definition at line 90 of file lpc.h.

◆ ROM_ADDRESS_RANGE2_START

#define ROM_ADDRESS_RANGE2_START   0x6c

Definition at line 89 of file lpc.h.

◆ ROM_BASE_MASK

#define ROM_BASE_MASK   0xfffff000 /* bits 31-12 */

Definition at line 74 of file lpc.h.

◆ ROM_PROTECT_RANGE0

#define ROM_PROTECT_RANGE0   0x50

Definition at line 73 of file lpc.h.

◆ ROM_PROTECT_RANGE_REG

#define ROM_PROTECT_RANGE_REG (   n)    (ROM_PROTECT_RANGE0 + (4 * n))

Definition at line 79 of file lpc.h.

◆ ROM_RANGE_RP

#define ROM_RANGE_RP   BIT(9)

Definition at line 76 of file lpc.h.

◆ ROM_RANGE_WP

#define ROM_RANGE_WP   BIT(10)

Definition at line 75 of file lpc.h.

◆ SPI_FROM_HOST_PREFETCH_EN

#define SPI_FROM_HOST_PREFETCH_EN   BIT(24)

Definition at line 114 of file lpc.h.

◆ SPI_FROM_USB_PREFETCH_EN

#define SPI_FROM_USB_PREFETCH_EN   BIT(23)

Definition at line 115 of file lpc.h.

◆ SPI_ROM_BIOS_SEMAPHORE

#define SPI_ROM_BIOS_SEMAPHORE   BIT(5)

Definition at line 13 of file lpc.h.

◆ SPI_ROM_EC_SEMAPHORE

#define SPI_ROM_EC_SEMAPHORE   BIT(6)

Definition at line 14 of file lpc.h.

◆ T_START_ENH

#define T_START_ENH   BIT(3)

Definition at line 129 of file lpc.h.

◆ TPM_12_EN

#define TPM_12_EN   BIT(0)

Definition at line 103 of file lpc.h.

◆ TPM_LEGACY_EN

#define TPM_LEGACY_EN   BIT(2)

Definition at line 104 of file lpc.h.

◆ VW_ROM_SHARING_EN

#define VW_ROM_SHARING_EN   BIT(3)

Definition at line 11 of file lpc.h.

◆ WIDEIO_RANGE_ERROR

#define WIDEIO_RANGE_ERROR   -1

Definition at line 70 of file lpc.h.

Function Documentation

◆ lpc_disable_decodes()

void lpc_disable_decodes ( void  )

Definition at line 169 of file lpc_util.c.

References _LPCB_DEV, lpc_enable_decode(), LPC_IO_OR_MEM_DECODE_ENABLE, LPC_IO_PORT_DECODE_ENABLE, LPC_MEM_PORT0, LPC_MEM_PORT1, LPC_SYNC_TIMEOUT_COUNT_ENABLE, LPC_SYNC_TIMEOUT_COUNT_MASK, LPC_WIDEIO2_GENERIC_PORT, pci_read_config32(), and pci_write_config32().

Referenced by lpc_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_disable_spi_rom_sharing()

void lpc_disable_spi_rom_sharing ( void  )

Definition at line 296 of file lpc_util.c.

References _LPCB_DEV, CONFIG, dead_code, EXT_ROM_SHARING_EN, LPC_PCI_CONTROL, pci_read_config8(), pci_write_config8(), and VW_ROM_SHARING_EN.

Referenced by fch_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_early_init()

void lpc_early_init ( void  )

Definition at line 355 of file lpc_util.c.

References lpc_disable_decodes(), lpc_enable_controller(), lpc_set_spibase(), and SPI_BASE_ADDRESS.

Referenced by fch_pre_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_enable_decode()

void lpc_enable_decode ( uint32_t  decodes)

Definition at line 160 of file lpc_util.c.

References _LPCB_DEV, LPC_IO_PORT_DECODE_ENABLE, and pci_write_config32().

Referenced by bootblock_mainboard_early_init(), lpc_disable_decodes(), and sb_lpc_decode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_enable_port80()

void lpc_enable_port80 ( void  )

Definition at line 139 of file lpc_util.c.

References _LPCB_DEV, DECODE_IO_PORT_ENABLE4, LPC_IO_OR_MEM_DECODE_ENABLE, pci_read_config32(), and pci_write_config32().

Referenced by bootblock_fch_early_init(), and lpc_configure_decodes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_enable_rom()

void lpc_enable_rom ( void  )

Definition at line 250 of file lpc_util.c.

References _LPCB_DEV, LPC_IO_OR_MEM_DECODE_ENABLE, pci_read_config8(), pci_write_config16(), pci_write_config8(), ROM_ADDRESS_RANGE1_END, ROM_ADDRESS_RANGE1_START, ROM_ADDRESS_RANGE2_END, and ROM_ADDRESS_RANGE2_START.

Referenced by bootblock_fch_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_enable_sio_decode()

void lpc_enable_sio_decode ( const bool  addr)

Definition at line 148 of file lpc_util.c.

References _LPCB_DEV, addr, DECODE_ALTERNATE_SIO_ENABLE, DECODE_SIO_ENABLE, LPC_IO_OR_MEM_DECODE_ENABLE, LPC_SELECT_SIO_2E2F, pci_read_config32(), and pci_write_config32().

Referenced by bootblock_mainboard_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_enable_spi_prefetch()

void lpc_enable_spi_prefetch ( void  )

Definition at line 287 of file lpc_util.c.

References _LPCB_DEV, LPC_ROM_DMA_EC_HOST_CONTROL, pci_read_config32(), pci_write_config32(), SPI_FROM_HOST_PREFETCH_EN, and SPI_FROM_USB_PREFETCH_EN.

Referenced by fch_spi_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_enable_spi_rom()

void lpc_enable_spi_rom ( uint32_t  enable)

Definition at line 330 of file lpc_util.c.

References _LPCB_DEV, pci_read_config32(), pci_write_config32(), SPI_BASE_ADDRESS_REGISTER, SPI_ROM_ALT_ENABLE, and SPI_ROM_ENABLE.

Referenced by fch_spi_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_find_wideio_range()

int lpc_find_wideio_range ( uint16_t  start,
uint16_t  size 
)

Identify if any LPC wide IO is covering the IO range.

Parameters
start= start of IO range
size= size of IO range
Returns
Index of wide IO covering the range or error

Definition at line 80 of file lpc_util.c.

References _LPCB_DEV, ARRAY_SIZE, lpc_wideio_size(), pci_read_config16(), WIDEIO_RANGE_ERROR, and wio_io_en.

Referenced by configure_child_lpc_windows().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_get_spibase()

uintptr_t lpc_get_spibase ( void  )

Definition at line 309 of file lpc_util.c.

References _LPCB_DEV, ALIGN_DOWN, base, pci_read_config32(), SPI_BASE_ADDRESS_REGISTER, and SPI_BASE_ALIGNMENT.

Referenced by espi_get_bar(), and spi_get_bar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_set_spibase()

void lpc_set_spibase ( uint32_t  base)

Definition at line 318 of file lpc_util.c.

References _LPCB_DEV, ALIGN_DOWN, base, pci_read_config32(), pci_write_config32(), SPI_BASE_ADDRESS_REGISTER, and SPI_BASE_ALIGNMENT.

Referenced by bootblock_fch_early_init(), and lpc_early_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_set_wideio_range()

int lpc_set_wideio_range ( uint16_t  start,
uint16_t  size 
)

Program a LPC wide IO to support an IO range.

Parameters
start= start of range to be routed through wide IO
size= size of range to be routed through wide IO
Returns
Index of wide IO register used or error

Definition at line 109 of file lpc_util.c.

References _LPCB_DEV, wide_io_ioport_and_bits::alt, ARRAY_SIZE, wide_io_ioport_and_bits::enable, LPC_ALT_WIDEIO_RANGE_ENABLE, LPC_IO_OR_MEM_DECODE_ENABLE, pci_read_config32(), pci_read_config8(), pci_write_config16(), pci_write_config32(), pci_write_config8(), WIDEIO_RANGE_ERROR, and wio_io_en.

Referenced by bootblock_mainboard_early_init(), configure_child_lpc_windows(), and early_ec_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_spibase()

uintptr_t lpc_spibase ( void  )

Definition at line 185 of file lpc_util.c.

References _LPCB_DEV, base, pci_read_config32(), pci_write_config32(), SPI_BASE_ADDRESS, SPI_BASE_ADDRESS_REGISTER, SPI_BASE_RESERVED, SPI_PRESERVE_BITS, and SPI_ROM_ENABLE.

Here is the call graph for this function:

◆ lpc_tpm_decode()

void lpc_tpm_decode ( void  )

Definition at line 214 of file lpc_util.c.

References _LPCB_DEV, LPC_TRUSTED_PLATFORM_MODULE, pci_read_config32(), pci_write_config32(), TPM_12_EN, TPM_LEGACY_EN, and value.

Referenced by lpc_tpm_decode_spi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_tpm_decode_spi()

void lpc_tpm_decode_spi ( void  )

Definition at line 229 of file lpc_util.c.

References _LPCB_DEV, lpc_tpm_decode(), pci_read_config32(), pci_write_config32(), ROUTE_TPM_2_SPI, and SPI_BASE_ADDRESS_REGISTER.

Referenced by bootblock_mainboard_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lpc_wideio_size()

uint16_t lpc_wideio_size ( int  index)

Find the size of a particular wide IO.

Parameters
index= index of desired wide IO
Returns
size of desired wide IO

Definition at line 54 of file lpc_util.c.

References _LPCB_DEV, wide_io_ioport_and_bits::alt, ARRAY_SIZE, LPC_ALT_WIDEIO_RANGE_ENABLE, LPC_IO_OR_MEM_DECODE_ENABLE, pci_read_config32(), pci_read_config8(), and wio_io_en.

Referenced by configure_child_lpc_windows(), and lpc_find_wideio_range().

Here is the call graph for this function:
Here is the caller graph for this function: