]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/commitdiff
rproc: add rproc_mem resource entry
authorWendy Liang <jliang@xilinx.com>
Mon, 23 Jan 2017 19:39:49 +0000 (11:39 -0800)
committerWendy Liang <jliang@xilinx.com>
Fri, 3 Feb 2017 21:41:22 +0000 (13:41 -0800)
Add fw_rsc_rproc_mem resource entry to tell the host the
remote processor's memory which can be used as shared memory.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/include/openamp/remoteproc.h
lib/include/openamp/rsc_table_parser.h
lib/remoteproc/rsc_table_parser.c

index cf80e9809f10fba1f3d450d5fb85c883e2734081..e76b04fea2214192cff60889283bdd681648ab54 100644 (file)
@@ -112,7 +112,8 @@ enum fw_resource_type {
        RSC_DEVMEM = 1,
        RSC_TRACE = 2,
        RSC_VDEV = 3,
-       RSC_LAST = 4,
+       RSC_RPROC_MEM = 4,
+       RSC_LAST = 5,
 };
 
 #define FW_RSC_ADDR_ANY (0xFFFFFFFFFFFFFFFF)
@@ -311,6 +312,28 @@ struct fw_rsc_vdev {
        struct fw_rsc_vdev_vring vring[0];
 } OPENAMP_PACKED_END;
 
+/**
+ * struct fw_rsc_rproc_mem - remote processor memory
+ * @da: device address
+ * @pa: physical address
+ * @len: length (in bytes)
+ * @reserved: reserved (must be zero)
+ *
+ * This resource entry tells the host to the remote processor
+ * memory that the host can be used as shared memory.
+ *
+ * These request entries should precede other shared resource entries
+ * such as vdevs, vrings.
+ */
+OPENAMP_PACKED_BEGIN
+struct fw_rsc_rproc_mem {
+       uint32_t type;
+       uint32_t da;
+       uint32_t pa;
+       uint32_t len;
+       uint32_t reserved;
+} OPENAMP_PACKED_END;
+
 /**
  * struct remote_proc
  *
index 676e6f263d222cfc93ada589128b5af488477023..0b35d188f6562cd92d6003396b393a310f9e54af 100644 (file)
@@ -48,6 +48,7 @@ int handle_carve_out_rsc(struct remote_proc *rproc, void *rsc);
 int handle_trace_rsc(struct remote_proc *rproc, void *rsc);
 int handle_dev_mem_rsc(struct remote_proc *rproc, void *rsc);
 int handle_vdev_rsc(struct remote_proc *rproc, void *rsc);
+int handle_rproc_mem_rsc(struct remote_proc *rproc, void *rsc);
 int handle_mmu_rsc(struct remote_proc *rproc, void *rsc);
 
 #endif                         /* RSC_TABLE_PARSER_H */
index 9acbe3627282c0d2b964638f4993257cf8677669..30534c63ae78df86f8636a040bf5732b675c82f0 100644 (file)
@@ -36,6 +36,7 @@ rsc_handler rsc_handler_table[] = {
        handle_dev_mem_rsc,
        handle_trace_rsc,
        handle_vdev_rsc,
+       handle_rproc_mem_rsc,
        handle_mmu_rsc
 };
 
@@ -229,6 +230,30 @@ int handle_vdev_rsc(struct remote_proc *rproc, void *rsc)
        return RPROC_SUCCESS;
 }
 
+/**
+ * handle_rproc_mem_rsc
+ *
+ * This function parses rproc_mem resource.
+ * This is the resource for the remote processor
+ * to tell the host the memory can be used as
+ * shared memory.
+ *
+ * @param rproc - pointer to remote remote_proc
+ * @param rsc   - pointer to mmu resource
+ *
+ * @returns - execution status
+ *
+ */
+int handle_rproc_mem_rsc(struct remote_proc *rproc, void *rsc)
+{
+       (void)rproc;
+       (void)rsc;
+
+       /* TODO: the firmware side should handle this resource properly
+        * when it is the master or when it is the remote. */
+       return RPROC_SUCCESS;
+}
+
 /**
  * handle_mmu_rsc
  *