Skip to content

drivers: remoteproc: backport upstream j784s4evm patches

Summary of Changes

Backport upstream k3_dsp and k3_r5 changes from v6.11 for TI J784S4EVM.

Approved Development Ticket

JIRA: https://issues.redhat.com/browse/RHEL-60788

Testing Notes

I used TI's rpmsg_char_simple utility for testing, plus the following patch:

diff --git a/src/rpmsg_char.c b/src/rpmsg_char.c
index cf4b79f..47a3d95 100644
--- a/src/rpmsg_char.c
+++ b/src/rpmsg_char.c
@@ -257,7 +257,7 @@ static int _rpmsg_char_find_ctrldev(struct rpmsg_char_endpt *ept,
        }
 
        memset(&fpath, 0, sizeof(fpath));
-       sprintf(fpath, "%s/%s/rpmsg", rpath, iter->d_name);
+       sprintf(fpath, "%s/%s", rpath, iter->d_name);
        if (check_dir(fpath)) { 
                fprintf(stderr, "%s: rpmsg directory doesn't exist under %s\n",
                        __func__, ept->rpmsg_dev_name);

The following Kconfig options were used when testing the backport:

CONFIG_TI_K3_DSP_REMOTEPROC=y
CONFIG_TI_K3_R5_REMOTEPROC=y
CONFIG_RPMSG=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_CTRL=y
CONFIG_RPMSG_NS=y
CONFIG_RPMSG_VIRTIO=y

(Compiling as modules would probably work too. I just started building them into the kernel after I ran into module signing issues.)

Once the driver probes, there will probably be errors in the kernel logs caused by missing firmware in /lib/firmware. I loaded firmware with the following (exact process varies between cores and sysfs paths):

# cd $(mktemp -d)
# git clone --branch ti-linux-firmware https://git.ti.com/cgit/processor-firmware/ti-linux-firmware
# cp -rZ ti-linux-firmware/ti-ipc /lib/firmware
# cd /lib/firmware
# head /sys/class/remoteproc/remoteproc3/{name,firmware,state}
==> /sys/class/remoteproc/remoteproc3/name <==
64800000.dsp

==> /sys/class/remoteproc/remoteproc3/firmware <==
j784s4-c71_0-fw

==> /sys/class/remoteproc/remoteproc3/state <==
offline
# ln -sf $PWD/ti-ipc/j784s4/ipc_echo_test_c7x_1_release_strip.xe71 j784s4-c71_0-fw
# echo start >/sys/class/remoteproc3/state

Then to test with rpmsg_char_simple:

# cd ~/ti-rpmsg-char
# git remote get-url origin
https://git.ti.com/cgit/rpmsg/ti-rpmsg-char
# dmesg | grep virtio_rpmsg_bus | grep 'creating channel'
[ 1745.834678] virtio_rpmsg_bus virtio0: creating channel ti.ipc4.ping-pong addr 0xd
[ 1745.835002] virtio_rpmsg_bus virtio0: creating channel rpmsg_chrdev addr 0xe
# grep DSP_C71_0 include/rproc_id.h
        DSP_C71_0 = 8,
# dev_name=ti.ipc4.ping-pong
# remote_port=$((0xd))
# proc_id=8
# rpmsg_char_simple -r $proc_id -d $dev_name -p $remote_port -l 1024 -n 3
Created endpt device rpmsg-char-8-5051, fd = 4 port = 1024
Exchanging 3 messages with rpmsg device rpmsg-char-8-5051 on rproc id 8 ...

Sending message #0: hello there 0!
Received message #0: round trip delay(usecs) = 116728
hello there 0!
Sending message #1: hello there 1!
Received message #1: round trip delay(usecs) = 58087
hello there 1!
Sending message #2: hello there 2!
Received message #2: round trip delay(usecs) = 55652
hello there 2!

Communicated 3 messages successfully on rpmsg-char-8-5051

TEST STATUS: PASSED

Signed-off-by: Jared Kangas jkangas@redhat.com

Edited by Jared Kangas

Merge request reports

Loading