Hi NXP
I am currently working on a board based on the iMX8QXP_MEK. As part of our update process we sometimes update the boot containers produced by imx-mkimage. Due to this we need to be able to initiate a reset at a lower level to be able to load the new boot container.
I've investigated and it seems like I would need to call the SCFW API sc_pm_reset function but this requires the SC_R_SYSTEM permissions.
I was wondering how feasible it is to create a "ghost" resource that could be used as an extra permission check to allow Linux to initiate this reset without handing over SC_R_SYSTEM.
Something like this
sc_err_t pm_reset(sc_rm_pt_t caller_pt, sc_pm_reset_type_t type)
{
sc_err_t err = SC_ERR_NONE;
/* Bounds check */
BOUND_PT(caller_pt);
ASRT_ERR(type <= SC_PM_RESET_TYPE_BOARD, SC_ERR_PARM);
/* Check permissions */
if(rm_is_sys_access(caller_pt) == SC_FALSE && rm_is_resource_owned(caller_pt, SC_R_POWER_RESET) == SC_FALSE)
{
err = SC_ERR_NOACCESS;
}
/* Do reset */
if (err == SC_ERR_NONE)
{
err = board_reset(type, SC_PM_RESET_REASON_SW, caller_pt);
}
return err;
}
This fails due to the rm_rsrc_map_data value check in rm_check_map_ridx(). The map it's referring to is marked with a do not edit comment inside the relevant mx8qx_mek/board.c
If not, is there any other method you would recommend?
Kind regards
George