Zephyr Project API 4.0.0
A Scalable Open Source RTOS
|
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/arch/arm64/arm-smccc.h>
#include <zephyr/drivers/sip_svc/sip_svc_proto.h>
#include <zephyr/sip_svc/sip_svc_controller.h>
#include <zephyr/syscalls/sip_svc_driver.h>
Go to the source code of this file.
Data Structures | |
struct | svc_driver_api |
API structure for sip_svc driver. More... | |
Macros | |
#define | DEV_API(dev) ((struct svc_driver_api *)(dev)->api) |
#define | SVC_CONDUIT_NAME_LENGTH (4) |
Length of SVC conduit name. | |
Typedefs | |
typedef void(* | sip_supervisory_call_t) (const struct device *dev, unsigned long function_id, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, unsigned long arg6, struct arm_smccc_res *res) |
Callback API for executing the supervisory call See sip_supervisory_call() for argument description. | |
typedef bool(* | sip_svc_plat_func_id_valid_t) (const struct device *dev, uint32_t command, uint32_t func_id) |
Callback API for validating function id for the supervisory call. | |
typedef uint32_t(* | sip_svc_plat_format_trans_id_t) (const struct device *dev, uint32_t client_idx, uint32_t trans_idx) |
Callback API for generating the transaction id from client id. | |
typedef uint32_t(* | sip_svc_plat_get_trans_idx_t) (const struct device *dev, uint32_t trans_id) |
Callback API for retrieving client transaction id from transaction id See sip_svc_plat_get_trans_idx() for argument description. | |
typedef void(* | sip_svc_plat_update_trans_id_t) (const struct device *dev, struct sip_svc_request *request, uint32_t trans_id) |
Callback API for updating transaction id for request packet for lower layer See sip_svc_plat_update_trans_id() for argument description. | |
typedef void(* | sip_svc_plat_free_async_memory_t) (const struct device *dev, struct sip_svc_request *request) |
Callback API for freeing command buffer in ASYNC packets See sip_svc_plat_free_async_memory() for argument description. | |
typedef int(* | sip_svc_plat_async_res_req_t) (const struct device *dev, unsigned long *a0, unsigned long *a1, unsigned long *a2, unsigned long *a3, unsigned long *a4, unsigned long *a5, unsigned long *a6, unsigned long *a7, char *buf, size_t size) |
Callback API to construct Polling packet for ASYNC transaction. | |
typedef int(* | sip_svc_plat_async_res_res_t) (const struct device *dev, struct arm_smccc_res *res, char *buf, size_t *size, uint32_t *trans_id) |
Callback API to check the response of polling request See sip_svc_plat_async_res_res() for argument description. | |
typedef uint32_t(* | sip_svc_plat_get_error_code_t) (const struct device *dev, struct arm_smccc_res *res) |
Callback API for retrieving error code from a supervisory call response. | |
Functions | |
void | sip_supervisory_call (const struct device *dev, unsigned long function_id, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, unsigned long arg6, struct arm_smccc_res *res) |
supervisory call function which will execute the smc/hvc call | |
bool | sip_svc_plat_func_id_valid (const struct device *dev, uint32_t command, uint32_t func_id) |
Validate the function id for the supervisory call. | |
uint32_t | sip_svc_plat_format_trans_id (const struct device *dev, uint32_t client_idx, uint32_t trans_idx) |
Formats and generates the transaction id from client id. | |
uint32_t | sip_svc_plat_get_trans_idx (const struct device *dev, uint32_t trans_id) |
Retrieve client transaction id from packet transaction id. | |
void | sip_svc_plat_update_trans_id (const struct device *dev, struct sip_svc_request *request, uint32_t trans_id) |
Update transaction id for sip_svc_request for lower layer. | |
uint32_t | sip_svc_plat_get_error_code (const struct device *dev, struct arm_smccc_res *res) |
Retrieve the error code from arm_smccc_res response. | |
int | sip_svc_plat_async_res_req (const struct device *dev, unsigned long *a0, unsigned long *a1, unsigned long *a2, unsigned long *a3, unsigned long *a4, unsigned long *a5, unsigned long *a6, unsigned long *a7, char *buf, size_t size) |
Set arguments for polling supervisory call. | |
int | sip_svc_plat_async_res_res (const struct device *dev, struct arm_smccc_res *res, char *buf, size_t *size, uint32_t *trans_id) |
Check the response of polling supervisory call and retrieve the response size and transaction id. | |
void | sip_svc_plat_free_async_memory (const struct device *dev, struct sip_svc_request *request) |
Free the command buffer used for ASYNC packet after sending it to lower layers. | |
#define DEV_API | ( | dev | ) | ((struct svc_driver_api *)(dev)->api) |
#define SVC_CONDUIT_NAME_LENGTH (4) |
Length of SVC conduit name.
typedef void(* sip_supervisory_call_t) (const struct device *dev, unsigned long function_id, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5, unsigned long arg6, struct arm_smccc_res *res) |
Callback API for executing the supervisory call See sip_supervisory_call() for argument description.
typedef int(* sip_svc_plat_async_res_req_t) (const struct device *dev, unsigned long *a0, unsigned long *a1, unsigned long *a2, unsigned long *a3, unsigned long *a4, unsigned long *a5, unsigned long *a6, unsigned long *a7, char *buf, size_t size) |
Callback API to construct Polling packet for ASYNC transaction.
See sip_svc_plat_async_res_req() for argument description
typedef int(* sip_svc_plat_async_res_res_t) (const struct device *dev, struct arm_smccc_res *res, char *buf, size_t *size, uint32_t *trans_id) |
Callback API to check the response of polling request See sip_svc_plat_async_res_res() for argument description.
typedef uint32_t(* sip_svc_plat_format_trans_id_t) (const struct device *dev, uint32_t client_idx, uint32_t trans_idx) |
Callback API for generating the transaction id from client id.
See sip_svc_plat_format_trans_id() for argument description
typedef void(* sip_svc_plat_free_async_memory_t) (const struct device *dev, struct sip_svc_request *request) |
Callback API for freeing command buffer in ASYNC packets See sip_svc_plat_free_async_memory() for argument description.
typedef bool(* sip_svc_plat_func_id_valid_t) (const struct device *dev, uint32_t command, uint32_t func_id) |
Callback API for validating function id for the supervisory call.
See sip_svc_plat_func_id_valid() for argument description
typedef uint32_t(* sip_svc_plat_get_error_code_t) (const struct device *dev, struct arm_smccc_res *res) |
Callback API for retrieving error code from a supervisory call response.
See sip_svc_plat_get_error_code() for argument description.
Callback API for retrieving client transaction id from transaction id See sip_svc_plat_get_trans_idx() for argument description.
typedef void(* sip_svc_plat_update_trans_id_t) (const struct device *dev, struct sip_svc_request *request, uint32_t trans_id) |
Callback API for updating transaction id for request packet for lower layer See sip_svc_plat_update_trans_id() for argument description.
void sip_supervisory_call | ( | const struct device * | dev, |
unsigned long | function_id, | ||
unsigned long | arg0, | ||
unsigned long | arg1, | ||
unsigned long | arg2, | ||
unsigned long | arg3, | ||
unsigned long | arg4, | ||
unsigned long | arg5, | ||
unsigned long | arg6, | ||
struct arm_smccc_res * | res | ||
) |
supervisory call function which will execute the smc/hvc call
dev | Pointer to the device structure for the driver instance. |
function_id | Function identifier for the supervisory call. |
arg0 | Argument 0 for supervisory call. |
arg1 | Argument 1 for supervisory call. |
arg2 | Argument 2 for supervisory call. |
arg3 | Argument 3 for supervisory call. |
arg4 | Argument 4 for supervisory call. |
arg5 | Argument 5 for supervisory call. |
arg6 | Argument 6 for supervisory call. |
res | Pointer to response buffer for supervisory call. |
int sip_svc_plat_async_res_req | ( | const struct device * | dev, |
unsigned long * | a0, | ||
unsigned long * | a1, | ||
unsigned long * | a2, | ||
unsigned long * | a3, | ||
unsigned long * | a4, | ||
unsigned long * | a5, | ||
unsigned long * | a6, | ||
unsigned long * | a7, | ||
char * | buf, | ||
size_t | size | ||
) |
Set arguments for polling supervisory call.
For ASYNC polling of response.
dev | Pointer to the device structure for the driver instance. |
a0 | Argument 0 for supervisory call. |
a1 | Argument 1 for supervisory call. |
a2 | Argument 2 for supervisory call. |
a3 | Argument 3 for supervisory call. |
a4 | Argument 4 for supervisory call. |
a5 | Argument 5 for supervisory call. |
a6 | Argument 6 for supervisory call. |
a7 | Argument 7 for supervisory call. |
buf | Pointer for response buffer. |
size | Size of response buffer. |
0 | on success |
int sip_svc_plat_async_res_res | ( | const struct device * | dev, |
struct arm_smccc_res * | res, | ||
char * | buf, | ||
size_t * | size, | ||
uint32_t * | trans_id | ||
) |
Check the response of polling supervisory call and retrieve the response size and transaction id.
dev | Pointer to the device structure for the driver instance. |
res | Pointer to struct arm_smccc_res response. |
buf | Pointer to response buffer. |
size | Size of response in response buffer |
trans_id | Transaction id of the response. |
0 | on getting a valid polling response from supervisory call. |
-EINPROGRESS | on no valid polling response from supervisory call. |
uint32_t sip_svc_plat_format_trans_id | ( | const struct device * | dev, |
uint32_t | client_idx, | ||
uint32_t | trans_idx | ||
) |
Formats and generates the transaction id from client id.
dev | Pointer to the device structure for the driver instance. |
client_idx | client index. |
trans_idx | transaction index. |
transaction | id, which is used for tracking each transaction. |
void sip_svc_plat_free_async_memory | ( | const struct device * | dev, |
struct sip_svc_request * | request | ||
) |
Free the command buffer used for ASYNC packet after sending it to lower layers.
dev | Pointer to the device structure for the driver instance. |
request | Pointer to sip_svc_request packet. |
Validate the function id for the supervisory call.
dev | Pointer to the device structure for the driver instance. |
command | Command which specify if the call is SYNC or ASYNC. |
func_id | Function identifier |
true | if command and function identifiers are valid. |
false | if command and function identifiers are invalid. |
uint32_t sip_svc_plat_get_error_code | ( | const struct device * | dev, |
struct arm_smccc_res * | res | ||
) |
Retrieve the error code from arm_smccc_res response.
dev | Pointer to the device structure for the driver instance. |
res | Pointer to struct arm_smccc_res response. |
0 | on success. |
SIP_SVC_ID_INVALID | on failure |
Retrieve client transaction id from packet transaction id.
dev | Pointer to the device structure for the driver instance. |
trans_id | transaction identifier if for a transaction. |
client | transaction id form Transaction id. |
void sip_svc_plat_update_trans_id | ( | const struct device * | dev, |
struct sip_svc_request * | request, | ||
uint32_t | trans_id | ||
) |
Update transaction id for sip_svc_request for lower layer.
dev | Pointer to the device structure for the driver instance. |
request | Pointer to sip_svc_request structure. |
trans_id | Transaction id. |