Commit 2229d582 authored by Ranjani Vaidyanathan's avatar Ranjani Vaidyanathan Committed by Jason Liu

MLK16263 - Update uboot to the latest SCFW API

Update uboot to the latest SCFW based on commit:
"
commit 129c16e312334af7b07d71d6dccac1cda1808b93
Author: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
Date:   Thu Aug 24 16:50:59 2017 -0500

    Add support to change DRC clock rate.
"
Signed-off-by: default avatarRanjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
parent 593372c1
......@@ -37,10 +37,10 @@ typedef enum pad_func_e
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_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;
......
......@@ -238,23 +238,19 @@ sc_err_t sc_pad_get(sc_ipc_t ipc, sc_pad_t pad, uint32_t *val)
return (sc_err_t) result;
}
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)
{
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_FUNC(&msg) = PAD_FUNC_SET_GP_28FDSOI;
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;
RPC_SIZE(&msg) = 2;
sc_call_rpc(ipc, &msg, false);
......@@ -262,16 +258,15 @@ sc_err_t sc_pad_set_gp_28lpp(sc_ipc_t ipc, sc_pad_t pad,
return (sc_err_t) result;
}
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)
{
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_FUNC(&msg) = PAD_FUNC_GET_GP_28FDSOI;
RPC_U16(&msg, 0) = pad;
RPC_SIZE(&msg) = 2;
......@@ -282,28 +277,26 @@ sc_err_t sc_pad_get_gp_28lpp(sc_ipc_t ipc, sc_pad_t pad,
*dse = RPC_U8(&msg, 0);
if (ps != NULL)
*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(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)
{
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_FUNC(&msg) = PAD_FUNC_SET_GP_28FDSOI_HSIC;
RPC_U16(&msg, 0) = pad;
RPC_U8(&msg, 2) = dse;
RPC_U8(&msg, 3) = ps;
RPC_SIZE(&msg) = 2;
RPC_U8(&msg, 3) = pus;
RPC_U8(&msg, 4) = hys;
RPC_U8(&msg, 5) = pke;
RPC_U8(&msg, 6) = pue;
RPC_SIZE(&msg) = 3;
sc_call_rpc(ipc, &msg, false);
......@@ -311,15 +304,16 @@ sc_err_t sc_pad_set_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad,
return (sc_err_t) result;
}
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)
{
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_FUNC(&msg) = PAD_FUNC_GET_GP_28FDSOI_HSIC;
RPC_U16(&msg, 0) = pad;
RPC_SIZE(&msg) = 2;
......@@ -328,14 +322,20 @@ sc_err_t sc_pad_get_gp_28fdsoi(sc_ipc_t ipc, sc_pad_t pad,
result = RPC_R8(&msg);
if (dse != NULL)
*dse = RPC_U8(&msg, 0);
if (ps != NULL)
*ps = RPC_U8(&msg, 1);
if (pus != NULL)
*pus = RPC_U8(&msg, 1);
if (hys != NULL)
*hys = RPC_U8(&msg, 2);
if (pke != NULL)
*pke = RPC_U8(&msg, 3);
if (pue != NULL)
*pue = RPC_U8(&msg, 4);
return (sc_err_t) result;
}
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)
bool nasrc_sel, bool psw_ovr)
{
sc_rpc_msg_t msg;
uint8_t result;
......@@ -349,6 +349,7 @@ sc_err_t sc_pad_set_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad,
RPC_U8(&msg, 4) = rasrcn;
RPC_U8(&msg, 5) = fastfrz;
RPC_U8(&msg, 6) = nasrc_sel;
RPC_U8(&msg, 7) = psw_ovr;
RPC_SIZE(&msg) = 3;
sc_call_rpc(ipc, &msg, false);
......@@ -359,7 +360,7 @@ 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 *nasrc_sel, bool *compok, uint8_t *nasrc, bool *psw_ovr)
{
sc_rpc_msg_t msg;
uint8_t result;
......@@ -387,6 +388,8 @@ sc_err_t sc_pad_get_gp_28fdsoi_comp(sc_ipc_t ipc, sc_pad_t pad,
*nasrc_sel = RPC_U8(&msg, 5);
if (compok != NULL)
*compok = RPC_U8(&msg, 6);
if (psw_ovr != NULL)
*psw_ovr = RPC_U8(&msg, 7);
return (sc_err_t) result;
}
......
......@@ -37,6 +37,7 @@ typedef enum rm_func_e
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 */
......@@ -45,7 +46,9 @@ typedef enum rm_func_e
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 */
......@@ -53,6 +56,7 @@ typedef enum rm_func_e
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 */
......
......@@ -216,6 +216,25 @@ sc_err_t sc_rm_set_resource_movable(sc_ipc_t ipc, sc_rsrc_t resource_fst,
return (sc_err_t) result;
}
sc_err_t sc_rm_set_subsys_rsrc_movable(sc_ipc_t ipc, sc_rsrc_t resource,
bool movable)
{
sc_rpc_msg_t msg;
uint8_t result;
RPC_VER(&msg) = SC_RPC_VERSION;
RPC_SVC(&msg) = SC_RPC_SVC_RM;
RPC_FUNC(&msg) = RM_FUNC_SET_SUBSYS_RSRC_MOVABLE;
RPC_U16(&msg, 0) = resource;
RPC_U8(&msg, 2) = movable;
RPC_SIZE(&msg) = 2;
sc_call_rpc(ipc, &msg, false);
result = RPC_R8(&msg);
return (sc_err_t) result;
}
sc_err_t sc_rm_set_master_attributes(sc_ipc_t ipc, sc_rsrc_t resource,
sc_rm_spa_t sa, sc_rm_spa_t pa, bool smmu_bypass)
{
......@@ -370,6 +389,30 @@ sc_err_t sc_rm_memreg_alloc(sc_ipc_t ipc, sc_rm_mr_t *mr,
return (sc_err_t) result;
}
sc_err_t sc_rm_memreg_split(sc_ipc_t ipc, sc_rm_mr_t mr,
sc_rm_mr_t *mr_ret, sc_faddr_t addr_start, sc_faddr_t addr_end)
{
sc_rpc_msg_t msg;
uint8_t result;
RPC_VER(&msg) = SC_RPC_VERSION;
RPC_SVC(&msg) = SC_RPC_SVC_RM;
RPC_FUNC(&msg) = RM_FUNC_MEMREG_SPLIT;
RPC_U32(&msg, 0) = addr_start >> 32;
RPC_U32(&msg, 4) = addr_start;
RPC_U32(&msg, 8) = addr_end >> 32;
RPC_U32(&msg, 12) = addr_end;
RPC_U8(&msg, 16) = mr;
RPC_SIZE(&msg) = 6;
sc_call_rpc(ipc, &msg, false);
result = RPC_R8(&msg);
if (mr_ret != NULL)
*mr_ret = RPC_U8(&msg, 0);
return (sc_err_t) result;
}
sc_err_t sc_rm_memreg_free(sc_ipc_t ipc, sc_rm_mr_t mr)
{
sc_rpc_msg_t msg;
......@@ -387,6 +430,29 @@ sc_err_t sc_rm_memreg_free(sc_ipc_t ipc, sc_rm_mr_t mr)
return (sc_err_t) result;
}
sc_err_t sc_rm_find_memreg(sc_ipc_t ipc, sc_rm_mr_t *mr,
sc_faddr_t addr_start, sc_faddr_t addr_end)
{
sc_rpc_msg_t msg;
uint8_t result;
RPC_VER(&msg) = SC_RPC_VERSION;
RPC_SVC(&msg) = SC_RPC_SVC_RM;
RPC_FUNC(&msg) = RM_FUNC_FIND_MEMREG;
RPC_U32(&msg, 0) = addr_start >> 32;
RPC_U32(&msg, 4) = addr_start;
RPC_U32(&msg, 8) = addr_end >> 32;
RPC_U32(&msg, 12) = addr_end;
RPC_SIZE(&msg) = 5;
sc_call_rpc(ipc, &msg, false);
result = RPC_R8(&msg);
if (mr != NULL)
*mr = RPC_U8(&msg, 0);
return (sc_err_t) result;
}
sc_err_t sc_rm_assign_memreg(sc_ipc_t ipc, sc_rm_pt_t pt, sc_rm_mr_t mr)
{
sc_rpc_msg_t msg;
......@@ -519,5 +585,19 @@ bool sc_rm_is_pad_owned(sc_ipc_t ipc, sc_pad_t pad)
return (bool) result;
}
void sc_rm_dump(sc_ipc_t ipc)
{
sc_rpc_msg_t msg;
RPC_VER(&msg) = SC_RPC_VERSION;
RPC_SVC(&msg) = SC_RPC_SVC_RM;
RPC_FUNC(&msg) = RM_FUNC_DUMP;
RPC_SIZE(&msg) = 1;
sc_call_rpc(ipc, &msg, false);
return;
}
/**@}*/
......@@ -226,6 +226,11 @@ sc_err_t sc_pm_get_sys_power_mode(sc_ipc_t ipc, sc_rm_pt_t pt,
* will return an error. Resources set to SC_PM_PW_MODE_ON will reflect the
* power mode of the partition and will change as that changes.
*
* Note some resources are still not accessible even when powered up if bus
* transactions go through a fabric not powered up. Examples of this are
* resources in display and capture subsystems which require the display
* controller or the imaging subsytem to be powered up first.
*
* @see sc_pm_set_sys_power_mode().
*/
sc_err_t sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource,
......
......@@ -332,6 +332,25 @@ sc_err_t sc_rm_assign_resource(sc_ipc_t ipc, sc_rm_pt_t pt,
sc_err_t sc_rm_set_resource_movable(sc_ipc_t ipc, sc_rsrc_t resource_fst,
sc_rsrc_t resource_lst, bool movable);
/*!
* This function flags all of a subsystem's resources as movable
* or not.
*
* @param[in] ipc IPC handle
* @param[in] resource resource to use to identify subsystem
* @param[in] movable movable flag (true) is movable
*
* @return Returns an error code (SC_ERR_NONE = success).
*
* Return errors:
* - SC_ERR_PARM if a function argument is out of range
*
* Note \a resource is used to find the associated subsystem. Only
* resources owned by the caller are set.
*/
sc_err_t sc_rm_set_subsys_rsrc_movable(sc_ipc_t ipc, sc_rsrc_t resource,
bool movable);
/*!
* This function sets attributes for a resource which is a bus master (i.e.
* capable of DMA).
......@@ -490,6 +509,33 @@ sc_err_t sc_rm_get_resource_info(sc_ipc_t ipc, sc_rsrc_t resource,
sc_err_t sc_rm_memreg_alloc(sc_ipc_t ipc, sc_rm_mr_t *mr,
sc_faddr_t addr_start, sc_faddr_t addr_end);
/*!
* This function requests that the SC split a memory region.
*
* @param[in] ipc IPC handle
* @param[in] mr handle of memory region to split
* @param[out] mr_ret return handle for new region; used for
* subsequent function calls
* associated with this region
* @param[in] addr_start start address of region (physical)
* @param[in] addr_end end address of region (physical)
*
* @return Returns an error code (SC_ERR_NONE = success).
*
* Return errors:
* - SC_ERR_PARM if the new memory region is not start/end part of mr,
* - SC_ERR_LOCKED if caller's partition is locked,
* - SC_ERR_PARM if the new memory region spans multiple existing regions,
* - SC_ERR_NOACCESS if caller's partition does not own the memory containing
* the new region,
* - SC_ERR_UNAVAILABLE if memory region table is full (no more allocation
* space)
*
* 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);
/*!
* This function frees a memory region.
*
......@@ -505,6 +551,32 @@ sc_err_t sc_rm_memreg_alloc(sc_ipc_t ipc, sc_rm_mr_t *mr,
*/
sc_err_t sc_rm_memreg_free(sc_ipc_t ipc, sc_rm_mr_t mr);
/*!
* Internal SC function to find a memory region.
*
* @see sc_rm_find_memreg().
*/
/*!
* This function finds a memory region.
*
* @param[in] ipc IPC handle
* @param[out] mr return handle for region; used for
* subsequent function calls
* associated with this region
* @param[in] addr_start start address of region to search for
* @param[in] addr_end end address of region to search for
*
* @return Returns an error code (SC_ERR_NONE = success).
*
* Return errors:
* - SC_ERR_NOTFOUND if region not found,
*
* Searches only for regions owned by the caller. Finds first
* region containing the range specified.
*/
sc_err_t sc_rm_find_memreg(sc_ipc_t ipc, sc_rm_mr_t *mr,
sc_faddr_t addr_start, sc_faddr_t addr_end);
/*!
* This function assigns ownership of a memory region.
*
......@@ -639,6 +711,20 @@ bool sc_rm_is_pad_owned(sc_ipc_t ipc, sc_pad_t pad);
/* @} */
/*!
* @name Debug Functions
* @{
*/
/*!
* This function dumps the RM state for debug.
*
* @param[in] ipc IPC handle
*/
void sc_rm_dump(sc_ipc_t ipc);
/* @} */
#endif /* _SC_RM_API_H */
/**@}*/
......
......@@ -68,6 +68,7 @@
#define SC_1000MHZ 1000000000 /*!< 1GHz */
#define SC_1056MHZ 1056000000 /*!< 1.056GHz */
#define SC_1188MHZ 1188000000 /*!< 1.188GHz */
#define SC_1260MHZ 1260000000 /*!< 1.26GHz */
#define SC_1300MHZ 1300000000 /*!< 1.3GHz */
#define SC_1400MHZ 1400000000 /*!< 1.4GHz */
#define SC_1500MHZ 1500000000 /*!< 1.5GHz */
......@@ -103,6 +104,7 @@
#define SC_960MHZ 960000000 /*!< 960MHz */
#define SC_1056MHZ 1056000000 /*!< 1056MHz */
#define SC_1200MHZ 1200000000 /*!< 1.2GHz */
#define SC_1464MHZ 1464000000 /*!< 1.464GHz */
#define SC_2400MHZ 2400000000 /*!< 2.4GHz */
/*@}*/
......@@ -149,6 +151,7 @@ typedef enum sc_err_e
SC_ERR_NOPOWER = 8, /*!< No power */
SC_ERR_IPC = 9, /*!< Generic IPC error */
SC_ERR_BUSY = 10, /*!< Resource is currently busy/active */
SC_ERR_FAIL = 11, /*!< General I/O failure */
SC_ERR_LAST
} sc_err_t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment