Core of the SF32LB MPI memory controller.
More...
|
| #define | PBL_SF32LB_MPI_DEFINE(sym, _name, _base, _mem_base, _mem_size, _clk, _pinctrl, ...) |
| | Define an SF32LB MPI controller.
|
| |
Core of the SF32LB MPI memory controller.
The controller drives one memory: a SPI one, with the SPI memory driver of the controller, or a HyperBus one, with its HyperBus driver. The core is what both have of the controller: its registers, its memory-mapped window, its clock and its pins. The devicetree generator gives a controller the driver for the memory on it.
◆ pbl_sf32lb_mpi
| Data Fields |
|
const struct pbl_clk_assigned * |
assigned |
Clock parents and rates to assign. |
|
uintptr_t |
base |
Registers. |
|
struct pbl_clk |
clk |
Clock. |
|
struct pbl_device |
dev |
Device. |
|
uintptr_t |
mem_base |
Memory-mapped window. |
|
uint32_t |
mem_size |
Memory-mapped window size, in bytes. |
|
struct pbl_pinctrl |
pinctrl |
Pins, when the boot code did not set them up. |
|
struct pbl_sf32lb_mpi_state * |
state |
Runtime state. |
◆ PBL_SF32LB_MPI_DEFINE
| #define PBL_SF32LB_MPI_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_base, |
|
|
|
_mem_base, |
|
|
|
_mem_size, |
|
|
|
_clk, |
|
|
|
_pinctrl, |
|
|
|
... |
|
) |
| |
Value:
static struct pbl_sf32lb_mpi_state sym##_mpi_state; \
PBL_CLK_ASSIGNED_DEFINE(sym##_assigned, __VA_ARGS__); \
.base = (_base), \
.mem_size = (_mem_size), \
.assigned = sym##_assigned, \
.
state = &sym##_mpi_state, \
}; \
PBL_DEVICE_REGISTER(sym, &sym.
dev)
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:131
#define PBL_DEVICE_INIT(sym, _name, _init, _parent, _deps)
Initializer for the struct pbl_device of device instance sym.
Definition device.h:164
uintptr_t mem_base
Memory-mapped window.
Definition sf32lb_mpi.h:38
struct pbl_clk clk
Clock.
Definition sf32lb_mpi.h:42
struct pbl_device dev
Device.
Definition sf32lb_mpi.h:34
struct pbl_sf32lb_mpi_state * state
Runtime state.
Definition sf32lb_mpi.h:48
struct pbl_pinctrl pinctrl
Pins, when the boot code did not set them up.
Definition sf32lb_mpi.h:44
SF32LB MPI controller.
Definition sf32lb_mpi.h:32
#define PBL_PINCTRL(_default, _sleep, _reg)
Initializer for a struct pbl_pinctrl.
Definition pinctrl.h:131
Define an SF32LB MPI controller.
- Parameters
-
| sym | Symbol of the controller. |
| _name | Name. |
| _base | Registers. |
| _mem_base | Memory-mapped window. |
| _mem_size | Memory-mapped window size, in bytes. |
| _clk | Clock, from PBL_CLK(). |
| _pinctrl | Default state of its pins, or NULL when the boot code set them up. |
| ... | PBL_CLK_ASSIGNED() initializers, applied by pbl_sf32lb_mpi_prepare(). |
◆ pbl_sf32lb_mpi_prepare()
Set up the pins and the clock parents of a controller, once.
Called by the driver of the memory on it before its first use, so that a controller nothing uses is left as it is.
- Parameters
-
- Returns
- 0 or a negative errno.