Hang issue when firmware load into M7 via remoteproc in Linux (i.MX8M Plus)

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

Hang issue when firmware load into M7 via remoteproc in Linux (i.MX8M Plus)

ソリューションへジャンプ
5,029件の閲覧回数
Jimmychea
Contributor III

Experienced hang issue when firmware loading into M7 via remoteproc in Linux.

Initial setup in uboot

$ setenv fdtfile imx8mp-evk-rpmsg.dtb

$ saveenv

 

Issue reproduce steps :

$ echo -n /lib/firmware/ > /sys/module/firmware_class/parameters/path

$ echo -n imx8mp_m7_TCM_hello_world.elf > /sys/class/remoteproc/remoteproc0/firmware

$ echo start > /sys/class/remoteproc/remoteproc0/state

Issue happened... can refer to picture attached.

ラベル(2)
0 件の賞賛
返信
1 解決策
4,978件の閲覧回数
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Jimmychea 

I hope you are doing well.
 
Please refer to the below note in  AN5317.
 
For i.MX 8M platforms, the root clock for M7/M4 must be kept always enabled by Linux to load the firmware code and start Cortex M7/M4. By default, NXP Linux BSP keeps the root clock enabled for the M core when it is started from U-Boot. 
Otherwise, if you need to first start the M core from the Linux booting phase, the clock driver (drivers/clk/imx/clk-composite-8m.c) must be updated to always skip the gate registration to keep the root clock always enabled for the M core.
 
prepare_mcore is used to indicate to linux that the m4 core is booted.
 
One can edit bsp_bootcmd to run prepare_mcore in /include/configs/imx8mp_evk.h
 
Thanks & Regards,
Sanket Parekh

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
4,996件の閲覧回数
Jimmychea
Contributor III

it's working. But wondering why required to run the command "run prepare_mcore", i can't find this in any documents. Can you explain on this ? And also how to make it to auto run when booting ? Thanks

0 件の賞賛
返信
4,979件の閲覧回数
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Jimmychea 

I hope you are doing well.
 
Please refer to the below note in  AN5317.
 
For i.MX 8M platforms, the root clock for M7/M4 must be kept always enabled by Linux to load the firmware code and start Cortex M7/M4. By default, NXP Linux BSP keeps the root clock enabled for the M core when it is started from U-Boot. 
Otherwise, if you need to first start the M core from the Linux booting phase, the clock driver (drivers/clk/imx/clk-composite-8m.c) must be updated to always skip the gate registration to keep the root clock always enabled for the M core.
 
prepare_mcore is used to indicate to linux that the m4 core is booted.
 
One can edit bsp_bootcmd to run prepare_mcore in /include/configs/imx8mp_evk.h
 
Thanks & Regards,
Sanket Parekh

0 件の賞賛
返信
5,002件の閲覧回数
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @Jimmychea 

I hope you are doing well.
 
Please make sure that you have referred to 9.1 i.MX Linux RPROC support in AN5317.
and reserved TCM in dts as below.
 
m7_itcm: m4@0x7E0000 {
       no-map;
       reg = <0 0x7E0000 0 0x20000>;
 };

m7_dtcm: m4@0x800000 {
        no-map;
        reg = <0 0x800000 0 0x20000>;
};
 
Please add the above nodes in dts as shown in 9.1 i.MX Linux RPROC support in AN5317.
 
Please make sure that you have followed the below steps in u-boot cmd.
 
=> setenv fdtfile imx8mp-evk-rpmsg.dtb
=> saveenv
=> run prepare_mcore
 
Please mention the BSP version for further debugging.
 
Thanks & Regards,
Sanket Parekh
0 件の賞賛
返信
4,454件の閲覧回数
maryellenmclaug
Contributor II

Hi @Sanket_Parekh 

Do we also need the code changes described in AN12225

Section 5.2.  My M7 just uses ECSPI-1.  So I tried that code change but with the following in /drivers/clk/imx/clk-imx8mp.c

  clk_prepare_enable(clks[IMX8MP_CLK_M4_CG]->clk);
  clk_prepare_enable(clks[IMX8MP_CLK_M7_CORE]->clk);
  clk_prepare_enable(clks[IMX8MP_CLK_ECSPI1]->clk);

 

And the kernel hung.   Do I not need the IMX8MP_CLK_M7_CORE? 

0 件の賞賛
返信