summaryrefslogtreecommitdiffstats
path: root/include/linux/remoteproc.h
blob: c6264d1c0a49075226d31d16072f072548e53877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Remote Processor Framework
 *
 * Copyright(c) 2011 Texas Instruments, Inc.
 * Copyright(c) 2011 Google, Inc.
 */

#ifndef REMOTEPROC_H
#define REMOTEPROC_H

#include <firmware.h>

struct resource_table {
	u32 ver;
	u32 num;
	u32 reserved[2];
	u32 offset[0];
} __packed;

struct firmware {
	size_t size;
	const u8 *data;
};

struct rproc;

struct rproc_ops {
	int (*start)(struct rproc *rproc);
	int (*stop)(struct rproc *rproc);
	void * (*da_to_va)(struct rproc *rproc, u64 da, int len);
	int (*load)(struct rproc *rproc, const struct firmware *fw);
};

struct rproc {
	struct firmware_handler fh;
	const char *name;
	void *priv;
	struct rproc_ops *ops;
	struct device_d dev;

	void *fw_buf;
	size_t fw_buf_ofs;
};

struct rproc *rproc_alloc(struct device_d *dev, const char *name,
			  const struct rproc_ops *ops, int len);
int rproc_add(struct rproc *rproc);

#endif /* REMOTEPROC_H */