IMX8QXP SCFW API permissions pm_reset

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMX8QXP SCFW API permissions pm_reset

781件の閲覧回数
grichards-vt
Contributor I

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

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

698件の閲覧回数
grichards-vt
Contributor I

Hi Zhiming

Okay, thanks. I was hoping to pass over control for just that one function. There are other functions that are held in SC_R_SYSTEM that I would not like to pass access to such as writing to the fuses

Is there a standard way of allowing a reset to be triggered from Linux? From reading it seems only by passing this SC_R_SYSTEM or by using the watchdog. I will investigate the watchdog however this seems a bit over the top for our use case

Kind regards

George

0 件の賞賛
返信

710件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @grichards-vt 

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.

-->It is not possible to support this operation, and if the reset can be controlled without SC_R_SYSTEM , then there would be no value in SCFW's existence.

 

Best Regards

Zhiming

0 件の賞賛
返信