PMSIS API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Hyperbus

Data Structures

struct  pi_hyper_conf_t
 
struct  pi_hyper_conf
 Hyperbus configuration structure. More...
 

Typedefs

typedef struct pi_cl_hyper_req_s pi_cl_hyper_req_t
 Hyperbus cluster request structure. More...
 

Enumerations

enum  pi_hyper_type_e
 Type of the device connected to the hyperbus interface. More...
 
enum  pi_hyper_ioctl_cmd
 

Functions

void pi_hyper_conf_init (struct pi_hyper_conf *conf)
 Initialize an Hyperbus configuration with default values. More...
 
int32_t pi_hyper_open (struct pi_device *device)
 Open an Hyperbus device. More...
 
void pi_hyper_close (struct pi_device *device)
 Close an opened Hyperbus device. More...
 
int pi_hyper_ioctl (struct pi_device *device, uint32_t cmd, void *arg)
 Dynamically change the device configuration. More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_read (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size)
 Enqueue a read copy to the Hyperbus (from Hyperbus to processor). More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_read_async (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, struct pi_task *task)
 Enqueue an asynchronous read copy to the Hyperbus (from Hyperbus to processor). More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_write (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size)
 Enqueue a write copy to the Hyperbus (from processor to Hyperbus). More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_write_async (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, struct pi_task *task)
 Enqueue an asynchronous write copy to the Hyperbus (from processor to Hyperbus). More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_read_2d (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length)
 Enqueue a 2D read copy (rectangle area) to the Hyperbus (from Hyperbus to processor). More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_read_2d_async (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length, struct pi_task *task)
 Enqueue an asynchronous 2D read copy (rectangle area) to the Hyperbus (from Hyperbus to processor). More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_write_2d (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length)
 Enqueue a 2D write copy (rectangle area) to the Hyperbus (from processor to Hyperbus). More...
 
PI_INLINE_HYPER_LVL_0 void pi_hyper_write_2d_async (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length, struct pi_task *task)
 Enqueue an asynchronous 2D write copy (rectangle area) to the Hyperbus (from processor to Hyperbus). More...
 
static void pi_cl_hyper_read (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, pi_cl_hyper_req_t *req)
 Enqueue a read copy to the Hyperbus from cluster side (from Hyperbus to processor). More...
 
static void pi_cl_hyper_read_2d (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length, pi_cl_hyper_req_t *req)
 Enqueue a 2D read copy (rectangle area) to the Hyperbus from cluster side (from Hyperbus to processor). More...
 
static void pi_cl_hyper_read_wait (pi_cl_hyper_req_t *req)
 Wait until the specified hyperbus request has finished. More...
 
static void pi_cl_hyper_write (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, pi_cl_hyper_req_t *req)
 Enqueue a write copy to the Hyperbus from cluster side (from Hyperbus to processor). More...
 
static void pi_cl_hyper_write_2d (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length, pi_cl_hyper_req_t *req)
 Enqueue a 2D write copy (rectangle area) to the Hyperbus from cluster side (from Hyperbus to processor). More...
 
static void pi_cl_hyper_write_wait (pi_cl_hyper_req_t *req)
 Wait until the specified hyperbus request has finished. More...
 
static void pi_cl_hyper_copy (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, int ext2loc, pi_cl_hyper_req_t *req)
 Enqueue a copy with the Hyperbus from cluster side. More...
 
static void pi_cl_hyper_copy_2d (struct pi_device *device, uint32_t hyper_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length, int ext2loc, pi_cl_hyper_req_t *req)
 Enqueue a 2D copy (rectangle area) with the Hyperbus from cluster side. More...
 
void pi_hyper_xip_lock (struct pi_device *device)
 Forbid XIP refills. More...
 
void pi_hyper_xip_unlock (struct pi_device *device)
 Allow XIP refills. More...
 

Description

The Hyperbus driver provides support for transferring data between an external Hyperbus chip and the processor running this driver.

This is a driver for the Hyperbus interface. Higher-level drivers can be built on top of this one to target specific devices such as Hyperflash or Hyperram. Please refer to the PMSIS BSP documentation for such drivers.

Typedef Documentation

typedef struct pi_cl_hyper_req_s pi_cl_hyper_req_t

This structure is used by the runtime to manage a cluster remote copy with the Hyperbus. It must be instantiated once for each copy and must be kept alive until the copy is finished. It can be instantiated as a normal variable, for example as a global variable, a local one on the stack, or through a memory allocator.

