From 5a9ac99043ef1dc18565700d4c46dc2c8fe34e59 Mon Sep 17 00:00:00 2001 From: Ranjani Vaidyanathan Date: Fri, 26 May 2017 17:36:29 -0500 Subject: i.MX8: Update to the latest SCFW API Signed-off-by: Ranjani Vaidyanathan --- plat/freescale/common/sci/svc/pad/pad_rpc_clnt.c | 307 +++++++++++------------ plat/freescale/common/sci/svc/pad/rpc.h | 61 ++--- plat/freescale/common/sci/svc/pm/pm_rpc_clnt.c | 175 +++++++------ plat/freescale/common/sci/svc/pm/rpc.h | 57 ++--- plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c | 153 +++++------ plat/freescale/common/sci/svc/rm/rpc.h | 58 ++--- 6 files changed, 385 insertions(+), 426 deletions(-) mode change 100755 => 100644 plat/freescale/common/sci/svc/pm/pm_rpc_clnt.c mode change 100755 => 100644 plat/freescale/common/sci/svc/pm/rpc.h (limited to 'plat/freescale/common/sci/svc') diff --git a/plat/freescale/common/sci/svc/pad/pad_rpc_clnt.c b/plat/freescale/common/sci/svc/pad/pad_rpc_clnt.c index 3bc7740b..4b0ef948 100644 --- a/plat/freescale/common/sci/svc/pad/pad_rpc_clnt.c +++ b/plat/freescale/common/sci/svc/pad/pad_rpc_clnt.c @@ -1,31 +1,8 @@ /* + * Copyright (C) 2016 Freescale Semiconductor, Inc. * Copyright 2017 NXP * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of NXP nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0+ */ /*! @@ -51,7 +28,7 @@ /* Local Functions */ -sc_err_t sc_pad_set_mux(sc_ipc_t ipc, sc_pin_t pin, +sc_err_t sc_pad_set_mux(sc_ipc_t ipc, sc_pad_t pad, uint8_t mux, sc_pad_config_t config, sc_pad_iso_t iso) { sc_rpc_msg_t msg; @@ -60,10 +37,10 @@ sc_err_t sc_pad_set_mux(sc_ipc_t ipc, sc_pin_t pin, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; RPC_FUNC(&msg) = PAD_FUNC_SET_MUX; - RPC_D16(&msg, 0) = pin; - RPC_D8(&msg, 2) = mux; - RPC_D8(&msg, 3) = config; - RPC_D8(&msg, 4) = iso; + RPC_U16(&msg, 0) = pad; + RPC_U8(&msg, 2) = mux; + RPC_U8(&msg, 3) = config; + RPC_U8(&msg, 4) = iso; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -72,40 +49,40 @@ sc_err_t sc_pad_set_mux(sc_ipc_t ipc, sc_pin_t pin, return (sc_err_t) result; } -sc_err_t sc_pad_set_gp(sc_ipc_t ipc, sc_pin_t pin, uint32_t ctrl) +sc_err_t sc_pad_get_mux(sc_ipc_t ipc, sc_pad_t pad, + uint8_t *mux, sc_pad_config_t *config, sc_pad_iso_t *iso) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_SET_GP; - RPC_D32(&msg, 0) = ctrl; - RPC_D16(&msg, 4) = pin; - RPC_SIZE(&msg) = 3; + RPC_FUNC(&msg) = PAD_FUNC_GET_MUX; + RPC_U16(&msg, 0) = pad; + RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); + if (mux != NULL) + *mux = RPC_U8(&msg, 0); + if (config != NULL) + *config = RPC_U8(&msg, 1); + if (iso != NULL) + *iso = RPC_U8(&msg, 2); return (sc_err_t) result; } -sc_err_t sc_pad_set_gp_28lpp(sc_ipc_t ipc, sc_pin_t pin, - sc_pad_28lpp_dse_t dse, bool sre, bool hys, bool pe, - sc_pad_28lpp_ps_t ps) +sc_err_t sc_pad_set_gp(sc_ipc_t ipc, sc_pad_t pad, uint32_t ctrl) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_SET_GP_28LPP; - RPC_D16(&msg, 0) = pin; - RPC_D8(&msg, 2) = dse; - RPC_D8(&msg, 3) = ps; - RPC_D8(&msg, 4) = sre; - RPC_D8(&msg, 5) = hys; - RPC_D8(&msg, 6) = pe; + RPC_FUNC(&msg) = PAD_FUNC_SET_GP; + RPC_U32(&msg, 0) = ctrl; + RPC_U16(&msg, 4) = pad; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -114,27 +91,26 @@ sc_err_t sc_pad_set_gp_28lpp(sc_ipc_t ipc, sc_pin_t pin, return (sc_err_t) result; } -sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pin_t pin, - sc_pad_wakeup_t wakeup) +sc_err_t sc_pad_get_gp(sc_ipc_t ipc, sc_pad_t pad, uint32_t *ctrl) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_SET_WAKEUP; - RPC_D16(&msg, 0) = pin; - RPC_D8(&msg, 2) = wakeup; + RPC_FUNC(&msg) = PAD_FUNC_GET_GP; + RPC_U16(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); + if (ctrl != NULL) + *ctrl = RPC_U32(&msg, 0); result = RPC_R8(&msg); return (sc_err_t) result; } -sc_err_t sc_pad_set_all(sc_ipc_t ipc, sc_pin_t pin, uint8_t mux, - sc_pad_config_t config, sc_pad_iso_t iso, uint32_t ctrl, +sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t wakeup) { sc_rpc_msg_t msg; @@ -142,14 +118,10 @@ sc_err_t sc_pad_set_all(sc_ipc_t ipc, sc_pin_t pin, uint8_t mux, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_SET_ALL; - RPC_D32(&msg, 0) = ctrl; - RPC_D16(&msg, 4) = pin; - RPC_D8(&msg, 6) = mux; - RPC_D8(&msg, 7) = config; - RPC_D8(&msg, 8) = iso; - RPC_D8(&msg, 9) = wakeup; - RPC_SIZE(&msg) = 4; + RPC_FUNC(&msg) = PAD_FUNC_SET_WAKEUP; + RPC_U16(&msg, 0) = pad; + RPC_U8(&msg, 2) = wakeup; + RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -157,140 +129,133 @@ sc_err_t sc_pad_set_all(sc_ipc_t ipc, sc_pin_t pin, uint8_t mux, return (sc_err_t) result; } -sc_err_t sc_pad_get_mux(sc_ipc_t ipc, sc_pin_t pin, - uint8_t *mux, sc_pad_config_t *config, sc_pad_iso_t *iso) +sc_err_t sc_pad_get_wakeup(sc_ipc_t ipc, sc_pad_t pad, + sc_pad_wakeup_t *wakeup) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET_MUX; - RPC_D16(&msg, 0) = pin; + RPC_FUNC(&msg) = PAD_FUNC_GET_WAKEUP; + RPC_U16(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); - if (mux != NULL) - *mux = RPC_D8(&msg, 0); - if (config != NULL) - *config = RPC_D8(&msg, 1); - if (iso != NULL) - *iso = RPC_D8(&msg, 2); + if (wakeup != NULL) + *wakeup = RPC_U8(&msg, 0); return (sc_err_t) result; } -sc_err_t sc_pad_get_gp(sc_ipc_t ipc, sc_pin_t pin, uint32_t *ctrl) +sc_err_t sc_pad_set_all(sc_ipc_t ipc, sc_pad_t pad, uint8_t mux, + sc_pad_config_t config, sc_pad_iso_t iso, uint32_t ctrl, + sc_pad_wakeup_t wakeup) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET_GP; - RPC_D16(&msg, 0) = pin; - RPC_SIZE(&msg) = 2; + RPC_FUNC(&msg) = PAD_FUNC_SET_ALL; + RPC_U32(&msg, 0) = ctrl; + RPC_U16(&msg, 4) = pad; + RPC_U8(&msg, 6) = mux; + RPC_U8(&msg, 7) = config; + RPC_U8(&msg, 8) = iso; + RPC_U8(&msg, 9) = wakeup; + RPC_SIZE(&msg) = 4; sc_call_rpc(ipc, &msg, false); - if (ctrl != NULL) - *ctrl = RPC_D32(&msg, 0); result = RPC_R8(&msg); return (sc_err_t) result; } -sc_err_t sc_pad_get_gp_28lpp(sc_ipc_t ipc, sc_pin_t pin, - sc_pad_28lpp_dse_t *dse, bool *sre, bool *hys, bool *pe, - sc_pad_28lpp_ps_t *ps) +sc_err_t sc_pad_get_all(sc_ipc_t ipc, sc_pad_t pad, uint8_t *mux, + sc_pad_config_t *config, sc_pad_iso_t *iso, uint32_t *ctrl, + sc_pad_wakeup_t *wakeup) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET_GP_28LPP; - RPC_D16(&msg, 0) = pin; + RPC_FUNC(&msg) = PAD_FUNC_GET_ALL; + RPC_U16(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); + if (ctrl != NULL) + *ctrl = RPC_U32(&msg, 0); result = RPC_R8(&msg); - if (dse != NULL) - *dse = RPC_D8(&msg, 0); - if (ps != NULL) - *ps = RPC_D8(&msg, 1); - if (sre != NULL) - *sre = RPC_D8(&msg, 2); - if (hys != NULL) - *hys = RPC_D8(&msg, 3); - if (pe != NULL) - *pe = RPC_D8(&msg, 4); + if (mux != NULL) + *mux = RPC_U8(&msg, 4); + if (config != NULL) + *config = RPC_U8(&msg, 5); + if (iso != NULL) + *iso = RPC_U8(&msg, 6); + if (wakeup != NULL) + *wakeup = RPC_U8(&msg, 7); return (sc_err_t) result; } -sc_err_t sc_pad_get_wakeup(sc_ipc_t ipc, sc_pin_t pin, - sc_pad_wakeup_t *wakeup) +sc_err_t sc_pad_set(sc_ipc_t ipc, sc_pad_t pad, uint32_t val) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET_WAKEUP; - RPC_D16(&msg, 0) = pin; - RPC_SIZE(&msg) = 2; + RPC_FUNC(&msg) = PAD_FUNC_SET; + RPC_U32(&msg, 0) = val; + RPC_U16(&msg, 4) = pad; + RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); - if (wakeup != NULL) - *wakeup = RPC_D8(&msg, 0); return (sc_err_t) result; } -sc_err_t sc_pad_get_all(sc_ipc_t ipc, sc_pin_t pin, uint8_t *mux, - sc_pad_config_t *config, sc_pad_iso_t *iso, uint32_t *ctrl, - sc_pad_wakeup_t *wakeup) +sc_err_t sc_pad_get(sc_ipc_t ipc, sc_pad_t pad, uint32_t *val) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET_ALL; - RPC_D16(&msg, 0) = pin; + RPC_FUNC(&msg) = PAD_FUNC_GET; + RPC_U16(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); - if (ctrl != NULL) - *ctrl = RPC_D32(&msg, 0); + if (val != NULL) + *val = RPC_U32(&msg, 0); result = RPC_R8(&msg); - if (mux != NULL) - *mux = RPC_D8(&msg, 4); - if (config != NULL) - *config = RPC_D8(&msg, 5); - if (iso != NULL) - *iso = RPC_D8(&msg, 6); - if (wakeup != NULL) - *wakeup = RPC_D8(&msg, 7); return (sc_err_t) result; } -sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pin_t pin, - sc_pad_28fdsoi_dse_t dse, sc_pad_28fdsoi_ps_t ps) +sc_err_t sc_pad_set_gp_28lpp(sc_ipc_t ipc, sc_pad_t pad, + sc_pad_28lpp_dse_t dse, bool sre, bool hys, bool pe, + sc_pad_28lpp_ps_t ps) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_SET_GP_28FDSOI; - RPC_D16(&msg, 0) = pin; - RPC_D8(&msg, 2) = dse; - RPC_D8(&msg, 3) = ps; - RPC_SIZE(&msg) = 2; + RPC_FUNC(&msg) = PAD_FUNC_SET_GP_28LPP; + RPC_U16(&msg, 0) = pad; + RPC_U8(&msg, 2) = dse; + RPC_U8(&msg, 3) = ps; + RPC_U8(&msg, 4) = sre; + RPC_U8(&msg, 5) = hys; + RPC_U8(&msg, 6) = pe; + RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -298,45 +263,48 @@ sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pin_t pin, return (sc_err_t) result; } -sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pin_t pin, - sc_pad_28fdsoi_dse_t *dse, sc_pad_28fdsoi_ps_t *ps) +sc_err_t sc_pad_get_gp_28lpp(sc_ipc_t ipc, sc_pad_t pad, + sc_pad_28lpp_dse_t *dse, bool *sre, bool *hys, bool *pe, + sc_pad_28lpp_ps_t *ps) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET_GP_28FDSOI; - RPC_D16(&msg, 0) = pin; + RPC_FUNC(&msg) = PAD_FUNC_GET_GP_28LPP; + RPC_U16(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); if (dse != NULL) - *dse = RPC_D8(&msg, 0); + *dse = RPC_U8(&msg, 0); if (ps != NULL) - *ps = RPC_D8(&msg, 1); + *ps = RPC_U8(&msg, 1); + if (sre != NULL) + *sre = RPC_U8(&msg, 2); + if (hys != NULL) + *hys = RPC_U8(&msg, 3); + if (pe != NULL) + *pe = RPC_U8(&msg, 4); return (sc_err_t) result; } -sc_err_t sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pin_t pin, - uint8_t compen, bool fastfrz, uint8_t rasrcp, uint8_t rasrcn, - bool nasrc_sel) +sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, + sc_pad_28fdsoi_dse_t dse, sc_pad_28fdsoi_ps_t ps) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_SET_GP_28FDSOI_COMP; - RPC_D16(&msg, 0) = pin; - RPC_D8(&msg, 2) = compen; - RPC_D8(&msg, 3) = rasrcp; - RPC_D8(&msg, 4) = rasrcn; - RPC_D8(&msg, 5) = fastfrz; - RPC_D8(&msg, 6) = nasrc_sel; - RPC_SIZE(&msg) = 3; + RPC_FUNC(&msg) = PAD_FUNC_SET_GP_28FDSOI; + RPC_U16(&msg, 0) = pad; + RPC_U8(&msg, 2) = dse; + RPC_U8(&msg, 3) = ps; + RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -344,49 +312,44 @@ sc_err_t sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pin_t pin, return (sc_err_t) result; } -sc_err_t sc_pad_get_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pin_t pin, - uint8_t *compen, bool *fastfrz, uint8_t *rasrcp, uint8_t *rasrcn, - bool *nasrc_sel, bool *compok, uint8_t *nasrc) +sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, + sc_pad_28fdsoi_dse_t *dse, sc_pad_28fdsoi_ps_t *ps) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET_GP_28FDSOI_COMP; - RPC_D16(&msg, 0) = pin; + RPC_FUNC(&msg) = PAD_FUNC_GET_GP_28FDSOI; + RPC_U16(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); - if (compen != NULL) - *compen = RPC_D8(&msg, 0); - if (rasrcp != NULL) - *rasrcp = RPC_D8(&msg, 1); - if (rasrcn != NULL) - *rasrcn = RPC_D8(&msg, 2); - if (nasrc != NULL) - *nasrc = RPC_D8(&msg, 3); - if (fastfrz != NULL) - *fastfrz = RPC_D8(&msg, 4); - if (nasrc_sel != NULL) - *nasrc_sel = RPC_D8(&msg, 5); - if (compok != NULL) - *compok = RPC_D8(&msg, 6); + if (dse != NULL) + *dse = RPC_U8(&msg, 0); + if (ps != NULL) + *ps = RPC_U8(&msg, 1); return (sc_err_t) result; } -sc_err_t sc_pad_set(sc_ipc_t ipc, sc_pin_t pin, uint32_t val) +sc_err_t sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad, + uint8_t compen, bool fastfrz, uint8_t rasrcp, uint8_t rasrcn, + bool nasrc_sel) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_SET; - RPC_D32(&msg, 0) = val; - RPC_D16(&msg, 4) = pin; + RPC_FUNC(&msg) = PAD_FUNC_SET_GP_28FDSOI_COMP; + RPC_U16(&msg, 0) = pad; + RPC_U8(&msg, 2) = compen; + RPC_U8(&msg, 3) = rasrcp; + RPC_U8(&msg, 4) = rasrcn; + RPC_U8(&msg, 5) = fastfrz; + RPC_U8(&msg, 6) = nasrc_sel; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -395,22 +358,36 @@ sc_err_t sc_pad_set(sc_ipc_t ipc, sc_pin_t pin, uint32_t val) return (sc_err_t) result; } -sc_err_t sc_pad_get(sc_ipc_t ipc, sc_pin_t pin, uint32_t *val) +sc_err_t sc_pad_get_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad, + uint8_t *compen, bool *fastfrz, uint8_t *rasrcp, uint8_t *rasrcn, + bool *nasrc_sel, bool *compok, uint8_t *nasrc) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PAD; - RPC_FUNC(&msg) = PAD_FUNC_GET; - RPC_D16(&msg, 0) = pin; + RPC_FUNC(&msg) = PAD_FUNC_GET_GP_28FDSOI_COMP; + RPC_U16(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); - if (val != NULL) - *val = RPC_D32(&msg, 0); result = RPC_R8(&msg); + if (compen != NULL) + *compen = RPC_U8(&msg, 0); + if (rasrcp != NULL) + *rasrcp = RPC_U8(&msg, 1); + if (rasrcn != NULL) + *rasrcn = RPC_U8(&msg, 2); + if (nasrc != NULL) + *nasrc = RPC_U8(&msg, 3); + if (fastfrz != NULL) + *fastfrz = RPC_U8(&msg, 4); + if (nasrc_sel != NULL) + *nasrc_sel = RPC_U8(&msg, 5); + if (compok != NULL) + *compok = RPC_U8(&msg, 6); return (sc_err_t) result; } diff --git a/plat/freescale/common/sci/svc/pad/rpc.h b/plat/freescale/common/sci/svc/pad/rpc.h index 25f2ce7e..f0f32aff 100644 --- a/plat/freescale/common/sci/svc/pad/rpc.h +++ b/plat/freescale/common/sci/svc/pad/rpc.h @@ -1,31 +1,8 @@ /* + * Copyright (C) 2016 Freescale Semiconductor, Inc. * Copyright 2017 NXP * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of NXP nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0+ */ /*! @@ -49,23 +26,23 @@ */ typedef enum pad_func_e { - PAD_FUNC_UNKNOWN, //!< Unknown function - PAD_FUNC_SET_MUX, //!< Index for pad_set_mux() RPC call - PAD_FUNC_SET_GP, //!< Index for pad_set_gp() RPC call - PAD_FUNC_SET_GP_28LPP, //!< Index for pad_set_gp_28lpp() RPC call - PAD_FUNC_SET_WAKEUP, //!< Index for pad_set_wakeup() RPC call - PAD_FUNC_SET_ALL, //!< Index for pad_set_all() RPC call - PAD_FUNC_GET_MUX, //!< Index for pad_get_mux() RPC call - PAD_FUNC_GET_GP, //!< Index for pad_get_gp() RPC call - PAD_FUNC_GET_GP_28LPP, //!< Index for pad_get_gp_28lpp() RPC call - PAD_FUNC_GET_WAKEUP, //!< Index for pad_get_wakeup() RPC call - PAD_FUNC_GET_ALL, //!< Index for pad_get_all() RPC call - PAD_FUNC_SET_GP_28FDSOI, //!< Index for pad_set_gp_28fdsoi() RPC call - PAD_FUNC_GET_GP_28FDSOI, //!< Index for pad_get_gp_28fdsoi() RPC call - PAD_FUNC_SET_GP_28FDSOI_COMP, //!< Index for pad_set_gp_28fdsoi_comp() RPC call - PAD_FUNC_GET_GP_28FDSOI_COMP, //!< Index for pad_get_gp_28fdsoi_comp() RPC call - PAD_FUNC_SET, //!< Index for pad_set() RPC call - PAD_FUNC_GET, //!< Index for pad_get() RPC call + PAD_FUNC_UNKNOWN = 0, /*!< Unknown function */ + PAD_FUNC_SET_MUX = 1, /*!< Index for pad_set_mux() RPC call */ + PAD_FUNC_GET_MUX = 6, /*!< Index for pad_get_mux() RPC call */ + PAD_FUNC_SET_GP = 2, /*!< Index for pad_set_gp() RPC call */ + PAD_FUNC_GET_GP = 7, /*!< Index for pad_get_gp() RPC call */ + PAD_FUNC_SET_WAKEUP = 4, /*!< Index for pad_set_wakeup() RPC call */ + PAD_FUNC_GET_WAKEUP = 9, /*!< Index for pad_get_wakeup() RPC call */ + PAD_FUNC_SET_ALL = 5, /*!< Index for pad_set_all() RPC call */ + PAD_FUNC_GET_ALL = 10, /*!< Index for pad_get_all() RPC call */ + PAD_FUNC_SET = 15, /*!< Index for pad_set() RPC call */ + PAD_FUNC_GET = 16, /*!< Index for pad_get() RPC call */ + PAD_FUNC_SET_GP_28LPP = 3, /*!< Index for pad_set_gp_28lpp() RPC call */ + PAD_FUNC_GET_GP_28LPP = 8, /*!< Index for pad_get_gp_28lpp() RPC call */ + PAD_FUNC_SET_GP_28FDSOI = 11, /*!< Index for pad_set_gp_28fdsoi() RPC call */ + PAD_FUNC_GET_GP_28FDSOI = 12, /*!< Index for pad_get_gp_28fdsoi() RPC call */ + PAD_FUNC_SET_GP_28FDSOI_COMP = 13, /*!< Index for pad_set_gp_28fdsoi_comp() RPC call */ + PAD_FUNC_GET_GP_28FDSOI_COMP = 14, /*!< Index for pad_get_gp_28fdsoi_comp() RPC call */ } pad_func_t; /* Functions */ diff --git a/plat/freescale/common/sci/svc/pm/pm_rpc_clnt.c b/plat/freescale/common/sci/svc/pm/pm_rpc_clnt.c old mode 100755 new mode 100644 index fc91fad1..96b93c1a --- a/plat/freescale/common/sci/svc/pm/pm_rpc_clnt.c +++ b/plat/freescale/common/sci/svc/pm/pm_rpc_clnt.c @@ -1,31 +1,8 @@ /* + * Copyright (C) 2016 Freescale Semiconductor, Inc. * Copyright 2017 NXP * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of NXP nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0+ */ /*! @@ -60,8 +37,8 @@ sc_err_t sc_pm_set_sys_power_mode(sc_ipc_t ipc, sc_rm_pt_t pt, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_SET_SYS_POWER_MODE; - RPC_D8(&msg, 0) = pt; - RPC_D8(&msg, 1) = mode; + RPC_U8(&msg, 0) = pt; + RPC_U8(&msg, 1) = mode; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -79,14 +56,14 @@ sc_err_t sc_pm_get_sys_power_mode(sc_ipc_t ipc, sc_rm_pt_t pt, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_GET_SYS_POWER_MODE; - RPC_D8(&msg, 0) = pt; + RPC_U8(&msg, 0) = pt; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); if (mode != NULL) - *mode = RPC_D8(&msg, 0); + *mode = RPC_U8(&msg, 0); return (sc_err_t) result; } @@ -99,8 +76,8 @@ sc_err_t sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_SET_RESOURCE_POWER_MODE; - RPC_D16(&msg, 0) = resource; - RPC_D8(&msg, 2) = mode; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = mode; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -118,14 +95,14 @@ sc_err_t sc_pm_get_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_GET_RESOURCE_POWER_MODE; - RPC_D16(&msg, 0) = resource; + RPC_U16(&msg, 0) = resource; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); if (mode != NULL) - *mode = RPC_D8(&msg, 0); + *mode = RPC_U8(&msg, 0); return (sc_err_t) result; } @@ -138,14 +115,14 @@ sc_err_t sc_pm_set_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_SET_CLOCK_RATE; - RPC_D32(&msg, 0) = *rate; - RPC_D16(&msg, 4) = resource; - RPC_D8(&msg, 6) = clk; + RPC_U32(&msg, 0) = *rate; + RPC_U16(&msg, 4) = resource; + RPC_U8(&msg, 6) = clk; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); - *rate = RPC_D32(&msg, 0); + *rate = RPC_U32(&msg, 0); result = RPC_R8(&msg); return (sc_err_t) result; } @@ -159,14 +136,14 @@ sc_err_t sc_pm_get_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_GET_CLOCK_RATE; - RPC_D16(&msg, 0) = resource; - RPC_D8(&msg, 2) = clk; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = clk; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); if (rate != NULL) - *rate = RPC_D32(&msg, 0); + *rate = RPC_U32(&msg, 0); result = RPC_R8(&msg); return (sc_err_t) result; } @@ -180,10 +157,10 @@ sc_err_t sc_pm_clock_enable(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_CLOCK_ENABLE; - RPC_D16(&msg, 0) = resource; - RPC_D8(&msg, 2) = clk; - RPC_D8(&msg, 3) = enable; - RPC_D8(&msg, 4) = autog; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = clk; + RPC_U8(&msg, 3) = enable; + RPC_U8(&msg, 4) = autog; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -192,22 +169,19 @@ sc_err_t sc_pm_clock_enable(sc_ipc_t ipc, sc_rsrc_t resource, return (sc_err_t) result; } -sc_err_t sc_pm_boot(sc_ipc_t ipc, sc_rm_pt_t pt, - sc_rsrc_t resource_cpu, sc_faddr_t boot_addr, - sc_rsrc_t resource_mu) +sc_err_t sc_pm_set_clock_parent(sc_ipc_t ipc, sc_rsrc_t resource, + sc_pm_clk_t clk, sc_pm_clk_parent_t parent) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; - RPC_FUNC(&msg) = PM_FUNC_BOOT; - RPC_D32(&msg, 0) = boot_addr >> 32; - RPC_D32(&msg, 4) = boot_addr; - RPC_D16(&msg, 8) = resource_cpu; - RPC_D16(&msg, 10) = resource_mu; - RPC_D8(&msg, 12) = pt; - RPC_SIZE(&msg) = 5; + RPC_FUNC(&msg) = PM_FUNC_SET_CLOCK_PARENT; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = clk; + RPC_U8(&msg, 3) = parent; + RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -215,51 +189,79 @@ sc_err_t sc_pm_boot(sc_ipc_t ipc, sc_rm_pt_t pt, return (sc_err_t) result; } -void sc_pm_reboot(sc_ipc_t ipc, sc_pm_reset_type_t type) +sc_err_t sc_pm_get_clock_parent(sc_ipc_t ipc, sc_rsrc_t resource, + sc_pm_clk_t clk, sc_pm_clk_parent_t * parent) { sc_rpc_msg_t msg; + uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; - RPC_FUNC(&msg) = PM_FUNC_REBOOT; - RPC_D8(&msg, 0) = type; + RPC_FUNC(&msg) = PM_FUNC_GET_CLOCK_PARENT; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = clk; RPC_SIZE(&msg) = 2; - sc_call_rpc(ipc, &msg, true); + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + if (parent != NULL) + *parent = RPC_U8(&msg, 0); + return (sc_err_t)result; +} + +sc_err_t sc_pm_reset(sc_ipc_t ipc, sc_pm_reset_type_t type) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_PM; + RPC_FUNC(&msg) = PM_FUNC_RESET; + RPC_U8(&msg, 0) = type; + RPC_SIZE(&msg) = 2; + + sc_call_rpc(ipc, &msg, false); - return; + result = RPC_R8(&msg); + return (sc_err_t)result; } -void sc_pm_reset_reason(sc_ipc_t ipc, sc_pm_reset_reason_t *reason) +sc_err_t sc_pm_reset_reason(sc_ipc_t ipc, sc_pm_reset_reason_t *reason) { sc_rpc_msg_t msg; + uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_RESET_REASON; RPC_SIZE(&msg) = 1; - sc_call_rpc(ipc, &msg, true); + sc_call_rpc(ipc, &msg, false); + result = RPC_R8(&msg); if (reason != NULL) - *reason = RPC_D8(&msg, 0); - return; + *reason = RPC_U8(&msg, 0); + return (sc_err_t)result; } -sc_err_t sc_pm_cpu_start(sc_ipc_t ipc, sc_rsrc_t resource, bool enable, - sc_faddr_t address) +sc_err_t sc_pm_boot(sc_ipc_t ipc, sc_rm_pt_t pt, + sc_rsrc_t resource_cpu, sc_faddr_t boot_addr, + sc_rsrc_t resource_mu, sc_rsrc_t resource_dev) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; - RPC_FUNC(&msg) = PM_FUNC_CPU_START; - RPC_D32(&msg, 0) = address >> 32; - RPC_D32(&msg, 4) = address; - RPC_D16(&msg, 8) = resource; - RPC_D8(&msg, 10) = enable; - RPC_SIZE(&msg) = 4; + RPC_FUNC(&msg) = PM_FUNC_BOOT; + RPC_U32(&msg, 0) = boot_addr >> 32; + RPC_U32(&msg, 4) = boot_addr; + RPC_U16(&msg, 8) = resource_cpu; + RPC_U16(&msg, 10) = resource_mu; + RPC_U16(&msg, 12) = resource_dev; + RPC_U8(&msg, 14) = pt; + RPC_SIZE(&msg) = 5; sc_call_rpc(ipc, &msg, false); @@ -267,6 +269,21 @@ sc_err_t sc_pm_cpu_start(sc_ipc_t ipc, sc_rsrc_t resource, bool enable, return (sc_err_t) result; } +void sc_pm_reboot(sc_ipc_t ipc, sc_pm_reset_type_t type) +{ + sc_rpc_msg_t msg; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_PM; + RPC_FUNC(&msg) = PM_FUNC_REBOOT; + RPC_U8(&msg, 0) = type; + RPC_SIZE(&msg) = 2; + + sc_call_rpc(ipc, &msg, true); + + return; +} + sc_err_t sc_pm_reboot_partition(sc_ipc_t ipc, sc_rm_pt_t pt, sc_pm_reset_type_t type) { @@ -276,8 +293,8 @@ sc_err_t sc_pm_reboot_partition(sc_ipc_t ipc, sc_rm_pt_t pt, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; RPC_FUNC(&msg) = PM_FUNC_REBOOT_PARTITION; - RPC_D8(&msg, 0) = pt; - RPC_D8(&msg, 1) = type; + RPC_U8(&msg, 0) = pt; + RPC_U8(&msg, 1) = type; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -286,16 +303,20 @@ sc_err_t sc_pm_reboot_partition(sc_ipc_t ipc, sc_rm_pt_t pt, return (sc_err_t) result; } -sc_err_t sc_pm_reset(sc_ipc_t ipc, sc_pm_reset_type_t type) +sc_err_t sc_pm_cpu_start(sc_ipc_t ipc, sc_rsrc_t resource, bool enable, + sc_faddr_t address) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_PM; - RPC_FUNC(&msg) = PM_FUNC_RESET; - RPC_D8(&msg, 0) = type; - RPC_SIZE(&msg) = 2; + RPC_FUNC(&msg) = PM_FUNC_CPU_START; + RPC_U32(&msg, 0) = address >> 32; + RPC_U32(&msg, 4) = address; + RPC_U16(&msg, 8) = resource; + RPC_U8(&msg, 10) = enable; + RPC_SIZE(&msg) = 4; sc_call_rpc(ipc, &msg, false); diff --git a/plat/freescale/common/sci/svc/pm/rpc.h b/plat/freescale/common/sci/svc/pm/rpc.h old mode 100755 new mode 100644 index 2ce1b5c9..1f4235a2 --- a/plat/freescale/common/sci/svc/pm/rpc.h +++ b/plat/freescale/common/sci/svc/pm/rpc.h @@ -1,31 +1,8 @@ /* + * Copyright (C) 2016 Freescale Semiconductor, Inc. * Copyright 2017 NXP * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * Neither the name of NXP nor the names of its contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0+ */ /*! @@ -49,20 +26,22 @@ */ typedef enum pm_func_e { - PM_FUNC_UNKNOWN, //!< Unknown function - PM_FUNC_SET_SYS_POWER_MODE, //!< Index for pm_set_sys_power_mode() RPC call - PM_FUNC_GET_SYS_POWER_MODE, //!< Index for pm_get_sys_power_mode() RPC call - PM_FUNC_SET_RESOURCE_POWER_MODE, //!< Index for pm_set_resource_power_mode() RPC call - PM_FUNC_GET_RESOURCE_POWER_MODE, //!< Index for pm_get_resource_power_mode() RPC call - PM_FUNC_SET_CLOCK_RATE, //!< Index for pm_set_clock_rate() RPC call - PM_FUNC_GET_CLOCK_RATE, //!< Index for pm_get_clock_rate() RPC call - PM_FUNC_CLOCK_ENABLE, //!< Index for pm_clock_enable() RPC call - PM_FUNC_BOOT, //!< Index for pm_boot() RPC call - PM_FUNC_REBOOT, //!< Index for pm_reboot() RPC call - PM_FUNC_RESET_REASON, //!< Index for pm_reset_reason() RPC call - PM_FUNC_CPU_START, //!< Index for pm_cpu_start() RPC call - PM_FUNC_REBOOT_PARTITION, //!< Index for pm_reboot_partition() RPC call - PM_FUNC_RESET, //!< Index for pm_reset() RPC call + PM_FUNC_UNKNOWN = 0, /*!< Unknown function */ + PM_FUNC_SET_SYS_POWER_MODE = 1, /*!< Index for pm_set_sys_power_mode() RPC call */ + PM_FUNC_GET_SYS_POWER_MODE = 2, /*!< Index for pm_get_sys_power_mode() RPC call */ + PM_FUNC_SET_RESOURCE_POWER_MODE = 3, /*!< Index for pm_set_resource_power_mode() RPC call */ + PM_FUNC_GET_RESOURCE_POWER_MODE = 4, /*!< Index for pm_get_resource_power_mode() RPC call */ + PM_FUNC_SET_CLOCK_RATE = 5, /*!< Index for pm_set_clock_rate() RPC call */ + PM_FUNC_GET_CLOCK_RATE = 6, /*!< Index for pm_get_clock_rate() RPC call */ + PM_FUNC_CLOCK_ENABLE = 7, /*!< Index for pm_clock_enable() RPC call */ + PM_FUNC_SET_CLOCK_PARENT = 14, /*!< Index for pm_set_clock_parent() RPC call */ + PM_FUNC_GET_CLOCK_PARENT = 15, /*!< Index for pm_get_clock_parent() RPC call */ + PM_FUNC_RESET = 13, /*!< Index for pm_reset() RPC call */ + PM_FUNC_RESET_REASON = 10, /*!< Index for pm_reset_reason() RPC call */ + PM_FUNC_BOOT = 8, /*!< Index for pm_boot() RPC call */ + PM_FUNC_REBOOT = 9, /*!< Index for pm_reboot() RPC call */ + PM_FUNC_REBOOT_PARTITION = 12, /*!< Index for pm_reboot_partition() RPC call */ + PM_FUNC_CPU_START = 11, /*!< Index for pm_cpu_start() RPC call */ } pm_func_t; /* Functions */ diff --git a/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c b/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c index a7e7e188..9cdf6177 100644 --- a/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c +++ b/plat/freescale/common/sci/svc/rm/rm_rpc_clnt.c @@ -1,6 +1,8 @@ /* + * Copyright (C) 2016 Freescale Semiconductor, Inc. * Copyright 2017 NXP * + * SPDX-License-Identifier: GPL-2.0+ */ /*! @@ -26,8 +28,7 @@ /* 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; @@ -35,18 +36,18 @@ sc_err_t sc_rm_partition_alloc(sc_ipc_t ipc, sc_rm_pt_t *pt, bool secure, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_PARTITION_ALLOC; - RPC_D8(&msg, 0) = secure; - RPC_D8(&msg, 1) = isolated; - RPC_D8(&msg, 2) = restricted; - RPC_D8(&msg, 3) = confidential; - RPC_D8(&msg, 4) = coherent; + RPC_U8(&msg, 0) = secure; + RPC_U8(&msg, 1) = isolated; + RPC_U8(&msg, 2) = restricted; + RPC_U8(&msg, 3) = confidential; + RPC_U8(&msg, 4) = coherent; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); result = RPC_R8(&msg); if (pt != NULL) - *pt = RPC_D8(&msg, 0); + *pt = RPC_U8(&msg, 0); return (sc_err_t)result; } @@ -58,7 +59,7 @@ sc_err_t sc_rm_partition_free(sc_ipc_t ipc, sc_rm_pt_t pt) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_PARTITION_FREE; - RPC_D8(&msg, 0) = pt; + RPC_U8(&msg, 0) = pt; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -83,7 +84,8 @@ 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; @@ -91,8 +93,8 @@ sc_err_t sc_rm_partition_static(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_did_t did) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_PARTITION_STATIC; - RPC_D8(&msg, 0) = pt; - RPC_D8(&msg, 1) = did; + RPC_U8(&msg, 0) = pt; + RPC_U8(&msg, 1) = did; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -109,7 +111,7 @@ sc_err_t sc_rm_partition_lock(sc_ipc_t ipc, sc_rm_pt_t pt) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_PARTITION_LOCK; - RPC_D8(&msg, 0) = pt; + RPC_U8(&msg, 0) = pt; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -132,11 +134,12 @@ sc_err_t sc_rm_get_partition(sc_ipc_t ipc, sc_rm_pt_t *pt) result = RPC_R8(&msg); if (pt != NULL) - *pt = RPC_D8(&msg, 0); + *pt = RPC_U8(&msg, 0); 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; @@ -144,8 +147,8 @@ sc_err_t sc_rm_set_parent(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_pt_t pt_parent) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_SET_PARENT; - RPC_D8(&msg, 0) = pt; - RPC_D8(&msg, 1) = pt_parent; + RPC_U8(&msg, 0) = pt; + RPC_U8(&msg, 1) = pt_parent; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -155,7 +158,7 @@ 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_move_all(sc_ipc_t ipc, sc_rm_pt_t pt_src, sc_rm_pt_t pt_dst, - bool move_rsrc, bool move_pins) + bool move_rsrc, bool move_pads) { sc_rpc_msg_t msg; uint8_t result; @@ -163,10 +166,10 @@ sc_err_t sc_rm_move_all(sc_ipc_t ipc, sc_rm_pt_t pt_src, sc_rm_pt_t pt_dst, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_MOVE_ALL; - RPC_D8(&msg, 0) = pt_src; - RPC_D8(&msg, 1) = pt_dst; - RPC_D8(&msg, 2) = move_rsrc; - RPC_D8(&msg, 3) = move_pins; + RPC_U8(&msg, 0) = pt_src; + RPC_U8(&msg, 1) = pt_dst; + RPC_U8(&msg, 2) = move_rsrc; + RPC_U8(&msg, 3) = move_pads; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -175,7 +178,8 @@ 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; @@ -183,8 +187,8 @@ sc_err_t sc_rm_assign_resource(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rsrc_t resource) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_ASSIGN_RESOURCE; - RPC_D16(&msg, 0) = resource; - RPC_D8(&msg, 2) = pt; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = pt; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -202,9 +206,9 @@ sc_err_t sc_rm_set_resource_movable(sc_ipc_t ipc, sc_rsrc_t resource_fst, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_SET_RESOURCE_MOVABLE; - RPC_D16(&msg, 0) = resource_fst; - RPC_D16(&msg, 2) = resource_lst; - RPC_D8(&msg, 4) = movable; + RPC_U16(&msg, 0) = resource_fst; + RPC_U16(&msg, 2) = resource_lst; + RPC_U8(&msg, 4) = movable; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -214,8 +218,7 @@ sc_err_t sc_rm_set_resource_movable(sc_ipc_t ipc, sc_rsrc_t resource_fst, } 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; @@ -223,10 +226,10 @@ sc_err_t sc_rm_set_master_attributes(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_SET_MASTER_ATTRIBUTES; - RPC_D16(&msg, 0) = resource; - RPC_D8(&msg, 2) = sa; - RPC_D8(&msg, 3) = pa; - RPC_D8(&msg, 4) = smmu_bypass; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = sa; + RPC_U8(&msg, 3) = pa; + RPC_U8(&msg, 4) = smmu_bypass; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -235,7 +238,8 @@ 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; @@ -243,8 +247,8 @@ sc_err_t sc_rm_set_master_sid(sc_ipc_t ipc, sc_rsrc_t resource, sc_rm_sid_t sid) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_SET_MASTER_SID; - RPC_D16(&msg, 0) = resource; - RPC_D16(&msg, 2) = sid; + RPC_U16(&msg, 0) = resource; + RPC_U16(&msg, 2) = sid; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -262,9 +266,9 @@ sc_err_t sc_rm_set_peripheral_permissions(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_SET_PERIPHERAL_PERMISSIONS; - RPC_D16(&msg, 0) = resource; - RPC_D8(&msg, 2) = pt; - RPC_D8(&msg, 3) = perm; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = pt; + RPC_U8(&msg, 3) = perm; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -281,7 +285,7 @@ bool sc_rm_is_resource_owned(sc_ipc_t ipc, sc_rsrc_t resource) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_IS_RESOURCE_OWNED; - RPC_D16(&msg, 0) = resource; + RPC_U16(&msg, 0) = resource; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -298,7 +302,7 @@ bool sc_rm_is_resource_master(sc_ipc_t ipc, sc_rsrc_t resource) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_IS_RESOURCE_MASTER; - RPC_D16(&msg, 0) = resource; + RPC_U16(&msg, 0) = resource; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -315,7 +319,7 @@ bool sc_rm_is_resource_peripheral(sc_ipc_t ipc, sc_rsrc_t resource) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_IS_RESOURCE_PERIPHERAL; - RPC_D16(&msg, 0) = resource; + RPC_U16(&msg, 0) = resource; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -333,13 +337,13 @@ sc_err_t sc_rm_get_resource_info(sc_ipc_t ipc, sc_rsrc_t resource, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_GET_RESOURCE_INFO; - RPC_D16(&msg, 0) = resource; + RPC_U16(&msg, 0) = resource; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); if (sid != NULL) - *sid = RPC_D16(&msg, 0); + *sid = RPC_U16(&msg, 0); result = RPC_R8(&msg); return (sc_err_t)result; } @@ -353,17 +357,17 @@ sc_err_t sc_rm_memreg_alloc(sc_ipc_t ipc, sc_rm_mr_t *mr, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_MEMREG_ALLOC; - RPC_D32(&msg, 0) = addr_start >> 32; - RPC_D32(&msg, 4) = addr_start; - RPC_D32(&msg, 8) = addr_end >> 32; - RPC_D32(&msg, 12) = addr_end; + 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_D8(&msg, 0); + *mr = RPC_U8(&msg, 0); return (sc_err_t)result; } @@ -375,7 +379,7 @@ sc_err_t sc_rm_memreg_free(sc_ipc_t ipc, sc_rm_mr_t mr) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_MEMREG_FREE; - RPC_D8(&msg, 0) = mr; + RPC_U8(&msg, 0) = mr; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -392,8 +396,8 @@ sc_err_t sc_rm_assign_memreg(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_mr_t mr) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_ASSIGN_MEMREG; - RPC_D8(&msg, 0) = pt; - RPC_D8(&msg, 1) = mr; + RPC_U8(&msg, 0) = pt; + RPC_U8(&msg, 1) = mr; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -411,9 +415,9 @@ sc_err_t sc_rm_set_memreg_permissions(sc_ipc_t ipc, sc_rm_mr_t mr, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_SET_MEMREG_PERMISSIONS; - RPC_D8(&msg, 0) = mr; - RPC_D8(&msg, 1) = pt; - RPC_D8(&msg, 2) = perm; + RPC_U8(&msg, 0) = mr; + RPC_U8(&msg, 1) = pt; + RPC_U8(&msg, 2) = perm; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -430,7 +434,7 @@ bool sc_rm_is_memreg_owned(sc_ipc_t ipc, sc_rm_mr_t mr) RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_IS_MEMREG_OWNED; - RPC_D8(&msg, 0) = mr; + RPC_U8(&msg, 0) = mr; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -448,31 +452,29 @@ sc_err_t sc_rm_get_memreg_info(sc_ipc_t ipc, sc_rm_mr_t mr, RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_RM; RPC_FUNC(&msg) = RM_FUNC_GET_MEMREG_INFO; - RPC_D8(&msg, 0) = mr; + RPC_U8(&msg, 0) = mr; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); if (addr_start != NULL) - *addr_start = - ((uint64_t) RPC_D32(&msg, 0) << 32) | RPC_D32(&msg, 4); + *addr_start = ((uint64_t) RPC_U32(&msg, 0) << 32) | RPC_U32(&msg, 4); if (addr_end != NULL) - *addr_end = - ((uint64_t) RPC_D32(&msg, 8) << 32) | RPC_D32(&msg, 12); + *addr_end = ((uint64_t) RPC_U32(&msg, 8) << 32) | RPC_U32(&msg, 12); result = RPC_R8(&msg); return (sc_err_t)result; } -sc_err_t sc_rm_assign_pin(sc_ipc_t ipc, sc_rm_pt_t pt, sc_pin_t pin) +sc_err_t sc_rm_assign_pad(sc_ipc_t ipc, sc_rm_pt_t pt, sc_pad_t pad) { 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_ASSIGN_PIN; - RPC_D16(&msg, 0) = pin; - RPC_D8(&msg, 2) = pt; + RPC_FUNC(&msg) = RM_FUNC_ASSIGN_PAD; + RPC_U16(&msg, 0) = pad; + RPC_U8(&msg, 2) = pt; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -481,18 +483,18 @@ sc_err_t sc_rm_assign_pin(sc_ipc_t ipc, sc_rm_pt_t pt, sc_pin_t pin) return (sc_err_t)result; } -sc_err_t sc_rm_set_pin_movable(sc_ipc_t ipc, sc_pin_t pin_fst, - sc_pin_t pin_lst, bool movable) +sc_err_t sc_rm_set_pad_movable(sc_ipc_t ipc, sc_pad_t pad_fst, + sc_pad_t pad_lst, 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_PIN_MOVABLE; - RPC_D16(&msg, 0) = pin_fst; - RPC_D16(&msg, 2) = pin_lst; - RPC_D8(&msg, 4) = movable; + RPC_FUNC(&msg) = RM_FUNC_SET_PAD_MOVABLE; + RPC_U16(&msg, 0) = pad_fst; + RPC_U16(&msg, 2) = pad_lst; + RPC_U8(&msg, 4) = movable; RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -501,15 +503,15 @@ sc_err_t sc_rm_set_pin_movable(sc_ipc_t ipc, sc_pin_t pin_fst, return (sc_err_t)result; } -bool sc_rm_is_pin_owned(sc_ipc_t ipc, sc_pin_t pin) +bool sc_rm_is_pad_owned(sc_ipc_t ipc, sc_pad_t pad) { 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_IS_PIN_OWNED; - RPC_D8(&msg, 0) = pin; + RPC_FUNC(&msg) = RM_FUNC_IS_PAD_OWNED; + RPC_U8(&msg, 0) = pad; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -519,3 +521,4 @@ bool sc_rm_is_pin_owned(sc_ipc_t ipc, sc_pin_t pin) } /**@}*/ + diff --git a/plat/freescale/common/sci/svc/rm/rpc.h b/plat/freescale/common/sci/svc/rm/rpc.h index 25e60243..68037470 100644 --- a/plat/freescale/common/sci/svc/rm/rpc.h +++ b/plat/freescale/common/sci/svc/rm/rpc.h @@ -24,34 +24,35 @@ /*! * 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_PIN = 23, /* Index for rm_assign_pin() RPC call */ - RM_FUNC_SET_PIN_MOVABLE = 24, /* Index for rm_set_pin_movable() RPC call */ - RM_FUNC_IS_PIN_OWNED = 25, /* Index for rm_is_pin_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_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 */ } rm_func_t; /* Functions */ @@ -75,3 +76,4 @@ void rm_xlate(sc_ipc_t ipc, sc_rpc_msg_t *msg); #endif /* _SC_RM_RPC_H */ /**@}*/ + -- cgit v1.2.3