-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for HiFi4 DSP on openamp_rsc_table sample #60455
Add support for HiFi4 DSP on openamp_rsc_table sample #60455
Conversation
This PR has some dependencies: |
24fe843
to
c2203ad
Compare
Blocked on the open-amp patch. |
@carlocaione how do we update the Zephyr's openamp repo?
|
Correct. You have to sync https://github.com/zephyrproject-rtos/open-amp/ opening a PR and fixing the Zephyr manifest in this PR to point to the new SHA.
Correct. 😄 ok, I can sync the zephyr open-amp repo, but you still have to fix this PR making the Zephyr manifest pointing to the new PR / SHA. Anyway, we have to wait for the Open-AMP PR to be merged. |
FYI |
@@ -29,6 +29,9 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC | |||
config SYS_CLOCK_TICKS_PER_SEC | |||
default 50000 | |||
|
|||
config IPM_IMX_REV2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? I expect that IPM_IMX_REV2
should be enabled when mailbox0
is status=okay
and CONFIG_IPM=y
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is possible, you're right.
I removed the commit that was adding this config.
4e388e5
to
b1ac483
Compare
Add resource_table section in linker script for nxp_adsp_imx8m for inter-process communication. Signed-off-by: Iuliana Prodan <[email protected]>
Add mailbox and interrupt-controller nodes used for inter-process communication. Add also the dt binding for the interrupt-controller. For now, this is used just to fix some compile errors, since the mailbox requires an interrupt-controller. For DSP, we have a direct interrupt line to the core. Signed-off-by: Iuliana Prodan <[email protected]>
Add the dts and config overlay for nxp_adsp_imx8m board in order to have the openamp_rsc_table sample working on HiFi4 DSP from i.MX 8M Plus. Signed-off-by: Iuliana Prodan <[email protected]>
While testing openamp_rsc_table sample for HiFi4 DSP from i.MX8MP, realized the stack is not enough. Increase the size based on Thread Analyzer measurements: *** Booting Zephyr OS build zephyr-v3.4.0-971-g9415baf2c211 *** Starting application threads! OpenAMP[remote] linux responder demo started OpenAMP[remote] Linux sample client responder started OpenAMP[remote] Linux tty responder started [00:00:00.020,000] <dbg> openamp_rsc_table: mailbox_notify: mailbox_notify: msg received [00:00:00.024,000] <dbg> openamp_rsc_table: mailbox_notify: mailbox_notify: msg received Thread analyze: 0x9240c5a0 : STACK: unused 240 usage 1296 / 1536 (84 %); CPU: 10% : Total CPU cycles used: 3388523 0x9240c628 : STACK: unused 240 usage 784 / 1024 (76 %); CPU: 10% : Total CPU cycles used: 4086621 0x9240c6b0 : STACK: unused 408 usage 616 / 1024 (60 %); CPU: 7% : Total CPU cycles used: 3553673 0x9240c738 : STACK: unused 152 usage 872 / 1024 (85 %); CPU: 44% : Total CPU cycles used: 25529572 0x9240c7c0 : STACK: unused 352 usage 672 / 1024 (65 %); CPU: 21% : Total CPU cycles used: 13742359 0x9240c888 : STACK: unused 936 usage 88 / 1024 (8 %); CPU: 0% : Total CPU cycles used: 0 ISR0 : STACK: unused 1536 usage 512 / 2048 (25 %) Signed-off-by: Iuliana Prodan <[email protected]>
Update open-amp repository with new sha. Signed-off-by: Iuliana Prodan <[email protected]>
b1ac483
to
8d1e6a6
Compare
Hi, Hope you are well. I would like to test “zephyr_openamp_rsc_table” on IMX8MP-EVK. In the first step I compiled the code: _**xxxx@LinuxForiMX:~/nxp/Repositories/DSP_Zephyr/zephyr$ west build -p always -b nxp_adsp_imx8m samples/subsys/ipc/openamp_rsc_table -- Board: imx8mp_evk, qualifiers: mimx8ml8/adsp warning: PRINTK (defined at subsys/debug/Kconfig:204) was assigned the value 'n' but got the value Parsing /home/xxxx/nxp/Repositories/DSP_Zephyr/zephyr/zephyr/Kconfig [3/189] Generating include/generated/version.h Then when I load the elf file on DSP I am receiving the error and ttyRPMGx was not created: On DSP at first I couldn't receive log then I change LOG_INFO to printf. Do you have any idea in this regard? Thank you, |
-2 means
This means that the file path you provided is not correct. I think first line should read: echo -n "imx/zephyr/zephyr_openamp_rsc_table.elf" > /sys/class/..../firmware" Cc: @iuliana-prodan Later edit: or maybe your commands are OK but the firmware elf file is not in the correct location in the rootfs. |
Thank you for your reply. I think my command line is correct as you see when I use your suggested command I receive "No such file or directory" error. root@imx8mp-lpddr4-evk: As you see in the image, it seems that the elf is loaded into DSP and I am receiving the initial log in DSP side (PuTTY COM11). I checked the openamp_rsc_table and based on the DSP log, it seems that DSP crashes in the first thread and two other threads are not executed: int main(void) |
@majidBahmanigbt I've checked on latest Zephyr and as you, I can't see any logging messages.
but still no messages. So, I've changed some Be sure you follow all the steps from here: https://www.nxp.com/docs/en/application-note/AN13970.pdf In order for the TTY sample to work, you have to probe the
Here's Zephyr output:
You can see above, what Linux Kernel and Zephyr versions I've used. The |
Thank you for your explanations. Yes, I did the steps by: https://www.nxp.com/docs/en/application-note/AN13970.pdf It seems that the Linux version is different. I use real-time edge https://github.com/nxp-real-time-edge-sw/meta-real-time-edge. And I have enabled "Fully Preemptible Kernel". Please give me time to test more. If the problem comes from Linux version, do you know if there is any way to solve it? root@imx8mp-lpddr4-evk: |
Hi,
In the above function rproc_virtio_get_status(vdev) is always return 0 and stuck in while loop.
Log output:
The other two threads don’t run because the semaphore has locked them, and they wait for the first thread to finish. The only problem is that for some reason “rproc_virtio_wait_remote_ready()” stocks in a loop. I have also check the dsp reserved memory address and size in both Linux and Zephyr device tree and they are equal. However, about other register values I don't have any idea if they are correct specially for VRING_TX_ADDRESS and VRING_RX_ADDRESS. Could you please check my register value in the log? I would really appreciate it if you had any idea what can make this problem. |
I had a similar problem. |
Hi, After a lot of test, I finally found that the problem is in my outdated imx_dsp_rproc.c kernel module. I found and apply your modification in DSP kernel module Many thanks for you help. |
@majidBahmanigbt Glad that you finally find the solution! May I ask what kind of project are you working on that involves the HIFI4 DSP? This can helps us at NXP understanding customer's needs and plan ahead for next features. |
Well... Our products should meet some real-time tight deadlines. I am investigating DSP to take advantage of this core for reducing some loads on the main cores IMX8MP (CA53 and CM7). Thank you for your support. |
I have another question but I don't know here is a right place to ask. According to IMX8MPRM.pdf, there is a messaging unit between CM7 and DSP (MU_3). Thanks |
With this patchset we can run
openamp_rsc_table
sample on HiFi4 DSP from i.MX8MP.We run Linux on Cortex A53 and Zephyr on HiFi4.
Compile the sample with:
west build -p always -b nxp_adsp_imx8m samples/subsys/ipc/openamp_rsc_table
The firmware is loaded on DSP from Linux, using remoteproc: