Merge drm/drm-next into drm-intel-next
[linux-2.6-microblaze.git] / include / linux / remoteproc.h
index 9e42e90..8b795b5 100644 (file)
@@ -363,6 +363,7 @@ enum rsc_handling_status {
  * @start:     power on the device and boot it
  * @stop:      power off the device
  * @attach:    attach to a device that his already powered up
+ * @detach:    detach from a device, leaving it powered up
  * @kick:      kick a virtqueue (virtqueue id given as a parameter)
  * @da_to_va:  optional platform hook to perform address translations
  * @parse_fw:  parse firmware to extract information (e.g. resource table)
@@ -370,7 +371,9 @@ enum rsc_handling_status {
  * RSC_HANDLED if resource was handled, RSC_IGNORED if not handled and a
  * negative value on error
  * @load_rsc_table:    load resource table from firmware image
- * @find_loaded_rsc_table: find the loaded resouce table
+ * @find_loaded_rsc_table: find the loaded resource table from firmware image
+ * @get_loaded_rsc_table: get resource table installed in memory
+ *                       by external entity
  * @load:              load firmware to memory, where the remote processor
  *                     expects to find it
  * @sanity_check:      sanity check the fw image
@@ -385,6 +388,7 @@ struct rproc_ops {
        int (*start)(struct rproc *rproc);
        int (*stop)(struct rproc *rproc);
        int (*attach)(struct rproc *rproc);
+       int (*detach)(struct rproc *rproc);
        void (*kick)(struct rproc *rproc, int vqid);
        void * (*da_to_va)(struct rproc *rproc, u64 da, size_t len, bool *is_iomem);
        int (*parse_fw)(struct rproc *rproc, const struct firmware *fw);
@@ -392,6 +396,8 @@ struct rproc_ops {
                          int offset, int avail);
        struct resource_table *(*find_loaded_rsc_table)(
                                struct rproc *rproc, const struct firmware *fw);
+       struct resource_table *(*get_loaded_rsc_table)(
+                               struct rproc *rproc, size_t *size);
        int (*load)(struct rproc *rproc, const struct firmware *fw);
        int (*sanity_check)(struct rproc *rproc, const struct firmware *fw);
        u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw);
@@ -510,6 +516,8 @@ struct rproc_dump_segment {
  * @recovery_disabled: flag that state if recovery was disabled
  * @max_notifyid: largest allocated notify id.
  * @table_ptr: pointer to the resource table in effect
+ * @clean_table: copy of the resource table without modifications.  Used
+ *              when a remote processor is attached or detached from the core
  * @cached_table: copy of the resource table
  * @table_sz: size of @cached_table
  * @has_iommu: flag to indicate if remote processor is behind an MMU
@@ -546,6 +554,7 @@ struct rproc {
        bool recovery_disabled;
        int max_notifyid;
        struct resource_table *table_ptr;
+       struct resource_table *clean_table;
        struct resource_table *cached_table;
        size_t table_sz;
        bool has_iommu;
@@ -658,6 +667,7 @@ rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, size_t len,
 
 int rproc_boot(struct rproc *rproc);
 void rproc_shutdown(struct rproc *rproc);
+int rproc_detach(struct rproc *rproc);
 int rproc_set_firmware(struct rproc *rproc, const char *fw_name);
 void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
 void rproc_coredump_using_sections(struct rproc *rproc);