3 #define __SIMPLE_DEVICE__
17 #include <soc/pci_devs.h>
66 assert((bios_cntl_bit & (bios_cntl_bit - 1)) == 0);
68 bc_cntl |= bios_cntl_bit;
105 if (!
CONFIG(FAST_SPI_SUPPORTS_EXT_BIOS_WINDOW))
150 if (
CONFIG(FAST_SPI_DISABLE_WRITE_STATUS))
234 size_t bios_start, bios_end;
252 if (!
CONFIG(FAST_SPI_SUPPORTS_EXT_BIOS_WINDOW))
258 if (*size == 0 || *
base == 0)
271 size_t ext_bios_size;
282 size_t ext_bios_size;
328 if (!
CONFIG(FAST_SPI_SUPPORTS_EXT_BIOS_WINDOW))
331 #if CONFIG(FAST_SPI_SUPPORTS_EXT_BIOS_WINDOW)
339 "Extended BIOS window base must be a multiple of 32 * MiB!");
341 "Only 32MiB windows are supported for extended BIOS!");
345 if (
enable_gpmr(CONFIG_EXT_BIOS_WIN_BASE, CONFIG_EXT_BIOS_WIN_SIZE,
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
static void write16(void *addr, uint16_t val)
void postcar_frame_add_mtrr(struct postcar_frame *pcf, uintptr_t addr, size_t size, int type)
#define assert(statement)
@ CB_ERR
Generic error code.
#define printk(level,...)
void fast_spi_set_lock_enable(void)
void fast_spi_early_init(uintptr_t spi_base_address)
void fast_spi_set_ext_bios_lock_enable(void)
void fast_spi_vscc0_lock(void)
void fast_spi_set_eiss(void)
static bool fast_spi_ext_bios_cache_range(uintptr_t *base, size_t *size)
void fast_spi_enable_wp(void)
void fast_spi_cache_bios_region(void)
static void fast_spi_read_post_write(uint8_t reg)
size_t fast_spi_get_bios_region(size_t *bios_size)
static void fast_spi_cache_ext_bios_window(void)
void fast_spi_clear_outstanding_status(void)
void fast_spi_set_bios_interface_lock_down(void)
void * fast_spi_get_bar(void)
void fast_spi_cache_ext_bios_postcar(struct postcar_frame *pcf)
bool fast_spi_clear_sync_smi_status(void)
void fast_spi_pr_dlock(void)
bool fast_spi_wpd_status(void)
void fast_spi_lock_bar(void)
static void fast_spi_enable_ext_bios(void)
void fast_spi_disable_wp(void)
static void fast_spi_enable_cache_range(unsigned int base, unsigned int size)
void fast_spi_set_strap_msg_data(uint32_t soft_reset_data)
static void fast_spi_set_bios_control_reg(uint32_t bios_cntl_bit)
void fast_spi_set_opcode_menu(void)
#define SPI_BIOS_CONTROL_PREFETCH_ENABLE
#define SPIBAR_BFPREG_PRL_SHIFT
#define SPI_BIOS_CONTROL_CACHE_DISABLE
#define SPIBAR_DLOCK_PR2LOCKDN
#define SPIBAR_HSFSTS_W1C_BITS
#define SPIBAR_DLOCK_PR1LOCKDN
#define SPIBAR_HSFSTS_WRSDIS
#define SPIBAR_DLOCK_PR4LOCKDN
#define SPIBAR_HSFSTS_FLOCKDN
#define SPIBAR_RESET_CTRL_SSMC
#define SPIBAR_OPMENU_UPPER
#define SPI_BIOS_CONTROL_EXT_BIOS_ENABLE
#define SPIBAR_DLOCK_PR0LOCKDN
#define SPI_BIOS_CONTROL_EXT_BIOS_LOCK_ENABLE
#define SPIBAR_HSFSTS_PRR34_LOCKDN
#define SPIBAR_BFPREG_PRB_MASK
#define SPIBAR_BFPREG_PRL_MASK
#define SPI_BIOS_CONTROL_EXT_BIOS_LIMIT(x)
#define SPIBAR_HSFSTS_CTL
#define SPI_BIOS_CONTROL_SYNC_SS
#define SPIBAR_RESET_CTRL
#define SPIBAR_RESET_DATA
#define SPIBAR_DLOCK_PR3LOCKDN
#define SPI_BIOS_CONTROL_EISS
#define SPIBAR_SFDP0_VSCC0
#define SPI_BIOS_CONTROL_BILD
#define SPI_BIOS_CONTROL_WPD
#define SPIBAR_RESET_LOCK
#define SPIBAR_OPMENU_LOWER
#define SPI_BIOS_CONTROL_LOCK_ENABLE
#define SPIBAR_RESET_LOCK_ENABLE
enum cb_err enable_gpmr(uint32_t base, uint32_t size, uint32_t dest_id)
#define setbits32(addr, set)
static __always_inline void pci_or_config32(const struct device *dev, u16 reg, u32 ormask)
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
static __always_inline void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
static __always_inline u16 pci_read_config16(const struct device *dev, u16 reg)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
static __always_inline u8 pci_read_config8(const struct device *dev, u16 reg)
static __always_inline void pci_write_config16(const struct device *dev, u16 reg, u16 val)
static __always_inline void pci_write_config8(const struct device *dev, u16 reg, u8 val)
static int log2_ceil(u32 x)
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
_Static_assert(sizeof(hls_t)==HLS_SIZE, "HLS_SIZE must equal to sizeof(hls_t)")
int get_free_var_mtrr(void)
void set_var_mtrr(unsigned int reg, unsigned int base, unsigned int size, unsigned int type)
#define PCI_BASE_ADDRESS_MEM_ATTR_MASK
#define PCI_COMMAND_MASTER
#define PCI_COMMAND_MEMORY
#define PCI_BASE_ADDRESS_0
#define PCI_BASE_ADDRESS_SPACE_MEMORY
uint32_t soc_get_spi_psf_destination_id(void)
void fast_spi_get_ext_bios_window(uintptr_t *base, size_t *size)