PebbleOS v4.47.0-160-g9e782207f
Loading...
Searching...
No Matches
HyperBus

HyperBus controllers. More...

Modules

 SF32LB MPI
 HyperBus controller driver for the SF32LB MPI.
 

Data Structures

struct  pbl_hyperbus_config
 What a HyperBus memory needs of the bus. More...
 
struct  pbl_hyperbus_ops
 Driver operations. More...
 
struct  pbl_hyperbus
 HyperBus controller. More...
 

Macros

#define PBL_HYPERBUS_INIT(sym, _name, _parent, _ops)
 Initializer for the struct pbl_hyperbus of controller sym.
 

Functions

static int pbl_hyperbus_enable (const struct pbl_hyperbus *bus)
 Ungate the controller.
 
static void pbl_hyperbus_disable (const struct pbl_hyperbus *bus)
 Gate the controller.
 
static int pbl_hyperbus_get_rate (const struct pbl_hyperbus *bus, uint32_t *rate_hz)
 Get the bus clock rate.
 
static int pbl_hyperbus_configure (const struct pbl_hyperbus *bus, const struct pbl_hyperbus_config *cfg, uintptr_t *base)
 Set the bus up for the memory and map the memory.
 
static int pbl_hyperbus_read_reg (const struct pbl_hyperbus *bus, uint32_t addr, uint16_t *val)
 Read a register of the memory.
 
static int pbl_hyperbus_write_reg (const struct pbl_hyperbus *bus, uint32_t addr, uint16_t val)
 Write a register of the memory.
 
static int pbl_hyperbus_wake (const struct pbl_hyperbus *bus)
 Pulse CS, which wakes a sleeping memory up.
 

Variables

const struct pbl_device_class pbl_hyperbus_class
 

Detailed Description

HyperBus controllers.

A controller drives one HyperBus memory, which it maps for reads and writes. The driver of the memory, which knows its registers and what it needs of the bus, uses the controller through this interface without knowing which one it is.

Register addresses are HyperBus word addresses in the register space, and values are as the memory documents them. Times are given as the memory specifies them, for the controller to turn into what its clock makes of them.


Data Structure Documentation

◆ pbl_hyperbus_config

struct pbl_hyperbus_config

What a HyperBus memory needs of the bus.

Data Fields
uint16_t cs_high_min_ns Shortest time CS stays high between accesses, in nanoseconds.
uint32_t cs_low_max_ns Longest time CS may stay low, in nanoseconds.
uint8_t latency Latency, in clocks.
uint16_t read_recovery_ns Shortest time between a read and the next access, in nanoseconds.

◆ pbl_hyperbus

struct pbl_hyperbus

HyperBus controller.

Data Fields
struct pbl_device dev Device.
const struct pbl_hyperbus_ops * ops Driver operations.

Macro Definition Documentation

◆ PBL_HYPERBUS_INIT

#define PBL_HYPERBUS_INIT (   sym,
  _name,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, nullptr, _parent, nullptr, &pbl_hyperbus_class), \
.ops = (_ops), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _deps, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:145
const struct pbl_device_class pbl_hyperbus_class

Initializer for the struct pbl_hyperbus of controller sym.

Parameters
symSymbol of the controller instance, with its state defined by PBL_DEVICE_STATE_DEFINE().
_nameName.
_parentParent device, or NULL.
_opsDriver operations.

Function Documentation

◆ pbl_hyperbus_configure()

static int pbl_hyperbus_configure ( const struct pbl_hyperbus *  bus,
const struct pbl_hyperbus_config *  cfg,
uintptr_t *  base 
)
inlinestatic

Set the bus up for the memory and map the memory.

Parameters
busController, enabled.
cfgWhat the memory needs of the bus.
[out]baseCPU address of the memory.
Returns
0 or a negative errno.

References pbl_hyperbus_ops::configure, and pbl_hyperbus::ops.

◆ pbl_hyperbus_disable()

static void pbl_hyperbus_disable ( const struct pbl_hyperbus *  bus)
inlinestatic

Gate the controller.

Callable with interrupts disabled.

Parameters
busController.

References pbl_hyperbus_ops::disable, and pbl_hyperbus::ops.

◆ pbl_hyperbus_enable()

static int pbl_hyperbus_enable ( const struct pbl_hyperbus *  bus)
inlinestatic

Ungate the controller.

Parameters
busController.
Returns
0 or a negative errno.

References pbl_hyperbus_ops::enable, and pbl_hyperbus::ops.

◆ pbl_hyperbus_get_rate()

static int pbl_hyperbus_get_rate ( const struct pbl_hyperbus *  bus,
uint32_t *  rate_hz 
)
inlinestatic

Get the bus clock rate.

Parameters
busController.
[out]rate_hzRate, in Hz.
Returns
0 or a negative errno.

References pbl_hyperbus_ops::get_rate, and pbl_hyperbus::ops.

◆ pbl_hyperbus_read_reg()

static int pbl_hyperbus_read_reg ( const struct pbl_hyperbus *  bus,
uint32_t  addr,
uint16_t *  val 
)
inlinestatic

Read a register of the memory.

Callable with interrupts disabled.

Parameters
busController, configured.
addrWord address in the register space.
[out]valValue.
Returns
0 or a negative errno.

References pbl_hyperbus::ops, and pbl_hyperbus_ops::read_reg.

◆ pbl_hyperbus_wake()

static int pbl_hyperbus_wake ( const struct pbl_hyperbus *  bus)
inlinestatic

Pulse CS, which wakes a sleeping memory up.

Callable with interrupts disabled.

Parameters
busController, enabled.
Returns
0 or a negative errno.

References pbl_hyperbus::ops, and pbl_hyperbus_ops::wake.

◆ pbl_hyperbus_write_reg()

static int pbl_hyperbus_write_reg ( const struct pbl_hyperbus *  bus,
uint32_t  addr,
uint16_t  val 
)
inlinestatic

Write a register of the memory.

Callable with interrupts disabled.

Parameters
busController, enabled.
addrWord address in the register space.
valValue.
Returns
0 or a negative errno.

References pbl_hyperbus::ops, and pbl_hyperbus_ops::write_reg.

Variable Documentation

◆ pbl_hyperbus_class

const struct pbl_device_class pbl_hyperbus_class
extern