Enumeration Type Documentation

IOCTL command

Enumerator
PI_HYPER_IOCTL_SET_LATENCY 

Set the device latency.

This command can be used when the interface has been opened to configure the latency suitable for the device.

This is used to know if the device is a flash or a RAM.

Enumerator
PI_HYPER_TYPE_FLASH 

Device is an Hyperflash.

PI_HYPER_TYPE_RAM 

Device is an Hyperram.

Function Documentation

static void pi_cl_hyper_copy ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
int  ext2loc,
pi_cl_hyper_req_t req 
)
inlinestatic

This function is a remote call that the cluster can issue to the fabric-controller in order to ask for an HyperBus copy. The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A pointer to a request structure must be provided so that the runtime can properly do the remote call. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
ext2loc1 if the copy is from HyperBus to the chip or 0 for the contrary.
reqA pointer to the HyperBus request structure. It must be allocated by the caller and kept alive until the copy is finished.
static void pi_cl_hyper_copy_2d ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length,
int  ext2loc,
pi_cl_hyper_req_t req 
)
inlinestatic

This function is a remote call that the cluster can issue to the fabric-controller in order to ask for an HyperBus copy. The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A pointer to a request structure must be provided so that the runtime can properly do the remote call. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
stride2D stride, which is the number of bytes which are added to the beginning of the current line to switch to the next one.
length2D length, which is the number of transferred bytes after which the driver will switch to the next line.
ext2loc1 if the copy is from HyperBus to the chip or 0 for the contrary.
reqA pointer to the HyperBus request structure. It must be allocated by the caller and kept alive until the copy is finished.
static void pi_cl_hyper_read ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
pi_cl_hyper_req_t req 
)
inlinestatic

This function is a remote call that the cluster can do to the fabric-controller in order to ask for an HyperBus read copy. The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A pointer to a request structure must be provided so that the runtime can properly do the remote call. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
reqA pointer to the HyperBus request structure. It must be allocated by the caller and kept alive until the copy is finished.
static void pi_cl_hyper_read_2d ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length,
pi_cl_hyper_req_t req 
)
inlinestatic

This function is a remote call that the cluster can issue to the fabric-controller in order to ask for an HyperBus read copy. The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A pointer to a request structure must be provided so that the runtime can properly do the remote call. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy.
stride2D stride, which is the number of bytes which are added to the beginning of the current line to switch to the next one.
length2D length, which is the number of transferred bytes after which the driver will switch to the next line.
reqA pointer to the HyperBus request structure. It must be allocated by the caller and kept alive until the copy is finished.
static void pi_cl_hyper_read_wait ( pi_cl_hyper_req_t req)
inlinestatic

This blocks the calling core until the specified cluster remote copy is finished.

Parameters
reqThe request structure used for termination.
static void pi_cl_hyper_write ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
pi_cl_hyper_req_t req 
)
inlinestatic

This function is a remote call that the cluster can issue to the fabric-controller in order to ask for an HyperBus write copy. The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A pointer to a request structure must be provided so that the runtime can properly do the remote call. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
reqA pointer to the HyperBus request structure. It must be allocated by the caller and kept alive until the copy is finished.
static void pi_cl_hyper_write_2d ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length,
pi_cl_hyper_req_t req 
)
inlinestatic

This function is a remote call that the cluster can issue to the fabric-controller in order to ask for an HyperBus write copy. The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A pointer to a request structure must be provided so that the runtime can properly do the remote call. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
stride2D stride, which is the number of bytes which are added to the beginning of the current line to switch to the next one.
length2D length, which is the number of transferred bytes after which the driver will switch to the next line.
reqA pointer to the HyperBus request structure. It must be allocated by the caller and kept alive until the copy is finished.
static void pi_cl_hyper_write_wait ( pi_cl_hyper_req_t req)
inlinestatic

This blocks the calling core until the specified cluster remote copy is finished.

Parameters
reqThe request structure used for termination.
void pi_hyper_close ( struct pi_device *  device)

This function can be called to close an opened Hyperbus device once it is not needed anymore, in order to free all allocated resources. Once this function is called, the device is not accessible anymore and must be opened again before being used.

Parameters
deviceThe device structure of the device to close.
void pi_hyper_conf_init ( struct pi_hyper_conf conf)

