aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuman Anna2019-02-15 17:07:52 -0600
committerSuman Anna2019-02-23 11:39:59 -0600
commit786ff4b31d294b6b873f34aa8dfc5e48be43c267 (patch)
treea9e4bbed0dafa2ebfb1c0cfa8984640616c478c8 /include/linux
parent9d98b91e4296798c9a77bbca1c7954f4ef46e50c (diff)
downloadremoteproc-786ff4b31d294b6b873f34aa8dfc5e48be43c267.tar.gz
remoteproc-786ff4b31d294b6b873f34aa8dfc5e48be43c267.tar.xz
remoteproc-786ff4b31d294b6b873f34aa8dfc5e48be43c267.zip
irqchip/irq-pruss-intc: Add a PRUSS irqchip driver for PRUSS interrupts
The Programmable Real-Time Unit Subsystem (PRUSS) contains an interrupt controller (INTC) that can handle various system input events and post interrupts back to the device-level initiators. The INTC can support upto 64 input events with individual control configuration and hardware prioritization. These events are mapped onto 10 interrupt signals through two levels of many-to-one mapping support. Different interrupt signals are routed to the individual PRU cores or to the host CPU. The PRUSS INTC platform driver manages this PRUSS interrupt controller and implements an irqchip driver to provide a Linux standard way for the PRU client users to enable/disable/ack/ re-trigger a PRUSS system event. The system events to interrupt channels and host interrupts relies on the mapping configuration provided through a firmware resource table for now. This will be revisited and enhanced in the future for a better interface. The mappings will currently be programmed during the boot/shutdown of the PRU. The PRUSS INTC module is reference counted during the interrupt setup phase through the irqchip's irq_request_resources() and irq_release_resources() ops. This restricts the module from being removed as long as there are active interrupt users. The driver currently supports the AM335x SoC, and support for other TI SoCs will be added in subsequent patches. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Roger Quadros <rogerq@ti.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pruss_driver.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/pruss_driver.h b/include/linux/pruss_driver.h
index 874c61be8a07..fe7d513ea8e7 100644
--- a/include/linux/pruss_driver.h
+++ b/include/linux/pruss_driver.h
@@ -9,6 +9,18 @@
9#ifndef _PRUSS_DRIVER_H_ 9#ifndef _PRUSS_DRIVER_H_
10#define _PRUSS_DRIVER_H_ 10#define _PRUSS_DRIVER_H_
11 11
12/* maximum number of system events */
13#define MAX_PRU_SYS_EVENTS 64
14
15/* maximum number of interrupt channels */
16#define MAX_PRU_CHANNELS 10
17
18/* minimum starting host interrupt number for MPU */
19#define MIN_PRU_HOST_INT 2
20
21/* maximum number of host interrupts */
22#define MAX_PRU_HOST_INT 10
23
12/** 24/**
13 * enum pruss_mem - PRUSS memory range identifiers 25 * enum pruss_mem - PRUSS memory range identifiers
14 */ 26 */
@@ -32,6 +44,16 @@ struct pruss_mem_region {
32}; 44};
33 45
34/** 46/**
47 * struct pruss_intc_config - INTC configuration info
48 * @sysev_to_ch: system events to channel mapping information
49 * @ch_to_host: interrupt channel to host interrupt information
50 */
51struct pruss_intc_config {
52 s8 sysev_to_ch[MAX_PRU_SYS_EVENTS];
53 s8 ch_to_host[MAX_PRU_CHANNELS];
54};
55
56/**
35 * struct pruss - PRUSS parent structure 57 * struct pruss - PRUSS parent structure
36 * @dev: pruss device pointer 58 * @dev: pruss device pointer
37 * @cfg: regmap for config region 59 * @cfg: regmap for config region
@@ -47,4 +69,9 @@ struct pruss {
47 struct pruss_mem_region mem_regions[PRUSS_MEM_MAX]; 69 struct pruss_mem_region mem_regions[PRUSS_MEM_MAX];
48}; 70};
49 71
72int pruss_intc_configure(struct pruss *pruss,
73 struct pruss_intc_config *intc_config);
74int pruss_intc_unconfigure(struct pruss *pruss,
75 struct pruss_intc_config *intc_config);
76
50#endif /* _PRUSS_DRIVER_H_ */ 77#endif /* _PRUSS_DRIVER_H_ */