diff options
author | Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com> | 2017-11-17 18:08:51 -0600 |
---|---|---|
committer | Abel Vesa <abel.vesa@nxp.com> | 2018-06-11 10:08:40 +0300 |
commit | 74279916c69f78dac4d4b3c67646ebb42ed081ab (patch) | |
tree | e5bcd97e6f4b0cbe11568b470e75888d75f82355 /plat/imx/common | |
parent | a0d4bc5b69b465d584fec186032751e37fab0f59 (diff) |
Update SCFW API based on commit 0245582bf4a58
"commit 0245582bf4a58289e25c59fb0befe84923ca6742
Author: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Date: Fri Nov 17 13:43:30 2017 -0600
Fix bug in system interface PM code.
Also ensure that DB/DBLOGIC is powered up before MU.
"
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Diffstat (limited to 'plat/imx/common')
-rw-r--r-- | plat/imx/common/include/sci/rpc.h | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | plat/imx/common/include/sci/svc/pad/api.h | 112 | ||||
-rw-r--r-- | plat/imx/common/include/sci/svc/pm/api.h | 123 | ||||
-rw-r--r--[-rwxr-xr-x] | plat/imx/common/include/sci/svc/rm/api.h | 90 | ||||
-rw-r--r-- | plat/imx/common/include/sci/svc/timer/api.h | 82 | ||||
-rw-r--r-- | plat/imx/common/include/sci/types.h | 24 | ||||
-rw-r--r--[-rwxr-xr-x] | plat/imx/common/sci/svc/pad/pad_rpc_clnt.c | 35 | ||||
-rw-r--r--[-rwxr-xr-x] | plat/imx/common/sci/svc/pad/rpc.h | 37 | ||||
-rw-r--r-- | plat/imx/common/sci/svc/pm/pm_rpc_clnt.c | 21 | ||||
-rw-r--r-- | plat/imx/common/sci/svc/pm/rpc.h | 40 | ||||
-rw-r--r--[-rwxr-xr-x] | plat/imx/common/sci/svc/rm/rm_rpc_clnt.c | 48 | ||||
-rw-r--r--[-rwxr-xr-x] | plat/imx/common/sci/svc/rm/rpc.h | 66 | ||||
-rw-r--r-- | plat/imx/common/sci/svc/timer/rpc.h | 30 | ||||
-rw-r--r-- | plat/imx/common/sci/svc/timer/timer_rpc_clnt.c | 185 |
14 files changed, 545 insertions, 360 deletions
diff --git a/plat/imx/common/include/sci/rpc.h b/plat/imx/common/include/sci/rpc.h index f55f1c84..b7e5c7f5 100644 --- a/plat/imx/common/include/sci/rpc.h +++ b/plat/imx/common/include/sci/rpc.h @@ -28,12 +28,12 @@ #define RPC_SVC(MSG) ((MSG)->svc) #define RPC_FUNC(MSG) ((MSG)->func) #define RPC_R8(MSG) ((MSG)->func) -#define RPC_I32(MSG, IDX) ((MSG)->DATA.i32[IDX / 4]) -#define RPC_I16(MSG, IDX) ((MSG)->DATA.i16[IDX / 2]) -#define RPC_I8(MSG, IDX) ((MSG)->DATA.i8[IDX]) -#define RPC_U32(MSG, IDX) ((MSG)->DATA.u32[IDX / 4]) -#define RPC_U16(MSG, IDX) ((MSG)->DATA.u16[IDX / 2]) -#define RPC_U8(MSG, IDX) ((MSG)->DATA.u8[IDX]) +#define RPC_I32(MSG, IDX) ((MSG)->DATA.i32[(IDX) / 4]) +#define RPC_I16(MSG, IDX) ((MSG)->DATA.i16[(IDX) / 2]) +#define RPC_I8(MSG, IDX) ((MSG)->DATA.i8[(IDX)]) +#define RPC_U32(MSG, IDX) ((MSG)->DATA.u32[(IDX) / 4]) +#define RPC_U16(MSG, IDX) ((MSG)->DATA.u16[(IDX) / 2]) +#define RPC_U8(MSG, IDX) ((MSG)->DATA.u8[(IDX)]) /* Types */ diff --git a/plat/imx/common/include/sci/svc/pad/api.h b/plat/imx/common/include/sci/svc/pad/api.h index 4d6d834f..f05a59b4 100755..100644 --- a/plat/imx/common/include/sci/svc/pad/api.h +++ b/plat/imx/common/include/sci/svc/pad/api.h @@ -65,79 +65,79 @@ * @name Defines for type widths */ /*@{*/ -#define SC_PAD_MUX_W 3 /* Width of mux parameter */ +#define SC_PAD_MUX_W 3 /*!< Width of mux parameter */ /*@}*/ /*! * @name Defines for sc_pad_config_t */ /*@{*/ -#define SC_PAD_CONFIG_NORMAL 0 /* Normal */ -#define SC_PAD_CONFIG_OD 1 /* Open Drain */ -#define SC_PAD_CONFIG_OD_IN 2 /* Open Drain and input */ -#define SC_PAD_CONFIG_OUT_IN 3 /* Output and input */ +#define SC_PAD_CONFIG_NORMAL 0 /*!< Normal */ +#define SC_PAD_CONFIG_OD 1 /*!< Open Drain */ +#define SC_PAD_CONFIG_OD_IN 2 /*!< Open Drain and input */ +#define SC_PAD_CONFIG_OUT_IN 3 /*!< Output and input */ /*@}*/ /*! * @name Defines for sc_pad_iso_t */ /*@{*/ -#define SC_PAD_ISO_OFF 0 /* ISO latch is transparent */ -#define SC_PAD_ISO_EARLY 1 /* Follow EARLY_ISO */ -#define SC_PAD_ISO_LATE 2 /* Follow LATE_ISO */ -#define SC_PAD_ISO_ON 3 /* ISO latched data is held */ +#define SC_PAD_ISO_OFF 0 /*!< ISO latch is transparent */ +#define SC_PAD_ISO_EARLY 1 /*!< Follow EARLY_ISO */ +#define SC_PAD_ISO_LATE 2 /*!< Follow LATE_ISO */ +#define SC_PAD_ISO_ON 3 /*!< ISO latched data is held */ /*@}*/ /*! * @name Defines for sc_pad_28fdsoi_dse_t */ /*@{*/ -#define SC_PAD_28FDSOI_DSE_18V_1MA 0 /* Drive strength of 1mA for 1.8v */ -#define SC_PAD_28FDSOI_DSE_18V_2MA 1 /* Drive strength of 2mA for 1.8v */ -#define SC_PAD_28FDSOI_DSE_18V_4MA 2 /* Drive strength of 4mA for 1.8v */ -#define SC_PAD_28FDSOI_DSE_18V_6MA 3 /* Drive strength of 6mA for 1.8v */ -#define SC_PAD_28FDSOI_DSE_18V_8MA 4 /* Drive strength of 8mA for 1.8v */ -#define SC_PAD_28FDSOI_DSE_18V_10MA 5 /* Drive strength of 10mA for 1.8v */ -#define SC_PAD_28FDSOI_DSE_18V_12MA 6 /* Drive strength of 12mA for 1.8v */ -#define SC_PAD_28FDSOI_DSE_18V_HS 7 /* High-speed drive strength for 1.8v */ -#define SC_PAD_28FDSOI_DSE_33V_2MA 0 /* Drive strength of 2mA for 3.3v */ -#define SC_PAD_28FDSOI_DSE_33V_4MA 1 /* Drive strength of 4mA for 3.3v */ -#define SC_PAD_28FDSOI_DSE_33V_8MA 2 /* Drive strength of 8mA for 3.3v */ -#define SC_PAD_28FDSOI_DSE_33V_12MA 3 /* Drive strength of 12mA for 3.3v */ -#define SC_PAD_28FDSOI_DSE_DV_HIGH 0 /* High drive strength for dual volt */ -#define SC_PAD_28FDSOI_DSE_DV_LOW 1 /* Low drive strength for dual volt */ +#define SC_PAD_28FDSOI_DSE_18V_1MA 0 /*!< Drive strength of 1mA for 1.8v */ +#define SC_PAD_28FDSOI_DSE_18V_2MA 1 /*!< Drive strength of 2mA for 1.8v */ +#define SC_PAD_28FDSOI_DSE_18V_4MA 2 /*!< Drive strength of 4mA for 1.8v */ +#define SC_PAD_28FDSOI_DSE_18V_6MA 3 /*!< Drive strength of 6mA for 1.8v */ +#define SC_PAD_28FDSOI_DSE_18V_8MA 4 /*!< Drive strength of 8mA for 1.8v */ +#define SC_PAD_28FDSOI_DSE_18V_10MA 5 /*!< Drive strength of 10mA for 1.8v */ +#define SC_PAD_28FDSOI_DSE_18V_12MA 6 /*!< Drive strength of 12mA for 1.8v */ +#define SC_PAD_28FDSOI_DSE_18V_HS 7 /*!< High-speed drive strength for 1.8v */ +#define SC_PAD_28FDSOI_DSE_33V_2MA 0 /*!< Drive strength of 2mA for 3.3v */ +#define SC_PAD_28FDSOI_DSE_33V_4MA 1 /*!< Drive strength of 4mA for 3.3v */ +#define SC_PAD_28FDSOI_DSE_33V_8MA 2 /*!< Drive strength of 8mA for 3.3v */ +#define SC_PAD_28FDSOI_DSE_33V_12MA 3 /*!< Drive strength of 12mA for 3.3v */ +#define SC_PAD_28FDSOI_DSE_DV_HIGH 0 /*!< High drive strength for dual volt */ +#define SC_PAD_28FDSOI_DSE_DV_LOW 1 /*!< Low drive strength for dual volt */ /*@}*/ /*! * @name Defines for sc_pad_28fdsoi_ps_t */ /*@{*/ -#define SC_PAD_28FDSOI_PS_KEEPER 0 /* Bus-keeper (only valid for 1.8v) */ -#define SC_PAD_28FDSOI_PS_PU 1 /* Pull-up */ -#define SC_PAD_28FDSOI_PS_PD 2 /* Pull-down */ -#define SC_PAD_28FDSOI_PS_NONE 3 /* No pull (disabled) */ +#define SC_PAD_28FDSOI_PS_KEEPER 0 /*!< Bus-keeper (only valid for 1.8v) */ +#define SC_PAD_28FDSOI_PS_PU 1 /*!< Pull-up */ +#define SC_PAD_28FDSOI_PS_PD 2 /*!< Pull-down */ +#define SC_PAD_28FDSOI_PS_NONE 3 /*!< No pull (disabled) */ /*@}*/ /*! * @name Defines for sc_pad_28fdsoi_pus_t */ /*@{*/ -#define SC_PAD_28FDSOI_PUS_30K_PD 0 /* 30K pull-down */ -#define SC_PAD_28FDSOI_PUS_100K_PU 1 /* 100K pull-up */ -#define SC_PAD_28FDSOI_PUS_3K_PU 2 /* 3K pull-up */ -#define SC_PAD_28FDSOI_PUS_30K_PU 3 /* 30K pull-up */ +#define SC_PAD_28FDSOI_PUS_30K_PD 0 /*!< 30K pull-down */ +#define SC_PAD_28FDSOI_PUS_100K_PU 1 /*!< 100K pull-up */ +#define SC_PAD_28FDSOI_PUS_3K_PU 2 /*!< 3K pull-up */ +#define SC_PAD_28FDSOI_PUS_30K_PU 3 /*!< 30K pull-up */ /*@}*/ /*! * @name Defines for sc_pad_wakeup_t */ /*@{*/ -#define SC_PAD_WAKEUP_OFF 0 /* Off */ -#define SC_PAD_WAKEUP_CLEAR 1 /* Clears pending flag */ -#define SC_PAD_WAKEUP_LOW_LVL 4 /* Low level */ -#define SC_PAD_WAKEUP_FALL_EDGE 5 /* Falling edge */ -#define SC_PAD_WAKEUP_RISE_EDGE 6 /* Rising edge */ -#define SC_PAD_WAKEUP_HIGH_LVL 7 /* High-level */ +#define SC_PAD_WAKEUP_OFF 0 /*!< Off */ +#define SC_PAD_WAKEUP_CLEAR 1 /*!< Clears pending flag */ +#define SC_PAD_WAKEUP_LOW_LVL 4 /*!< Low level */ +#define SC_PAD_WAKEUP_FALL_EDGE 5 /*!< Falling edge */ +#define SC_PAD_WAKEUP_RISE_EDGE 6 /*!< Rising edge */ +#define SC_PAD_WAKEUP_HIGH_LVL 7 /*!< High-level */ /*@}*/ /* Types */ @@ -229,8 +229,7 @@ sc_err_t sc_pad_set_mux(sc_ipc_t ipc, sc_pad_t pad, * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ 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); + uint8_t *mux, sc_pad_config_t *config, sc_pad_iso_t *iso); /*! * This function configures the general purpose pad control. This @@ -287,7 +286,8 @@ sc_err_t sc_pad_get_gp(sc_ipc_t ipc, sc_pad_t pad, uint32_t *ctrl); * * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ -sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t wakeup); +sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pad_t pad, + sc_pad_wakeup_t wakeup); /*! * This function gets the wakeup mode of a pad. @@ -304,7 +304,8 @@ sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t wakeup); * * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ -sc_err_t sc_pad_get_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t *wakeup); +sc_err_t sc_pad_get_wakeup(sc_ipc_t ipc, sc_pad_t pad, + sc_pad_wakeup_t *wakeup); /*! * This function configures a pad. @@ -355,8 +356,8 @@ sc_err_t sc_pad_set_all(sc_ipc_t ipc, sc_pad_t pad, uint8_t mux, * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ 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_pad_config_t *config, sc_pad_iso_t *iso, uint32_t *ctrl, + sc_pad_wakeup_t *wakeup); /* @} */ @@ -426,8 +427,7 @@ sc_err_t sc_pad_get(sc_ipc_t ipc, sc_pad_t pad, uint32_t *val); * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ 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_pad_28fdsoi_dse_t dse, sc_pad_28fdsoi_ps_t ps); /*! * This function gets the pad control specific to 28FDSOI. @@ -447,8 +447,7 @@ sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ 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_pad_28fdsoi_dse_t *dse, sc_pad_28fdsoi_ps_t *ps); /*! * This function configures the pad control specific to 28FDSOI. @@ -471,9 +470,8 @@ sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ sc_err_t sc_pad_set_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, - sc_pad_28fdsoi_dse_t dse, bool hys, - sc_pad_28fdsoi_pus_t pus, bool pke, - bool pue); + sc_pad_28fdsoi_dse_t dse, bool hys, sc_pad_28fdsoi_pus_t pus, + bool pke, bool pue); /*! * This function gets the pad control specific to 28FDSOI. @@ -496,9 +494,8 @@ sc_err_t sc_pad_set_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ sc_err_t sc_pad_get_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, - sc_pad_28fdsoi_dse_t *dse, bool *hys, - sc_pad_28fdsoi_pus_t * pus, bool *pke, - bool *pue); + sc_pad_28fdsoi_dse_t *dse, bool *hys, sc_pad_28fdsoi_pus_t *pus, + bool *pke, bool *pue); /*! * This function configures the compensation control specific to 28FDSOI. @@ -525,8 +522,7 @@ sc_err_t sc_pad_get_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, * operation (e.g. some Ethernet pads). */ 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, + uint8_t compen, bool fastfrz, uint8_t rasrcp, uint8_t rasrcn, bool nasrc_sel, bool psw_ovr); /*! @@ -553,10 +549,8 @@ sc_err_t sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad, * Refer to the SoC [Pad List](@ref PADS) for valid pad values. */ 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, bool *psw_ovr); + uint8_t *compen, bool *fastfrz, uint8_t *rasrcp, uint8_t *rasrcn, + bool *nasrc_sel, bool *compok, uint8_t *nasrc, bool *psw_ovr); /* @} */ diff --git a/plat/imx/common/include/sci/svc/pm/api.h b/plat/imx/common/include/sci/svc/pm/api.h index 30a35a0c..41ed9ea9 100644 --- a/plat/imx/common/include/sci/svc/pm/api.h +++ b/plat/imx/common/include/sci/svc/pm/api.h @@ -31,10 +31,10 @@ * @name Defines for type widths */ /*@{*/ -#define SC_PM_POWER_MODE_W 2 /* Width of sc_pm_power_mode_t */ -#define SC_PM_CLOCK_MODE_W 3 /* Width of sc_pm_clock_mode_t */ -#define SC_PM_RESET_TYPE_W 2 /* Width of sc_pm_reset_type_t */ -#define SC_PM_RESET_REASON_W 3 /* Width of sc_pm_reset_reason_t */ +#define SC_PM_POWER_MODE_W 2 /*!< Width of sc_pm_power_mode_t */ +#define SC_PM_CLOCK_MODE_W 3 /*!< Width of sc_pm_clock_mode_t */ +#define SC_PM_RESET_TYPE_W 2 /*!< Width of sc_pm_reset_type_t */ +#define SC_PM_RESET_REASON_W 3 /*!< Width of sc_pm_reset_reason_t */ /*@}*/ /*! @@ -47,82 +47,92 @@ * @name Defines for ALL parameters */ /*@{*/ -#define SC_PM_CLK_ALL UINT8_MAX /* All clocks */ +#define SC_PM_CLK_ALL UINT8_MAX /*!< All clocks */ /*@}*/ /*! * @name Defines for sc_pm_power_mode_t */ /*@{*/ -#define SC_PM_PW_MODE_OFF 0 /* Power off */ -#define SC_PM_PW_MODE_STBY 1 /* Power in standby */ -#define SC_PM_PW_MODE_LP 2 /* Power in low-power */ -#define SC_PM_PW_MODE_ON 3 /* Power on */ +#define SC_PM_PW_MODE_OFF 0 /*!< Power off */ +#define SC_PM_PW_MODE_STBY 1 /*!< Power in standby */ +#define SC_PM_PW_MODE_LP 2 /*!< Power in low-power */ +#define SC_PM_PW_MODE_ON 3 /*!< Power on */ /*@}*/ /*! * @name Defines for sc_pm_clk_t */ /*@{*/ -#define SC_PM_CLK_SLV_BUS 0 /* Slave bus clock */ -#define SC_PM_CLK_MST_BUS 1 /* Master bus clock */ -#define SC_PM_CLK_PER 2 /* Peripheral clock */ -#define SC_PM_CLK_PHY 3 /* Phy clock */ -#define SC_PM_CLK_MISC 4 /* Misc clock */ -#define SC_PM_CLK_MISC0 0 /* Misc 0 clock */ -#define SC_PM_CLK_MISC1 1 /* Misc 1 clock */ -#define SC_PM_CLK_MISC2 2 /* Misc 2 clock */ -#define SC_PM_CLK_MISC3 3 /* Misc 3 clock */ -#define SC_PM_CLK_MISC4 4 /* Misc 4 clock */ -#define SC_PM_CLK_CPU 2 /* CPU clock */ -#define SC_PM_CLK_PLL 4 /* PLL */ -#define SC_PM_CLK_BYPASS 4 /* Bypass clock */ +#define SC_PM_CLK_SLV_BUS 0 /*!< Slave bus clock */ +#define SC_PM_CLK_MST_BUS 1 /*!< Master bus clock */ +#define SC_PM_CLK_PER 2 /*!< Peripheral clock */ +#define SC_PM_CLK_PHY 3 /*!< Phy clock */ +#define SC_PM_CLK_MISC 4 /*!< Misc clock */ +#define SC_PM_CLK_MISC0 0 /*!< Misc 0 clock */ +#define SC_PM_CLK_MISC1 1 /*!< Misc 1 clock */ +#define SC_PM_CLK_MISC2 2 /*!< Misc 2 clock */ +#define SC_PM_CLK_MISC3 3 /*!< Misc 3 clock */ +#define SC_PM_CLK_MISC4 4 /*!< Misc 4 clock */ +#define SC_PM_CLK_CPU 2 /*!< CPU clock */ +#define SC_PM_CLK_PLL 4 /*!< PLL */ +#define SC_PM_CLK_BYPASS 4 /*!< Bypass clock */ /*@}*/ /*! * @name Defines for sc_pm_clk_mode_t */ /*@{*/ -#define SC_PM_CLK_MODE_ROM_INIT 0 /* Clock is initialized by ROM. */ -#define SC_PM_CLK_MODE_OFF 1 /* Clock is disabled */ -#define SC_PM_CLK_MODE_ON 2 /* Clock is enabled. */ -#define SC_PM_CLK_MODE_AUTOGATE_SW 3 /* Clock is in SW autogate mode */ -#define SC_PM_CLK_MODE_AUTOGATE_HW 4 /* Clock is in HW autogate mode */ -#define SC_PM_CLK_MODE_AUTOGATE_SW_HW 5 /* Clock is in SW-HW autogate mode */ +#define SC_PM_CLK_MODE_ROM_INIT 0 /*!< Clock is initialized by ROM. */ +#define SC_PM_CLK_MODE_OFF 1 /*!< Clock is disabled */ +#define SC_PM_CLK_MODE_ON 2 /*!< Clock is enabled. */ +#define SC_PM_CLK_MODE_AUTOGATE_SW 3 /*!< Clock is in SW autogate mode */ +#define SC_PM_CLK_MODE_AUTOGATE_HW 4 /*!< Clock is in HW autogate mode */ +#define SC_PM_CLK_MODE_AUTOGATE_SW_HW 5 /*!< Clock is in SW-HW autogate mode */ /*@}*/ /*! * @name Defines for sc_pm_clk_parent_t */ /*@{*/ -#define SC_PM_PARENT_XTAL 0 /* Parent is XTAL. */ -#define SC_PM_PARENT_PLL0 1 /* Parent is PLL0 */ -#define SC_PM_PARENT_PLL1 2 /* Parent is PLL1 or PLL0/2 */ -#define SC_PM_PARENT_PLL2 3 /* Parent in PLL2 or PLL0/4 */ -#define SC_PM_PARENT_BYPS 4 /* Parent is a bypass clock. */ +#define SC_PM_PARENT_XTAL 0 /*!< Parent is XTAL. */ +#define SC_PM_PARENT_PLL0 1 /*!< Parent is PLL0 */ +#define SC_PM_PARENT_PLL1 2 /*!< Parent is PLL1 or PLL0/2 */ +#define SC_PM_PARENT_PLL2 3 /*!< Parent in PLL2 or PLL0/4 */ +#define SC_PM_PARENT_BYPS 4 /*!< Parent is a bypass clock. */ /*@}*/ /*! * @name Defines for sc_pm_reset_type_t */ /*@{*/ -#define SC_PM_RESET_TYPE_COLD 0 /* Cold reset */ -#define SC_PM_RESET_TYPE_WARM 1 /* Warm reset */ -#define SC_PM_RESET_TYPE_BOARD 2 /* Board reset */ +#define SC_PM_RESET_TYPE_COLD 0 /*!< Cold reset */ +#define SC_PM_RESET_TYPE_WARM 1 /*!< Warm reset */ +#define SC_PM_RESET_TYPE_BOARD 2 /*!< Board reset */ /*@}*/ /*! * @name Defines for sc_pm_reset_reason_t */ /*@{*/ -#define SC_PM_RESET_REASON_POR 0 /* Power on reset */ -#define SC_PM_RESET_REASON_WARM 1 /* Warm reset */ -#define SC_PM_RESET_REASON_SW 2 /* Software reset */ -#define SC_PM_RESET_REASON_WDOG 3 /* Watchdog reset */ -#define SC_PM_RESET_REASON_LOCKUP 4 /* Lockup reset */ -#define SC_PM_RESET_REASON_TAMPER 5 /* Tamper reset */ -#define SC_PM_RESET_REASON_TEMP 6 /* Temp reset */ -#define SC_PM_RESET_REASON_LOW_VOLT 7 /* Low voltage reset */ +#define SC_PM_RESET_REASON_POR 0 /*!< Power on reset */ +#define SC_PM_RESET_REASON_WARM 1 /*!< Warm reset */ +#define SC_PM_RESET_REASON_SW 2 /*!< Software reset */ +#define SC_PM_RESET_REASON_WDOG 3 /*!< Watchdog reset */ +#define SC_PM_RESET_REASON_LOCKUP 4 /*!< Lockup reset */ +#define SC_PM_RESET_REASON_TAMPER 5 /*!< Tamper reset */ +#define SC_PM_RESET_REASON_TEMP 6 /*!< Temp reset */ +#define SC_PM_RESET_REASON_LOW_VOLT 7 /*!< Low voltage reset */ +/*@}*/ + +/*! + * @name Defines for sc_pm_sys_if_t + */ +/*@{*/ +#define SC_PM_SYS_IF_INTERCONNECT 0 /*!< System interconnect */ +#define SC_PM_SYS_IF_MU 1 /*!< AP -> SCU message units */ +#define SC_PM_SYS_IF_OCMEM 2 /*!< On-chip memory (ROM/OCRAM) */ +#define SC_PM_SYS_IF_DDR 3 /*!< DDR memory */ /*@}*/ /* Types */ @@ -164,6 +174,11 @@ typedef uint8_t sc_pm_reset_type_t; */ typedef uint8_t sc_pm_reset_reason_t; +/*! + * This type is used to specify a system-level interface to be power managed. + */ +typedef uint8_t sc_pm_sys_if_t; + /* Functions */ /*! @@ -288,6 +303,26 @@ sc_err_t sc_pm_req_low_power_mode(sc_ipc_t ipc, sc_rsrc_t resource, sc_err_t sc_pm_set_cpu_resume_addr(sc_ipc_t ipc, sc_rsrc_t resource, sc_faddr_t address); +/*! + * This function requests the power mode configuration for system-level + * interfaces including messaging units, interconnect, and memories. This API + * is only valid for the following resources : SC_R_A53, SC_R_A72, and + * SC_R_M4_x_PID_y. For all other resources, it will return SC_ERR_PARAM. + * The requested power mode will be captured and applied to system-level + * resources as system conditions allow. + * + * @param[in] ipc IPC handle + * @param[in] resource ID of the resource + * @param[in] sys_if system-level interface to be configured + * @param[in] hpm high-power mode for the system interface + * @param[in] lpm low-power mode for the system interface + * + * @return Returns an error code (SC_ERR_NONE = success). + * + */ +sc_err_t sc_pm_req_sys_if_power_mode(sc_ipc_t ipc, sc_rsrc_t resource, + sc_pm_sys_if_t sys_if, sc_pm_power_mode_t hpm, sc_pm_power_mode_t lpm); + /* @} */ /*! diff --git a/plat/imx/common/include/sci/svc/rm/api.h b/plat/imx/common/include/sci/svc/rm/api.h index 4a52b879..1fcbee58 100755..100644 --- a/plat/imx/common/include/sci/svc/rm/api.h +++ b/plat/imx/common/include/sci/svc/rm/api.h @@ -30,44 +30,44 @@ * @name Defines for type widths */ /*@{*/ -#define SC_RM_PARTITION_W 5 /* Width of sc_rm_pt_t */ -#define SC_RM_MEMREG_W 6 /* Width of sc_rm_mr_t */ -#define SC_RM_DID_W 4 /* Width of sc_rm_did_t */ -#define SC_RM_SID_W 6 /* Width of sc_rm_sid_t */ -#define SC_RM_SPA_W 2 /* Width of sc_rm_spa_t */ -#define SC_RM_PERM_W 3 /* Width of sc_rm_perm_t */ +#define SC_RM_PARTITION_W 5 /*!< Width of sc_rm_pt_t */ +#define SC_RM_MEMREG_W 6 /*!< Width of sc_rm_mr_t */ +#define SC_RM_DID_W 4 /*!< Width of sc_rm_did_t */ +#define SC_RM_SID_W 6 /*!< Width of sc_rm_sid_t */ +#define SC_RM_SPA_W 2 /*!< Width of sc_rm_spa_t */ +#define SC_RM_PERM_W 3 /*!< Width of sc_rm_perm_t */ /*@}*/ /*! * @name Defines for ALL parameters */ /*@{*/ -#define SC_RM_PT_ALL UINT8_MAX /* All partitions */ -#define SC_RM_MR_ALL UINT8_MAX /* All memory regions */ +#define SC_RM_PT_ALL UINT8_MAX /*!< All partitions */ +#define SC_RM_MR_ALL UINT8_MAX /*!< All memory regions */ /*@}*/ /*! * @name Defines for sc_rm_spa_t */ /*@{*/ -#define SC_RM_SPA_PASSTHRU 0 /* Pass through (attribute driven by master) */ -#define SC_RM_SPA_PASSSID 1 /* Pass through and output on SID */ -#define SC_RM_SPA_ASSERT 2 /* Assert (force to be secure/privileged) */ -#define SC_RM_SPA_NEGATE 3 /* Negate (force to be non-secure/user) */ +#define SC_RM_SPA_PASSTHRU 0 /*!< Pass through (attribute driven by master) */ +#define SC_RM_SPA_PASSSID 1 /*!< Pass through and output on SID */ +#define SC_RM_SPA_ASSERT 2 /*!< Assert (force to be secure/privileged) */ +#define SC_RM_SPA_NEGATE 3 /*!< Negate (force to be non-secure/user) */ /*@}*/ /*! * @name Defines for sc_rm_perm_t */ /*@{*/ -#define SC_RM_PERM_NONE 0 /* No access */ -#define SC_RM_PERM_SEC_R 1 /* Secure RO */ -#define SC_RM_PERM_SECPRIV_RW 2 /* Secure privilege R/W */ -#define SC_RM_PERM_SEC_RW 3 /* Secure R/W */ -#define SC_RM_PERM_NSPRIV_R 4 /* Secure R/W, non-secure privilege RO */ -#define SC_RM_PERM_NS_R 5 /* Secure R/W, non-secure RO */ -#define SC_RM_PERM_NSPRIV_RW 6 /* Secure R/W, non-secure privilege R/W */ -#define SC_RM_PERM_FULL 7 /* Full access */ +#define SC_RM_PERM_NONE 0 /*!< No access */ +#define SC_RM_PERM_SEC_R 1 /*!< Secure RO */ +#define SC_RM_PERM_SECPRIV_RW 2 /*!< Secure privilege R/W */ +#define SC_RM_PERM_SEC_RW 3 /*!< Secure R/W */ +#define SC_RM_PERM_NSPRIV_R 4 /*!< Secure R/W, non-secure privilege RO */ +#define SC_RM_PERM_NS_R 5 /*!< Secure R/W, non-secure RO */ +#define SC_RM_PERM_NSPRIV_RW 6 /*!< Secure R/W, non-secure privilege R/W */ +#define SC_RM_PERM_FULL 7 /*!< Full access */ /*@}*/ /* Types */ @@ -123,9 +123,8 @@ typedef uint8_t sc_rm_perm_t; * via XRDC; set true if new DID is desired * @param[in] restricted boolean indicating if this partition should be restricted; set * true if masters in this partition cannot create new partitions - * @param[in] confidential boolean indicating if this partition should be confidential; - * set true if only this partition should be able to grant - * resource access permissions to this partition + * @param[in] grant boolean indicating if this partition should always grant + * access and control to the parent * @param[in] coherent boolean indicating if this partition is coherent; * set true if only this partition will contain both AP clusters * and they will be coherent via the CCI @@ -141,10 +140,35 @@ typedef uint8_t sc_rm_perm_t; * Marking as non-secure prevents subsequent functions from configuring masters in this * partition to assert the secure signal. If restricted then the new partition is limited * in what functions it can call, especially those associated with managing partitions. + * + * The grant option is usually used to isolate a bus master's traffic to specific + * memory without isolating the peripheral interface of the master or the API + * controls of that master. */ 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 grant, bool coherent); + +/*! + * This function makes a partition confidential. + * + * @param[in] ipc IPC handle + * @param[in] pt handle of partition that is granting + * @param[in] retro retroactive + * + * @return Returns an error code (SC_ERR_NONE = success). + * + * Return errors: + * - SC_PARM if \a pt out of range, + * - SC_ERR_NOACCESS if caller's not allowed to change \a pt + * - SC_ERR_LOCKED if partition \a pt is locked + * + * Call to make a partition confidential. Confidential means only this + * partition should be able to grant access permissions to this partition. + * + * If retroactive, then all resources owned by other partitions will have + * access rights for this partition removed, even if locked. + */ +sc_err_t sc_rm_set_confidential(sc_ipc_t ipc, sc_rm_pt_t pt, bool retro); /*! * This function frees a partition and assigns all resources to the caller. @@ -197,7 +221,8 @@ sc_rm_did_t sc_rm_get_did(sc_ipc_t ipc); * Assumes no assigned resources or memory regions yet! The number of static * DID is fixed by the SC at boot. */ -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); /*! * This function locks a partition. @@ -242,7 +267,8 @@ sc_err_t sc_rm_get_partition(sc_ipc_t ipc, sc_rm_pt_t *pt); * - SC_ERR_NOACCESS if caller's partition is not the parent of \a pt, * - SC_ERR_LOCKED if either partition is locked */ -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); /*! * This function moves all movable resources/pads owned by a source partition @@ -305,7 +331,8 @@ sc_err_t sc_rm_move_all(sc_ipc_t ipc, sc_rm_pt_t pt_src, sc_rm_pt_t pt_dst, * of the owner, * - SC_ERR_LOCKED if the owning partition or \a pt is locked */ -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); /*! * This function flags resources as movable or not. @@ -372,8 +399,7 @@ sc_err_t sc_rm_set_subsys_rsrc_movable(sc_ipc_t ipc, sc_rsrc_t resource, * changed if the caller's partition is secure. */ 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); /*! * This function sets the StreamID for a resource which is a bus master (i.e. @@ -533,8 +559,7 @@ sc_err_t sc_rm_memreg_alloc(sc_ipc_t ipc, sc_rm_mr_t *mr, * Note the new region must start or end on the split region. */ 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_rm_mr_t *mr_ret, sc_faddr_t addr_start, sc_faddr_t addr_end); /*! * This function frees a memory region. @@ -612,6 +637,7 @@ sc_err_t sc_rm_assign_memreg(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_mr_t mr); * - SC_ERR_NOACCESS if caller's partition is not the region owner or parent * of the owner, * - SC_ERR_LOCKED if the owning partition is locked + * - SC_ERR_LOCKED if the \a pt is confidential and the caller isn't \a pt * * This function configures how the HW isolation will restrict access to a * memory region based on the attributes of a transaction from bus master. diff --git a/plat/imx/common/include/sci/svc/timer/api.h b/plat/imx/common/include/sci/svc/timer/api.h index 2099af15..3d832eba 100644 --- a/plat/imx/common/include/sci/svc/timer/api.h +++ b/plat/imx/common/include/sci/svc/timer/api.h @@ -55,17 +55,18 @@ * @name Defines for type widths */ /*@{*/ -#define SC_TIMER_ACTION_W 2 /* Width of sc_timer_wdog_action_t */ +#define SC_TIMER_ACTION_W 3 /*!< Width of sc_timer_wdog_action_t */ /*@}*/ /*! * @name Defines for sc_timer_wdog_action_t */ /*@{*/ -#define SC_TIMER_WDOG_ACTION_PARTITION 0 /* Reset partition */ -#define SC_TIMER_WDOG_ACTION_WARM 1 /* Warm reset system */ -#define SC_TIMER_WDOG_ACTION_COLD 2 /* Cold reset system */ -#define SC_TIMER_WDOG_ACTION_BOARD 3 /* Reset board */ +#define SC_TIMER_WDOG_ACTION_PARTITION 0 /*!< Reset partition */ +#define SC_TIMER_WDOG_ACTION_WARM 1 /*!< Warm reset system */ +#define SC_TIMER_WDOG_ACTION_COLD 2 /*!< Cold reset system */ +#define SC_TIMER_WDOG_ACTION_BOARD 3 /*!< Reset board */ +#define SC_TIMER_WDOG_ACTION_IRQ 4 /*!< Only generate IRQs */ /*@}*/ /* Types */ @@ -98,7 +99,25 @@ typedef uint32_t sc_timer_wdog_time_t; * @return Returns an error code (SC_ERR_NONE = success, SC_ERR_LOCKED * = locked). */ -sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, sc_timer_wdog_time_t timeout); +sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, + sc_timer_wdog_time_t timeout); + +/*! + * This function sets the watchdog pre-timeout in milliseconds. If not + * set then the pre-timeout defaults to the max. Once locked this value + * cannot be changed. + * + * @param[in] ipc IPC handle + * @param[in] pre_timeout pre-timeout period for the watchdog + * + * When the pre-timout expires an IRQ will be generated. Note this timeout + * clears when the IRQ is triggered. An IRQ is generated for the failing + * partition and all of its child partitions. + * + * @return Returns an error code (SC_ERR_NONE = success). + */ +sc_err_t sc_timer_set_wdog_pre_timeout(sc_ipc_t ipc, + sc_timer_wdog_time_t pre_timeout); /*! * This function sets the watchdog pre-timeout in milliseconds. If not @@ -162,11 +181,26 @@ sc_err_t sc_timer_ping_wdog(sc_ipc_t ipc); * @return Returns an error code (SC_ERR_NONE = success). */ sc_err_t sc_timer_get_wdog_status(sc_ipc_t ipc, - sc_timer_wdog_time_t *timeout, - sc_timer_wdog_time_t *max_timeout, + sc_timer_wdog_time_t *timeout, sc_timer_wdog_time_t *max_timeout, sc_timer_wdog_time_t *remaining_time); /*! + * This function gets the status of the watchdog of a partition. All + * arguments are in milliseconds. + * + * @param[in] ipc IPC handle + * @param[in] pt partition to query + * @param[out] enb pointer to return enable status + * @param[out] timeout pointer to return the timeout + * @param[out] remaining_time pointer to return the time remaining + * until trigger + * + * @return Returns an error code (SC_ERR_NONE = success). + */ +sc_err_t sc_timer_pt_get_wdog_status(sc_ipc_t ipc, sc_rm_pt_t pt, bool *enb, + sc_timer_wdog_time_t *timeout, sc_timer_wdog_time_t *remaining_time); + +/*! * This function configures the action to be taken when a watchdog * expires. * @@ -174,12 +208,13 @@ sc_err_t sc_timer_get_wdog_status(sc_ipc_t ipc, * @param[in] pt partition to affect * @param[in] action action to take * + * Default action is inherited from the parent. + * * @return Returns an error code (SC_ERR_NONE = success). * * Return errors: * - SC_ERR_PARM if invalid parameters, * - SC_ERR_NOACCESS if caller's partition is not the SYSTEM owner, - * - SC_ERR_NOACCESS if caller's partition is not the parent of \a pt, * - SC_ERR_LOCKED if the watchdog is locked */ sc_err_t sc_timer_set_wdog_action(sc_ipc_t ipc, @@ -211,8 +246,7 @@ sc_err_t sc_timer_set_wdog_action(sc_ipc_t ipc, * - SC_ERR_NOACCESS if caller's partition is not the SYSTEM owner */ sc_err_t sc_timer_set_rtc_time(sc_ipc_t ipc, uint16_t year, uint8_t mon, - uint8_t day, uint8_t hour, uint8_t min, - uint8_t sec); + uint8_t day, uint8_t hour, uint8_t min, uint8_t sec); /*! * This function gets the RTC time. @@ -228,8 +262,7 @@ sc_err_t sc_timer_set_rtc_time(sc_ipc_t ipc, uint16_t year, uint8_t mon, * @return Returns an error code (SC_ERR_NONE = success). */ sc_err_t sc_timer_get_rtc_time(sc_ipc_t ipc, uint16_t *year, uint8_t *mon, - uint8_t *day, uint8_t *hour, uint8_t *min, - uint8_t *sec); + uint8_t *day, uint8_t *hour, uint8_t *min, uint8_t *sec); /*! * This function gets the RTC time in seconds since 1/1/1970. @@ -242,8 +275,7 @@ sc_err_t sc_timer_get_rtc_time(sc_ipc_t ipc, uint16_t *year, uint8_t *mon, sc_err_t sc_timer_get_rtc_sec1970(sc_ipc_t ipc, uint32_t *sec); /*! - * This function sets the RTC alarm. Only the owner of the SC_R_SYSTEM - * resource can set the alarm. + * This function sets the RTC alarm. * * @param[in] ipc IPC handle * @param[in] year year (min 1970) @@ -253,14 +285,30 @@ sc_err_t sc_timer_get_rtc_sec1970(sc_ipc_t ipc, uint32_t *sec); * @param[in] min minute (0-59) * @param[in] sec second (0-59) * + * Note this alarm setting clears when the alarm is triggered. + * * @return Returns an error code (SC_ERR_NONE = success). * * Return errors: * - SC_ERR_PARM if invalid time/date parameters */ sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, - uint8_t day, uint8_t hour, uint8_t min, - uint8_t sec); + uint8_t day, uint8_t hour, uint8_t min, uint8_t sec); + +/*! + * This function sets the RTC calibration value. Only the owner of the SC_R_SYSTEM + * resource can set the calibration. + * + * @param[in] ipc IPC handle + * @param[in] count calbration count (-16 to 15) + * + * The calibration value is a 5-bit value including the sign bit, which is + * implemented in 2's complement. It is added or subtracted from the RTC on + * a perdiodic basis, once per 32768 cycles of the RTC clock. + * + * @return Returns an error code (SC_ERR_NONE = success). + */ +sc_err_t sc_timer_set_rtc_calb(sc_ipc_t ipc, int8_t count); /*! * This function sets the RTC calibration value. Only the owner of the SC_R_SYSTEM diff --git a/plat/imx/common/include/sci/types.h b/plat/imx/common/include/sci/types.h index f07e0a4f..c7058875 100644 --- a/plat/imx/common/include/sci/types.h +++ b/plat/imx/common/include/sci/types.h @@ -89,6 +89,7 @@ #define SC_12MHZ 12000000 /* 12MHz */ #define SC_19MHZ 19800000 /* 19.8MHz */ #define SC_24MHZ 24000000 /* 24MHz */ +#define SC_48MHZ 48000000 /* 48MHz */ #define SC_120MHZ 120000000 /* 120MHz */ #define SC_132MHZ 132000000 /* 132MHz */ #define SC_144MHZ 144000000 /* 144MHz */ @@ -100,6 +101,7 @@ #define SC_360MHZ 360000000 /* 360MHz */ #define SC_384MHZ 384000000 /* 384MHz */ #define SC_396MHZ 396000000 /* 396MHz */ +#define SC_432MHZ 432000000 /* 432MHz */ #define SC_480MHZ 480000000 /* 480MHz */ #define SC_600MHZ 600000000 /* 600MHz */ #define SC_744MHZ 744000000 /* 744MHz */ @@ -304,10 +306,10 @@ typedef enum sc_rsrc_e { SC_R_DMA_1_CH29 = 137, SC_R_DMA_1_CH30 = 138, SC_R_DMA_1_CH31 = 139, - SC_R_DRC_0_V = 140, - SC_R_DRC_0_H = 141, - SC_R_DRC_1_V = 142, - SC_R_DRC_1_H = 143, + SC_R_UNUSED1 = 140, + SC_R_UNUSED2 = 141, + SC_R_UNUSED3 = 142, + SC_R_UNUSED4 = 143, SC_R_GPU_0_PID0 = 144, SC_R_GPU_0_PID1 = 145, SC_R_GPU_0_PID2 = 146, @@ -485,10 +487,10 @@ typedef enum sc_rsrc_e { SC_R_SAI_0 = 318, SC_R_SAI_1 = 319, SC_R_SAI_2 = 320, - SC_R_SPBA = 321, - SC_R_QSPI_0 = 322, - SC_R_SDMA = 323, - SC_R_IRQSTR_MW = 324, + SC_R_IRQSTR_SCU2 = 321, + SC_R_IRQSTR_DSP = 322, + SC_R_UNUSED5 = 323, + SC_R_UNUSED6 = 324, SC_R_AUDIO_PLL_0 = 325, SC_R_PI_0 = 326, SC_R_PI_0_PWM_0 = 327, @@ -676,8 +678,8 @@ typedef enum sc_rsrc_e { SC_R_A35_1 = 509, SC_R_A35_2 = 510, SC_R_A35_3 = 511, - SC_R_HIFI = 512, - SC_R_HIFI_RAM = 513, + SC_R_DSP = 512, + SC_R_DSP_RAM = 513, SC_R_CAAM_JR1_OUT = 514, SC_R_CAAM_JR2_OUT = 515, SC_R_CAAM_JR3_OUT = 516, @@ -701,6 +703,8 @@ typedef enum sc_rsrc_e { SC_R_LAST } sc_rsrc_t; +/* NOTE - please add by replacing some of the UNUSED from above! */ + /*! * This type is used to indicate a control. */ diff --git a/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c b/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c index 0840e3f5..3383fa63 100755..100644 --- a/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c +++ b/plat/imx/common/sci/svc/pad/pad_rpc_clnt.c @@ -50,8 +50,7 @@ sc_err_t sc_pad_set_mux(sc_ipc_t ipc, sc_pad_t pad, } 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) + uint8_t *mux, sc_pad_config_t *config, sc_pad_iso_t *iso) { sc_rpc_msg_t msg; uint8_t result; @@ -111,7 +110,8 @@ sc_err_t sc_pad_get_gp(sc_ipc_t ipc, sc_pad_t pad, uint32_t *ctrl) return (sc_err_t) result; } -sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t wakeup) +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; uint8_t result; @@ -129,7 +129,8 @@ sc_err_t sc_pad_set_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t wakeup) return (sc_err_t) result; } -sc_err_t sc_pad_get_wakeup(sc_ipc_t ipc, sc_pad_t pad, sc_pad_wakeup_t *wakeup) +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; @@ -173,8 +174,8 @@ sc_err_t sc_pad_set_all(sc_ipc_t ipc, sc_pad_t pad, uint8_t mux, } 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_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; @@ -259,8 +260,7 @@ sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, } 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_pad_28fdsoi_dse_t *dse, sc_pad_28fdsoi_ps_t *ps) { sc_rpc_msg_t msg; uint8_t result; @@ -282,9 +282,8 @@ sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, } sc_err_t sc_pad_set_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, - sc_pad_28fdsoi_dse_t dse, bool hys, - sc_pad_28fdsoi_pus_t pus, bool pke, - bool pue) + sc_pad_28fdsoi_dse_t dse, bool hys, sc_pad_28fdsoi_pus_t pus, + bool pke, bool pue) { sc_rpc_msg_t msg; uint8_t result; @@ -307,9 +306,8 @@ sc_err_t sc_pad_set_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, } sc_err_t sc_pad_get_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, - sc_pad_28fdsoi_dse_t *dse, bool *hys, - sc_pad_28fdsoi_pus_t * pus, bool *pke, - bool *pue) + sc_pad_28fdsoi_dse_t *dse, bool *hys, sc_pad_28fdsoi_pus_t *pus, + bool *pke, bool *pue) { sc_rpc_msg_t msg; uint8_t result; @@ -337,8 +335,7 @@ sc_err_t sc_pad_get_gp_28fdsoi_hsic(sc_ipc_t ipc, sc_pad_t pad, } 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, + uint8_t compen, bool fastfrz, uint8_t rasrcp, uint8_t rasrcn, bool nasrc_sel, bool psw_ovr) { sc_rpc_msg_t msg; @@ -363,10 +360,8 @@ sc_err_t sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad, } 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, bool *psw_ovr) + uint8_t *compen, bool *fastfrz, uint8_t *rasrcp, uint8_t *rasrcn, + bool *nasrc_sel, bool *compok, uint8_t *nasrc, bool *psw_ovr) { sc_rpc_msg_t msg; uint8_t result; diff --git a/plat/imx/common/sci/svc/pad/rpc.h b/plat/imx/common/sci/svc/pad/rpc.h index e66af4f5..571e06d3 100755..100644 --- a/plat/imx/common/sci/svc/pad/rpc.h +++ b/plat/imx/common/sci/svc/pad/rpc.h @@ -24,24 +24,25 @@ /*! * This type is used to indicate RPC PAD function calls. */ -typedef enum pad_func_e { - 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_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_HSIC = 3, /* Index for pad_set_gp_28fdsoi_hsic() RPC call */ - PAD_FUNC_GET_GP_28FDSOI_HSIC = 8, /* Index for pad_get_gp_28fdsoi_hsic() 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 */ +typedef enum pad_func_e +{ + 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_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_HSIC = 3, /*!< Index for pad_set_gp_28fdsoi_hsic() RPC call */ + PAD_FUNC_GET_GP_28FDSOI_HSIC = 8, /*!< Index for pad_get_gp_28fdsoi_hsic() 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/imx/common/sci/svc/pm/pm_rpc_clnt.c b/plat/imx/common/sci/svc/pm/pm_rpc_clnt.c index 1acc5089..ed8f53de 100644 --- a/plat/imx/common/sci/svc/pm/pm_rpc_clnt.c +++ b/plat/imx/common/sci/svc/pm/pm_rpc_clnt.c @@ -145,6 +145,27 @@ sc_err_t sc_pm_set_cpu_resume_addr(sc_ipc_t ipc, sc_rsrc_t resource, return (sc_err_t)result; } +sc_err_t sc_pm_req_sys_if_power_mode(sc_ipc_t ipc, sc_rsrc_t resource, + sc_pm_sys_if_t sys_if, sc_pm_power_mode_t hpm, sc_pm_power_mode_t lpm) +{ + 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_REQ_SYS_IF_POWER_MODE; + RPC_U16(&msg, 0) = resource; + RPC_U8(&msg, 2) = sys_if; + RPC_U8(&msg, 3) = hpm; + RPC_U8(&msg, 4) = lpm; + RPC_SIZE(&msg) = 3; + + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + return (sc_err_t)result; +} + sc_err_t sc_pm_set_clock_rate(sc_ipc_t ipc, sc_rsrc_t resource, sc_pm_clk_t clk, sc_pm_clock_rate_t *rate) { diff --git a/plat/imx/common/sci/svc/pm/rpc.h b/plat/imx/common/sci/svc/pm/rpc.h index 6f40c0dc..f6b02f15 100644 --- a/plat/imx/common/sci/svc/pm/rpc.h +++ b/plat/imx/common/sci/svc/pm/rpc.h @@ -24,25 +24,27 @@ /*! * This type is used to indicate RPC PM function calls. */ -typedef enum pm_func_e { - 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_REQ_LOW_POWER_MODE = 16, /* Index for pm_req_low_power_mode() RPC call */ - PM_FUNC_SET_CPU_RESUME_ADDR = 17, /* Index for pm_set_cpu_resume_addr() 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 */ +typedef enum pm_func_e +{ + 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_REQ_LOW_POWER_MODE = 16, /*!< Index for pm_req_low_power_mode() RPC call */ + PM_FUNC_SET_CPU_RESUME_ADDR = 17, /*!< Index for pm_set_cpu_resume_addr() RPC call */ + PM_FUNC_REQ_SYS_IF_POWER_MODE = 18, /*!< Index for pm_req_sys_if_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/imx/common/sci/svc/rm/rm_rpc_clnt.c b/plat/imx/common/sci/svc/rm/rm_rpc_clnt.c index 8cbdcac2..4cb76134 100755..100644 --- a/plat/imx/common/sci/svc/rm/rm_rpc_clnt.c +++ b/plat/imx/common/sci/svc/rm/rm_rpc_clnt.c @@ -28,8 +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 grant, + bool coherent) { sc_rpc_msg_t msg; uint8_t result; @@ -40,7 +40,7 @@ sc_err_t sc_rm_partition_alloc(sc_ipc_t ipc, sc_rm_pt_t *pt, bool secure, RPC_U8(&msg, 0) = secure; RPC_U8(&msg, 1) = isolated; RPC_U8(&msg, 2) = restricted; - RPC_U8(&msg, 3) = confidential; + RPC_U8(&msg, 3) = grant; RPC_U8(&msg, 4) = coherent; RPC_SIZE(&msg) = 3; @@ -52,6 +52,24 @@ sc_err_t sc_rm_partition_alloc(sc_ipc_t ipc, sc_rm_pt_t *pt, bool secure, return (sc_err_t)result; } +sc_err_t sc_rm_set_confidential(sc_ipc_t ipc, sc_rm_pt_t pt, bool retro) +{ + 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_CONFIDENTIAL; + RPC_U8(&msg, 0) = pt; + RPC_U8(&msg, 1) = retro; + RPC_SIZE(&msg) = 2; + + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + return (sc_err_t)result; +} + sc_err_t sc_rm_partition_free(sc_ipc_t ipc, sc_rm_pt_t pt) { sc_rpc_msg_t msg; @@ -85,7 +103,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; @@ -138,7 +157,8 @@ 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; @@ -177,7 +197,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; @@ -235,8 +256,7 @@ sc_err_t sc_rm_set_subsys_rsrc_movable(sc_ipc_t ipc, sc_rsrc_t resource, } 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; @@ -256,7 +276,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; @@ -389,8 +410,7 @@ sc_err_t sc_rm_memreg_alloc(sc_ipc_t ipc, sc_rm_mr_t *mr, } 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_rm_mr_t *mr_ret, sc_faddr_t addr_start, sc_faddr_t addr_end) { sc_rpc_msg_t msg; uint8_t result; @@ -523,11 +543,9 @@ 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; } diff --git a/plat/imx/common/sci/svc/rm/rpc.h b/plat/imx/common/sci/svc/rm/rpc.h index 7f83e8ce..3376b9c9 100755..100644 --- a/plat/imx/common/sci/svc/rm/rpc.h +++ b/plat/imx/common/sci/svc/rm/rpc.h @@ -24,38 +24,40 @@ /*! * 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_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 */ +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_SET_CONFIDENTIAL = 31, /*!< Index for rm_set_confidential() 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 */ diff --git a/plat/imx/common/sci/svc/timer/rpc.h b/plat/imx/common/sci/svc/timer/rpc.h index 8692f58a..eeb41a49 100644 --- a/plat/imx/common/sci/svc/timer/rpc.h +++ b/plat/imx/common/sci/svc/timer/rpc.h @@ -47,20 +47,22 @@ /*! * This type is used to indicate RPC TIMER function calls. */ -typedef enum timer_func_e { - TIMER_FUNC_UNKNOWN = 0, /* Unknown function */ - TIMER_FUNC_SET_WDOG_TIMEOUT = 1, /* Index for timer_set_wdog_timeout() RPC call */ - TIMER_FUNC_SET_WDOG_PRE_TIMEOUT = 12, /* Index for timer_set_wdog_pre_timeout() RPC call */ - TIMER_FUNC_START_WDOG = 2, /* Index for timer_start_wdog() RPC call */ - TIMER_FUNC_STOP_WDOG = 3, /* Index for timer_stop_wdog() RPC call */ - TIMER_FUNC_PING_WDOG = 4, /* Index for timer_ping_wdog() RPC call */ - TIMER_FUNC_GET_WDOG_STATUS = 5, /* Index for timer_get_wdog_status() RPC call */ - TIMER_FUNC_SET_WDOG_ACTION = 10, /* Index for timer_set_wdog_action() RPC call */ - TIMER_FUNC_SET_RTC_TIME = 6, /* Index for timer_set_rtc_time() RPC call */ - TIMER_FUNC_GET_RTC_TIME = 7, /* Index for timer_get_rtc_time() RPC call */ - TIMER_FUNC_GET_RTC_SEC1970 = 9, /* Index for timer_get_rtc_sec1970() RPC call */ - TIMER_FUNC_SET_RTC_ALARM = 8, /* Index for timer_set_rtc_alarm() RPC call */ - TIMER_FUNC_SET_RTC_CALB = 11, /* Index for timer_set_rtc_calb() RPC call */ +typedef enum timer_func_e +{ + TIMER_FUNC_UNKNOWN = 0, /*!< Unknown function */ + TIMER_FUNC_SET_WDOG_TIMEOUT = 1, /*!< Index for timer_set_wdog_timeout() RPC call */ + TIMER_FUNC_SET_WDOG_PRE_TIMEOUT = 12, /*!< Index for timer_set_wdog_pre_timeout() RPC call */ + TIMER_FUNC_START_WDOG = 2, /*!< Index for timer_start_wdog() RPC call */ + TIMER_FUNC_STOP_WDOG = 3, /*!< Index for timer_stop_wdog() RPC call */ + TIMER_FUNC_PING_WDOG = 4, /*!< Index for timer_ping_wdog() RPC call */ + TIMER_FUNC_GET_WDOG_STATUS = 5, /*!< Index for timer_get_wdog_status() RPC call */ + TIMER_FUNC_PT_GET_WDOG_STATUS = 13, /*!< Index for timer_pt_get_wdog_status() RPC call */ + TIMER_FUNC_SET_WDOG_ACTION = 10, /*!< Index for timer_set_wdog_action() RPC call */ + TIMER_FUNC_SET_RTC_TIME = 6, /*!< Index for timer_set_rtc_time() RPC call */ + TIMER_FUNC_GET_RTC_TIME = 7, /*!< Index for timer_get_rtc_time() RPC call */ + TIMER_FUNC_GET_RTC_SEC1970 = 9, /*!< Index for timer_get_rtc_sec1970() RPC call */ + TIMER_FUNC_SET_RTC_ALARM = 8, /*!< Index for timer_set_rtc_alarm() RPC call */ + TIMER_FUNC_SET_RTC_CALB = 11, /*!< Index for timer_set_rtc_calb() RPC call */ } timer_func_t; /* Functions */ diff --git a/plat/imx/common/sci/svc/timer/timer_rpc_clnt.c b/plat/imx/common/sci/svc/timer/timer_rpc_clnt.c index 44be73cf..22494030 100644 --- a/plat/imx/common/sci/svc/timer/timer_rpc_clnt.c +++ b/plat/imx/common/sci/svc/timer/timer_rpc_clnt.c @@ -40,7 +40,7 @@ #include <sci/types.h> #include <sci/svc/rm/api.h> -#include <sci/svc/pm/api.h> +#include <sci/svc/timer/api.h> #include <sci/rpc.h> #include <stdlib.h> #include "rpc.h" @@ -48,27 +48,20 @@ /* Local Defines */ /* Local Types */ -typedef uint8_t sc_timer_wdog_action_t; -typedef uint32_t sc_timer_wdog_time_t; + /* Local Functions */ -sc_err_t sc_timer_set_rtc_time(sc_ipc_t ipc, uint16_t year, uint8_t mon, - uint8_t day, uint8_t hour, uint8_t min, - uint8_t sec) +sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, + sc_timer_wdog_time_t timeout) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_SET_RTC_TIME; - RPC_U16(&msg, 0) = year; - RPC_U8(&msg, 2) = mon; - RPC_U8(&msg, 3) = day; - RPC_U8(&msg, 4) = hour; - RPC_U8(&msg, 5) = min; - RPC_U8(&msg, 6) = sec; - RPC_SIZE(&msg) = 3; + RPC_FUNC(&msg) = TIMER_FUNC_SET_WDOG_TIMEOUT; + RPC_U32(&msg, 0) = timeout; + RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); @@ -76,71 +69,50 @@ sc_err_t sc_timer_set_rtc_time(sc_ipc_t ipc, uint16_t year, uint8_t mon, return (sc_err_t)result; } -sc_err_t sc_timer_get_rtc_time(sc_ipc_t ipc, uint16_t *year, uint8_t *mon, - uint8_t *day, uint8_t *hour, uint8_t *min, - uint8_t *sec) +sc_err_t sc_timer_set_wdog_pre_timeout(sc_ipc_t ipc, + sc_timer_wdog_time_t pre_timeout) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_GET_RTC_TIME; - RPC_SIZE(&msg) = 1; + RPC_FUNC(&msg) = TIMER_FUNC_SET_WDOG_PRE_TIMEOUT; + RPC_U32(&msg, 0) = pre_timeout; + RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); - if (year != NULL) - *year = RPC_U16(&msg, 0); result = RPC_R8(&msg); - if (mon != NULL) - *mon = RPC_U8(&msg, 2); - if (day != NULL) - *day = RPC_U8(&msg, 3); - if (hour != NULL) - *hour = RPC_U8(&msg, 4); - if (min != NULL) - *min = RPC_U8(&msg, 5); - if (sec != NULL) - *sec = RPC_U8(&msg, 6); return (sc_err_t)result; } -sc_err_t sc_timer_get_rtc_sec1970(sc_ipc_t ipc, uint32_t *sec) +sc_err_t sc_timer_start_wdog(sc_ipc_t ipc, bool lock) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_GET_RTC_SEC1970; - RPC_SIZE(&msg) = 1; + RPC_FUNC(&msg) = TIMER_FUNC_START_WDOG; + RPC_U8(&msg, 0) = lock; + RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); - if (sec != NULL) - *sec = RPC_U32(&msg, 0); result = RPC_R8(&msg); return (sc_err_t)result; } -sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, - uint8_t day, uint8_t hour, uint8_t min, - uint8_t sec) +sc_err_t sc_timer_stop_wdog(sc_ipc_t ipc) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_SET_RTC_ALARM; - RPC_U16(&msg, 0) = year; - RPC_U8(&msg, 2) = mon; - RPC_U8(&msg, 3) = day; - RPC_U8(&msg, 4) = hour; - RPC_U8(&msg, 5) = min; - RPC_U8(&msg, 6) = sec; - RPC_SIZE(&msg) = 3; + RPC_FUNC(&msg) = TIMER_FUNC_STOP_WDOG; + RPC_SIZE(&msg) = 1; sc_call_rpc(ipc, &msg, false); @@ -148,16 +120,15 @@ sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, return (sc_err_t)result; } -sc_err_t sc_timer_start_wdog(sc_ipc_t ipc, bool lock) +sc_err_t sc_timer_ping_wdog(sc_ipc_t ipc) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_START_WDOG; - RPC_U8(&msg, 0) = lock; - RPC_SIZE(&msg) = 2; + RPC_FUNC(&msg) = TIMER_FUNC_PING_WDOG; + RPC_SIZE(&msg) = 1; sc_call_rpc(ipc, &msg, false); @@ -165,22 +136,54 @@ sc_err_t sc_timer_start_wdog(sc_ipc_t ipc, bool lock) return (sc_err_t)result; } -sc_err_t sc_timer_stop_wdog(sc_ipc_t ipc) +sc_err_t sc_timer_get_wdog_status(sc_ipc_t ipc, + sc_timer_wdog_time_t *timeout, sc_timer_wdog_time_t *max_timeout, + sc_timer_wdog_time_t *remaining_time) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_STOP_WDOG; + RPC_FUNC(&msg) = TIMER_FUNC_GET_WDOG_STATUS; RPC_SIZE(&msg) = 1; sc_call_rpc(ipc, &msg, false); + if (timeout != NULL) + *timeout = RPC_U32(&msg, 0); + if (max_timeout != NULL) + *max_timeout = RPC_U32(&msg, 4); + if (remaining_time != NULL) + *remaining_time = RPC_U32(&msg, 8); result = RPC_R8(&msg); return (sc_err_t)result; } +sc_err_t sc_timer_pt_get_wdog_status(sc_ipc_t ipc, sc_rm_pt_t pt, bool *enb, + sc_timer_wdog_time_t *timeout, sc_timer_wdog_time_t *remaining_time) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_TIMER; + RPC_FUNC(&msg) = TIMER_FUNC_PT_GET_WDOG_STATUS; + RPC_U8(&msg, 0) = pt; + RPC_SIZE(&msg) = 2; + + sc_call_rpc(ipc, &msg, false); + + if (timeout != NULL) + *timeout = RPC_U32(&msg, 0); + if (remaining_time != NULL) + *remaining_time = RPC_U32(&msg, 4); + result = RPC_R8(&msg); + if (enb != NULL) + *enb = RPC_U8(&msg, 8); + return (sc_err_t)result; +} + sc_err_t sc_timer_set_wdog_action(sc_ipc_t ipc, sc_rm_pt_t pt, sc_timer_wdog_action_t action) { @@ -200,16 +203,22 @@ sc_err_t sc_timer_set_wdog_action(sc_ipc_t ipc, return (sc_err_t)result; } -sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, sc_timer_wdog_time_t timeout) +sc_err_t sc_timer_set_rtc_time(sc_ipc_t ipc, uint16_t year, uint8_t mon, + uint8_t day, uint8_t hour, uint8_t min, uint8_t sec) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_SET_WDOG_TIMEOUT; - RPC_U32(&msg, 0) = timeout; - RPC_SIZE(&msg) = 2; + RPC_FUNC(&msg) = TIMER_FUNC_SET_RTC_TIME; + RPC_U16(&msg, 0) = year; + RPC_U8(&msg, 2) = mon; + RPC_U8(&msg, 3) = day; + RPC_U8(&msg, 4) = hour; + RPC_U8(&msg, 5) = min; + RPC_U8(&msg, 6) = sec; + RPC_SIZE(&msg) = 3; sc_call_rpc(ipc, &msg, false); @@ -217,57 +226,85 @@ sc_err_t sc_timer_set_wdog_timeout(sc_ipc_t ipc, sc_timer_wdog_time_t timeout) return (sc_err_t)result; } -sc_err_t sc_timer_ping_wdog(sc_ipc_t ipc) +sc_err_t sc_timer_get_rtc_time(sc_ipc_t ipc, uint16_t *year, uint8_t *mon, + uint8_t *day, uint8_t *hour, uint8_t *min, uint8_t *sec) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_PING_WDOG; + RPC_FUNC(&msg) = TIMER_FUNC_GET_RTC_TIME; RPC_SIZE(&msg) = 1; sc_call_rpc(ipc, &msg, false); + if (year != NULL) + *year = RPC_U16(&msg, 0); result = RPC_R8(&msg); + if (mon != NULL) + *mon = RPC_U8(&msg, 2); + if (day != NULL) + *day = RPC_U8(&msg, 3); + if (hour != NULL) + *hour = RPC_U8(&msg, 4); + if (min != NULL) + *min = RPC_U8(&msg, 5); + if (sec != NULL) + *sec = RPC_U8(&msg, 6); return (sc_err_t)result; } -sc_err_t sc_timer_get_wdog_status(sc_ipc_t ipc, - sc_timer_wdog_time_t *timeout, - sc_timer_wdog_time_t *max_timeout, - sc_timer_wdog_time_t *remaining_time) +sc_err_t sc_timer_get_rtc_sec1970(sc_ipc_t ipc, uint32_t *sec) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_GET_WDOG_STATUS; + RPC_FUNC(&msg) = TIMER_FUNC_GET_RTC_SEC1970; RPC_SIZE(&msg) = 1; sc_call_rpc(ipc, &msg, false); - if (timeout != NULL) - *timeout = RPC_U32(&msg, 0); - if (max_timeout != NULL) - *max_timeout = RPC_U32(&msg, 4); - if (remaining_time != NULL) - *remaining_time = RPC_U32(&msg, 8); + if (sec != NULL) + *sec = RPC_U32(&msg, 0); result = RPC_R8(&msg); return (sc_err_t)result; } -sc_err_t sc_timer_set_wdog_pre_timeout(sc_ipc_t ipc, - sc_timer_wdog_time_t pre_timeout) +sc_err_t sc_timer_set_rtc_alarm(sc_ipc_t ipc, uint16_t year, uint8_t mon, + uint8_t day, uint8_t hour, uint8_t min, uint8_t sec) { sc_rpc_msg_t msg; uint8_t result; RPC_VER(&msg) = SC_RPC_VERSION; RPC_SVC(&msg) = SC_RPC_SVC_TIMER; - RPC_FUNC(&msg) = TIMER_FUNC_SET_WDOG_PRE_TIMEOUT; - RPC_U32(&msg, 0) = pre_timeout; + RPC_FUNC(&msg) = TIMER_FUNC_SET_RTC_ALARM; + RPC_U16(&msg, 0) = year; + RPC_U8(&msg, 2) = mon; + RPC_U8(&msg, 3) = day; + RPC_U8(&msg, 4) = hour; + RPC_U8(&msg, 5) = min; + RPC_U8(&msg, 6) = sec; + RPC_SIZE(&msg) = 3; + + sc_call_rpc(ipc, &msg, false); + + result = RPC_R8(&msg); + return (sc_err_t)result; +} + +sc_err_t sc_timer_set_rtc_calb(sc_ipc_t ipc, int8_t count) +{ + sc_rpc_msg_t msg; + uint8_t result; + + RPC_VER(&msg) = SC_RPC_VERSION; + RPC_SVC(&msg) = SC_RPC_SVC_TIMER; + RPC_FUNC(&msg) = TIMER_FUNC_SET_RTC_CALB; + RPC_I8(&msg, 0) = count; RPC_SIZE(&msg) = 2; sc_call_rpc(ipc, &msg, false); |