]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/commitdiff
remoteproc: Add support for peers without firmware
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Tue, 17 Nov 2015 10:30:26 +0000 (11:30 +0100)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:45 +0000 (22:01 -0700)
Add support for initiating communication with a peer that does
not carry any firmware package. This is for example useful
when the remote processor already is running.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/include/openamp/remoteproc.h
lib/remoteproc/remoteproc.c

index 3c29fdc97183a59d137572479983b5d6825725ce..315869390f12a28ac8c69c6994b8ae0f1cbe46a9 100644 (file)
@@ -391,6 +391,8 @@ struct rsc_table_info {
  * @param channel_destroyed - callback function for channel deletion
  * @param default_cb        - default callback for channel I/O
  * @param rproc_handle      - pointer to new remoteproc instance
+ * @param init_env          - 1 to initialize environment, 0 not to
+ * @param rpmsg_role        - 1 for rpmsg master,  or 0 for rpmsg slave
  *
  * @param returns - status of execution
  *
@@ -400,7 +402,8 @@ int remoteproc_resource_init(struct rsc_table_info *rsc_info,
                             rpmsg_chnl_cb_t channel_created,
                             rpmsg_chnl_cb_t channel_destroyed,
                             rpmsg_rx_cb_t default_cb,
-                            struct remote_proc **rproc_handle);
+                            struct remote_proc **rproc_handle,
+                            int rpmsg_role);
 
 /**
  * remoteproc_resource_deinit
index bce24f0b114619c33eedfacfde74aef627235d27..c6103c81f8949ae4c936afa9a6de524ded05b17d 100644 (file)
@@ -49,6 +49,7 @@
  * @param channel_destroyed - callback function for channel deletion
  * @param default_cb        - default callback for channel I/O
  * @param rproc_handle      - pointer to new remoteproc instance
+ * @param rpmsg_role        - 1 for rpmsg master, or 0 for rpmsg slave
  *
  * @param returns - status of function execution
  *
@@ -58,11 +59,13 @@ int remoteproc_resource_init(struct rsc_table_info *rsc_info,
                             rpmsg_chnl_cb_t channel_created,
                             rpmsg_chnl_cb_t channel_destroyed,
                             rpmsg_rx_cb_t default_cb,
-                            struct remote_proc **rproc_handle)
+                            struct remote_proc **rproc_handle,
+                            int rpmsg_role)
 {
 
        struct remote_proc *rproc;
        int status;
+       int remote_rpmsg_role;
 
        if (!rsc_info) {
                return RPROC_ERR_PARAM;
@@ -82,11 +85,13 @@ int remoteproc_resource_init(struct rsc_table_info *rsc_info,
                        if (status == RPROC_SUCCESS) {
                                /* Initialize RPMSG "messaging" component */
                                *rproc_handle = rproc;
+                               remote_rpmsg_role = (rpmsg_role == RPMSG_MASTER?
+                                               RPMSG_REMOTE : RPMSG_MASTER);
                                status =
                                    rpmsg_init(NULL, rproc->proc->cpu_id,
                                               &rproc->rdev, channel_created,
                                               channel_destroyed, default_cb,
-                                              RPMSG_MASTER);
+                                              remote_rpmsg_role);
                        } else {
                                status = RPROC_ERR_NO_RSC_TABLE;
                        }