From 8fa9a67cc4938ce6c2c1c09a2d0c9e3f7dcd835c Mon Sep 17 00:00:00 2001 From: Ranjani Vaidyanathan Date: Mon, 28 Aug 2017 19:16:33 -0500 Subject: Update to the latest SCFW API. Signed-off-by: Ranjani Vaidyanathan --- plat/freescale/common/include/sci/svc/pad/api.h | 246 +++++++++++++----------- 1 file changed, 136 insertions(+), 110 deletions(-) mode change 100644 => 100755 plat/freescale/common/include/sci/svc/pad/api.h (limited to 'plat/freescale/common/include/sci/svc/pad') diff --git a/plat/freescale/common/include/sci/svc/pad/api.h b/plat/freescale/common/include/sci/svc/pad/api.h old mode 100644 new mode 100755 index fb6e78c1..c57b48a0 --- a/plat/freescale/common/include/sci/svc/pad/api.h +++ b/plat/freescale/common/include/sci/svc/pad/api.h @@ -42,7 +42,11 @@ * info on these can be found in the associated Reference Manual. * * Pads are managed as a resource by the Resource Manager (RM). They have - * assigned owners and only the owners can configure the pads. + * assigned owners and only the owners can configure the pads. Some of the + * pads are reserved for use by the SCFW itself and this can be overriden + * with the implementation of board_config_sc(). Additionally, pads may + * be assigned to various other partitions via SCD or via the implementation + * of board_system_config(). * * @{ */ @@ -61,7 +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 */ +/*@}*/ + +/*! + * @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 */ +/*@}*/ + +/*! + * @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 */ +/*@}*/ + +/*! + * @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) */ +/*@}*/ + +/*! + * @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 */ +/*@}*/ + +/*! + * @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 */ /*@}*/ /* Types */ @@ -73,13 +149,7 @@ * when the output is not driven. The IN options are less common and * force an input connection even when driving the output. */ -typedef enum sc_pad_config_e -{ - SC_PAD_CONFIG_NORMAL = 0, /*!< Normal */ - SC_PAD_CONFIG_OD = 1, /*!< Open Drain */ - SC_PAD_CONFIG_OD_IN = 2, /*!< Open Drain and input */ - SC_PAD_CONFIG_OUT_IN = 3 /*!< Output and input */ -} sc_pad_config_t; +typedef uint8_t sc_pad_config_t; /*! * This type is used to declare a pad low-power isolation config. @@ -87,84 +157,30 @@ typedef enum sc_pad_config_e * an output pad is directly determined by another input pad. The * other two are only used when SW wants to directly contol isolation. */ -typedef enum sc_pad_iso_e -{ - SC_PAD_ISO_OFF = 0, /*!< ISO latch is transparent */ - SC_PAD_ISO_EARLY = 1, /*!< Follow EARLY_ISO */ - SC_PAD_ISO_LATE = 2, /*!< Follow LATE_ISO */ - SC_PAD_ISO_ON = 3 /*!< ISO latched data is held */ -} sc_pad_iso_t; - -/*! - * This type is used to declare a drive strength. Note it is specific - * to 28LPP. - */ -typedef enum sc_pad_28lpp_dse_e -{ - SC_PAD_28LPP_DSE_x1 = 0, /*!< Drive strength x1 */ - SC_PAD_28LPP_DSE_x4 = 1, /*!< Drive strength x4 */ - SC_PAD_28LPP_DSE_x2 = 2, /*!< Drive strength x2 */ - SC_PAD_28LPP_DSE_x6 = 3 /*!< Drive strength x6 */ -} sc_pad_28lpp_dse_t; +typedef uint8_t sc_pad_iso_t; /*! * This type is used to declare a drive strength. Note it is specific * to 28FDSOI. Also note that valid values depend on the pad type. */ -typedef enum sc_pad_28fdsio_dse_e -{ - SC_PAD_28FDSOI_DSE_18V_1MA = 0, /*!< Drive strength of 1mA for 1.8v */ - SC_PAD_28FDSOI_DSE_18V_2MA = 1, /*!< Drive strength of 2mA for 1.8v */ - SC_PAD_28FDSOI_DSE_18V_4MA = 2, /*!< Drive strength of 4mA for 1.8v */ - SC_PAD_28FDSOI_DSE_18V_6MA = 3, /*!< Drive strength of 6mA for 1.8v */ - SC_PAD_28FDSOI_DSE_18V_8MA = 4, /*!< Drive strength of 8mA for 1.8v */ - SC_PAD_28FDSOI_DSE_18V_10MA = 5, /*!< Drive strength of 10mA for 1.8v */ - SC_PAD_28FDSOI_DSE_18V_12MA = 6, /*!< Drive strength of 12mA for 1.8v */ - SC_PAD_28FDSOI_DSE_33V_2MA = 0, /*!< Drive strength of 2mA for 3.3v */ - SC_PAD_28FDSOI_DSE_33V_4MA = 1, /*!< Drive strength of 4mA for 3.3v */ - SC_PAD_28FDSOI_DSE_33V_8MA = 2, /*!< Drive strength of 8mA for 3.3v */ - SC_PAD_28FDSOI_DSE_33V_12MA = 3, /*!< Drive strength of 12mA for 3.3v */ - SC_PAD_28FDSOI_DSE_33V_HS = 7, /*!< High-speed drive strength for 1.8v */ - SC_PAD_28FDSOI_DSE_DV_LOW = 0, /*!< Low drive strength for dual volt */ - SC_PAD_28FDSOI_DSE_DV_HIGH = 1 /*!< High drive strength for dual volt */ -} sc_pad_28fdsoi_dse_t; +typedef uint8_t sc_pad_28fdsoi_dse_t; /*! * This type is used to declare a pull select. Note it is specific - * to 28LPP. + * to 28FDSOI. */ -typedef enum sc_pad_28lpp_ps_e -{ - SC_PAD_28LPP_PS_PD = 0, /*!< Pull down */ - SC_PAD_28LPP_PS_PU_5K = 1, /*!< 5K pull up */ - SC_PAD_28LPP_PS_PU_47K = 2, /*!< 47K pull up */ - SC_PAD_28LPP_PS_PU_100K = 3 /*!< 100K pull up */ -} sc_pad_28lpp_ps_t; +typedef uint8_t sc_pad_28fdsoi_ps_t; /*! - * This type is used to declare a pull select. Note it is specific - * to 28FDSOI. + * This type is used to declare a pull-up select. Note it is specific + * to 28FDSOI HSIC pads. */ -typedef enum sc_pad_28fdsoi_ps_e -{ - SC_PAD_28FDSOI_PS_KEEPER = 0, /*!< Bus-keeper (only valid for 1.8v) */ - SC_PAD_28FDSOI_PS_PU = 1, /*!< Pull-up */ - SC_PAD_28FDSOI_PS_PD = 2, /*!< Pull-down */ - SC_PAD_28FDSOI_PS_NONE = 3 /*!< No pull (disabled) */ -} sc_pad_28fdsoi_ps_t; +typedef uint8_t sc_pad_28fdsoi_pus_t; /*! * This type is used to declare a wakeup mode of a pad. */ -typedef enum sc_pad_wakeup_e -{ - SC_PAD_WAKEUP_OFF = 0, /*!< Off */ - SC_PAD_WAKEUP_CLEAR = 1, /*!< Clears pending flag */ - SC_PAD_WAKEUP_LOW_LVL = 4, /*!< Low level */ - SC_PAD_WAKEUP_FALL_EDGE = 5, /*!< Falling edge */ - SC_PAD_WAKEUP_RISE_EDGE = 6, /*!< Rising edge */ - SC_PAD_WAKEUP_HIGH_LVL = 7 /*!< High-level */ -} sc_pad_wakeup_t; +typedef uint8_t sc_pad_wakeup_t; /* Functions */ @@ -213,7 +229,8 @@ 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 @@ -270,8 +287,7 @@ 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. @@ -288,8 +304,7 @@ sc_err_t sc_pad_set_wakeup(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_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. @@ -340,8 +355,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); /* @} */ @@ -394,14 +409,11 @@ sc_err_t sc_pad_get(sc_ipc_t ipc, sc_pad_t pad, uint32_t *val); */ /*! - * This function configures the pad control specific to 28LPP. + * This function configures the pad control specific to 28FDSOI. * * @param[in] ipc IPC handle * @param[in] pad pad to configure * @param[in] dse drive strength - * @param[in] sre slew rate - * @param[in] hys hysteresis - * @param[in] pe pull enable * @param[in] ps pull select * * @return Returns an error code (SC_ERR_NONE = success). @@ -413,19 +425,16 @@ 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_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_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); /*! - * This function gets the pad control specific to 28LPP. + * This function gets the pad control specific to 28FDSOI. * * @param[in] ipc IPC handle * @param[in] pad pad to query * @param[out] dse pointer to return drive strength - * @param[out] sre pointer to return slew rate - * @param[out] hys pointer to return hysteresis - * @param[out] pe pointer to return pull enable * @param[out] ps pointer to return pull select * * @return Returns an error code (SC_ERR_NONE = success). @@ -437,9 +446,9 @@ sc_err_t sc_pad_set_gp_28lpp(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_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_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); /*! * This function configures the pad control specific to 28FDSOI. @@ -447,7 +456,10 @@ sc_err_t sc_pad_get_gp_28lpp(sc_ipc_t ipc, sc_pad_t pad, * @param[in] ipc IPC handle * @param[in] pad pad to configure * @param[in] dse drive strength - * @param[in] ps pull select + * @param[in] hys hysteresis + * @param[in] pus pull-up select + * @param[in] pke pull keeper enable + * @param[in] pue pull-up enable * * @return Returns an error code (SC_ERR_NONE = success). * @@ -458,8 +470,10 @@ sc_err_t sc_pad_get_gp_28lpp(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(sc_ipc_t ipc, sc_pad_t pad, - sc_pad_28fdsoi_dse_t dse, sc_pad_28fdsoi_ps_t ps); +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); /*! * This function gets the pad control specific to 28FDSOI. @@ -467,7 +481,10 @@ sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, * @param[in] ipc IPC handle * @param[in] pad pad to query * @param[out] dse pointer to return drive strength - * @param[out] ps pointer to return pull select + * @param[out] hys pointer to return hysteresis + * @param[out] pus pointer to return pull-up select + * @param[out] pke pointer to return pull keeper enable + * @param[out] pue pointer to return pull-up enable * * @return Returns an error code (SC_ERR_NONE = success). * @@ -478,8 +495,10 @@ 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_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); /*! * This function configures the compensation control specific to 28FDSOI. @@ -491,6 +510,7 @@ sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, * @param[in] rasrcp compensation code for PMOS * @param[in] rasrcn compensation code for NMOS * @param[in] nasrc_sel NASRC read select + * @param[in] psw_ovr 2.5v override * * @return Returns an error code (SC_ERR_NONE = success). * @@ -500,23 +520,28 @@ sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad, * - SC_ERR_UNAVAILABLE if process not applicable * * Refer to the SoC [Pad List](@ref PADS) for valid pad values. + * + * Note \a psw_ovr is only applicable to pads supporting 2.5 volt + * 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, - bool nasrc_sel); + uint8_t compen, bool fastfrz, + uint8_t rasrcp, uint8_t rasrcn, + bool nasrc_sel, bool psw_ovr); /*! * This function gets the compensation control specific to 28FDSOI. * * @param[in] ipc IPC handle * @param[in] pad pad to query - * @param[in] compen pointer to return compensation/freeze mode - * @param[in] fastfrz pointer to return fast freeze - * @param[in] rasrcp pointer to return compensation code for PMOS - * @param[in] rasrcn pointer to return compensation code for NMOS - * @param[in] nasrc_sel pointer to return NASRC read select - * @param[in] compok pointer to return compensation status - * @param[in] nasrc pointer to return NASRCP/NASRCN + * @param[out] compen pointer to return compensation/freeze mode + * @param[out] fastfrz pointer to return fast freeze + * @param[out] rasrcp pointer to return compensation code for PMOS + * @param[out] rasrcn pointer to return compensation code for NMOS + * @param[out] nasrc_sel pointer to return NASRC read select + * @param[out] compok pointer to return compensation status + * @param[out] nasrc pointer to return NASRCP/NASRCN + * @param[out] psw_ovr pointer to return the 2.5v override * * @return Returns an error code (SC_ERR_NONE = success). * @@ -528,12 +553,13 @@ 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); + uint8_t *compen, bool *fastfrz, + uint8_t *rasrcp, uint8_t *rasrcn, + bool *nasrc_sel, bool *compok, + uint8_t *nasrc, bool *psw_ovr); /* @} */ #endif /* _SC_PAD_API_H */ /**@}*/ - -- cgit v1.2.3