coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
fast_spi.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef SOC_INTEL_COMMON_BLOCK_FAST_SPI_H
4 #define SOC_INTEL_COMMON_BLOCK_FAST_SPI_H
5 
6 #include <types.h>
7 
8 /* Clear any SPI outstanding status bits, i.e., FCERR, FDONE etc. */
10 /* Check if SPI transaction is pending */
12 /*
13  * Disable the BIOS write protect and Enable Prefetching and Caching.
14  */
15 void fast_spi_init(void);
16 /*
17  * Set FAST_SPIBAR BIOS Control BILD bit.
18  */
20 /*
21  * Set FAST_SPIBAR BIOS Control LE bit.
22  */
23 void fast_spi_set_lock_enable(void);
24 /*
25  * Set FAST_SPIBAR BIOS Control Ext Bios LE bit.
26  */
28 /*
29  * Set FAST_SPIBAR BIOS Control EISS bit.
30  */
31 void fast_spi_set_eiss(void);
32 /*
33  * Set FAST_SPI opcode menu.
34  */
35 void fast_spi_set_opcode_menu(void);
36 /*
37  * Lock FAST_SPIBAR.
38  */
39 void fast_spi_lock_bar(void);
40 /*
41  * Set FAST_SPIBAR + DLOCK (0x0C) register bits to discrete lock the
42  * FAST_SPI Protected Range (PR) registers.
43  */
44 void fast_spi_pr_dlock(void);
45 /*
46  * Set FAST_SPIBAR + VSCC0 (0xC4) register VCL (bit 30).
47  */
48 void fast_spi_vscc0_lock(void);
49 /*
50  * Set FAST_SPIBAR Soft Reset Data Register value.
51  */
52 void fast_spi_set_strap_msg_data(uint32_t soft_reset_data);
53 /*
54  * Returns bios_start and fills in size of the BIOS region.
55  */
56 size_t fast_spi_get_bios_region(size_t *bios_size);
57 /*
58  * Cache the memory-mapped BIOS region as write-protect type. In ramstage
59  * this function needs to be called after the final MTRR solution has been
60  * calculated.
61  */
63 /*
64  * Program temporary BAR for FAST_SPI in case any of the stages before ramstage
65  * need to access FAST_SPI MMIO regs. Ramstage will assign a new BAR during PCI
66  * enumeration. Also, Disable the BIOS write protect and Enable Prefetching and
67  * Caching.
68  */
69 void fast_spi_early_init(uintptr_t spi_base_address);
70 /*
71  * Fast SPI flash controller structure to allow SoCs to define bus-controller
72  * mapping.
73  */
74 extern const struct spi_ctrlr fast_spi_flash_ctrlr;
75 /*
76  * Clear SPI Synchronous SMI status bit and return its value.
77  */
79 /*
80  * Read SPI Write protect disable bit.
81  */
82 bool fast_spi_wpd_status(void);
83 /*
84  * Enable SPI Write protect.
85  */
86 void fast_spi_enable_wp(void);
87 /*
88  * Disable SPI Write protect.
89  */
90 void fast_spi_disable_wp(void);
91 /*
92  * Get base and size of extended BIOS decode window used at runtime in host address space. If
93  * the BIOS region is not greater than 16MiB, then this function returns 0 for both base and
94  * size.
95  */
96 void fast_spi_get_ext_bios_window(uintptr_t *base, size_t *size);
97 /*
98  * SOC function to get SPI PSF Destination Id
99  */
101 /*
102  * Add MTRR for extended BIOS region(when supported) to postcar frame
103  */
104 struct postcar_frame;
106 
107 #endif /* SOC_INTEL_COMMON_BLOCK_FAST_SPI_H */
void fast_spi_set_lock_enable(void)
Definition: fast_spi.c:93
void fast_spi_early_init(uintptr_t spi_base_address)
Definition: fast_spi.c:378
void fast_spi_set_ext_bios_lock_enable(void)
Definition: fast_spi.c:103
void fast_spi_vscc0_lock(void)
Definition: fast_spi.c:176
void fast_spi_set_eiss(void)
Definition: fast_spi.c:116
void fast_spi_init(void)
Definition: fast_spi.c:41
void fast_spi_enable_wp(void)
Definition: fast_spi.c:428
void fast_spi_cache_bios_region(void)
Definition: fast_spi.c:292
size_t fast_spi_get_bios_region(size_t *bios_size)
Definition: fast_spi.c:232
void fast_spi_clear_outstanding_status(void)
Definition: fast_spi.c:449
const struct spi_ctrlr fast_spi_flash_ctrlr
void fast_spi_set_bios_interface_lock_down(void)
Definition: fast_spi.c:83
uint32_t soc_get_spi_psf_destination_id(void)
Definition: spi.c:32
void fast_spi_cache_ext_bios_postcar(struct postcar_frame *pcf)
Definition: fast_spi.c:280
bool fast_spi_clear_sync_smi_status(void)
Definition: fast_spi.c:407
void fast_spi_pr_dlock(void)
Definition: fast_spi.c:160
bool fast_spi_wpd_status(void)
Definition: fast_spi.c:421
void fast_spi_lock_bar(void)
Definition: fast_spi.c:145
int fast_spi_cycle_in_progress(void)
void fast_spi_get_ext_bios_window(uintptr_t *base, size_t *size)
Definition: mmap_boot.c:146
void fast_spi_disable_wp(void)
Definition: fast_spi.c:439
void fast_spi_set_strap_msg_data(uint32_t soft_reset_data)
Definition: fast_spi.c:193
void fast_spi_set_opcode_menu(void)
Definition: fast_spi.c:126
uintptr_t base
Definition: uart.c:17
static size_t bios_size
Definition: mmap_boot.c:43
unsigned int uint32_t
Definition: stdint.h:14
unsigned long uintptr_t
Definition: stdint.h:21