Blame view
drivers/remoteproc/remoteproc_internal.h
3.61 KB
400e64df6 remoteproc: add f... |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
/* * Remote processor framework * * Copyright (C) 2011 Texas Instruments, Inc. * Copyright (C) 2011 Google, Inc. * * Ohad Ben-Cohen <ohad@wizery.com> * Brian Swetland <swetland@google.com> * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef REMOTEPROC_INTERNAL_H #define REMOTEPROC_INTERNAL_H #include <linux/irqreturn.h> |
72854fb04 remoteproc: Move ... |
24 |
#include <linux/firmware.h> |
400e64df6 remoteproc: add f... |
25 26 |
struct rproc; |
4afc89d66 remoteproc: Suppo... |
27 28 |
/** * struct rproc_fw_ops - firmware format specific operations. |
95f957816 remoteproc: add f... |
29 30 |
* @find_rsc_table: find the resource table inside the firmware image * @find_loaded_rsc_table: find the loaded resouce table |
4afc89d66 remoteproc: Suppo... |
31 32 33 34 35 36 |
* @load: load firmeware to memory, where the remote processor * expects to find it * @sanity_check: sanity check the fw image * @get_boot_addr: get boot address to entry point specified in firmware */ struct rproc_fw_ops { |
172e6ab1c remoteproc: fix v... |
37 |
struct resource_table *(*find_rsc_table)(struct rproc *rproc, |
730f84ce6 remoteproc: align... |
38 39 40 41 |
const struct firmware *fw, int *tablesz); struct resource_table *(*find_loaded_rsc_table)( struct rproc *rproc, const struct firmware *fw); |
4afc89d66 remoteproc: Suppo... |
42 43 44 45 |
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); }; |
400e64df6 remoteproc: add f... |
46 47 48 |
/* from remoteproc_core.c */ void rproc_release(struct kref *kref); irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int vq_id); |
3d87fa1d4 remoteproc: core:... |
49 |
int rproc_boot_nowait(struct rproc *rproc); |
400e64df6 remoteproc: add f... |
50 |
|
7a1869416 remoteproc: remov... |
51 52 53 |
/* from remoteproc_virtio.c */ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id); void rproc_remove_virtio_dev(struct rproc_vdev *rvdev); |
400e64df6 remoteproc: add f... |
54 55 56 57 |
/* from remoteproc_debugfs.c */ void rproc_remove_trace_file(struct dentry *tfile); struct dentry *rproc_create_trace_file(const char *name, struct rproc *rproc, |
730f84ce6 remoteproc: align... |
58 |
struct rproc_mem_entry *trace); |
400e64df6 remoteproc: add f... |
59 60 61 62 |
void rproc_delete_debug_dir(struct rproc *rproc); void rproc_create_debug_dir(struct rproc *rproc); void rproc_init_debugfs(void); void rproc_exit_debugfs(void); |
6db20ea8d remoteproc: alloc... |
63 64 |
void rproc_free_vring(struct rproc_vring *rvring); int rproc_alloc_vring(struct rproc_vdev *rvdev, int i); |
72854fb04 remoteproc: Move ... |
65 66 |
void *rproc_da_to_va(struct rproc *rproc, u64 da, int len); |
70b85ef83 remoteproc: add a... |
67 |
int rproc_trigger_recovery(struct rproc *rproc); |
72854fb04 remoteproc: Move ... |
68 |
|
4afc89d66 remoteproc: Suppo... |
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
static inline int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw) { if (rproc->fw_ops->sanity_check) return rproc->fw_ops->sanity_check(rproc, fw); return 0; } static inline u32 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw) { if (rproc->fw_ops->get_boot_addr) return rproc->fw_ops->get_boot_addr(rproc, fw); return 0; } static inline int rproc_load_segments(struct rproc *rproc, const struct firmware *fw) { if (rproc->fw_ops->load) return rproc->fw_ops->load(rproc, fw); return -EINVAL; } static inline |
72854fb04 remoteproc: Move ... |
97 |
struct resource_table *rproc_find_rsc_table(struct rproc *rproc, |
730f84ce6 remoteproc: align... |
98 99 |
const struct firmware *fw, int *tablesz) |
4afc89d66 remoteproc: Suppo... |
100 101 102 103 104 105 |
{ if (rproc->fw_ops->find_rsc_table) return rproc->fw_ops->find_rsc_table(rproc, fw, tablesz); return NULL; } |
95f957816 remoteproc: add f... |
106 107 |
static inline struct resource_table *rproc_find_loaded_rsc_table(struct rproc *rproc, |
730f84ce6 remoteproc: align... |
108 |
const struct firmware *fw) |
95f957816 remoteproc: add f... |
109 110 111 |
{ if (rproc->fw_ops->find_loaded_rsc_table) return rproc->fw_ops->find_loaded_rsc_table(rproc, fw); |
579711592 remoteproc: fix c... |
112 |
return NULL; |
95f957816 remoteproc: add f... |
113 |
} |
4afc89d66 remoteproc: Suppo... |
114 |
extern const struct rproc_fw_ops rproc_elf_fw_ops; |
72854fb04 remoteproc: Move ... |
115 |
|
400e64df6 remoteproc: add f... |
116 |
#endif /* REMOTEPROC_INTERNAL_H */ |