PebbleOS v4.47.0-160-g9e782207f
Loading...
Searching...
No Matches
SF32LB MPI

SPI memory controller driver for the SF32LB MPI, for a SPI NOR flash on it. More...

Data Structures

struct  pbl_spi_mem_sf32lb_mpi
 SF32LB MPI SPI memory controller. More...
 

Macros

#define PBL_SPI_MEM_SF32LB_MPI_DEFINE(sym, _name, _mpi, _mem_base, _mem_size)
 Define an SF32LB MPI SPI memory controller.
 

Detailed Description

SPI memory controller driver for the SF32LB MPI, for a SPI NOR flash on it.

Operations go through the command registers and the 64-byte FIFO: read data comes back through it, and write data is pushed to it byte by byte once the command is issued, so that it only ever holds the bytes the command takes. The memory-mapped window is the read window, programmed with the read operation the memory driver picks.

The controller is PBL_SPI_MEM_XIP when the firmware runs from its window, at CONFIG_FLASH_BASE: the boot code's clock, prescaler and sampling setup are kept, the clock is never gated, and everything that runs while the memory is unreadable (status polling, window changes, power down) runs from RAM with interrupts disabled.

PBL_SF32LB_MPI_DEFINE(s_mpi2, "mpi2", 0x50042000, 0x12000000, 0xe000000,
PBL_SPI_MEM_SF32LB_MPI_DEFINE(s_mpi2_spi_mem, "mpi2", &s_mpi2, 0x12000000, 0xe000000);
#define SF32LB_HPSYS_RCC
HPSYS RCC clock controller.
Definition sf32lb.h:25
#define SF32LB52_HPSYS_CLK_MPI2
Definition sf32lb.h:57
#define PBL_CLK(_ctrl, _id)
Initializer for a struct pbl_clk.
Definition clk.h:132
#define PBL_SF32LB_MPI_DEFINE(sym, _name, _base, _mem_base, _mem_size, _clk, _pinctrl,...)
Define an SF32LB MPI controller.
Definition sf32lb_mpi.h:63
#define PBL_SPI_MEM_SF32LB_MPI_DEFINE(sym, _name, _mpi, _mem_base, _mem_size)
Define an SF32LB MPI SPI memory controller.
Definition sf32lb_mpi.h:69

Data Structure Documentation

◆ pbl_spi_mem_sf32lb_mpi

struct pbl_spi_mem_sf32lb_mpi

SF32LB MPI SPI memory controller.

Data Fields
struct pbl_spi_mem_sf32lb_mpi_data * data Runtime data.
struct pbl_spi_mem mem Controller.
const struct pbl_sf32lb_mpi * mpi Core of the MPI.

Macro Definition Documentation

◆ PBL_SPI_MEM_SF32LB_MPI_DEFINE

#define PBL_SPI_MEM_SF32LB_MPI_DEFINE (   sym,
  _name,
  _mpi,
  _mem_base,
  _mem_size 
)
Value:
static struct pbl_spi_mem_sf32lb_mpi_data sym##_data; \
PBL_DEVICE_INSTANCE(sym, struct pbl_spi_mem_sf32lb_mpi, struct pbl_spi_mem, mem) { \
.mem = \
PBL_SPI_MEM_INIT(sym, _name, PBL_DEVICE_DEPS(&(_mpi)->dev), &pbl_spi_mem_sf32lb_mpi_ops, \
PBL_SPI_MEM_SF32LB_MPI_XIP(_mem_base, _mem_size)), \
.mpi = (_mpi), .data = &sym##_data, \
}
#define PBL_DEVICE_DEPS(...)
Static dependency list for struct pbl_device::deps.
Definition device.h:124
SF32LB MPI SPI memory controller.
Definition sf32lb_mpi.h:42
A SPI memory controller.
Definition spi_mem.h:231
#define PBL_SPI_MEM_STATE_DEFINE(sym)
Define the class state of controller sym, for the PBL_SPI_MEM_*_DEFINE() macro of a driver.
Definition spi_mem.h:248

Define an SF32LB MPI SPI memory controller.

Parameters
symSymbol of the controller.
_nameName.
_mpiCore of the MPI, from PBL_SF32LB_MPI_DEFINE().
_mem_baseMemory-mapped window of the MPI.
_mem_sizeMemory-mapped window size, in bytes.