FreeRTOS port on GAP8/RISC-V
|
Macros | |
#define | UDMA_DATA_MAX_SIZE |
Functions | |
void | __pi_octospi_0_irq_handler (void) |
void | __pi_octospi_1_irq_handler (void) |
static void | __pi_octospi_handler (void *arg) |
void | __pi_octospi_irq_handler (uint8_t octospi_id) |
static void | __pi_octospi_clk_div_get (struct octospi_cs_data_s *cs_data, uint32_t baudrate) |
static void | __pi_octospi_device_settings_set (struct octospi_cs_data_s *cs_data, uint32_t cs_max) |
static void | __pi_octospi_ospi_config_set (struct octospi_cs_data_s *cs_data, pi_octospi_op_conf_t *op, uint8_t is_xip) |
static void | __pi_octospi_2d_copy_exec (struct octospi_itf_data_s *driver_data, pi_task_t *task, int32_t hw_buff_idx) |
void | __pi_octospi_conf_init (struct pi_octospi_conf *conf) |
Init octospi configuration structure. More... | |
int32_t | __pi_octospi_open (struct pi_octospi_conf *conf, struct octospi_cs_data_s **device_data) |
Open octospi device. More... | |
void | __pi_octospi_close (struct octospi_cs_data_s *cs_data) |
Close octospi device. More... | |
int32_t | __pi_octospi_ioctl (struct octospi_cs_data_s *cs_data, uint32_t cmd, void *arg) |
Ioctl function. More... | |
void | __pi_octospi_2d_copy (struct octospi_cs_data_s *cs_data, uint32_t ext_addr, void *addr, uint32_t size, uint32_t stride, uint32_t length, pi_octospi_op_conf_t *op, udma_channel_e channel, pi_task_t *task) |
Enqueue 2D transfer. More... | |
Variables | |
static struct octospi_itf_data_s * | g_octospi_itf_data [UDMA_NB_HYPER] |
#define UDMA_DATA_MAX_SIZE |
Referenced by __pi_octospi_2d_copy_exec().
void __pi_octospi_0_irq_handler | ( | void | ) |
Referenced by __pi_octospi_open().
void __pi_octospi_1_irq_handler | ( | void | ) |
Referenced by __pi_octospi_open().
void __pi_octospi_2d_copy | ( | struct octospi_cs_data_s * | cs_data, |
uint32_t | ext_addr, | ||
void * | addr, | ||
uint32_t | size, | ||
uint32_t | stride, | ||
uint32_t | length, | ||
pi_octospi_op_conf_t * | op, | ||
udma_channel_e | channel, | ||
pi_task_t * | task | ||
) |
cs_data | Pointer to ospi device data. |
ext_addr | External address. |
addr | L2 buffer address. |
size | Size of data to transfer. |
stride | 2D stride value, 0 if 1D. |
length | 2D length value, 0 if 1D. |
op | OSPI operation. |
channel | Type of transfer(RX or TX). |
task | Event task attached to the transfer. |
References __pi_octospi_2d_copy_exec(), pi_task_t::data, octospi_cs_data_s::device_id, octospi_itf_data_s::device_id, disable_irq(), pi_task_t::next, OSPI_TRACE, pi_udma_fifo_hw_buffer_empty(), pi_udma_fifo_sw_fifo_task_enqueue(), restore_irq(), octospi_itf_data_s::udma_chan, and udma_chan_str.
Referenced by pi_octospi_read(), pi_octospi_read_2d(), pi_octospi_read_2d_async(), pi_octospi_read_async(), pi_octospi_write(), pi_octospi_write_2d(), pi_octospi_write_2d_async(), and pi_octospi_write_async().
|
static |
References __pi_octospi_ospi_config_set(), pi_task_t::data, octospi_itf_data_s::device_id, hal_udma_hyperbus_transfer_2d_auto(), HYPER_2D_MODE_1D_1D, HYPER_2D_MODE_1D_2D, max_size, OSPI_TRACE, pi_udma_fifo_buffer_set(), pi_udma_fifo_hw_fifo_task_enqueue(), octospi_itf_data_s::udma_chan, udma_chan_str, UDMA_DATA_MAX_SIZE, and UDMA_HYPER_BURST_ENABLE_2D_MODE.
Referenced by __pi_octospi_2d_copy(), and __pi_octospi_irq_handler().
|
inlinestatic |
References octospi_cs_data_s::baudrate, octospi_cs_data_s::clk_div, OSPI_TRACE, and pi_freq_get().
Referenced by __pi_octospi_open().
void __pi_octospi_close | ( | struct octospi_cs_data_s * | cs_data | ) |
cs_data | Pointer to ospi device data. |
References octospi_cs_data_s::device_id, hal_udma_core_2d_get(), hal_udma_core_2d_reset(), hal_udma_ctrl_cg_enable(), hal_udma_ctrl_reset_clear(), hal_udma_hyperbus_rx_dest_set(), hal_udma_hyperbus_tx_dest_set(), HYPER_TRACE, octospi_itf_data_s::nb_open, pi_free(), pi_udma_core_2d_free(), UDMA_CHAN_2D_ID, octospi_itf_data_s::udma_chan_id_rx, octospi_itf_data_s::udma_chan_id_tx, and UDMA_HYPER_ID.
Referenced by pi_octospi_close().
void __pi_octospi_conf_init | ( | struct pi_octospi_conf * | conf | ) |
conf | Pointer to octospi conf. |
Referenced by pi_octospi_conf_init().
|
static |
References octospi_cs_data_s::clk_div, octospi_cs_data_s::device_id, octospi_itf_data_s::device_id, FLASH_ADDR, hal_udma_hyperbus_clk_div_set(), hal_udma_hyperbus_device_type_set(), hal_udma_hyperbus_mba0_set(), hal_udma_hyperbus_mba1_set(), hal_udma_hyperbus_ospi_csn_get(), hal_udma_hyperbus_ospi_csn_mask_set(), hal_udma_hyperbus_timing_set(), HYPERRAM, OSPI_TRACE, octospi_cs_data_s::ram_opt, octospi_cs_data_s::type, TYPE_OCTOSPI, udma_hyper, udma_hyper_clk_div_get(), udma_hyper_device_get(), udma_hyper_mba0_get(), udma_hyper_mba1_get(), udma_hyper_ospi_csn_get(), udma_hyper_ospi_ram_opt_get(), UDMA_HYPER_OSPI_RAM_OPT_PSRAM_CROSS_BOUNDARY_EN_BIT, UDMA_HYPER_OSPI_RAM_OPT_REAL_ADDR_EN_BIT, and udma_hyper_timing_cfg_get().
Referenced by __pi_octospi_open().
|
static |
References octospi_itf_data_s::device_id, and OSPI_TRACE.
Referenced by __pi_octospi_open().
int32_t __pi_octospi_ioctl | ( | struct octospi_cs_data_s * | cs_data, |
uint32_t | cmd, | ||
void * | arg | ||
) |
cs_data | Pointer to ospi device data. |
cmd | Ioctl command ID. |
arg | Ioctl command arg. |
-1 | Unknown command. |
RETVAL | Ioctl function return value. |
References __pi_octospi_ospi_config_set(), disable_irq(), and restore_irq().
Referenced by pi_octospi_ioctl().
void __pi_octospi_irq_handler | ( | uint8_t | octospi_id | ) |
int32_t __pi_octospi_open | ( | struct pi_octospi_conf * | conf, |
struct octospi_cs_data_s ** | device_data | ||
) |
conf | Pointer to octospi conf. |
driver_conf | Pointer to internal octospi conf pointer. |
0 | Operation is successful. |
ERRNO | Error code. |
References __pi_octospi_0_irq_handler(), __pi_octospi_1_irq_handler(), __pi_octospi_clk_div_get(), __pi_octospi_device_settings_set(), __pi_octospi_handler(), octospi_cs_data_s::baudrate, octospi_itf_data_s::cs_list, octospi_itf_data_s::device_id, FC_IRQ_HYPER_0_EOT_IRQ, FC_IRQ_HYPER_1_EOT_IRQ, hal_udma_ctrl_cg_disable(), hal_udma_ctrl_reset_set(), hal_udma_hyperbus_irq_enable(), hal_udma_hyperbus_rx_dest_set(), hal_udma_hyperbus_transfert_mode_set(), hal_udma_hyperbus_tx_dest_set(), HYPER_BURST_2D_ENABLE, HYPER_MODE_AUTO_ENABLE, octospi_itf_data_s::nb_open, NVIC_EnableIRQ, NVIC_SetVector, OSPI_TRACE, OSPI_TRACE_ERR, pi_free(), pi_malloc(), pi_udma_core_2d_alloc(), pi_udma_core_2d_free(), pi_udma_fifo_init(), octospi_itf_data_s::udma_chan, octospi_itf_data_s::udma_chan_id_rx, octospi_itf_data_s::udma_chan_id_tx, udma_ctrl, udma_hyper, UDMA_HYPER_BURST_ENABLE_2D_ENABLE, UDMA_HYPER_BURST_ENABLE_CS0_AUTO_BURST_ENABLE_MASK, UDMA_HYPER_BURST_ENABLE_CS0_MAXIMUM_CHECK_ENABLE_MASK, and UDMA_HYPER_ID.
Referenced by pi_octospi_open().
|
static |
References octospi_cs_data_s::cs, octospi_cs_data_s::device_id, octospi_itf_data_s::device_id, hal_udma_hyperbus_ospi_alter_set(), hal_udma_hyperbus_ospi_alter_xip_set(), hal_udma_hyperbus_ospi_cfg_mask_set(), hal_udma_hyperbus_ospi_cfg_mask_xip_set(), hal_udma_hyperbus_ospi_cmd_set(), hal_udma_hyperbus_ospi_cmd_xip_set(), hal_udma_hyperbus_ospi_ram_opt_mask_set(), hal_udma_hyperbus_timing_get(), hal_udma_hyperbus_timing_mask_set(), OSPI_TRACE, printf, octospi_cs_data_s::ram_opt, udma_hyper, udma_hyper_ospi_alter_get(), udma_hyper_ospi_cfg_get(), UDMA_HYPER_OSPI_CMD_CMD_MASK, udma_hyper_ospi_cmd_get(), udma_hyper_ospi_csn_get(), udma_hyper_ospi_ram_opt_get(), UDMA_HYPER_OSPI_RAM_OPT_PSRAM_ADDR_EVEN_BIT, UDMA_HYPER_OSPI_RAM_OPT_PSRAM_CMD_EN_BIT, UDMA_HYPER_OSPI_RAM_OPT_PSRAM_READ_BIT_BIT, udma_hyper_timing_cfg_get(), and UDMA_HYPER_TIMING_CFG_LATENCY0_MASK.
Referenced by __pi_octospi_2d_copy_exec(), and __pi_octospi_ioctl().
|
static |