Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion drivers/rz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ zephyr_library_sources_ifdef(CONFIG_USE_RZ_FSP_CANFD
zephyr_library_sources_ifdef(CONFIG_USE_RZ_FSP_RSPI_SPI
fsp/src/${SOC_SERIES_PREFIX}/r_rspi/r_rspi.c)

zephyr_library_sources_ifdef(CONFIG_USE_RZ_FSP_DMA
zephyr_library_sources_ifdef(CONFIG_USE_RZ_FSP_DMAC
fsp/src/${SOC_SERIES_PREFIX}/r_dmac/r_dmac.c)

zephyr_library_sources_ifdef(CONFIG_USE_RZ_FSP_DMAC_B
fsp/src/${SOC_SERIES_PREFIX}/r_dmac_b/r_dmac_b.c)

if(CONFIG_DT_HAS_RENESAS_RZ_SCI_B_ENABLED)
Expand Down
14 changes: 14 additions & 0 deletions drivers/rz/README
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,17 @@ Patch List:
Impacted files:
drivers/rz/fsp/src/rzg/r_gtm/r_gtm.c
drivers/rz/fsp/src/rzv/r_gtm/r_gtm.c

* Use r_transfer_api.h of rzv-fsp to support the callbackSet member of the transfer_api_t struct
Impacted files:
drivers/rz/fsp/inc/api/r_transfer_api.h

* Disable the BSP_FEATURE_BSP_HAS_MMU_SUPPORT configuration of the RZ/A3UL to avoid using
FSP MMU functions and let Zephyr handle MMU
Impacted files:
drivers/rz/fsp/src/rza/bsp/mcu/rza3ul/bsp_feature.h

* Change the cast type from uint32_t to uintptr_t when assigning an address to a register in the
DMAC FSP driver of the RZ/A3UL to avoid build warnings
Impacted files:
drivers/rz/fsp/src/rza/r_dmac/r_dmac.c
49 changes: 23 additions & 26 deletions drivers/rz/fsp/inc/api/r_transfer_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
*/

/*******************************************************************************************************************//**
* @ingroup RENESAS_INTERFACES
* @ingroup RENESAS_TRANSFER_INTERFACES
* @defgroup TRANSFER_API Transfer Interface
*
* @brief Interface for data transfer functions.
*
* @section TRANSFER_API_SUMMARY Summary
* The transfer interface supports background data transfer (no CPU intervention).
*
* Implemented by:
* - @ref DMAC_B
*
* @{
**********************************************************************************************************************/
Expand Down Expand Up @@ -49,8 +47,6 @@ FSP_HEADER
**********************************************************************************************************************/

/** Transfer control block. Allocate an instance specific control block to pass into the transfer API calls.
* @par Implemented as
* - dmac_b_instance_ctrl_t
*/
typedef void transfer_ctrl_t;

Expand Down Expand Up @@ -95,7 +91,8 @@ typedef enum e_transfer_size
{
TRANSFER_SIZE_1_BYTE = 0, ///< Each transfer transfers a 8-bit value
TRANSFER_SIZE_2_BYTE = 1, ///< Each transfer transfers a 16-bit value
TRANSFER_SIZE_4_BYTE = 2 ///< Each transfer transfers a 32-bit value
TRANSFER_SIZE_4_BYTE = 2, ///< Each transfer transfers a 32-bit value
TRANSFER_SIZE_8_BYTE = 3 ///< Each transfer transfers a 64-bit value
} transfer_size_t;

#endif
Expand Down Expand Up @@ -172,6 +169,16 @@ typedef enum e_transfer_irq

#endif

#ifndef BSP_OVERRIDE_TRANSFER_CALLBACK_ARGS_T

/** Callback function parameter data. */
typedef struct st_transfer_callback_args_t
{
void const * p_context; ///< Placeholder for user data. Set in @ref transfer_api_t::open function in ::transfer_cfg_t.
} transfer_callback_args_t;

#endif

/** Driver specific information. */
typedef struct st_transfer_properties
{
Expand Down Expand Up @@ -266,8 +273,6 @@ typedef enum e_transfer_start_mode
typedef struct st_transfer_api
{
/** Initial configuration.
* @par Implemented as
* - @ref R_DMAC_B_Open()
*
* @param[in,out] p_ctrl Pointer to control block. Must be declared by user. Elements set here.
* @param[in] p_cfg Pointer to configuration structure. All elements of this structure
Expand All @@ -277,8 +282,6 @@ typedef struct st_transfer_api

/** Reconfigure the transfer.
* Enable the transfer if p_info is valid.
* @par Implemented as
* - @ref R_DMAC_B_Reconfigure()
*
* @param[in,out] p_ctrl Pointer to control block. Must be declared by user. Elements set here.
* @param[in] p_info Pointer to a new transfer info structure.
Expand All @@ -287,8 +290,6 @@ typedef struct st_transfer_api

/** Reset source address pointer, destination address pointer, and/or length, keeping all other settings the same.
* Enable the transfer if p_src, p_dest, and length are valid.
* @par Implemented as
* - @ref R_DMAC_B_Reset()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
* @param[in] p_src Pointer to source. Set to NULL if source pointer should not change.
Expand All @@ -302,8 +303,6 @@ typedef struct st_transfer_api

/** Enable transfer. Transfers occur after the activation source event (or when
* @ref transfer_api_t::softwareStart is called if no peripheral event is chosen as activation source).
* @par Implemented as
* - @ref R_DMAC_B_Enable()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
*/
Expand All @@ -313,8 +312,6 @@ typedef struct st_transfer_api
* @ref transfer_api_t::softwareStart is called if no peripheral event is chosen as the DMAC activation source).
* @note If a transfer is in progress, it will be completed. Subsequent transfer requests do not cause a
* transfer.
* @par Implemented as
* - @ref R_DMAC_B_Disable()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
*/
Expand All @@ -323,8 +320,6 @@ typedef struct st_transfer_api
/** Start transfer in software.
* @warning Only works if no peripheral event is chosen as the DMAC activation source.
* @note Not supported for DTC.
* @par Implemented as
* - @ref R_DMAC_B_SoftwareStart()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
* @param[in] mode Select mode from @ref transfer_start_mode_t.
Expand All @@ -335,34 +330,26 @@ typedef struct st_transfer_api
* @note Not supported for DTC.
* @note Only applies for transfers started with TRANSFER_START_MODE_REPEAT.
* @warning Only works if no peripheral event is chosen as the DMAC activation source.
* @par Implemented as
* - @ref R_DMAC_B_SoftwareStop()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
*/
fsp_err_t (* softwareStop)(transfer_ctrl_t * const p_ctrl);

/** Provides information about this transfer.
* @par Implemented as
* - @ref R_DMAC_B_InfoGet()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
* @param[out] p_properties Driver specific information.
*/
fsp_err_t (* infoGet)(transfer_ctrl_t * const p_ctrl, transfer_properties_t * const p_properties);

/** Releases hardware lock. This allows a transfer to be reconfigured using @ref transfer_api_t::open.
* @par Implemented as
* - @ref R_DMAC_B_Close()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
*/
fsp_err_t (* close)(transfer_ctrl_t * const p_ctrl);

/** To update next transfer information without interruption during transfer.
* Allow further transfer continuation.
* @par Implemented as
* - @ref R_DMAC_B_Reload()
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
* @param[in] p_src Pointer to source. Set to NULL if source pointer should not change.
Expand All @@ -372,6 +359,16 @@ typedef struct st_transfer_api
fsp_err_t (* reload)(transfer_ctrl_t * const p_ctrl, void const * p_src, void * p_dest,
uint32_t const num_transfers);

/** Specify callback function and optional context pointer and working memory pointer.
*
* @param[in] p_ctrl Control block set in @ref transfer_api_t::open call for this transfer.
* @param[in] p_callback Callback function to register
* @param[in] p_context Pointer to send to callback function
* @param[in] p_callback_memory Pointer to volatile memory where callback structure can be allocated.
* Callback arguments allocated here are only valid during the callback.
*/
fsp_err_t (* callbackSet)(transfer_ctrl_t * const p_ctrl, void (* p_callback)(transfer_callback_args_t *),
void const * const p_context, transfer_callback_args_t * const p_callback_memory);
} transfer_api_t;

/** This structure encompasses everything that is needed to use an instance of this interface. */
Expand Down
Loading