summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-10-17 08:10:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-17 08:10:24 +0200
commit9156b904baf981561a8ed486db52746b04d2e464 (patch)
tree1679c7e689d541f5c1a5663c2ee201036407857e /include
parent854cdfbe265ebd99619bc6edc594d59b07c156fe (diff)
parent22763dab152cb38c0912fe688f564a54aeaaea88 (diff)
downloadbarebox-9156b904baf981561a8ed486db52746b04d2e464.tar.gz
barebox-9156b904baf981561a8ed486db52746b04d2e464.tar.xz
Merge branch 'for-next/remoteproc'
Diffstat (limited to 'include')
-rw-r--r--include/elf.h2
-rw-r--r--include/linux/remoteproc.h51
2 files changed, 52 insertions, 1 deletions
diff --git a/include/elf.h b/include/elf.h
index 633f4992dd..44be07f73a 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -286,7 +286,7 @@ typedef struct elf64_phdr {
#define SHN_COMMON 0xfff2
#define SHN_HIRESERVE 0xffff
-typedef struct {
+typedef struct elf32_shdr {
Elf32_Word sh_name;
Elf32_Word sh_type;
Elf32_Word sh_flags;
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
new file mode 100644
index 0000000000..feee9ee4ee
--- /dev/null
+++ b/include/linux/remoteproc.h
@@ -0,0 +1,51 @@
+/* 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;
+ int index;
+
+ 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 */