i.MX8MP boot M7 use u-boot cause linux kernel panic

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX8MP boot M7 use u-boot cause linux kernel panic

跳至解决方案
878 次查看
ShaunWei
Contributor I

u-boot patch:

ShaunWei_0-1750660850984.png

kernel panic log:

 

ShaunWei_1-1750660970518.png

SDK version:SDK_24_12_00_MIMX8ML8xxxKZ

Based on the Linux log, it is suspected that there is a resource conflict between SAI3 and M7. However, even when I modified the M7 program to only contain `main(){while(1);}`, the problem still persisted. But if I disabled the SAI3 node in the Linux device tree, both Linux and M7 could work normally. Has anyone encountered a similar problem?

 

 

标记 (1)
0 项奖励
回复
1 解答
805 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @ShaunWei 

Please check your uboot dtsi setting. 

For example, in arch/arm/dts/imx8mp-evk-u-boot.dtsi, need to delete RDC_PDAP_SAI3  and SDMA3 if you want to use SAI3 in Linux.

start-config = <
			    RDC_MDA  RDC_MDA_SDMA3p DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_ENET1_TX DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_ENET1_RX DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_SDMA3b DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_SDMA3_SPBA2 DID1 0x0 0x0
			    RDC_PDAP RDC_PDAP_ENET1 PDAP_D0D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_SAI3  PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_UART4 PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_GPT1  PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_SDMA3 PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_I2C3  PDAP_D1_ACCESS 0x0 0x0
			    RDC_MEM_REGION 22 TCM_START TCM_END MEM_D1_ACCESS
			    RDC_MEM_REGION 39 M4_DDR_START M4_DDR_END MEM_D1_ACCESS
			    0x0      0x0            0x0  0x0 0x0
			  >;
			    /* rdc config when MCU stops
			     * memory:
			     *   TCM    --> domain 0/1 can access (0x7E0000~0x81FFFF)
			     *   DDR    --> domain 0/1 can access (0x80000000~0x81000000)
			     * end.
			     */




Best Regards,
Zhiming

在原帖中查看解决方案

0 项奖励
回复
11 回复数
876 次查看
ShaunWei
Contributor I
and if I change the patch command from "bootcmd=run m7boot; run prepare_mcore; run distro_bootcmd"
to
"bootcmd=run prepare_mcore; run distro_bootcmd"
that is to do not boot M7, the linux kernel also boot successfully.
0 项奖励
回复
870 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @ShaunWei 

Please try to test SDK2.16

Best Regards,
Zhiming

0 项奖励
回复
850 次查看
ShaunWei
Contributor I

Hi Zhiming,

Many thanks for your reply.
I tried the sdk 2.16.100, which is downloads from https://github.com/nxp-mcuxpresso/mcux-sdk,
I use west init and update the whole repo, and build hello world app under "mcuxsdk/examples/evkmimx8mp/demo_apps/hello_world", then rename to eiu_m7.bin that is the name my uboot used, badly the problem is same.
the linux kernel stack log is also same.

Do you have any other debuging suggestions? thanks.

0 项奖励
回复
834 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi,

Which dtb you are using ? imx8mp-evk-rpmsg.dtb? or imx8mp-evk.dtb

Best Regards,
Zhiming

0 项奖励
回复
817 次查看
ShaunWei
Contributor I

The attached file is my dts, It is based on imx8mp-evk-rpmsg.dtb, and have some custom changes. I disabled the rpmsg and imx8mp-cm7 nodes for debugging this issue. 

0 项奖励
回复
814 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @ShaunWei   

After disabling the rpmsg node, does this issue exist? As the hello world demo doesn't support rpmsg feature. This issue should disappear after you disable the rpmsg node. 



Best Regards,
Zhiming

0 项奖励
回复
812 次查看
ShaunWei
Contributor I

After disable rpmsg node and imx8mp-cm7, the issue still exists, I tried this before submitting here. 

Two methods can make the issue disappear:

1. don't boot M7 in uboot, the issue will disapplear, below is my uboot command:

"m7image=eiu_m7.bin\0"

"load_m7image=fatload mmc ${mmcdev}:${mmcpart} 0x80000000 ${m7image};\0"

"m7boot=run load_m7image; bootaux 0x80000000;\0"

"bootcmd=run m7boot; run prepare_mcore; run distro_bootcmd\0"

 

   a. I tried boot one simplest M7 program, just while(1); in main.c, the issue also exists.

   b. I tried to not run load_m7image, just bootaux 0x80000000, this is not a normal usage, just tried to eliminate the influence of the M7 program, and the issue also exists.

2. disable sai3 node in dts, the issue will disappear. But I need sai3 to play sound, this is also the target that I wanted to achieve

 

0 项奖励
回复
809 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @ShaunWei 

No such issue with below commands and imx8mp-evk-rpmsg.dtb

setenv m7image 'hello_world.bin'
setenv load_m7image 'fatload mmc ${mmcdev}:1 0x48000000 ${m7image}; cp.b 0x48000000 0x7e0000 0x20000;'
setenv m7boot 'run prepare_mcore; run load_m7image; bootaux 0x7e0000'
run m7boot

 

Booting with DDR is still testing. Do you need to run M7 on DDR?

Best Regards,
Zhiming

0 项奖励
回复
806 次查看
ShaunWei
Contributor I

Hi Zhiming,

Thank you very much for your prompt reply.

I compared  imx8mp-evk-rpmsg.dtb with my dts. The status of sai@30c30000  is disabled in imx8mp-evk-rpmsg.dtb by default, Would you modify it to "okay" and then test it.

If I disable this sai@30c30000 node in my dts, the linux also works fine. But I need it to play sound

0 项奖励
回复
806 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @ShaunWei 

Please check your uboot dtsi setting. 

For example, in arch/arm/dts/imx8mp-evk-u-boot.dtsi, need to delete RDC_PDAP_SAI3  and SDMA3 if you want to use SAI3 in Linux.

start-config = <
			    RDC_MDA  RDC_MDA_SDMA3p DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_ENET1_TX DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_ENET1_RX DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_SDMA3b DID1 0x0 0x0
			    RDC_MDA  RDC_MDA_SDMA3_SPBA2 DID1 0x0 0x0
			    RDC_PDAP RDC_PDAP_ENET1 PDAP_D0D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_SAI3  PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_UART4 PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_GPT1  PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_SDMA3 PDAP_D1_ACCESS 0x0 0x0
			    RDC_PDAP RDC_PDAP_I2C3  PDAP_D1_ACCESS 0x0 0x0
			    RDC_MEM_REGION 22 TCM_START TCM_END MEM_D1_ACCESS
			    RDC_MEM_REGION 39 M4_DDR_START M4_DDR_END MEM_D1_ACCESS
			    0x0      0x0            0x0  0x0 0x0
			  >;
			    /* rdc config when MCU stops
			     * memory:
			     *   TCM    --> domain 0/1 can access (0x7E0000~0x81FFFF)
			     *   DDR    --> domain 0/1 can access (0x80000000~0x81000000)
			     * end.
			     */




Best Regards,
Zhiming

0 项奖励
回复
743 次查看
ShaunWei
Contributor I

Hi Zhiming,

The problem was solved by modifying imx8mp-evk-u-boot.dtsi, thanks!

0 项奖励
回复