13 #include <vendorcode/amd/cimx/sb800/ECfan.h>
15 #define AMD_SB_SPI_TX_LEN 8
44 size_t bytesout,
void *din,
size_t bytesin)
47 u8 cmd = *(
u8 *)dout++;
62 printk(
BIOS_DEBUG,
"FCH SPI: Too much to write. Does your SPI chip driver use"
63 " spi_crop_chunk()?\n");
67 readoffby1 = bytesout ? 0 : 1;
69 readwrite = (bytesin + readoffby1) << 4 | bytesout;
105 WaitForEcLDN9MailboxCmdAck();
118 WaitForEcLDN9MailboxCmdAck();
123 if (!
CONFIG(SB800_IMC_FWM))
132 if (!
CONFIG(SB800_IMC_FWM))
static void write8(void *addr, uint8_t val)
static uint8_t read8(const void *addr)
#define printk(level,...)
DEVTREE_CONST struct device * pcidev_on_root(uint8_t dev, uint8_t fn)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
const struct spi_ctrlr_buses spi_ctrlr_bus_map[]
void spi_init(void)
Init all SPI controllers with default values and enable all SPI controller.
const size_t spi_ctrlr_bus_map_count
int chipset_volatile_group_begin(const struct spi_flash *flash)
int chipset_volatile_group_end(const struct spi_flash *flash)
static void ImcWakeup(void)
static int xfer_vectors(const struct spi_slave *slave, struct spi_op vectors[], size_t count)
static void ImcSleep(void)
static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin)
#define AMD_SB_SPI_TX_LEN
static void execute_command(void)
static void reset_internal_fifo_pointer(void)
@ SPI_CNTRLR_DEDUCT_CMD_LEN
int spi_flash_vector_helper(const struct spi_slave *slave, struct spi_op vectors[], size_t count, int(*func)(const struct spi_slave *slave, const void *dout, size_t bytesout, void *din, size_t bytesin))
static struct spi_slave slave
const struct spi_ctrlr * ctrlr
int(* xfer_vector)(const struct spi_slave *slave, struct spi_op vectors[], size_t count)