zephyr: openamp_rsc_table App in imx7d-pico (M4-Side name in Zephyr=pico_pi_m4) I cant see /dev/ttyRPMSG
Hi,
https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/openamp_rsc_table#id6
I stay trying this since last month in my imx7d-pico (m4 side) Zephyr upstream board is pico_pi_m4 using mailbox=mub
I can run Remoteproc and zephyr on this device but without resource table, vrings and mailbox(mu) by NXP: https://www.youtube.com/watch?v=NFyEJXIpq4E
Now I stay trying openamp_rsc_table based on this link below: https://github.com/zephyrproject-rtos/zephyr/pull/60455
I can go up and run everything but the channel and /dev/ttyRPMSG are not created
cat /sys/kernel/debug/remoteproc/remoteproc0/carveout_memories
Carveout memory entry:
Name: vdev0vring0
Virtual address: 7938acbc
DMA address: 0x90000000
Device address: 0x90000000
Length: 0x8000 Bytes
Carveout memory entry:
Name: vdev0vring1
Virtual address: 3a612924
DMA address: 0x90008000
Device address: 0x90008000
Length: 0x8000 Bytes
cat /sys/kernel/debug/remoteproc/remoteproc0/resource_table
Entry 0 is of type vdev
ID 7
Notify ID 0
Device features 0x1
Guest features 0x1
Config length 0x0
Status 0x7
Number of vrings 2
Reserved (should be zero) [0][0]
Vring 0
Device Address 0x90000000
Alignment 16
Number of buffers 8
Notify ID 0
Physical Address 0x0
Vring 1
Device Address 0x90008000
Alignment 16
Number of buffers 8
Notify ID 1
Physical Address 0x0
pico_pi_m4.overlay
/ {
chosen {
/*
* shared memory reserved for the inter-processor communication
*/
zephyr,ipc_shm = &ocramfake;
zephyr,ipc = &mub;
};
ocramfake: memory@90000000 {
compatible = "mmio-sram";
reg = <0x90000000 0x110000>;
};
};
&mub {
status = "okay";
};
In linux Yocto A7 Side imx7d-pico-pi-qca-m4.dts (file):
/*
* Copyright 2018 TechNexion Ltd.
*
* Author: Tapani Utriainen <tapani@technexion.com>
* Richard Hu <richard.hu@technexion.com>
* Ray Chang <ray.chang@technexion.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include "imx7d-pico-pi-qca.dts"
/ {
memory {
linux,usable-memory = <0x80000000 0x1ff00000>;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
// mailbox_reserved: vrings0@30ab0000 {
// reg = <0x30ab0000 0x10000>;
// no-map;
// };
m4_reserved: m4@90000000 {
reg = <0x90000000 0x100000>;
no-map;
};
vdev0vring0: vdev0vring0@90000000 {
compatible = "shared-dma-pool";
// compatible = "shared-dma-pool";
reg = <0x90000000 0x8000>;
no-map;
};
vdev0vring1: vdev0vring1@90008000 {
compatible = "shared-dma-pool";
// compatible = "shared-dma-pool";
reg = <0x90008000 0x8000>;
no-map;
};
// rsc_table: rsc_table@900ff000 {
// reg = <0x900ff000 0x1000>;
// no-map;
// };
vdev0buffer: vdev0buffer@90010000 {
compatible = "shared-dma-pool";
reg = <0x90010000 0x80000>;
no-map;
};
// cm4tcmcode: cm4tcmcode@0x7f8000 {
// compatible = "shared-dma-pool";
// reg = <0x007f8000 0x8000>;
// no-map;
// };
// cm4sramcode: cm4sramcode@0x900000 {
// compatible = "shared-dma-pool";
// reg = <0x00900000 0x40000>;
// no-map;
// };
};
imx7d-cm4 {
compatible = "fsl,imx7d-cm4";
clocks = <&clks IMX7D_ARM_M4_ROOT_CLK>;
// fsl,auto-boot;
mbox-names = "tx0", "rx0", "rxdb0";
mboxes = <&mub 0 1
&mub 1 1
&mub 3 1>;
// memory-region = <&rpmsg_vrings>, <&cm4tcmcode>, <&cm4sramcode>;
memory-region = <&vdev0buffer>, <&vdev0vring0>, <&vdev0vring1>;
//, <&cm4tcmcode>;
fsl,rproc-auto-boot = <1>;
fsl,rproc-fw-name="zephyr_openamp_rsc_table.elf";
syscon = <&src>;
status = "okay";
};
m4_tcm: tcml@007f8000 {
compatible = "fsl, m4_tcml";
reg = <0x007f8000 0x8000>;
};
gpio-leds {
status = "disabled";
};
};
&adc1 {
status = "disabled";
};
&adc2 {
status = "disabled";
};
&gpt3 {
status = "disabled";
};
&gpt4 {
status = "disabled";
};
&ocram {
reg = <0x00901000 0xf000>;
};
&rpmsg{
vdev-nums = <1>;
memory-region = <&vdev0buffer>;
// memory-region = <&vdev0vring0>, <&vdev0vring1>, <&vdevbuffer>, <&cm4tcmcode>, <&cm4sramcode>;
reg = <0x9fff0000 0x10000>;
status = "okay"; // Tava disabled
};
&uart6 {
status = "disabled";
};
&mub {
status = "okay";
};
&wdog3{
status = "disabled";
};
Why I can`t see vdev0buffer in result of the cat /sys/kernel/debug/remoteproc/remoteproc0/carveout_memories And cat /sys/kernel/debug/remoteproc/remoteproc0/resource_table commands?
Why when I change MAX_RPMSG_NUM_BUFS and MAX_RPMSG_BUF_SIZE from 512 to 256 in virtio_rpmsg_bus.c (file in rpmsg/drivers in my linux kernel), nothing change in Number of buffers 8 in my resource_table?
Edited:
Change CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF=8 to CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF=512 in prj.conf. But not solved.
CONFIG_KERNEL_BIN_NAME="zephyr_openamp_rsc_table"
CONFIG_PRINTK=n
CONFIG_IPM=y
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_HEAP_MEM_POOL_SIZE=1024
CONFIG_OPENAMP=y
CONFIG_OPENAMP_RSC_TABLE_NUM_RPMSG_BUFF=32
CONFIG_OPENAMP_RSC_TABLE=y
CONFIG_OPENAMP_MASTER=n
About this issue
- Original URL
- State: open
- Created 4 months ago
- Comments: 64
@jlh-makeen
Unfortunately, I still don’t have carveout for vdev0buffer And /dev/ttyRPMSG.
pico_pi_m4.overlay
imx7d-pico-pi-qca-m4.dts
@neuberfran
So regarding the DT configs, Zephyr needs to use MU_B 0x30ab0000 and Linux needs to use MU_A 0x30aa0000.
Otherwise you get a ressource conflict.