]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/ti-rpmsg-char.git/commitdiff
remove ti.ipc4.ping-pong reference master 0.6.6
authorNick Saulnier <nsaulnier@ti.com>
Mon, 26 Feb 2024 16:12:16 +0000 (10:12 -0600)
committerNick Saulnier <nsaulnier@ti.com>
Mon, 26 Feb 2024 16:12:16 +0000 (10:12 -0600)
Resolves
LCPD-37524 ti-rpmsg-char: remove references to ti.ipc4.ping-pong

The Linux userspace ti-rpmsg-char uses rpmsg_chrvdev by default.

ti.ipc4.ping-pong will not work with ti-rpmsg-char without modifications to the
rpmsg char driver. Remove references to ti.ipc4.ping-pong from the ti-rpmsg-char
project to prevent confusion.

Signed-off-by: Nick Saulnier <nsaulnier@ti.com>
README
examples/README
examples/rpmsg_char_simple.c
include/rproc_id.h
include/ti_rpmsg_char.h
src/Makefile.am
src/rpmsg_char.c
src/rpmsg_char_internal.h
src/soc.c
src/utils.c

diff --git a/README b/README
index 94de97a1bf51a42d2e94b7397e14cae9430bbbe3..44390ef560d57638438d3f26480acef8db24d169 100644 (file)
--- a/README
+++ b/README
@@ -10,8 +10,9 @@ applications an easy means to open and identify rpmsg character devices
 created by the Linux kernel rpmsg-char driver using the virtio-rpmsg-bus
 transport back-end.
 
-The library currently supports the TI K3 AM65x, J721E and J7200 SoCs, but
-can be easily scaled to support other SoCs.
+The library currently supports the TI K3 AM65x, AM64x, AM62x, AM62Ax, AM62Px,
+J721E, J7200, J721S2, J784S4 and J722S SoCs, but can be easily scaled to
+support other SoCs.
 
 
 2. Sources
index 72caec89d39410b8e750e95498a770ac351a2db9..fad8517bf5adc07f5eb7d7a7e5502c06e41f01e9 100644 (file)
@@ -19,10 +19,7 @@ Usage:
                          (default 14 based on current example firmwares)
 
 Examples:
-1. rpmsg_char_simple -r 2 -d ti.ipc4.ping-pong -p 13
-     Runs the example using device "ti.ipc4.ping-pong" and remote port 13
-     with rproc_id value of 2 (R5F_MAIN0_0), exchanges 100 messages
-2. rpmsg_char_simple -r 4 -n 10
+  rpmsg_char_simple -r 4 -n 10
      Runs the example using default rpmsg device "rpmsg_chrdev",
      remote port 14 with rproc_id value of 4 (R5F_MAIN1_0), exchanges
      10 messages
index 96219b1d35dcee2c486c4a7ed4f8f26f30754ba7..5093d9c0a39d217af00f7bb4f7009fe254ab4942 100644 (file)
@@ -87,7 +87,7 @@ int recv_msg(int fd, int len, char *reply_msg, int *reply_len)
 }
 
 /* single thread communicating with a single endpoint */
