remoteproc.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /*
  2. * Remote Processor Framework
  3. *
  4. * Copyright(c) 2011 Texas Instruments, Inc.
  5. * Copyright(c) 2011 Google, Inc.
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * * Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * * Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in
  16. * the documentation and/or other materials provided with the
  17. * distribution.
  18. * * Neither the name Texas Instruments nor the names of its
  19. * contributors may be used to endorse or promote products derived
  20. * from this software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  25. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  26. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  27. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  28. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  29. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  30. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  31. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  32. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef REMOTEPROC_H
  35. #define REMOTEPROC_H
  36. #include <linux/types.h>
  37. #include <linux/mutex.h>
  38. #include <linux/virtio.h>
  39. #include <linux/completion.h>
  40. #include <linux/idr.h>
  41. #include <linux/of.h>
  42. #include <linux/bitops.h>
  43. /**
  44. * struct resource_table - firmware resource table header
  45. * @ver: version number
  46. * @num: number of resource entries
  47. * @reserved: reserved (must be zero)
  48. * @offset: array of offsets pointing at the various resource entries
  49. *
  50. * A resource table is essentially a list of system resources required
  51. * by the remote processor. It may also include configuration entries.
  52. * If needed, the remote processor firmware should contain this table
  53. * as a dedicated ".resource_table" ELF section.
  54. *
  55. * Some resources entries are mere announcements, where the host is informed
  56. * of specific remoteproc configuration. Other entries require the host to
  57. * do something (e.g. allocate a system resource). Sometimes a negotiation
  58. * is expected, where the firmware requests a resource, and once allocated,
  59. * the host should provide back its details (e.g. address of an allocated
  60. * memory region).
  61. *
  62. * The header of the resource table, as expressed by this structure,
  63. * contains a version number (should we need to change this format in the
  64. * future), the number of available resource entries, and their offsets
  65. * in the table.
  66. *
  67. * Immediately following this header are the resource entries themselves,
  68. * each of which begins with a resource entry header (as described below).
  69. */
  70. struct resource_table {
  71. u32 ver;
  72. u32 num;
  73. u32 reserved[2];
  74. u32 offset[0];
  75. } __packed;
  76. /**
  77. * struct fw_rsc_hdr - firmware resource entry header
  78. * @type: resource type
  79. * @data: resource data
  80. *
  81. * Every resource entry begins with a 'struct fw_rsc_hdr' header providing
  82. * its @type. The content of the entry itself will immediately follow
  83. * this header, and it should be parsed according to the resource type.
  84. */
  85. struct fw_rsc_hdr {
  86. u32 type;
  87. u8 data[0];
  88. } __packed;
  89. /**
  90. * enum fw_resource_type - types of resource entries
  91. *
  92. * @RSC_CARVEOUT: request for allocation of a physically contiguous
  93. * memory region.
  94. * @RSC_DEVMEM: request to iommu_map a memory-based peripheral.
  95. * @RSC_TRACE: announces the availability of a trace buffer into which
  96. * the remote processor will be writing logs.
  97. * @RSC_VDEV: declare support for a virtio device, and serve as its
  98. * virtio header.
  99. * @RSC_CUSTOM: a custom resource type that needs to be handled outside
  100. * remoteproc core.
  101. * @RSC_LAST: just keep this one at the end
  102. *
  103. * For more details regarding a specific resource type, please see its
  104. * dedicated structure below.
  105. *
  106. * Please note that these values are used as indices to the rproc_handle_rsc
  107. * lookup table, so please keep them sane. Moreover, @RSC_LAST is used to
  108. * check the validity of an index before the lookup table is accessed, so
  109. * please update it as needed.
  110. */
  111. enum fw_resource_type {
  112. RSC_CARVEOUT = 0,
  113. RSC_DEVMEM = 1,
  114. RSC_TRACE = 2,
  115. RSC_VDEV = 3,
  116. RSC_CUSTOM = 5,
  117. RSC_LAST = 6,
  118. };
  119. #define FW_RSC_ADDR_ANY (-1)
  120. /**
  121. * struct fw_rsc_carveout - physically contiguous memory request
  122. * @da: device address
  123. * @pa: physical address
  124. * @len: length (in bytes)
  125. * @flags: iommu protection flags
  126. * @reserved: reserved (must be zero)
  127. * @name: human-readable name of the requested memory region
  128. *
  129. * This resource entry requests the host to allocate a physically contiguous
  130. * memory region.
  131. *
  132. * These request entries should precede other firmware resource entries,
  133. * as other entries might request placing other data objects inside
  134. * these memory regions (e.g. data/code segments, trace resource entries, ...).
  135. *
  136. * Allocating memory this way helps utilizing the reserved physical memory
  137. * (e.g. CMA) more efficiently, and also minimizes the number of TLB entries
  138. * needed to map it (in case @rproc is using an IOMMU). Reducing the TLB
  139. * pressure is important; it may have a substantial impact on performance.
  140. *
  141. * If the firmware is compiled with static addresses, then @da should specify
  142. * the expected device address of this memory region. If @da is set to
  143. * FW_RSC_ADDR_ANY, then the host will dynamically allocate it, and then
  144. * overwrite @da with the dynamically allocated address.
  145. *
  146. * We will always use @da to negotiate the device addresses, even if it
  147. * isn't using an iommu. In that case, though, it will obviously contain
  148. * physical addresses.
  149. *
  150. * Some remote processors needs to know the allocated physical address
  151. * even if they do use an iommu. This is needed, e.g., if they control
  152. * hardware accelerators which access the physical memory directly (this
  153. * is the case with OMAP4 for instance). In that case, the host will
  154. * overwrite @pa with the dynamically allocated physical address.
  155. * Generally we don't want to expose physical addresses if we don't have to
  156. * (remote processors are generally _not_ trusted), so we might want to
  157. * change this to happen _only_ when explicitly required by the hardware.
  158. *
  159. * @flags is used to provide IOMMU protection flags, and @name should
  160. * (optionally) contain a human readable name of this carveout region
  161. * (mainly for debugging purposes).
  162. */
  163. struct fw_rsc_carveout {
  164. u32 da;
  165. u32 pa;
  166. u32 len;
  167. u32 flags;
  168. u32 reserved;
  169. u8 name[32];
  170. } __packed;
  171. /**
  172. * struct fw_rsc_devmem - iommu mapping request
  173. * @da: device address
  174. * @pa: physical address
  175. * @len: length (in bytes)
  176. * @flags: iommu protection flags
  177. * @reserved: reserved (must be zero)
  178. * @name: human-readable name of the requested region to be mapped
  179. *
  180. * This resource entry requests the host to iommu map a physically contiguous
  181. * memory region. This is needed in case the remote processor requires
  182. * access to certain memory-based peripherals; _never_ use it to access
  183. * regular memory.
  184. *
  185. * This is obviously only needed if the remote processor is accessing memory
  186. * via an iommu.
  187. *
  188. * @da should specify the required device address, @pa should specify
  189. * the physical address we want to map, @len should specify the size of
  190. * the mapping and @flags is the IOMMU protection flags. As always, @name may
  191. * (optionally) contain a human readable name of this mapping (mainly for
  192. * debugging purposes).
  193. *
  194. * Note: at this point we just "trust" those devmem entries to contain valid
  195. * physical addresses, but this isn't safe and will be changed: eventually we
  196. * want remoteproc implementations to provide us ranges of physical addresses
  197. * the firmware is allowed to request, and not allow firmwares to request
  198. * access to physical addresses that are outside those ranges.
  199. */
  200. struct fw_rsc_devmem {
  201. u32 da;
  202. u32 pa;
  203. u32 len;
  204. u32 flags;
  205. u32 reserved;
  206. u8 name[32];
  207. } __packed;
  208. /**
  209. * struct fw_rsc_trace - trace buffer declaration
  210. * @da: device address
  211. * @len: length (in bytes)
  212. * @reserved: reserved (must be zero)
  213. * @name: human-readable name of the trace buffer
  214. *
  215. * This resource entry provides the host information about a trace buffer
  216. * into which the remote processor will write log messages.
  217. *
  218. * @da specifies the device address of the buffer, @len specifies
  219. * its size, and @name may contain a human readable name of the trace buffer.
  220. *
  221. * After booting the remote processor, the trace buffers are exposed to the
  222. * user via debugfs entries (called trace0, trace1, etc..).
  223. */
  224. struct fw_rsc_trace {
  225. u32 da;
  226. u32 len;
  227. u32 reserved;
  228. u8 name[32];
  229. } __packed;
  230. /**
  231. * struct fw_rsc_vdev_vring - vring descriptor entry
  232. * @da: device address
  233. * @align: the alignment between the consumer and producer parts of the vring
  234. * @num: num of buffers supported by this vring (must be power of two)
  235. * @notifyid is a unique rproc-wide notify index for this vring. This notify
  236. * index is used when kicking a remote processor, to let it know that this
  237. * vring is triggered.
  238. * @pa: physical address
  239. *
  240. * This descriptor is not a resource entry by itself; it is part of the
  241. * vdev resource type (see below).
  242. *
  243. * Note that @da should either contain the device address where
  244. * the remote processor is expecting the vring, or indicate that
  245. * dynamically allocation of the vring's device address is supported.
  246. */
  247. struct fw_rsc_vdev_vring {
  248. u32 da;
  249. u32 align;
  250. u32 num;
  251. u32 notifyid;
  252. u32 pa;
  253. } __packed;
  254. /**
  255. * struct fw_rsc_vdev - virtio device header
  256. * @id: virtio device id (as in virtio_ids.h)
  257. * @notifyid is a unique rproc-wide notify index for this vdev. This notify
  258. * index is used when kicking a remote processor, to let it know that the
  259. * status/features of this vdev have changes.
  260. * @dfeatures specifies the virtio device features supported by the firmware
  261. * @gfeatures is a place holder used by the host to write back the
  262. * negotiated features that are supported by both sides.
  263. * @config_len is the size of the virtio config space of this vdev. The config
  264. * space lies in the resource table immediate after this vdev header.
  265. * @status is a place holder where the host will indicate its virtio progress.
  266. * @num_of_vrings indicates how many vrings are described in this vdev header
  267. * @reserved: reserved (must be zero)
  268. * @vring is an array of @num_of_vrings entries of 'struct fw_rsc_vdev_vring'.
  269. *
  270. * This resource is a virtio device header: it provides information about
  271. * the vdev, and is then used by the host and its peer remote processors
  272. * to negotiate and share certain virtio properties.
  273. *
  274. * By providing this resource entry, the firmware essentially asks remoteproc
  275. * to statically allocate a vdev upon registration of the rproc (dynamic vdev
  276. * allocation is not yet supported).
  277. *
  278. * Note: unlike virtualization systems, the term 'host' here means
  279. * the Linux side which is running remoteproc to control the remote
  280. * processors. We use the name 'gfeatures' to comply with virtio's terms,
  281. * though there isn't really any virtualized guest OS here: it's the host
  282. * which is responsible for negotiating the final features.
  283. * Yeah, it's a bit confusing.
  284. *
  285. * Note: immediately following this structure is the virtio config space for
  286. * this vdev (which is specific to the vdev; for more info, read the virtio
  287. * spec). the size of the config space is specified by @config_len.
  288. */
  289. struct fw_rsc_vdev {
  290. u32 id;
  291. u32 notifyid;
  292. u32 dfeatures;
  293. u32 gfeatures;
  294. u32 config_len;
  295. u8 status;
  296. u8 num_of_vrings;
  297. u8 reserved[2];
  298. struct fw_rsc_vdev_vring vring[0];
  299. } __packed;
  300. /**
  301. * struct fw_rsc_custom - custom resource definition
  302. * @sub_type: implementation specific type
  303. * @size: size of the custom resource
  304. * @data: label for the start of the resource
  305. */
  306. struct fw_rsc_custom {
  307. u32 sub_type;
  308. u32 size;
  309. u8 data[0];
  310. } __packed;
  311. /**
  312. * struct rproc_mem_entry - memory entry descriptor
  313. * @va: virtual address
  314. * @dma: dma address
  315. * @len: length, in bytes
  316. * @da: device address
  317. * @priv: associated data
  318. * @node: list node
  319. */
  320. struct rproc_mem_entry {
  321. void *va;
  322. dma_addr_t dma;
  323. int len;
  324. u32 da;
  325. void *priv;
  326. struct list_head node;
  327. };
  328. struct rproc;
  329. /*
  330. * Macros to use with flags field in rproc_da_to_va API. Use
  331. * the upper 16 bits to dictate the flags type and the lower
  332. * 16 bits to pass on the value of the flags pertinent to that
  333. * type.
  334. *
  335. * Add any new flags type at a new bit-field position
  336. */
  337. #define RPROC_FLAGS_SHIFT 16
  338. #define RPROC_FLAGS_NONE 0
  339. #define RPROC_FLAGS_ELF_PHDR BIT(0 + RPROC_FLAGS_SHIFT)
  340. #define RPROC_FLAGS_ELF_SHDR BIT(1 + RPROC_FLAGS_SHIFT)
  341. /**
  342. * struct rproc_ops - platform-specific device handlers
  343. * @start: power on the device and boot it
  344. * @stop: power off the device
  345. * @kick: kick a virtqueue (virtqueue id given as a parameter)
  346. * @da_to_va: optional platform hook to perform address translations
  347. * @handle_custom_rsc: hook to handle device specific resource table entries
  348. */
  349. struct rproc_ops {
  350. int (*start)(struct rproc *rproc);
  351. int (*stop)(struct rproc *rproc);
  352. void (*kick)(struct rproc *rproc, int vqid);
  353. void * (*da_to_va)(struct rproc *rproc, u64 da, int len, u32 flags);
  354. int (*handle_custom_rsc)(struct rproc *rproc,
  355. struct fw_rsc_custom *rsc);
  356. };
  357. /**
  358. * enum rproc_state - remote processor states
  359. * @RPROC_OFFLINE: device is powered off
  360. * @RPROC_SUSPENDED: device is suspended; needs to be woken up to receive
  361. * a message.
  362. * @RPROC_RUNNING: device is up and running
  363. * @RPROC_CRASHED: device has crashed; need to start recovery
  364. * @RPROC_DELETED: device is deleted
  365. * @RPROC_LAST: just keep this one at the end
  366. *
  367. * Please note that the values of these states are used as indices
  368. * to rproc_state_string, a state-to-name lookup table,
  369. * so please keep the two synchronized. @RPROC_LAST is used to check
  370. * the validity of an index before the lookup table is accessed, so
  371. * please update it as needed too.
  372. */
  373. enum rproc_state {
  374. RPROC_OFFLINE = 0,
  375. RPROC_SUSPENDED = 1,
  376. RPROC_RUNNING = 2,
  377. RPROC_CRASHED = 3,
  378. RPROC_DELETED = 4,
  379. RPROC_LAST = 5,
  380. };
  381. /**
  382. * enum rproc_crash_type - remote processor crash types
  383. * @RPROC_MMUFAULT: iommu fault
  384. * @RPROC_WATCHDOG: watchdog bite
  385. * @RPROC_FATAL_ERROR fatal error
  386. *
  387. * Each element of the enum is used as an array index. So that, the value of
  388. * the elements should be always something sane.
  389. *
  390. * Feel free to add more types when needed.
  391. */
  392. enum rproc_crash_type {
  393. RPROC_MMUFAULT,
  394. RPROC_WATCHDOG,
  395. RPROC_FATAL_ERROR,
  396. };
  397. /**
  398. * struct rproc - represents a physical remote processor device
  399. * @node: list node of this rproc object
  400. * @domain: iommu domain
  401. * @name: human readable name of the rproc
  402. * @firmware: name of firmware file to be loaded
  403. * @priv: private data which belongs to the platform-specific rproc module
  404. * @ops: platform-specific start/stop rproc handlers
  405. * @dev: virtual device for refcounting and common remoteproc behavior
  406. * @fw_ops: firmware-specific handlers
  407. * @power: refcount of users who need this rproc powered up
  408. * @state: state of the device
  409. * @lock: lock which protects concurrent manipulations of the rproc
  410. * @dbg_dir: debugfs directory of this rproc device
  411. * @traces: list of trace buffers
  412. * @num_traces: number of trace buffers
  413. * @last_traces: list of last trace buffers
  414. * @num_last_traces: number of last trace buffers
  415. * @carveouts: list of physically contiguous memory allocations
  416. * @mappings: list of iommu mappings we initiated, needed on shutdown
  417. * @bootaddr: address of first instruction to boot rproc with (optional)
  418. * @rvdevs: list of remote virtio devices
  419. * @subdevs: list of subdevices, to following the running state
  420. * @notifyids: idr for dynamically assigning rproc-wide unique notify ids
  421. * @index: index of this rproc device
  422. * @crash_handler: workqueue for handling a crash
  423. * @crash_cnt: crash counter
  424. * @crash_comp: completion used to sync crash handler and the rproc reload
  425. * @recovery_disabled: flag that state if recovery was disabled
  426. * @max_notifyid: largest allocated notify id.
  427. * @table_ptr: pointer to the resource table in effect
  428. * @cached_table: copy of the resource table
  429. * @fw_version: human readable version information extracted from f/w
  430. * @has_iommu: flag to indicate if remote processor is behind an MMU
  431. * @use_userspace_loader: flag to denote if remoteproc is loaded by userspace
  432. */
  433. struct rproc {
  434. struct list_head node;
  435. struct iommu_domain *domain;
  436. const char *name;
  437. char *firmware;
  438. void *priv;
  439. const struct rproc_ops *ops;
  440. struct device dev;
  441. const struct rproc_fw_ops *fw_ops;
  442. atomic_t power;
  443. unsigned int state;
  444. struct mutex lock;
  445. struct dentry *dbg_dir;
  446. struct list_head traces;
  447. int num_traces;
  448. struct list_head last_traces;
  449. int num_last_traces;
  450. struct list_head carveouts;
  451. struct list_head mappings;
  452. u32 bootaddr;
  453. struct list_head rvdevs;
  454. struct list_head subdevs;
  455. struct idr notifyids;
  456. int index;
  457. struct work_struct crash_handler;
  458. unsigned int crash_cnt;
  459. struct completion crash_comp;
  460. bool recovery_disabled;
  461. int max_notifyid;
  462. struct resource_table *table_ptr;
  463. struct resource_table *cached_table;
  464. char *fw_version;
  465. bool has_iommu;
  466. bool auto_boot;
  467. bool use_userspace_loader;
  468. };
  469. /**
  470. * struct rproc_subdev - subdevice tied to a remoteproc
  471. * @node: list node related to the rproc subdevs list
  472. * @probe: probe function, called as the rproc is started
  473. * @remove: remove function, called as the rproc is stopped
  474. */
  475. struct rproc_subdev {
  476. struct list_head node;
  477. int (*probe)(struct rproc_subdev *subdev);
  478. void (*remove)(struct rproc_subdev *subdev);
  479. };
  480. /* we currently support only two vrings per rvdev */
  481. #define RVDEV_NUM_VRINGS 2
  482. /**
  483. * struct rproc_vring - remoteproc vring state
  484. * @va: virtual address
  485. * @dma: dma address
  486. * @len: length, in bytes
  487. * @da: device address
  488. * @align: vring alignment
  489. * @notifyid: rproc-specific unique vring index
  490. * @rvdev: remote vdev
  491. * @vq: the virtqueue of this vring
  492. */
  493. struct rproc_vring {
  494. void *va;
  495. dma_addr_t dma;
  496. int len;
  497. u32 da;
  498. u32 align;
  499. int notifyid;
  500. struct rproc_vdev *rvdev;
  501. struct virtqueue *vq;
  502. };
  503. /**
  504. * struct rproc_vdev - remoteproc state for a supported virtio device
  505. * @refcount: reference counter for the vdev and vring allocations
  506. * @subdev: handle for registering the vdev as a rproc subdevice
  507. * @id: virtio device id (as in virtio_ids.h)
  508. * @node: list node
  509. * @rproc: the rproc handle
  510. * @vdev: the virio device
  511. * @vring: the vrings for this vdev
  512. * @rsc_offset: offset of the vdev's resource entry
  513. */
  514. struct rproc_vdev {
  515. struct kref refcount;
  516. struct rproc_subdev subdev;
  517. unsigned int id;
  518. struct list_head node;
  519. struct rproc *rproc;
  520. struct virtio_device vdev;
  521. struct rproc_vring vring[RVDEV_NUM_VRINGS];
  522. u32 rsc_offset;
  523. };
  524. struct rproc *rproc_get_by_phandle(phandle phandle);
  525. struct rproc *rproc_alloc(struct device *dev, const char *name,
  526. const struct rproc_ops *ops,
  527. const char *firmware, int len);
  528. void rproc_put(struct rproc *rproc);
  529. int rproc_add(struct rproc *rproc);
  530. int rproc_del(struct rproc *rproc);
  531. void rproc_free(struct rproc *rproc);
  532. int rproc_boot(struct rproc *rproc);
  533. void rproc_shutdown(struct rproc *rproc);
  534. void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);
  535. struct rproc *rproc_vdev_to_rproc_safe(struct virtio_device *vdev);
  536. int rproc_get_alias_id(struct rproc *rproc);
  537. int rproc_pa_to_da(struct rproc *rproc, phys_addr_t pa, u64 *da);
  538. void *rproc_da_to_va(struct rproc *rproc, u64 da, int len, u32 flags);
  539. static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
  540. {
  541. return container_of(vdev, struct rproc_vdev, vdev);
  542. }
  543. static inline struct rproc *vdev_to_rproc(struct virtio_device *vdev)
  544. {
  545. struct rproc_vdev *rvdev = vdev_to_rvdev(vdev);
  546. return rvdev->rproc;
  547. }
  548. void rproc_add_subdev(struct rproc *rproc,
  549. struct rproc_subdev *subdev,
  550. int (*probe)(struct rproc_subdev *subdev),
  551. void (*remove)(struct rproc_subdev *subdev));
  552. void rproc_remove_subdev(struct rproc *rproc, struct rproc_subdev *subdev);
  553. int rproc_set_firmware(struct rproc *rproc, const char *fw_name);
  554. #endif /* REMOTEPROC_H */