diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/remoteproc.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 44e630eb3d94..728d421fffe9 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h | |||
| @@ -324,6 +324,7 @@ struct rproc_mem_entry { | |||
| 324 | }; | 324 | }; |
| 325 | 325 | ||
| 326 | struct rproc; | 326 | struct rproc; |
| 327 | struct firmware; | ||
| 327 | 328 | ||
| 328 | /** | 329 | /** |
| 329 | * struct rproc_ops - platform-specific device handlers | 330 | * struct rproc_ops - platform-specific device handlers |
| @@ -331,12 +332,24 @@ struct rproc; | |||
| 331 | * @stop: power off the device | 332 | * @stop: power off the device |
| 332 | * @kick: kick a virtqueue (virtqueue id given as a parameter) | 333 | * @kick: kick a virtqueue (virtqueue id given as a parameter) |
| 333 | * @da_to_va: optional platform hook to perform address translations | 334 | * @da_to_va: optional platform hook to perform address translations |
| 335 | * @load_rsc_table: load resource table from firmware image | ||
| 336 | * @find_loaded_rsc_table: find the loaded resouce table | ||
| 337 | * @load: load firmeware to memory, where the remote processor | ||
| 338 | * expects to find it | ||
| 339 | * @sanity_check: sanity check the fw image | ||
| 340 | * @get_boot_addr: get boot address to entry point specified in firmware | ||
| 334 | */ | 341 | */ |
| 335 | struct rproc_ops { | 342 | struct rproc_ops { |
| 336 | int (*start)(struct rproc *rproc); | 343 | int (*start)(struct rproc *rproc); |
| 337 | int (*stop)(struct rproc *rproc); | 344 | int (*stop)(struct rproc *rproc); |
| 338 | void (*kick)(struct rproc *rproc, int vqid); | 345 | void (*kick)(struct rproc *rproc, int vqid); |
| 339 | void * (*da_to_va)(struct rproc *rproc, u64 da, int len); | 346 | void * (*da_to_va)(struct rproc *rproc, u64 da, int len); |
| 347 | int (*load_rsc_table)(struct rproc *rproc, const struct firmware *fw); | ||
| 348 | struct resource_table *(*find_loaded_rsc_table)( | ||
| 349 | struct rproc *rproc, const struct firmware *fw); | ||
| 350 | int (*load)(struct rproc *rproc, const struct firmware *fw); | ||
| 351 | int (*sanity_check)(struct rproc *rproc, const struct firmware *fw); | ||
| 352 | u32 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); | ||
| 340 | }; | 353 | }; |
| 341 | 354 | ||
| 342 | /** | 355 | /** |
| @@ -390,7 +403,6 @@ enum rproc_crash_type { | |||
| 390 | * @priv: private data which belongs to the platform-specific rproc module | 403 | * @priv: private data which belongs to the platform-specific rproc module |
| 391 | * @ops: platform-specific start/stop rproc handlers | 404 | * @ops: platform-specific start/stop rproc handlers |
| 392 | * @dev: virtual device for refcounting and common remoteproc behavior | 405 | * @dev: virtual device for refcounting and common remoteproc behavior |
| 393 | * @fw_ops: firmware-specific handlers | ||
| 394 | * @power: refcount of users who need this rproc powered up | 406 | * @power: refcount of users who need this rproc powered up |
| 395 | * @state: state of the device | 407 | * @state: state of the device |
| 396 | * @lock: lock which protects concurrent manipulations of the rproc | 408 | * @lock: lock which protects concurrent manipulations of the rproc |
| @@ -406,11 +418,11 @@ enum rproc_crash_type { | |||
| 406 | * @index: index of this rproc device | 418 | * @index: index of this rproc device |
| 407 | * @crash_handler: workqueue for handling a crash | 419 | * @crash_handler: workqueue for handling a crash |
| 408 | * @crash_cnt: crash counter | 420 | * @crash_cnt: crash counter |
| 409 | * @crash_comp: completion used to sync crash handler and the rproc reload | ||
| 410 | * @recovery_disabled: flag that state if recovery was disabled | 421 | * @recovery_disabled: flag that state if recovery was disabled |
| 411 | * @max_notifyid: largest allocated notify id. | 422 | * @max_notifyid: largest allocated notify id. |
| 412 | * @table_ptr: pointer to the resource table in effect | 423 | * @table_ptr: pointer to the resource table in effect |
| 413 | * @cached_table: copy of the resource table | 424 | * @cached_table: copy of the resource table |
| 425 | * @table_sz: size of @cached_table | ||
| 414 | * @has_iommu: flag to indicate if remote processor is behind an MMU | 426 | * @has_iommu: flag to indicate if remote processor is behind an MMU |
| 415 | */ | 427 | */ |
| 416 | struct rproc { | 428 | struct rproc { |
| @@ -419,9 +431,8 @@ struct rproc { | |||
| 419 | const char *name; | 431 | const char *name; |
| 420 | char *firmware; | 432 | char *firmware; |
| 421 | void *priv; | 433 | void *priv; |
| 422 | const struct rproc_ops *ops; | 434 | struct rproc_ops *ops; |
| 423 | struct device dev; | 435 | struct device dev; |
| 424 | const struct rproc_fw_ops *fw_ops; | ||
| 425 | atomic_t power; | 436 | atomic_t power; |
| 426 | unsigned int state; | 437 | unsigned int state; |
| 427 | struct mutex lock; | 438 | struct mutex lock; |
| @@ -437,11 +448,11 @@ struct rproc { | |||
| 437 | int index; | 448 | int index; |
| 438 | struct work_struct crash_handler; | 449 | struct work_struct crash_handler; |
| 439 | unsigned int crash_cnt; | 450 | unsigned int crash_cnt; |
| 440 | struct completion crash_comp; | ||
| 441 | bool recovery_disabled; | 451 | bool recovery_disabled; |
| 442 | int max_notifyid; | 452 | int max_notifyid; |
| 443 | struct resource_table *table_ptr; | 453 | struct resource_table *table_ptr; |
| 444 | struct resource_table *cached_table; | 454 | struct resource_table *cached_table; |
| 455 | size_t table_sz; | ||
| 445 | bool has_iommu; | 456 | bool has_iommu; |
| 446 | bool auto_boot; | 457 | bool auto_boot; |
| 447 | }; | 458 | }; |
