]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/commitdiff
remoteproc: resource table: add fw checksum rsc
authorWendy Liang <jliang@xilinx.com>
Wed, 11 Jan 2017 00:14:49 +0000 (16:14 -0800)
committerWendy Liang <jliang@xilinx.com>
Fri, 3 Feb 2017 21:41:23 +0000 (13:41 -0800)
Add firmware checksum resource type to resource table.
It can be used for the master to check if the remote runs on
the expected firmware if it is still running before it tries
to boot the remote.

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 e76b04fea2214192cff60889283bdd681648ab54..95f5d190b2be8bdad39403cfd7da8d7d9c1bfbf6 100644 (file)
@@ -113,7 +113,8 @@ enum fw_resource_type {
        RSC_TRACE = 2,
        RSC_VDEV = 3,
        RSC_RPROC_MEM = 4,
        RSC_TRACE = 2,
        RSC_VDEV = 3,
        RSC_RPROC_MEM = 4,
-       RSC_LAST = 5,
+       RSC_FW_CHKSUM = 5,
+       RSC_LAST = 6,
 };
 
 #define FW_RSC_ADDR_ANY (0xFFFFFFFFFFFFFFFF)
 };
 
 #define FW_RSC_ADDR_ANY (0xFFFFFFFFFFFFFFFF)
@@ -334,6 +335,22 @@ struct fw_rsc_rproc_mem {
        uint32_t reserved;
 } OPENAMP_PACKED_END;
 
        uint32_t reserved;
 } OPENAMP_PACKED_END;
 
+/*
+ * struct fw_rsc_fw_chksum - firmware checksum
+ * @algo: algorithm to generate the cheksum
+ * @chksum: checksum of the firmware loadable sections.
+ *
+ * This resource entry provides checksum for the firmware loadable sections.
+ * It is used to check if the remote already runs with the expected firmware to
+ * decide if it needs to start the remote if the remote is already running.
+ */
+OPENAMP_PACKED_BEGIN
+struct fw_rsc_fw_chksum {
+       uint32_t type;
+       uint8_t algo[16];
+       uint8_t chksum[64];
+} OPENAMP_PACKED_END;
+
 /**
  * struct remote_proc
  *
 /**
  * struct remote_proc
  *
index 0b35d188f6562cd92d6003396b393a310f9e54af..0c9929dac6e90c85d4892418df019f2b98738e57 100644 (file)
@@ -49,6 +49,7 @@ 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_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_fw_chksum_rsc(struct remote_proc *rproc, void *rsc);
 int handle_mmu_rsc(struct remote_proc *rproc, void *rsc);
 
 #endif                         /* RSC_TABLE_PARSER_H */
 int handle_mmu_rsc(struct remote_proc *rproc, void *rsc);
 
 #endif                         /* RSC_TABLE_PARSER_H */
index 30534c63ae78df86f8636a040bf5732b675c82f0..cb428254b5ed719609ed413948a9623e6d24a929 100644 (file)
@@ -37,6 +37,7 @@ rsc_handler rsc_handler_table[] = {
        handle_trace_rsc,
        handle_vdev_rsc,
        handle_rproc_mem_rsc,
        handle_trace_rsc,
        handle_vdev_rsc,
        handle_rproc_mem_rsc,
+       handle_fw_chksum_rsc,
        handle_mmu_rsc
 };
 
        handle_mmu_rsc
 };
 
@@ -254,6 +255,27 @@ int handle_rproc_mem_rsc(struct remote_proc *rproc, void *rsc)
        return RPROC_SUCCESS;
 }
 
        return RPROC_SUCCESS;
 }
 
+/*
+ * handle_fw_chksum_rsc
+ *
+ * This function parses firmware checksum resource.
+ *
+ * @param rproc - pointer to remote remote_proc
+ * @param rsc   - pointer to mmu resource
+ *
+ * @returns - execution status
+ *
+ */
+int handle_fw_chksum_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
  *
 /**
  * handle_mmu_rsc
  *