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,028 次查看
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,977 次查看
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,995 次查看
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,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 项奖励
回复
5,001 次查看
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,453 次查看
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 项奖励
回复