-int rpmsg_char_ping(int rproc_id, char *dev_name, int remote_endpt,
+int rpmsg_char_ping(int rproc_id, char *dev_name, unsigned int local_endpt, unsigned int remote_endpt,
                    int num_msgs)
 {
        int ret = 0;
@@ -104,7 +104,7 @@ int rpmsg_char_ping(int rproc_id, char *dev_name, int remote_endpt,
         * remote processor
          */
        sprintf(eptdev_name, "rpmsg-char-%d-%d", rproc_id, getpid());
-       rcdev = rpmsg_char_open(rproc_id, dev_name, remote_endpt,
+       rcdev = rpmsg_char_open(rproc_id, dev_name, local_endpt, remote_endpt,
                                eptdev_name, flags);
         if (!rcdev) {
                perror("Can't create an endpoint device");
@@ -113,8 +113,8 @@ int rpmsg_char_ping(int rproc_id, char *dev_name, int remote_endpt,
         printf("Created endpt device %s, fd = %d port = %d\n", eptdev_name,
                rcdev->fd, rcdev->endpt);
 
-        printf("Exchanging %d messages with rpmsg device ti.ipc4.ping-pong on rproc id %d ...\n\n",
-               num_msgs, rproc_id);
+        printf("Exchanging %d messages with rpmsg device %s on rproc id %d ...\n\n",
+               num_msgs, eptdev_name, rproc_id);
 
        for (i = 0; i < num_msgs; i++) {
                memset(packet_buf, 0, sizeof(packet_buf));
@@ -157,7 +157,8 @@ out:
 
 void usage()
 {
-       printf("Usage: rpmsg_char_simple [-r <rproc_id>] [-n <num_msgs>] [-d <rpmsg_dev_name] [-p <remote_endpt]\n");
+       printf("Usage: rpmsg_char_simple [-r <rproc_id>] [-n <num_msgs>] [-d \
+              <rpmsg_dev_name] [-p <remote_endpt] [-l <local_endpt] \n");
        printf("\t\tDefaults: rproc_id: 0 num_msgs: %d rpmsg_dev_name: NULL remote_endpt: %d\n",
                NUM_ITERATIONS, REMOTE_ENDPT);
 }
@@ -167,11 +168,12 @@ int main(int argc, char *argv[])
        int ret, status, c;
        int rproc_id = 0;
        int num_msgs = NUM_ITERATIONS;
-       int remote_endpt = REMOTE_ENDPT;
+       unsigned int remote_endpt = REMOTE_ENDPT;
+       unsigned int local_endpt = RPMSG_ADDR_ANY;
        char *dev_name = NULL;
 
        while (1) {
-               c = getopt(argc, argv, "r:n:p:d:");
+               c = getopt(argc, argv, "r:n:p:d:l:");
                if (c == -1)
                        break;
 
@@ -188,6 +190,9 @@ int main(int argc, char *argv[])
                case 'd':
                        dev_name = optarg;
                        break;
+               case 'l':
+                       local_endpt = atoi(optarg);
+                       break;
                default:
                        usage();
                        exit(0);
@@ -208,7 +213,7 @@ int main(int argc, char *argv[])
                return ret;
        }
 
-       status = rpmsg_char_ping(rproc_id, dev_name, remote_endpt, num_msgs);
+       status = rpmsg_char_ping(rproc_id, dev_name, local_endpt, remote_endpt, num_msgs);
 
        rpmsg_char_exit();
 
index 4beee88da62be5af656db1388a1c5f2840cd8d1b..a51cb9f830fc0e0f47d3556f122a73df3fab77cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Texas Instruments Incorporated - https://www.ti.com
+ * Copyright (c) 2020-2022 Texas Instruments Incorporated - https://www.ti.com
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -65,6 +65,12 @@ enum rproc_id {
        DSP_C66_1,
        DSP_C71_0,
        M4F_MCU0_0,
+       DSP_C71_1,
+       R5F_MAIN2_0,
+       R5F_MAIN2_1,
+       DSP_C71_2,
+       DSP_C71_3,
+       R5F_WKUP0_0,
        RPROC_ID_MAX,
 };
 
index cb2399857515bad0baf47c935e5a84067bc63658..1f697705028ad216d04986608fa83231ea5f0bee 100644 (file)
@@ -40,7 +40,8 @@ extern "C" {
 #endif
 
 #define RPMSG_DEV_NAME_MAXLEN  32
-
+#define RPMSG_ADDR_ANY                  0xFFFFFFFF
+#define RPMSG_RESERVED_ADDRESSES        (1024)
 /*!
  * @brief Structure returned during rpmsg_char_open
  *
@@ -83,6 +84,9 @@ typedef struct rpmsg_char_dev rpmsg_char_dev_t;
  *                       length for the rpmsg device name is as per the virtio
  *                       rpmsg transport, RPMSG_DEV_NAME_MAXLEN (32 bytes)
  *
+ *  @param      local_endpt rpmsg local end-point address for the rpmsg device
+ *                           to open. Valid value is mandatory
+ *
  *  @param      remote_endpt rpmsg remote end-point address for the rpmsg device
  *                           to open. Valid value is mandatory
  *
@@ -99,8 +103,9 @@ typedef struct rpmsg_char_dev rpmsg_char_dev_t;
  *  @sa         rpmsg_char_close
  */
 rpmsg_char_dev_t *rpmsg_char_open(enum rproc_id id, char *dev_name,
-                                 int remote_endpt, char *eptdev_name,
-                                 int flags);
+                                 unsigned int local_endpt,
+                                 unsigned int remote_endpt,
+                                 char *eptdev_name, int flags);
 
 /*!
  *  @brief      Function to close and delete a previously created local endpoint
index 496aa6b40fad55760a43e0a4bfab08882ad1e1b0..3e6e3c23108c54158d494f527a4cce91a42ba16a 100644 (file)
@@ -8,4 +8,4 @@ libti_rpmsg_char_la_SOURCES = rpmsg_char.c soc.c utils.c
 
 libti_rpmsg_char_la_CFLAGS = -I$(top_srcdir)/include
 
-libti_rpmsg_char_la_LDFLAGS = -version-number 0:3:2 -no-undefined
+libti_rpmsg_char_la_LDFLAGS = -version-number 0:6:6 -no-undefined
index 88cc5dbc92bece93e827a4d07021bdd3e73830bb..e68fd9b120051e363bc7424c72a81032f2cddc1b 100644 (file)
@@ -46,8 +46,6 @@
 #include <sys/stat.h>
 #include <linux/rpmsg.h>
 
-#define RPMSG_ADDR_ANY         0xFFFFFFFF
-
 #include "ti_rpmsg_char.h"
 #include "rpmsg_char_internal.h"
 
@@ -73,7 +71,6 @@ struct rpmsg_char_endpt {
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static bool inited = false;
-static int soc_id = -1;
 static struct soc_rprocs soc_data;
 static struct rpmsg_char_endpt *ghead = NULL;
 static struct rpmsg_char_endpt *gtail = NULL;
@@ -158,6 +155,7 @@ static int _rpmsg_char_find_rproc(struct rpmsg_char_endpt *ept,
        char fpath[512];
        int i;
        int ret = -ENODEV;
+       char dir_name[512];
 
        for (i = 0; i < soc_data.num_rprocs; i++, r++) {
                if (id == r->id)
@@ -190,8 +188,15 @@ static int _rpmsg_char_find_rproc(struct rpmsg_char_endpt *ept,
 
        /* retrieve the dynamically created kernel virtio id */
        memset(&fpath, 0, sizeof(fpath));
-       sprintf(fpath, "%s/remoteproc/remoteproc%u/remoteproc%u#vdev0buffer",
+       sprintf(fpath, "%s/remoteproc/remoteproc%u/", ept->rpath, remoteproc_id);
+       /* check if virtio device is decoupled from remoteproc core */
+       if (get_child_dir_pattern(fpath,"rproc-virtio",dir_name) == 0) {
+               strcat(fpath,dir_name);
+       } else {
+               sprintf(fpath, "%s/remoteproc/remoteproc%u/remoteproc%u#vdev0buffer",
                ept->rpath, remoteproc_id, remoteproc_id);
+       }
+
        ret = get_child_dir_suffix(fpath, "virtio%u", &virtio_id);
        if (ret) {
                if (ret == -ENOENT) {
@@ -209,7 +214,7 @@ static int _rpmsg_char_find_rproc(struct rpmsg_char_endpt *ept,
 }
 
 static int _rpmsg_char_find_ctrldev(struct rpmsg_char_endpt *ept,
-                                   char *dev_name, int remote_port)
+                                   char *dev_name, unsigned int remote_port)
 {
        char virtio[16] = { 0 };
        struct dirent *iter;
@@ -218,6 +223,7 @@ static int _rpmsg_char_find_ctrldev(struct rpmsg_char_endpt *ept,
        char *rpath;
        unsigned int ctrl_id;
        int ret;
+       char ctrl_path[512];
 
        sprintf(virtio, "virtio%u", ept->virtio_id);
        rpath = file_deref_link("/sys/bus/virtio/devices", virtio);
@@ -259,8 +265,45 @@ static int _rpmsg_char_find_ctrldev(struct rpmsg_char_endpt *ept,
                goto chrdev_nodir;
        }
 
-       /* get rpmsg_ctrl id */
-       ret = get_child_dir_suffix(fpath, "rpmsg_ctrl%u", &ctrl_id);
+       /* With refactored rpmsg driver in upstream kernel6.1, rpmsg_ctrl device is under
+        * the virtio directory. And the device number can be different from the
+        * virtio device number and the rpmsg device number.
+        */
+       sprintf(ctrl_path, "virtio%u.rpmsg_ctrl.0.0", ept->virtio_id);
+       dir = opendir(rpath);
+       if (dir) {
+               /*
+                * find a directory that matches the rpmsg_ctrl
+                * form virtio%d.rpmsg_ctrl.0.0
+                */
+               while ((iter = readdir(dir))) {
+                       if (iter->d_type == DT_DIR) {
+                               if (!strcmp(iter->d_name, ctrl_path))
+                                       break;
+                       }
+               }
+               if (iter) {
+                       memset(&fpath, 0, sizeof(fpath));
+                       sprintf(fpath, "%s/%s/rpmsg", rpath, iter->d_name);
+                       if (check_dir(fpath)) {
+                               fprintf(stderr, "%s: rpmsg directory doesn't exist under %s\n",
+                                       __func__, ept->rpmsg_dev_name);
+                               ret = -ENOENT;
+                       } else {
+                               ret = get_child_dir_suffix(fpath, "rpmsg_ctrl%u", &ctrl_id);
+                       }
+               } else {
+                       ret = -ENOENT;
+               }
+       }
+       else  {
+               ret = -errno;
+       }
+
+       /* check for backward compatibility if failed */
+       if (ret)
+               ret = get_child_dir_suffix(fpath, "rpmsg_ctrl%u", &ctrl_id);
+
        if (ret)
                goto chrdev_nodir;
 
@@ -274,14 +317,14 @@ free_rpath:
 }
 
 static int _rpmsg_char_create_eptdev(struct rpmsg_char_endpt *ept,
-                                    char *eptdev_name, int remote_port)
+                                    char *eptdev_name, unsigned int local_port,
+                                    unsigned int remote_port)
 {
        int fd, ret;
        char ctrldev_path[32] = { 0 };
        struct rpmsg_endpoint_info ept_info = { 0 };
 
        sprintf(ctrldev_path, "/dev/rpmsg_ctrl%u", ept->ctrl_id);
-
        fd = open(ctrldev_path, O_RDWR);
        if (fd < 0) {
                fprintf(stderr, "%s: could not open rpmsg_ctrl dev node for id %d\n",
@@ -289,8 +332,15 @@ static int _rpmsg_char_create_eptdev(struct rpmsg_char_endpt *ept,
                return fd;
        }
 
-       /* let kernel dynamically allocate the local end-point */
-       ept_info.src = RPMSG_ADDR_ANY;
+       if ((local_port != RPMSG_ADDR_ANY) && (local_port <
+                                              RPMSG_RESERVED_ADDRESSES)) {
+               fprintf(stderr, "%s: invalid local address %d, should be more \
+                       than %d \n", __func__, local_port,
+                       RPMSG_RESERVED_ADDRESSES);
+               return 1;
+       }
+
+       ept_info.src = local_port;
        ept_info.dst = remote_port;
        sprintf(ept_info.name, "%s", eptdev_name);
 
@@ -323,7 +373,6 @@ static int _rpmsg_char_destroy_eptdev(int fd)
 static int _rpmsg_char_get_rpmsg_id(struct rpmsg_char_endpt *ept,
                                    char *eptdev_name)
 {
-       const struct rproc_map *r = ept->map;
        bool found = false;
        char rpmsg[16] = { 0 };
        char fpath[512];
@@ -358,7 +407,6 @@ static int _rpmsg_char_get_rpmsg_id(struct rpmsg_char_endpt *ept,
 
                if (strcmp(dev_name, eptdev_name))
                        continue;
-
                sscanf(iter->d_name, "rpmsg%u", &ept->rpmsg_id);
                found = true;
                break;
@@ -371,7 +419,6 @@ static int _rpmsg_char_get_rpmsg_id(struct rpmsg_char_endpt *ept,
 
 static int _rpmsg_char_get_local_endpt(struct rpmsg_char_endpt *ept)
 {
-       const struct rproc_map *r = ept->map;
        char fpath[512] = { 0 };
        char rpmsg[16] = { 0 };
        char *rpath;
@@ -413,6 +460,7 @@ static int _rpmsg_char_open_eptdev(struct rpmsg_char_endpt *ept,
        endpt = _rpmsg_char_get_local_endpt(ept);
        if (endpt < 0) {
                _rpmsg_char_destroy_eptdev(efd);
+               fprintf(stdout, "%s: get_local_endpt failed %d \n",__func__,endpt);
                return endpt;
        }
 
@@ -459,7 +507,7 @@ static void _rpmsg_char_cleanup(void)
                next = iter->next;
                ret = rpmsg_char_close(&iter->rcdev);
                if (ret) {
-                       fprintf(stderr, "rpmsg_char_close failed during cleanup, rcdev = 0x%x, ret = %d\n",
+                       fprintf(stderr, "rpmsg_char_close failed during cleanup, rcdev = %p, ret = %d\n",
                                &iter->rcdev, ret);
                }
        }
@@ -503,12 +551,13 @@ static int _rpmsg_char_register_signal_handlers(void)
 }
 
 rpmsg_char_dev_t *rpmsg_char_open(enum rproc_id id, char *dev_name,
-                                 int remote_endpt, char *eptdev_name,
-                                 int flags)
+                                 unsigned int local_endpt,
+                                 unsigned int remote_endpt,
+                                 char *eptdev_name, int flags)
 {
        struct rpmsg_char_endpt *ept = NULL;
        char *def_dev_name = "rpmsg_chrdev";
-       int ret, local_endpt;
+       int ret;
 
        pthread_mutex_lock(&mutex);
 
@@ -544,7 +593,7 @@ rpmsg_char_dev_t *rpmsg_char_open(enum rproc_id id, char *dev_name,
        if (ret)
                goto out;
 
-       ret = _rpmsg_char_create_eptdev(ept, eptdev_name, remote_endpt);
+       ret = _rpmsg_char_create_eptdev(ept, eptdev_name, local_endpt, remote_endpt);
        if (ret)
                goto out;
 
@@ -575,7 +624,7 @@ int rpmsg_char_close(rpmsg_char_dev_t *rcdev)
 
        ept = to_rpmsg_char_endpt(rcdev);
        if (!_list_is_present(ept)) {
-               fprintf(stderr, "%s: invalid handle passed in rcdev = 0x%x\n",
+               fprintf(stderr, "%s: invalid handle passed in rcdev = %p\n",
                        __func__, rcdev);
                ret = -ENOENT;
                goto out;
index 10a09c166daf60a0524b5a3e08c2895472eb86b5..ef7150629a1e1c6686957de74f3261bb4dc671b3 100644 (file)
@@ -56,6 +56,8 @@ int _rpmsg_char_find_soc_family(const char *soc_name, struct soc_rprocs *soc);
 char *find_child_dir_by_name(DIR *parent, char *child_name);
 int get_child_dir_suffix(char *fpath, const char *child_name_pattern,
                         unsigned int *suffix);
+int get_child_dir_pattern(char *fpath, const char *child_name_pattern,
+                        char *dir);
 char *str_join(const char *fmt, ...);
 int file_read_string(char *fpath, char *buf, int size);
 int file_read_value(char *fpath);
index 6f2deba970f03e43bdacd48f67342e6c6f86206d..ec8829dfbfa9e70b5fd2d30a7d57e780f9731b3a 100644 (file)
--- a/src/soc.c
+++ b/src/soc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Texas Instruments Incorporated - https://www.ti.com
+ * Copyright (c) 2020-2022 Texas Instruments Incorporated - https://www.ti.com
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -42,7 +42,7 @@
 #include "rpmsg_char_internal.h"
 
 /* Increment this whenever new SoC data is added */
-#define NUM_SOC_FAMILY 5
+#define NUM_SOC_FAMILY 10
 
 struct soc_data {
        const char *family_name;
@@ -86,9 +86,61 @@ const struct rproc_map am64x_map[] = {
        { .id = M4F_MCU0_0,  .rproc_name = "5000000.m4fss",  },
 };
 
+/* TI K3 J721S2 SoCs */
+const struct rproc_map j721s2_map[] = {
+       { .id = R5F_MCU0_0,  .rproc_name = "41000000.r5f",   },
+       { .id = R5F_MCU0_1,  .rproc_name = "41400000.r5f",   },
+       { .id = R5F_MAIN0_0, .rproc_name = "5c00000.r5f",    },
+       { .id = R5F_MAIN0_1, .rproc_name = "5d00000.r5f",    },
+       { .id = R5F_MAIN1_0, .rproc_name = "5e00000.r5f",    },
+       { .id = R5F_MAIN1_1, .rproc_name = "5f00000.r5f",    },
+       { .id = DSP_C71_0,   .rproc_name = "64800000.dsp",   },
+       { .id = DSP_C71_1,   .rproc_name = "65800000.dsp",   },
+};
+
+
 /* TI K3 AM62x SoCs */
 const struct rproc_map am62x_map[] = {
        { .id = M4F_MCU0_0,  .rproc_name = "5000000.m4fss",  },
+       { .id = R5F_WKUP0_0, .rproc_name = "78000000.r5f",   },
+};
+
+/* TI K3 J784S4 SoCs */
+const struct rproc_map j784s4_map[] = {
+       { .id = R5F_MCU0_0,  .rproc_name = "41000000.r5f",   },
+       { .id = R5F_MCU0_1,  .rproc_name = "41400000.r5f",   },
+       { .id = R5F_MAIN0_0, .rproc_name = "5c00000.r5f",    },
+       { .id = R5F_MAIN0_1, .rproc_name = "5d00000.r5f",    },
+       { .id = R5F_MAIN1_0, .rproc_name = "5e00000.r5f",    },
+       { .id = R5F_MAIN1_1, .rproc_name = "5f00000.r5f",    },
+       { .id = R5F_MAIN2_0, .rproc_name = "5900000.r5f",    },
+       { .id = R5F_MAIN2_1, .rproc_name = "5a00000.r5f",    },
+       { .id = DSP_C71_0,   .rproc_name = "64800000.dsp",   },
+       { .id = DSP_C71_1,   .rproc_name = "65800000.dsp",   },
+       { .id = DSP_C71_2,   .rproc_name = "66800000.dsp",   },
+       { .id = DSP_C71_3,   .rproc_name = "67800000.dsp",   },
+};
+
+/* TI K3 AM62Ax SoCs */
+const struct rproc_map am62ax_map[] = {
+       { .id = R5F_WKUP0_0, .rproc_name = "78000000.r5f",   },
+        { .id = R5F_MCU0_0,  .rproc_name = "79000000.r5f",   },
+       { .id = DSP_C71_0,   .rproc_name = "7e000000.dsp",   },
+};
+
+/* TI K3 AM62Px SoCs */
+const struct rproc_map am62px_map[] = {
+       { .id = R5F_WKUP0_0, .rproc_name = "78000000.r5f",   },
+        { .id = R5F_MCU0_0,  .rproc_name = "79000000.r5f",   },
+};
+
+/* TI K3 J722S SoCs */
+const struct rproc_map j722s_map[] = {
+       { .id = R5F_WKUP0_0, .rproc_name = "78000000.r5f",   },
+       { .id = R5F_MCU0_0,  .rproc_name = "79000000.r5f",   },
+       { .id = R5F_MAIN0_0, .rproc_name = "78400000.r5f",   },
+       { .id = DSP_C71_0,   .rproc_name = "7e000000.dsp",   },
+       { .id = DSP_C71_1,   .rproc_name = "7e200000.dsp",   },
 };
 
 const struct soc_data socs[NUM_SOC_FAMILY] = {
@@ -112,11 +164,36 @@ const struct soc_data socs[NUM_SOC_FAMILY] = {
                .map = am64x_map,
                .num_rprocs = (sizeof(am64x_map) / sizeof(struct rproc_map)),
        },
+       {
+               .family_name = "J721S2",
+               .map = j721s2_map,
+               .num_rprocs = (sizeof(j721s2_map) / sizeof(struct rproc_map)),
+       },
        {
                .family_name = "AM62X",
                .map = am62x_map,
                .num_rprocs = (sizeof(am62x_map) / sizeof(struct rproc_map)),
        },
+       {
+               .family_name = "J784S4",
+               .map = j784s4_map,
+               .num_rprocs = (sizeof(j784s4_map) / sizeof(struct rproc_map)),
+       },
+       {
+               .family_name = "AM62AX",
+               .map = am62ax_map,
+               .num_rprocs = (sizeof(am62ax_map) / sizeof(struct rproc_map)),
+       },
+       {
+               .family_name = "AM62PX",
+               .map = am62px_map,
+               .num_rprocs = (sizeof(am62px_map) / sizeof(struct rproc_map)),
+       },
+       {
+               .family_name = "J722S",
+               .map = j722s_map,
+               .num_rprocs = (sizeof(j722s_map) / sizeof(struct rproc_map)),
+       },
 };
 
 int _rpmsg_char_find_soc_family(const char *name, struct soc_rprocs *soc)
index d506939f5403a3cd26f4166f510ff422cf4d30c3..94a2debf53d9b186268f9862f3ae2f7ea16c7ad7 100644 (file)
@@ -63,6 +63,31 @@ int get_child_dir_suffix(char *fpath, const char *child_name_pattern,
        return ret;
 }
 
+int get_child_dir_pattern(char *fpath, const char *child_name_pattern,
+                        char *dir_name)
+{
+       struct dirent *iter;
+       DIR *parent;
+       int ret = -ENODEV;
+
+       parent = opendir(fpath);
+       if (!parent)
+               return -errno;
+
+       while ((iter = readdir(parent))) {
+               if (iter->d_type == DT_DIR &&
+                       (strncmp(iter->d_name,child_name_pattern,strlen(child_name_pattern))
+                        == 0)) {
+                       strcpy(dir_name,iter->d_name);
+                       ret = 0;
+                       break;
+               }
+       }
+
+       closedir(parent);
+       return ret;
+}
+
 int file_read_string(char *fpath, char *buf, int size)
 {
        int fd, bytes;