The structure containing the configuration must be kept alive until the device is opened.

Parameters
confA pointer to the Hyperbus configuration.
int pi_hyper_ioctl ( struct pi_device *  device,
uint32_t  cmd,
void *  arg 
)

This function can be called to change part of the device configuration after it has been opened or to control it.

Parameters
deviceA pointer to the structure describing the device.
cmdThe command which specifies which parameters of the driver to modify and for some of them also their values. The command must be one of those defined in pi_hyper_ioctl_e.
argAn additional value which is required for some parameters when they are set.
int32_t pi_hyper_open ( struct pi_device *  device)

This function must be called before the Hyperbus device can be used. It will do all the needed configuration to make it usable and initialize the handle used to refer to this opened device when calling other functions.

Parameters
deviceA pointer to the device structure of the device to open. This structure is allocated by the called and must be kept alive until the device is closed.
Returns
0 if the operation is successfull, -1 if there was an error.
PI_INLINE_HYPER_LVL_0 void pi_hyper_read ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size 
)

The copy will make a transfer between the Hyperbus and one of the processor memory areas. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
PI_INLINE_HYPER_LVL_0 void pi_hyper_read_2d ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length 
)

The copy will make a transfer between the Hyperbus and one of the processor memory areas. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
stride2D stride, which is the number of bytes which are added to the beginning of the current line to switch to the next one.
length2D length, which is the number of transferred bytes after which the driver will switch to the next line.
PI_INLINE_HYPER_LVL_0 void pi_hyper_read_2d_async ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length,
struct pi_task *  task 
)

The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
stride2D stride, which is the number of bytes which are added to the beginning of the current line to switch to the next one.
length2D length, which is the number of transferred bytes after which the driver will switch to the next line.
taskThe task used to notify the end of transfer. See the documentation of pi_task_t for more details.
PI_INLINE_HYPER_LVL_0 void pi_hyper_read_async ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
struct pi_task *  task 
)

The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
taskThe task used to notify the end of transfer. See the documentation of pi_task_t for more details.
PI_INLINE_HYPER_LVL_0 void pi_hyper_write ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size 
)

The copy will make a transfer between the Hyperbus and one of the processor memory areas. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
PI_INLINE_HYPER_LVL_0 void pi_hyper_write_2d ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length 
)

The copy will make a transfer between the Hyperbus and one of the processor memory areas. The caller is blocked until the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
stride2D stride, which is the number of bytes which are added to the beginning of the current line to switch to the next one.
length2D length, which is the number of transferred bytes after which the driver will switch to the next line.
PI_INLINE_HYPER_LVL_0 void pi_hyper_write_2d_async ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
uint32_t  stride,
uint32_t  length,
struct pi_task *  task 
)

The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
stride2D stride, which is the number of bytes which are added to the beginning of the current line to switch to the next one.
length2D length, which is the number of transferred bytes after which the driver will switch to the next line.
taskThe task used to notify the end of transfer. See the documentation of pi_task_t for more details.
PI_INLINE_HYPER_LVL_0 void pi_hyper_write_async ( struct pi_device *  device,
uint32_t  hyper_addr,
void *  addr,
uint32_t  size,
struct pi_task *  task 
)

The copy will make an asynchronous transfer between the Hyperbus and one of the processor memory areas. A task must be specified in order to specify how the caller should be notified when the transfer is finished. Depending on the chip, there may be some restrictions on the memory which can be used. Check the chip-specific documentation for more details.

Parameters
deviceThe device descriptor of the Hyperbus chip on which to do the copy.
hyper_addrThe address of the copy in the Hyperbus.
addrThe address of the copy in the processor.
sizeThe size in bytes of the copy
taskThe task used to notify the end of transfer. See the documentation of pi_task_t for more details.
void pi_hyper_xip_lock ( struct pi_device *  device)

This function can be called to prevent the hyperbus from triggering any XIP refill transfer. This can be used to do an operation in a device which would make an XIP refill fail, like an erase operation. Be careful that locking XIP refills can lead to a deadlock if XIP code is executed so only local code must be execyted when the XIP refill is locked. This will only apply to the new transfer enqueued after calling this function, not to the pending transfers enqueued before.

Parameters
deviceThe device structure of the device to close.
void pi_hyper_xip_unlock ( struct pi_device *  device)

This function can be called to allow again XIP refills after they have been forbidden.

Parameters
deviceThe device structure of the device to close.