From: Roger Quadros <rogerq@ti.com>
To: <tony@atomide.com>
Cc: <robh+dt@kernel.org>, <bcousson@baylibre.com>,
<ssantosh@kernel.org>, <ohad@wizery.com>,
<bjorn.andersson@linaro.org>, <s-anna@ti.com>, <nsekhar@ti.com>,
<t-kristo@ti.com>, <nsaulnier@ti.com>, <jreeder@ti.com>,
<m-karicheri2@ti.com>, <woods.technical@gmail.com>,
<linux-omap@vger.kernel.org>, <linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
<rogerq@ti.com>
Subject: [PATCH 13/17] soc: ti: pruss: export pruss_intc_configure/unconfigure APIs
Date: Thu, 22 Nov 2018 13:39:09 +0200 [thread overview]
Message-ID: <1542886753-17625-14-git-send-email-rogerq@ti.com> (raw)
In-Reply-To: <1542886753-17625-1-git-send-email-rogerq@ti.com>
The PRU remoteproc driver will need to configure the
Interrupt controller based on the application specific
interrupt map.
Export pruss_intc_configure() and pruss_intc_unconfigure()
to linux/pruss.h
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
drivers/soc/ti/pruss.h | 21 -------------------
include/linux/pruss.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 21 deletions(-)
diff --git a/drivers/soc/ti/pruss.h b/drivers/soc/ti/pruss.h
index 45de1be..ce3f96a 100644
--- a/drivers/soc/ti/pruss.h
+++ b/drivers/soc/ti/pruss.h
@@ -9,12 +9,6 @@
#ifndef _PRUSS_H_
#define _PRUSS_H_
-/* maximum number of system events */
-#define MAX_PRU_SYS_EVENTS 64
-
-/* maximum number of interrupt channels */
-#define MAX_PRU_CHANNELS 10
-
/* minimum starting host interrupt number for MPU */
#define MIN_PRU_HOST_INT 2
@@ -22,16 +16,6 @@
#define MAX_PRU_HOST_INT 10
/**
- * struct pruss_intc_config - INTC configuration info
- * @sysev_to_ch: system events to channel mapping information
- * @ch_to_host: interrupt channel to host interrupt information
- */
-struct pruss_intc_config {
- s8 sysev_to_ch[MAX_PRU_SYS_EVENTS];
- s8 ch_to_host[MAX_PRU_CHANNELS];
-};
-
-/**
* struct pruss - PRUSS parent structure
* @dev: pruss device pointer
* @cfg: regmap for config region
@@ -49,9 +33,4 @@ struct pruss {
struct mutex lock; /* PRU resource lock */
};
-int pruss_intc_configure(struct pruss *pruss,
- struct pruss_intc_config *intc_config);
-int pruss_intc_unconfigure(struct pruss *pruss,
- struct pruss_intc_config *intc_config);
-
#endif /* _PRUSS_H_ */
diff --git a/include/linux/pruss.h b/include/linux/pruss.h
index 3ed175a..c797fb1 100644
--- a/include/linux/pruss.h
+++ b/include/linux/pruss.h
@@ -118,6 +118,22 @@ struct pruss_mem_region {
size_t size;
};
+/* maximum number of system events */
+#define MAX_PRU_SYS_EVENTS 64
+
+/* maximum number of interrupt channels */
+#define MAX_PRU_CHANNELS 10
+
+/**
+ * struct pruss_intc_config - INTC configuration info
+ * @sysev_to_ch: system events to channel mapping information
+ * @ch_to_host: interrupt channel to host interrupt information
+ */
+struct pruss_intc_config {
+ s8 sysev_to_ch[MAX_PRU_SYS_EVENTS];
+ s8 ch_to_host[MAX_PRU_CHANNELS];
+};
+
struct pruss;
#if IS_ENABLED(CONFIG_TI_PRUSS)
@@ -136,6 +152,34 @@ int pruss_cfg_read(struct pruss *pruss, unsigned int reg, unsigned int *val);
int pruss_cfg_update(struct pruss *pruss, unsigned int reg,
unsigned int mask, unsigned int val);
+/**
+ * pruss_intc_configure() - configure the PRUSS INTC
+ * @pruss: the pruss instance
+ * @intc_config: PRU core-specific INTC configuration
+ *
+ * Configures the PRUSS INTC with the provided configuration from
+ * a PRU core. Any existing event to channel mappings or channel to
+ * host interrupt mappings are checked to make sure there are no
+ * conflicting configuration between both the PRU cores. The function
+ * is intended to be used only by the PRU remoteproc driver.
+ *
+ * Returns 0 on success, or a suitable error code otherwise
+ */
+int pruss_intc_configure(struct pruss *pruss,
+ struct pruss_intc_config *intc_config);
+
+/**
+ * pruss_intc_unconfigure() - unconfigure the PRUSS INTC
+ * @pruss: the pruss instance
+ * @intc_config: PRU core specific INTC configuration
+ *
+ * Undo whatever was done in pruss_intc_configure() for a PRU core.
+ * It should be sufficient to just mark the resources free in the
+ * global map and disable the host interrupts and sysevents.
+ */
+int pruss_intc_unconfigure(struct pruss *pruss,
+ struct pruss_intc_config *intc_config);
+
#else
static inline struct pruss *pruss_get(struct rproc *rproc)
@@ -174,6 +218,18 @@ int pruss_cfg_update(struct pruss *pruss, unsigned int reg,
return -ENOTSUPP;
}
+int pruss_intc_configure(struct pruss *pruss,
+ struct pruss_intc_config *intc_config)
+{
+ return -ENOTSUPP;
+}
+
+int pruss_intc_unconfigure(struct pruss *pruss,
+ struct pruss_intc_config *intc_config)
+{
+ return -ENOTSUPP;
+}
+
#endif /* CONFIG_TI_PRUSS */
#endif /* __LINUX_PRUSS_H */
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
next prev parent reply other threads:[~2018-11-22 11:40 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 11:38 [PATCH 00/17] Add support for TI PRU ICSS Roger Quadros
2018-11-22 11:38 ` [PATCH 01/17] dt-bindings: remoteproc: Add TI PRUSS bindings Roger Quadros
2018-11-23 16:24 ` Tony Lindgren
2018-11-26 7:47 ` Roger Quadros
2018-11-26 19:35 ` Tony Lindgren
2018-11-26 21:14 ` David Lechner
2018-11-26 23:41 ` Tony Lindgren
2018-11-27 15:15 ` Roger Quadros
2018-11-28 15:42 ` David Lechner
2018-11-29 8:49 ` Roger Quadros
2018-11-29 16:18 ` David Lechner
2018-11-22 11:38 ` [PATCH 02/17] soc: ti: pruss: Define platform data for PRUSS bus driver Roger Quadros
2018-11-22 11:38 ` [PATCH 03/17] soc: ti: pruss: Add pruss_soc_bus platform driver Roger Quadros
2018-11-22 11:39 ` [PATCH 04/17] soc: ti: pruss: Fix system suspend/MStandby config issues Roger Quadros
2018-11-22 11:39 ` [PATCH 05/17] soc: ti: pruss: Configure SYSCFG properly during probe/remove Roger Quadros
2018-11-23 16:26 ` Tony Lindgren
2018-11-22 11:39 ` [PATCH 06/17] soc: ti: pruss: Add a platform driver for PRUSS in TI SoCs Roger Quadros
2018-11-26 21:15 ` David Lechner
2018-11-27 15:17 ` Roger Quadros
2018-11-22 11:39 ` [PATCH 07/17] soc: ti: pruss: enable OCP master ports in SYSCFG always Roger Quadros
2018-11-23 16:35 ` Tony Lindgren
2018-11-22 11:39 ` [PATCH 08/17] soc: ti: pruss: Add a PRUSS irqchip driver for PRUSS interrupts Roger Quadros
2018-11-23 16:37 ` Tony Lindgren
2018-11-26 8:09 ` Roger Quadros
2018-11-26 19:33 ` Tony Lindgren
2018-12-12 15:48 ` Roger Quadros
2018-12-12 17:25 ` Tony Lindgren
2018-11-26 8:09 ` Roger Quadros
2018-11-26 21:17 ` David Lechner
2018-11-27 15:39 ` Roger Quadros
2018-11-28 15:46 ` David Lechner
2018-11-22 11:39 ` [PATCH 09/17] soc: ti: pruss: add pruss_{request,release}_mem_region() API Roger Quadros
2018-11-26 21:18 ` David Lechner
2018-11-22 11:39 ` [PATCH 10/17] soc: ti: pruss_intc: Add API to trigger a PRU sysevent Roger Quadros
2018-11-26 21:18 ` David Lechner
2018-11-22 11:39 ` [PATCH 11/17] soc: ti: pruss: add pruss_get()/put() API Roger Quadros
2018-11-23 2:47 ` kbuild test robot
2018-11-23 9:41 ` Roger Quadros
2018-11-23 8:20 ` Arnd Bergmann
2018-11-23 8:58 ` Tero Kristo
2018-11-23 9:40 ` Roger Quadros
2018-11-26 21:18 ` David Lechner
2018-11-22 11:39 ` [PATCH 12/17] soc: ti: pruss: add pruss_cfg_read()/update() API Roger Quadros
2018-11-22 11:39 ` Roger Quadros [this message]
2018-11-26 21:19 ` [PATCH 13/17] soc: ti: pruss: export pruss_intc_configure/unconfigure APIs David Lechner
2018-11-22 11:39 ` [PATCH 14/17] ARM: OMAP2+: use pdata quirks for PRUSS reset lines on AM335x Roger Quadros
2018-11-23 16:40 ` Tony Lindgren
2018-11-22 11:39 ` [PATCH 15/17] ARM: dts: AM33xx: Add the PRU-ICSS DT nodes Roger Quadros
2018-11-26 16:37 ` David Lechner
2018-11-22 11:39 ` [PATCH 16/17] ARM: dts: AM33xx: Add PRU system events for virtio Roger Quadros
2018-11-22 11:39 ` [PATCH 17/17] ARM: dts: am335x-*: Enable PRU-ICSS nodes Roger Quadros
2018-11-26 16:45 ` David Lechner
2018-12-03 2:04 ` [PATCH 00/17] Add support for TI PRU ICSS Derald D. Woods
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1542886753-17625-14-git-send-email-rogerq@ti.com \
--to=rogerq@ti.com \
--cc=bcousson@baylibre.com \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=jreeder@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=m-karicheri2@ti.com \
--cc=nsaulnier@ti.com \
--cc=nsekhar@ti.com \
--cc=ohad@wizery.com \
--cc=robh+dt@kernel.org \
--cc=s-anna@ti.com \
--cc=ssantosh@kernel.org \
--cc=t-kristo@ti.com \
--cc=tony@atomide.com \
--cc=woods.technical@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).