Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[firefly-linux-kernel-4.4.55.git] / drivers / remoteproc / remoteproc_internal.h
index 7bb66482d061d33e41cd9f4e69fb97fe0fa91655..157e762c15714d3c03778edd6ae3df8f68a31bab 100644 (file)
@@ -27,7 +27,8 @@ struct rproc;
 
 /**
  * struct rproc_fw_ops - firmware format specific operations.
- * @find_rsc_table:    finds the resource table inside the firmware image
+ * @find_rsc_table:    find the resource table inside the firmware image
+ * @find_loaded_rsc_table: find the loaded resouce table
  * @load:              load firmeware to memory, where the remote processor
  *                     expects to find it
  * @sanity_check:      sanity check the fw image
@@ -37,6 +38,8 @@ struct rproc_fw_ops {
        struct resource_table *(*find_rsc_table) (struct rproc *rproc,
                                                const struct firmware *fw,
                                                int *tablesz);
+       struct resource_table *(*find_loaded_rsc_table)(struct rproc *rproc,
+                                               const struct firmware *fw);
        int (*load)(struct rproc *rproc, const struct firmware *fw);
        int (*sanity_check)(struct rproc *rproc, const struct firmware *fw);
        u32 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw);
@@ -102,6 +105,16 @@ struct resource_table *rproc_find_rsc_table(struct rproc *rproc,
        return NULL;
 }
 
+static inline
+struct resource_table *rproc_find_loaded_rsc_table(struct rproc *rproc,
+                                const struct firmware *fw)
+{
+       if (rproc->fw_ops->find_loaded_rsc_table)
+               return rproc->fw_ops->find_loaded_rsc_table(rproc, fw);
+
+        return NULL;
+}
+
 extern const struct rproc_fw_ops rproc_elf_fw_ops;
 
 #endif /* REMOTEPROC_INTERNAL_H */