NXP MCU 技术william hill官网
直播中

王雪

7年用户 959经验值
私信 关注
[问答]

如何在Toradex (Verdin) 的开发板上使用Linux remoteproc和i.MX8MP?

我正在尝试在 Toradex (Verdin) 的开发板上使用 Linux remoteproc 和 i.MX8MP,在 M7 内核上运行 Zephyr 应用程序。
我正在使用这个设备树来启用 remoteproc/rpmsg:
```
#include  
#include
/ {
别名 {
i2c0 = &i2c1;
i2c1 = &i2c2;
i2c2 = &i2c_rpbus_3;
};
保留内存 {
#address-cells = <2>;
#size-cells = <2>;
范围;
/删除节点/ linux,cma;
m4_reserved: m4@0x80000000 {
无地图;
reg = <0 0x80000000 0 0x1000000>;
};
m7_itcm: m4@0x7E0000 {
无地图;
reg = <0 0x7E0000 0 0x20000>;
};
m7_dtcm: m4@0x800000 {
无地图;
reg = <0 0x800000 0 0x20000>;
};
vdev0vring0: vdev0vring0@55000000 {
reg = <0 0x55000000 0 0x8000>;
无地图;
};
vdev0vring1: vdev0vring1@55008000 {
reg = <0 0x55008000 0 0x8000>;
无地图;
};
vdevbuffer: vdevbuffer@55400000 {
compatible = "shared-dma-pool";
reg = <0 0x55400000 0 0x100000>;
无地图;
};
rsc_table: rsc_table@550ff000 {
reg = <0 0x550ff000 0 0x1000>;
无地图;
};
};
imx8mp-cm7 {
兼容=“fsl,imx8mn-cm7”;
rsc-da = <0x55000000>;
时钟=<&clk IMX8MP_CLK_M7_DIV>;
mbox-names = "tx", "rx", "rxdb";
mboxes = <μ 0 1
μ 1 1
μ 3 1>;
内存区域 = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m4_reserved>, <&m7_itcm>, <&m7_dtcm>;
状态=“好的”;
};
};
/*
* 注意:M7 可以使用如下 IP
* ECSPI0/ECSPI2、FLEXCAN、GPIO1/GPIO5、GPT1、I2C3、I2S3、UART4、
* PWM4、SDMA1/SDMA2
*/
&ecspi2 {
status = "disabled";
};
&flexcan1 {
status = "禁用";
};
&flexspi {
status = "禁用";
};
/删除节点/ &i2c3;
&pwm4{
status = "禁用";
};
&sai3 {
status = "禁用";
};
&sdma3{
status = "禁用";
};
&uart4 {
status = "禁用";
};
```
我正在构建 Zephyr 图像
```
west build -p always -b mimx8mp_evk_ddr zephyr/samples/philosophers
```
用于哲学家测试应用程序。我更喜欢那个应用程序,因为它不断地将哲学家状态输出到 M 内核的串行控制台。我还为 itcm 构建了应用程序来测试两者。
从 u-boot 提示启动 ddr 或 itcm 的应用程序工作正常。在显示附加到 remoteproc 的正在运行的 M 核心之后启动 Linux:
```
# cat /sys/class/remoteproc/remoteproc0/state
附加
```
停止 M 核心也可以正常工作
```
# echo 停止 >/sys/class/remoteproc/remoteproc0/state ``
`
但是,使用 itcm 或 ddr elf 再次启动 M 内核会在 Linux 中导致页面错误:
对于 ddr:
```
# echo start >/sys/class/remoteproc/remoteproc0/state
[120.544522] remoteproc remoteproc0:启动 imx-rproc
[120.550578] remoteproc remoteproc0:固件是一个 elf32 文件
[120.550596] remoteproc remoteproc0:启动 fw 图像 rproc- imx-rproc-fw,大小 676512
[120.558483] imx-rproc imx8mp-cm7:iommu 不存在
[120.558516] remoteproc remoteproc0:elf 中没有资源表 [120.564240]
imx-rproc imx8mp-cm7:映射内存:0000000091bca557+100 000
[ 120.564283 ] imx-rproc imx8mp-cm7:地图内存:00000000d2321245+8000
[120.564295] imx-rproc imx8mp-cm7:地图内存:00000000c7b96d40+8000 [120.564305] imx-rproc imx8mp-cm7:地图
内存:0 0000000c8f03ea6+1000000
[120.564316]imx-rproc imx8mp-cm7:映射内存:00000000bc20cfac+20000
[120.564327]imx-rproc imx8mp-cm7:映射内存:00000000ea51ea99+20000[120.564339
]remoteproc remoteproc0:ph博士:键入 1 da 0x80000000 memsz 0x6e9c filesz 0x6e9c
[ 120.564349 ] remoteproc remoteproc0: da = 0x80000000 len = 0x6e9c va = 0x00000000b21df214
[ 120.564382] 无法处理虚拟地址 ffff80000c006e5c 处的内核分页请求 [ 120.572359] 内存
中止信息:
[ 120.5751 71] ESR = 0x96000061
[ 120.578363] EC = 0x25: DABT(当前 EL ),IL = 32 位
[120.583692] SET = 0,FnV = 0
[120.586759] EA = 0,S1PTW = 0
[120.589926] FSC = 0x21:对齐错误
[120.593949] 数据中止信息:
[ 120.596841] ISV = 0, ISS = 0x00000061
[ 120.600703] CM = 0, WnR = 1
[ 120.603671] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000049888000
[ 120.6103 84] [ffff80000c006e5c] pgd=100000013ffff003, p4d=100000013ffff003 , pud=100000013fffe003, pmd=0068000080000711
[ 120.621023] 内部错误:糟糕:96000061 [#1] PREEMPT SMP
[ 120.626602] 链接的模块:cfg80211 fsl_jr_uio caam_jr caamkeyblob _desc caamhash_desc caamalg_desc crypto_engine rng_core authenc libdes bluetooth rfkill hid_multitouch crct10dif_ce snd_soc_imx_hdmi sec_mipi_dsim_imx sec_dsim dw_hdmi_cec snd_soc_fsl_sai snd_soc_nau8822 snd_e
[ 120.626672] CPU: 3 PID: 874 Comm: sh Tainted: GO 5.15.77-6.1.0-devel+git.349786b46e61 #1
[ 120.626679] 硬件名称:Verdin 开发板 (DT) 上的 Toradex Verdin iMX8M Plus
[ 120.626682] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 120.626689] pc : __memcpy+0x188/ 0x250
[ 120.626699] lr : rproc_elf_load_segments+0x184/0x260
[ 120.626707] sp : ffff80000b8bbb20
[ 120.626709] x29: ffff80000b8bbb20 x28: 0000000000006e9c x27: 0000000000006e9c
[ 120.626717] x26: 0000000080000000 x25: 00000000000000d4 x24: 0000000000000001
[ 120.626725] x23: ffff0000c11e7000 x22: 0000000000000020 x21: 0000000000000005
[ 120.626732] x20: 0000000000000001 x19: ffff80000bad5054 x18: ffffffffffffffff
[ 120.626740] x17: 303030307830203d x1 6:2061762063396536 x15:72796870655a2067
[ 120.626747] x14: 6e69746f6f42202a x13: 623738663038672d x12: 303635332d302e32
[ 120.626755] x11: 000a2a2a2a206236 x10: 3038343962373866 x9 : 3038672d30363533
[ 120.626763] x8 : 2d302e322e33762d x7 : 72796870657a2064 x6 : 6c69756220534f20
[ 120.626770] x5 : ffff80000c006e9c x4 : ffff80000badbf70 x3 : ffff80000c006e40
[ 120.626778 ] x2:ffffffffffffffcc x1:ffff80000badbf54 x0:ffff80000c000000
[120.626786] 调用跟踪:
[120.626789] __memcpy+0x188/0x250
[120.626794] imx_rproc_elf_load_段+0x20/0x40
[120.779785] rproc_start+0x30/0x168
[120.779795] rproc_boot+0x344/0x5f0
[120.779800 ] state_store+0x44/0x104
[ 120.779805] dev_attr_store+0x18/0x30
[ 120.779812] sysfs_kf_write+0x44/0x54
[ 120.779819] kernfs_fop_write_iter+0x118/0x1ac
[ 120.779825] new_sync_write+0xe8/0x184
[ 120.779831] vfs_write+0x22c/0x290 [ 120.779835
] ksys_write+0x68/0 xf4
[ 120.779839] __arm64_sys_write+0x1c/0x2c
[ 120.779844] invoke_syscall+0x48/0x114
[ 120.779851 ] el0_svc_common.constprop.0+0xd4/0xfc
[ 120.779856] do_el0_svc+0x28/0x90
[ 120.779861] el0_svc+0x28/0x80 [ 120.779867
] el0t_64_sync_handler+0xa4/0x 130 [ 120.779872
] el0t_64_sync+0x1a0/0x1a4
[ 120.779883] 代码:a97e2488 a9032c6a a97f2c8a a904346c (a93c3cae)
[ 120.779888] --- [ 结束跟踪 6d13cbdfead451d0 ]---
```
对于 itcm:
```
# echo start >/sys/class/remoteproc/remoteproc0/state
[86.857238] remoteproc remoteproc0:启动 imx-rproc
[86.881319] remoteproc remoteproc0:固件是一个 elf32 文件
[86.881339] remoteproc remoteproc0:启动 fw 图像 rproc- imx-rproc-fw,大小 676496
[86.889187] imx-rproc imx8mp-cm7:iommu 不存在
[86.889223] remoteproc remoteproc0:elf 中没有资源表 [86.894994]
imx-rproc imx8mp-cm7:映射内存:0000000048d67ebf+100000
[ 86.895044 ] imx-rproc imx8mp-cm7:地图内存:00000000b777ff91+8000
[86.895065] imx-rproc imx8mp-cm7:地图内存:00000000a047c2fb+8000 [86.895077] imx-rproc imx8mp-cm7:地图内存:0000
00001459a6a0+1000000
[86.895201] imx-rproc imx8mp-cm7: 映射内存:00000000b2e789f0+20000
[86.895212] imx-rproc imx8mp-cm7: 映射内存:00000000637ae398+20000 [86.895222
] remoteproc remoteproc0: phd r: 输入 1 da 0x0 memsz 0x6e84 filesz 0x6e84
[ 86.895230 ] remoteproc remoteproc0: da = 0x0 len = 0x6e84 va = 0x00000000db7dc377
[86.895298] remoteproc remoteproc0: phdr: type 1 da 0x6e84 memsz 0x12 filesz 0x12
[86.895304] remoteproc remoteproc0: da = 0x6e84 len = 0x12 va = 0x00000000bdcd6411
[86.895309] remoteproc remoteproc0: phdr: type 1 da 0x6e96 memsz 0x4 filesz 0x4
[86.895315] remoteproc remoteproc0: da = 0x6e96 len = 0x4 va = 0x000000007e8d31ef
[86.895321] remoteproc remoteproc0: phdr: type 1 da 0x2000001 8 内存 0x43c0 文件 0x0
[86.895327] remoteproc remoteproc0:da = 0x20000018 len = 0x43c0 va = 0x0000000037d3ce0e
[86.895380]无法处理虚拟地址 0000000000000000 处的内核空指针取消引用
[86.904206] 内存中止信息:
[ 86.907027] ESR = 0x96000004
[ 86.910101] EC = 0x25: DABT (当前 EL),IL = 32 位
[86.915449] SET = 0,FnV = 0
[86.918519] EA = 0,S1PTW = 0
[86.921672] FSC = 0x04:0 级转换错误
[86.926575] 数据中止信息:
[86.929469] ISV = 0,ISS = 0x00000004
[86.933318] CM = 0,WnR = 0
[86.936287] 用户 pgtable:4k 页,48 位 VA,pgdp = 0000000106616000
[86.942751] [0000000000000 000] pgd=0000000000000000, p4d=0000000000000000
[86.949560] 内部错误:糟糕:96000004 [#1] PREEMPT SMP
[86.955136] 链接的模块:cfg80211 fsl_jr_uio caam_jr caamkeyblob_desc caamhash_desc caamalg_desc crypto_engine rng_core authenc libdes bluetooth rfkill hid_multitouch crct10dif_ce snd_soc_imx_hdmi snd_soc_nau8822 dw_hdmi_cec lm75 ina2xx lontium_lt8912b flexcan snd_soc_fsle [86.955205] CPU:
3 PID: 880 Comm: sh Tainted: GO 5.15.77-6.1.0-devel+git.349786b46e61 #1 [
86.955211] 硬件名称:Verdin 开发板 (DT) 上的 Toradex Verdin iMX8M Plus [ 87.007503
] pstate: a0000005 (NzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[87.007509] pc:__memcpy+0x110/0x250
[87.007519] lr:rproc_start+0x84/0x168
[87.007526] sp:ffff80000db5bbd0
[ 87.007528] x29: ffff80000db5bbd0 x28: ffff0000c175b800 x27: 0000000000000000
[ 87.007536] x26: 0000000000000000 x25: ffff0000c13d8c80 x24: ffff0000c1783f80
[ 87.007544] x23: ffff0000c1048340 x22: ffff0000c1783f80 x21: ffff0000c1048038
[ 87.007551] x20: ffff800009e1d000 x19: ffff0000c1048000 x18: ffffffffffffffff
[ 87.007559 ] x17: 303030307830203d x16: 2061762030633334 x15: 7830203d206e656c
[ 87.007567] x14: ffff800009e1d000 x13: ffff8000099e2500 x12: 0000000000000666
[ 87.007575] x11: 0000000000000222 x10: ffff8000099e2500 x9 : ffff8000099e2500
[ 87.007582] x8 : 00000000ffffefff x7 : ffff800009a3a500 x6 : ffff800009a3a500
[ 87.007590] x5 : ffff800009e1d400 x4 : 0000000000000400 x3 : 0000000000000000
[87.007597] x2:0000000000000400 x1:0000000000000000 x0:ffff800009e1d000
[87.007605]调用跟踪:
[87.007608] __memcpy+0x110/0x250
[87 .007613] rproc_boot+0x344/0x5f0
[ 87.007619] state_store+0x44/0x104
[ 87.007624] dev_attr_store+0x18/0x30
[87.007631] sysfs_kf_write+0x44/0x54
[87.007639] kernfs_fop_write_iter+0x118/0x1ac
[87.007645] new_sync_write+0xe8/0x184 [87.007651
] vfs_write+0x22c/0 x290
[87.007655] ksys_write+0x68/0xf4
[87.007660] __arm64_sys_write+0x1c/0x2c
[87.007664 ] invoke_syscall+0x48/0x114
[87.007671] el0_svc_common.constprop.0+0xd4/0xfc
[87.007676] do_el0_svc+0x28/0x90
[87.007681] el0_svc+0x28/0x80
[ 87.007687] el0t_64_sync_handler+0xa4/0x130
[ 87.007693] el0t_64_sync+0x1a0/0x1a4
[ 87.007701] 代码:cb01000e b4fffc2e eb0201df 540004a3 (a940342 c) [ 87.007706]
---[ 结束跟踪 d0ace529e7c99988 ]---
```

回帖(1)

陈厚合

2023-10-18 09:53:23
x80000000 {compatible = "mmio-sram"; reg = <0x80000000 0x20000>; }; m7_dcode: m4@0x00000000 {compatible = "mmio-sram"; reg = <0x00000000 0x400000>; }; m7_ram: m4@0x20200000 {compatible = "mmio-sram"; reg = <0x20200000 0x20000>; }; m4_lpsr_0: m4_lpsr@0 {compatible = "fsl,imx8mp-m4-lpsr-rproc"; status = "okay"; halt-on-fatal-error = <0>; reg = <0>; mailbox-controller = <⁄soc⁄rpmsg@30b61c00>; vdevs { vdev_m4_0: vdev@0 { reg = <0>; label = "rpmsg-openamp-demo-channel"; remote-endpoint = <⁄rpmsg@0⁄demo-channel>; }; }; }; rpmsg { status = "okay"; }; };```但是,当我启动 M7 内核时,我得到了错误提示:“没有找到 rpmsg_m4 LPSR”。我该如何解决这个问题?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分