From 8fa9a67cc4938ce6c2c1c09a2d0c9e3f7dcd835c Mon Sep 17 00:00:00 2001 From: Ranjani Vaidyanathan Date: Mon, 28 Aug 2017 19:16:33 -0500 Subject: Update to the latest SCFW API. Signed-off-by: Ranjani Vaidyanathan --- plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c | 108 +++++++++++++++++++++---- plat/freescale/common/sci/svc/rm/rpc.h | 62 +++++++------- 2 files changed, 126 insertions(+), 44 deletions(-) mode change 100644 => 100755 plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c mode change 100644 => 100755 plat/freescale/common/sci/svc/rm/rpc.h (limited to 'plat/freescale/common/sci/svc/rm') diff --git a/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c b/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c old mode 100644 new mode 100755 index 9cdf6177..454d07bb --- a/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c +++ b/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c @@ -7,7 +7,7 @@ /*! * File containing client-side RPC functions for the RM service. These - * function are ported to clients that communicate to the SC. + * functions are ported to clients that communicate to the SC. * * @addtogroup RM_SVC * @{ @@ -28,7 +28,8 @@ /* Local Functions */ sc_err_t sc_rm_partition_alloc(sc_ipc_t ipc, sc_rm_pt_t *pt, bool secure, - bool isolated, bool restricted, bool confidential, bool coherent) + bool isolated, bool restricted, + bool confidential, bool coherent) { sc_rpc_msg_t msg; uint8_t result; @@ -84,8 +85,7 @@ sc_rm_did_t sc_rm_get_did(sc_ipc_t ipc) return (sc_rm_did_t) result; } -sc_err_t sc_rm_partition_static(sc_ipc_t ipc, sc_rm_pt_t pt, - sc_rm_did_t did) +sc_err_t sc_rm_partition_static(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_did_t did) { sc_rpc_msg_t msg; uint8_t result; @@ -138,8 +138,7 @@ sc_err_t sc_rm_get_partition(sc_ipc_t ipc, sc_rm_pt_t *pt) return (sc_err_t)result; } -sc_err_t sc_rm_set_parent(sc_ipc_t ipc, sc_rm_pt_t pt, - sc_rm_pt_t pt_parent) +sc_err_t sc_rm_set_parent(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_pt_t pt_parent) { sc_rpc_msg_t msg; uint8_t result; @@ -178,8 +177,7 @@ sc_err_t sc_rm_move_all(sc_ipc_t ipc, sc_rm_pt_t pt_src, sc_rm_pt_t pt_dst, return (sc_err_t)result; } -sc_err_t sc_rm_assign_resource(sc_ipc_t ipc, sc_rm_pt_t pt, - sc_rsrc_t resource) +sc_err_t sc_rm_assign_resource(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rsrc_t resource) { sc_rpc_msg_t msg; uint8_t result; @@ -217,8 +215,28 @@ sc_err_t sc_rm_set_resource_movable(sc_ipc_t ipc, sc_rsrc_t resource_fst, return (sc_err_t)result; } +sc_err_t sc_rm_set_subsys_rsrc_movable(sc_ipc_t ipc, sc_rsrc_t resource, + bool movable) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_RM; + RPC_FUNC(&msg) = RM_FUNC_SET_SUBSYS_RSRC_MOVABLE; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = movable; + RPC_SIZE(&msg) = 2; + + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + return (sc_err_t)result; +} + sc_err_t sc_rm_set_master_attributes(sc_ipc_t ipc, sc_rsrc_t resource, - sc_rm_spa_t sa, sc_rm_spa_t pa, bool smmu_bypass) + sc_rm_spa_t sa, sc_rm_spa_t pa, + bool smmu_bypass) { sc_rpc_msg_t msg; uint8_t result; @@ -238,8 +256,7 @@ sc_err_t sc_rm_set_master_attributes(sc_ipc_t ipc, sc_rsrc_t resource, return (sc_err_t)result; } -sc_err_t sc_rm_set_master_sid(sc_ipc_t ipc, sc_rsrc_t resource, - sc_rm_sid_t sid) +sc_err_t sc_rm_set_master_sid(sc_ipc_t ipc, sc_rsrc_t resource, sc_rm_sid_t sid) { sc_rpc_msg_t msg; uint8_t result; @@ -371,6 +388,31 @@ sc_err_t sc_rm_memreg_alloc(sc_ipc_t ipc, sc_rm_mr_t *mr, return (sc_err_t)result; } +sc_err_t sc_rm_memreg_split(sc_ipc_t ipc, sc_rm_mr_t mr, + sc_rm_mr_t *mr_ret, sc_faddr_t addr_start, + sc_faddr_t addr_end) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_RM; + RPC_FUNC(&msg) = RM_FUNC_MEMREG_SPLIT; + RPC_U32(&msg, 0) = addr_start >> 32; + RPC_U32(&msg, 4) = addr_start; + RPC_U32(&msg, 8) = addr_end >> 32; + RPC_U32(&msg, 12) = addr_end; + RPC_U8(&msg, 16) = mr; + RPC_SIZE(&msg) = 6; + + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + if (mr_ret != NULL) + *mr_ret = RPC_U8(&msg, 0); + return (sc_err_t)result; +} + sc_err_t sc_rm_memreg_free(sc_ipc_t ipc, sc_rm_mr_t mr) { sc_rpc_msg_t msg; @@ -388,6 +430,29 @@ sc_err_t sc_rm_memreg_free(sc_ipc_t ipc, sc_rm_mr_t mr) return (sc_err_t)result; } +sc_err_t sc_rm_find_memreg(sc_ipc_t ipc, sc_rm_mr_t *mr, + sc_faddr_t addr_start, sc_faddr_t addr_end) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_RM; + RPC_FUNC(&msg) = RM_FUNC_FIND_MEMREG; + RPC_U32(&msg, 0) = addr_start >> 32; + RPC_U32(&msg, 4) = addr_start; + RPC_U32(&msg, 8) = addr_end >> 32; + RPC_U32(&msg, 12) = addr_end; + RPC_SIZE(&msg) = 5; + + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + if (mr != NULL) + *mr = RPC_U8(&msg, 0); + return (sc_err_t)result; +} + sc_err_t sc_rm_assign_memreg(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_mr_t mr) { sc_rpc_msg_t msg; @@ -458,9 +523,11 @@ sc_err_t sc_rm_get_memreg_info(sc_ipc_t ipc, sc_rm_mr_t mr, sc_call_rpc(ipc, &msg, false); if (addr_start != NULL) - *addr_start = ((uint64_t) RPC_U32(&msg, 0) << 32) | RPC_U32(&msg, 4); + *addr_start = + ((uint64_t) RPC_U32(&msg, 0) << 32) | RPC_U32(&msg, 4); if (addr_end != NULL) - *addr_end = ((uint64_t) RPC_U32(&msg, 8) << 32) | RPC_U32(&msg, 12); + *addr_end = + ((uint64_t) RPC_U32(&msg, 8) << 32) | RPC_U32(&msg, 12); result = RPC_R8(&msg); return (sc_err_t)result; } @@ -520,5 +587,18 @@ bool sc_rm_is_pad_owned(sc_ipc_t ipc, sc_pad_t pad) return (bool)result; } -/**@}*/ +void sc_rm_dump(sc_ipc_t ipc) +{ + sc_rpc_msg_t msg; + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_RM; + RPC_FUNC(&msg) = RM_FUNC_DUMP; + RPC_SIZE(&msg) = 1; + + sc_call_rpc(ipc, &msg, false); + + return; +} + +/**@}*/ diff --git a/plat/freescale/common/sci/svc/rm/rpc.h b/plat/freescale/common/sci/svc/rm/rpc.h old mode 100644 new mode 100755 index 68037470..2a911874 --- a/plat/freescale/common/sci/svc/rm/rpc.h +++ b/plat/freescale/common/sci/svc/rm/rpc.h @@ -24,35 +24,38 @@ /*! * This type is used to indicate RPC RM function calls. */ -typedef enum rm_func_e -{ - RM_FUNC_UNKNOWN = 0, /*!< Unknown function */ - RM_FUNC_PARTITION_ALLOC = 1, /*!< Index for rm_partition_alloc() RPC call */ - RM_FUNC_PARTITION_FREE = 2, /*!< Index for rm_partition_free() RPC call */ - RM_FUNC_GET_DID = 26, /*!< Index for rm_get_did() RPC call */ - RM_FUNC_PARTITION_STATIC = 3, /*!< Index for rm_partition_static() RPC call */ - RM_FUNC_PARTITION_LOCK = 4, /*!< Index for rm_partition_lock() RPC call */ - RM_FUNC_GET_PARTITION = 5, /*!< Index for rm_get_partition() RPC call */ - RM_FUNC_SET_PARENT = 6, /*!< Index for rm_set_parent() RPC call */ - RM_FUNC_MOVE_ALL = 7, /*!< Index for rm_move_all() RPC call */ - RM_FUNC_ASSIGN_RESOURCE = 8, /*!< Index for rm_assign_resource() RPC call */ - RM_FUNC_SET_RESOURCE_MOVABLE = 9, /*!< Index for rm_set_resource_movable() RPC call */ - RM_FUNC_SET_MASTER_ATTRIBUTES = 10, /*!< Index for rm_set_master_attributes() RPC call */ - RM_FUNC_SET_MASTER_SID = 11, /*!< Index for rm_set_master_sid() RPC call */ - RM_FUNC_SET_PERIPHERAL_PERMISSIONS = 12, /*!< Index for rm_set_peripheral_permissions() RPC call */ - RM_FUNC_IS_RESOURCE_OWNED = 13, /*!< Index for rm_is_resource_owned() RPC call */ - RM_FUNC_IS_RESOURCE_MASTER = 14, /*!< Index for rm_is_resource_master() RPC call */ - RM_FUNC_IS_RESOURCE_PERIPHERAL = 15, /*!< Index for rm_is_resource_peripheral() RPC call */ - RM_FUNC_GET_RESOURCE_INFO = 16, /*!< Index for rm_get_resource_info() RPC call */ - RM_FUNC_MEMREG_ALLOC = 17, /*!< Index for rm_memreg_alloc() RPC call */ - RM_FUNC_MEMREG_FREE = 18, /*!< Index for rm_memreg_free() RPC call */ - RM_FUNC_ASSIGN_MEMREG = 19, /*!< Index for rm_assign_memreg() RPC call */ - RM_FUNC_SET_MEMREG_PERMISSIONS = 20, /*!< Index for rm_set_memreg_permissions() RPC call */ - RM_FUNC_IS_MEMREG_OWNED = 21, /*!< Index for rm_is_memreg_owned() RPC call */ - RM_FUNC_GET_MEMREG_INFO = 22, /*!< Index for rm_get_memreg_info() RPC call */ - RM_FUNC_ASSIGN_PAD = 23, /*!< Index for rm_assign_pad() RPC call */ - RM_FUNC_SET_PAD_MOVABLE = 24, /*!< Index for rm_set_pad_movable() RPC call */ - RM_FUNC_IS_PAD_OWNED = 25, /*!< Index for rm_is_pad_owned() RPC call */ +typedef enum rm_func_e { + RM_FUNC_UNKNOWN = 0, /* Unknown function */ + RM_FUNC_PARTITION_ALLOC = 1, /* Index for rm_partition_alloc() RPC call */ + RM_FUNC_PARTITION_FREE = 2, /* Index for rm_partition_free() RPC call */ + RM_FUNC_GET_DID = 26, /* Index for rm_get_did() RPC call */ + RM_FUNC_PARTITION_STATIC = 3, /* Index for rm_partition_static() RPC call */ + RM_FUNC_PARTITION_LOCK = 4, /* Index for rm_partition_lock() RPC call */ + RM_FUNC_GET_PARTITION = 5, /* Index for rm_get_partition() RPC call */ + RM_FUNC_SET_PARENT = 6, /* Index for rm_set_parent() RPC call */ + RM_FUNC_MOVE_ALL = 7, /* Index for rm_move_all() RPC call */ + RM_FUNC_ASSIGN_RESOURCE = 8, /* Index for rm_assign_resource() RPC call */ + RM_FUNC_SET_RESOURCE_MOVABLE = 9, /* Index for rm_set_resource_movable() RPC call */ + RM_FUNC_SET_SUBSYS_RSRC_MOVABLE = 28, /* Index for rm_set_subsys_rsrc_movable() RPC call */ + RM_FUNC_SET_MASTER_ATTRIBUTES = 10, /* Index for rm_set_master_attributes() RPC call */ + RM_FUNC_SET_MASTER_SID = 11, /* Index for rm_set_master_sid() RPC call */ + RM_FUNC_SET_PERIPHERAL_PERMISSIONS = 12, /* Index for rm_set_peripheral_permissions() RPC call */ + RM_FUNC_IS_RESOURCE_OWNED = 13, /* Index for rm_is_resource_owned() RPC call */ + RM_FUNC_IS_RESOURCE_MASTER = 14, /* Index for rm_is_resource_master() RPC call */ + RM_FUNC_IS_RESOURCE_PERIPHERAL = 15, /* Index for rm_is_resource_peripheral() RPC call */ + RM_FUNC_GET_RESOURCE_INFO = 16, /* Index for rm_get_resource_info() RPC call */ + RM_FUNC_MEMREG_ALLOC = 17, /* Index for rm_memreg_alloc() RPC call */ + RM_FUNC_MEMREG_SPLIT = 29, /* Index for rm_memreg_split() RPC call */ + RM_FUNC_MEMREG_FREE = 18, /* Index for rm_memreg_free() RPC call */ + RM_FUNC_FIND_MEMREG = 30, /* Index for rm_find_memreg() RPC call */ + RM_FUNC_ASSIGN_MEMREG = 19, /* Index for rm_assign_memreg() RPC call */ + RM_FUNC_SET_MEMREG_PERMISSIONS = 20, /* Index for rm_set_memreg_permissions() RPC call */ + RM_FUNC_IS_MEMREG_OWNED = 21, /* Index for rm_is_memreg_owned() RPC call */ + RM_FUNC_GET_MEMREG_INFO = 22, /* Index for rm_get_memreg_info() RPC call */ + RM_FUNC_ASSIGN_PAD = 23, /* Index for rm_assign_pad() RPC call */ + RM_FUNC_SET_PAD_MOVABLE = 24, /* Index for rm_set_pad_movable() RPC call */ + RM_FUNC_IS_PAD_OWNED = 25, /* Index for rm_is_pad_owned() RPC call */ + RM_FUNC_DUMP = 27, /* Index for rm_dump() RPC call */ } rm_func_t; /* Functions */ @@ -76,4 +79,3 @@ void rm_xlate(sc_ipc_t ipc, sc_rpc_msg_t *msg); #endif /* _SC_RM_RPC_H */ /**@}*/ - -- cgit v1.2.3