diff options
Diffstat (limited to 'include/linux/remoteproc.h')
-rw-r--r-- | include/linux/remoteproc.h | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 04d04709f2bd..16ad66683ad0 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -100,7 +100,9 @@ struct fw_rsc_hdr { * the remote processor will be writing logs. * @RSC_VDEV: declare support for a virtio device, and serve as its * virtio header. - * @RSC_LAST: just keep this one at the end + * @RSC_LAST: just keep this one at the end of standard resources + * @RSC_VENDOR_START: start of the vendor specific resource types range + * @RSC_VENDOR_END: end of the vendor specific resource types range * * For more details regarding a specific resource type, please see its * dedicated structure below. @@ -111,11 +113,13 @@ struct fw_rsc_hdr { * please update it as needed. */ enum fw_resource_type { - RSC_CARVEOUT = 0, - RSC_DEVMEM = 1, - RSC_TRACE = 2, - RSC_VDEV = 3, - RSC_LAST = 4, + RSC_CARVEOUT = 0, + RSC_DEVMEM = 1, + RSC_TRACE = 2, + RSC_VDEV = 3, + RSC_LAST = 4, + RSC_VENDOR_START = 128, + RSC_VENDOR_END = 512, }; #define FW_RSC_ADDR_ANY (-1) @@ -340,12 +344,26 @@ struct rproc_mem_entry { struct firmware; /** + * enum rsc_handling_status - return status of rproc_ops handle_rsc hook + * @RSC_HANDLED: resource was handled + * @RSC_IGNORED: resource was ignored + */ +enum rsc_handling_status { + RSC_HANDLED = 0, + RSC_IGNORED = 1, +}; + +/** * struct rproc_ops - platform-specific device handlers * @start: power on the device and boot it * @stop: power off the device * @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) + * @handle_rsc: optional platform hook to handle vendor resources. Should return + * 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 * @load: load firmware to memory, where the remote processor * expects to find it @@ -358,6 +376,8 @@ struct rproc_ops { void (*kick)(struct rproc *rproc, int vqid); void * (*da_to_va)(struct rproc *rproc, u64 da, int len); int (*parse_fw)(struct rproc *rproc, const struct firmware *fw); + int (*handle_rsc)(struct rproc *rproc, u32 rsc_type, void *rsc, + int offset, int avail); struct resource_table *(*find_loaded_rsc_table)( struct rproc *rproc, const struct firmware *fw); int (*load)(struct rproc *rproc, const struct firmware *fw); |