aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/remoteproc/Kconfig6
-rw-r--r--drivers/remoteproc/Makefile1
-rw-r--r--drivers/remoteproc/qcom_adsp_pil.c1
-rw-r--r--drivers/remoteproc/qcom_common.c46
-rw-r--r--drivers/remoteproc/qcom_common.h11
-rw-r--r--drivers/remoteproc/qcom_mdt_loader.c19
-rw-r--r--drivers/remoteproc/qcom_mdt_loader.h1
-rw-r--r--drivers/remoteproc/qcom_q6v5_pil.c1
-rw-r--r--drivers/remoteproc/qcom_wcnss.c1
9 files changed, 67 insertions, 20 deletions
diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
index 454fd9a4dd96..71ea703190c6 100644
--- a/drivers/remoteproc/Kconfig
+++ b/drivers/remoteproc/Kconfig
@@ -78,11 +78,15 @@ config QCOM_ADSP_PIL
78 depends on QCOM_SMEM 78 depends on QCOM_SMEM
79 select MFD_SYSCON 79 select MFD_SYSCON
80 select QCOM_MDT_LOADER 80 select QCOM_MDT_LOADER
81 select QCOM_RPROC_COMMON
81 select QCOM_SCM 82 select QCOM_SCM
82 help 83 help
83 Say y here to support the TrustZone based Peripherial Image Loader 84 Say y here to support the TrustZone based Peripherial Image Loader
84 for the Qualcomm ADSP remote processors. 85 for the Qualcomm ADSP remote processors.
85 86
87config QCOM_RPROC_COMMON
88 tristate
89
86config QCOM_MDT_LOADER 90config QCOM_MDT_LOADER
87 tristate 91 tristate
88 92
@@ -92,6 +96,7 @@ config QCOM_Q6V5_PIL
92 depends on QCOM_SMEM 96 depends on QCOM_SMEM
93 depends on REMOTEPROC 97 depends on REMOTEPROC
94 select MFD_SYSCON 98 select MFD_SYSCON
99 select QCOM_RPROC_COMMON
95 select QCOM_SCM 100 select QCOM_SCM
96 help 101 help
97 Say y here to support the Qualcomm Peripherial Image Loader for the 102 Say y here to support the Qualcomm Peripherial Image Loader for the
@@ -104,6 +109,7 @@ config QCOM_WCNSS_PIL
104 depends on QCOM_SMEM 109 depends on QCOM_SMEM
105 depends on REMOTEPROC 110 depends on REMOTEPROC
106 select QCOM_MDT_LOADER 111 select QCOM_MDT_LOADER
112 select QCOM_RPROC_COMMON
107 select QCOM_SCM 113 select QCOM_SCM
108 help 114 help
109 Say y here to support the Peripheral Image Loader for the Qualcomm 115 Say y here to support the Peripheral Image Loader for the Qualcomm
diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
index 0938ea3c41ba..d4f9525a226d 100644
--- a/drivers/remoteproc/Makefile
+++ b/drivers/remoteproc/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o
13obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o 13obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o
14obj-$(CONFIG_QCOM_ADSP_PIL) += qcom_adsp_pil.o 14obj-$(CONFIG_QCOM_ADSP_PIL) += qcom_adsp_pil.o
15obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o 15obj-$(CONFIG_QCOM_MDT_LOADER) += qcom_mdt_loader.o
16obj-$(CONFIG_QCOM_RPROC_COMMON) += qcom_common.o
16obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o 17obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o
17obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o 18obj-$(CONFIG_QCOM_WCNSS_PIL) += qcom_wcnss_pil.o
18qcom_wcnss_pil-y += qcom_wcnss.o 19qcom_wcnss_pil-y += qcom_wcnss.o
diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c
index a65351ea1889..4fb4c4b47875 100644
--- a/drivers/remoteproc/qcom_adsp_pil.c
+++ b/drivers/remoteproc/qcom_adsp_pil.c
@@ -29,6 +29,7 @@
29#include <linux/soc/qcom/smem.h> 29#include <linux/soc/qcom/smem.h>
30#include <linux/soc/qcom/smem_state.h> 30#include <linux/soc/qcom/smem_state.h>
31 31
32#include "qcom_common.h"
32#include "qcom_mdt_loader.h" 33#include "qcom_mdt_loader.h"
33#include "remoteproc_internal.h" 34#include "remoteproc_internal.h"
34 35
diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
new file mode 100644
index 000000000000..bd400336e209
--- /dev/null
+++ b/drivers/remoteproc/qcom_common.c
@@ -0,0 +1,46 @@
1/*
2 * Qualcomm Peripheral Image Loader helpers
3 *
4 * Copyright (C) 2016 Linaro Ltd
5 * Copyright (C) 2015 Sony Mobile Communications Inc
6 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#include <linux/firmware.h>
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/remoteproc.h>
22
23#include "remoteproc_internal.h"
24#include "qcom_common.h"
25
26/**
27 * qcom_mdt_find_rsc_table() - provide dummy resource table for remoteproc
28 * @rproc: remoteproc handle
29 * @fw: firmware header
30 * @tablesz: outgoing size of the table
31 *
32 * Returns a dummy table.
33 */
34struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc,
35 const struct firmware *fw,
36 int *tablesz)
37{
38 static struct resource_table table = { .ver = 1, };
39
40 *tablesz = sizeof(table);
41 return &table;
42}
43EXPORT_SYMBOL_GPL(qcom_mdt_find_rsc_table);
44
45MODULE_DESCRIPTION("Qualcomm Remoteproc helper driver");
46MODULE_LICENSE("GPL v2");
diff --git a/drivers/remoteproc/qcom_common.h b/drivers/remoteproc/qcom_common.h
new file mode 100644
index 000000000000..caecf27c4ffa
--- /dev/null
+++ b/drivers/remoteproc/qcom_common.h
@@ -0,0 +1,11 @@
1#ifndef __RPROC_QCOM_COMMON_H__
2#define __RPROC_QCOM_COMMON_H__
3
4struct resource_table;
5struct rproc;
6
7struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc,
8 const struct firmware *fw,
9 int *tablesz);
10
11#endif
diff --git a/drivers/remoteproc/qcom_mdt_loader.c b/drivers/remoteproc/qcom_mdt_loader.c
index 2ff18cd6c096..897e14512123 100644
--- a/drivers/remoteproc/qcom_mdt_loader.c
+++ b/drivers/remoteproc/qcom_mdt_loader.c
@@ -27,25 +27,6 @@
27#include "qcom_mdt_loader.h" 27#include "qcom_mdt_loader.h"
28 28
29/** 29/**
30 * qcom_mdt_find_rsc_table() - provide dummy resource table for remoteproc
31 * @rproc: remoteproc handle
32 * @fw: firmware header
33 * @tablesz: outgoing size of the table
34 *
35 * Returns a dummy table.
36 */
37struct resource_table *qcom_mdt_find_rsc_table(struct rproc *rproc,
38 const struct firmware *fw,
39 int *tablesz)
40{
41 static struct resource_table table = { .ver = 1, };
42
43 *tablesz = sizeof(table);
44 return &table;
45}
46EXPORT_SYMBOL_GPL(qcom_mdt_find_rsc_table);
47
48/**
49 * qcom_mdt_parse() - extract useful parameters from the mdt header 30 * qcom_mdt_parse() - extract useful parameters from the mdt header
50 * @fw: firmware handle 31 * @fw: firmware handle
51 * @fw_addr: optional reference for base of the firmware's memory region 32 * @fw_addr: optional reference for base of the firmware's memory region
diff --git a/drivers/remoteproc/qcom_mdt_loader.h b/drivers/remoteproc/qcom_mdt_loader.h
index c5d7122755b6..e513548e52ec 100644
--- a/drivers/remoteproc/qcom_mdt_loader.h
+++ b/drivers/remoteproc/qcom_mdt_loader.h
@@ -5,7 +5,6 @@
5#define QCOM_MDT_TYPE_HASH (2 << 24) 5#define QCOM_MDT_TYPE_HASH (2 << 24)
6#define QCOM_MDT_RELOCATABLE BIT(27) 6#define QCOM_MDT_RELOCATABLE BIT(27)
7 7
8struct resource_table * qcom_mdt_find_rsc_table(struct rproc *rproc, const struct firmware *fw, int *tablesz);
9int qcom_mdt_load(struct rproc *rproc, const struct firmware *fw, const char *fw_name); 8int qcom_mdt_load(struct rproc *rproc, const struct firmware *fw, const char *fw_name);
10 9
11int qcom_mdt_parse(const struct firmware *fw, phys_addr_t *fw_addr, size_t *fw_size, bool *fw_relocate); 10int qcom_mdt_parse(const struct firmware *fw, phys_addr_t *fw_addr, size_t *fw_size, bool *fw_relocate);
diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index 83a78daf55ef..2e44c06e604a 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -33,6 +33,7 @@
33#include <linux/soc/qcom/smem_state.h> 33#include <linux/soc/qcom/smem_state.h>
34 34
35#include "remoteproc_internal.h" 35#include "remoteproc_internal.h"
36#include "qcom_common.h"
36#include "qcom_mdt_loader.h" 37#include "qcom_mdt_loader.h"
37 38
38#include <linux/qcom_scm.h> 39#include <linux/qcom_scm.h>
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index ebd61f5d18bb..f158f8243b04 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -32,6 +32,7 @@
32#include <linux/soc/qcom/smem_state.h> 32#include <linux/soc/qcom/smem_state.h>
33#include <linux/rpmsg/qcom_smd.h> 33#include <linux/rpmsg/qcom_smd.h>
34 34
35#include "qcom_common.h"
35#include "qcom_mdt_loader.h" 36#include "qcom_mdt_loader.h"
36#include "remoteproc_internal.h" 37#include "remoteproc_internal.h"
37#include "qcom_wcnss.h" 38#include "qcom_wcnss.h"