Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1568799

[PATCH 2/6] ARCv2: MCIP: Add structure for build register of IDU

From Yuriy Kolerov <yuriy.kolerov@synopsys.com>
Newsgroups linux.kernel
Subject [PATCH 2/6] ARCv2: MCIP: Add structure for build register of IDU
Date 2017-01-28 01:10 +0100
Message-ID <t4oKD-2wK-27@gated-at.bofh.it> (permalink)
References <t4oKC-2wK-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This structure is necessary for retrieving of supported
number of common interrupts in IDU interrupt controller.

Signed-off-by: Yuriy Kolerov <yuriy.kolerov@synopsys.com>
---
 include/soc/arc/mcip.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/soc/arc/mcip.h b/include/soc/arc/mcip.h
index 6902c2a..798c01b 100644
--- a/include/soc/arc/mcip.h
+++ b/include/soc/arc/mcip.h
@@ -14,6 +14,7 @@
 #include <soc/arc/aux.h>
 
 #define ARC_REG_MCIP_BCR	0x0d0
+#define ARC_REG_MCIP_IDU_BCR	0x0D5
 #define ARC_REG_MCIP_CMD	0x600
 #define ARC_REG_MCIP_WDATA	0x601
 #define ARC_REG_MCIP_READBACK	0x602
@@ -69,6 +70,22 @@ struct mcip_bcr {
 #endif
 };
 
+struct mcip_idu_bcr {
+#ifdef CONFIG_CPU_BIG_ENDIAN
+	unsigned int pad:21, cirqnum:3, ver:8;
+#else
+	unsigned int ver:8, cirqnum:3, pad:21;
+#endif
+};
+
+
+/*
+ * Build register for IDU contains not an actual number of supported common
+ * interrupts but an exponent of 2 which must be multiplied by 4 to
+ * get a number of supported common interrupts.
+ */
+#define mcip_idu_bcr_to_nr_irqs(bcr) (4 * (1 << (bcr).cirqnum))
+
 /*
  * MCIP programming model
  *
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Use build registers for getting numbers of interrupts Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2017-01-28 01:10 +0100
  [PATCH 5/6] ARCv2: IRQ: Use build registers for getting numbers of interrupts Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2017-01-28 01:10 +0100
  [PATCH 1/6] ARCv2: IRQ: Move structures for core intc to the header Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2017-01-28 01:10 +0100
  [PATCH 6/6] ARCv2: IRQ: Set a default priority for all core interrupts Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2017-01-28 01:10 +0100
  [PATCH 2/6] ARCv2: MCIP: Add structure for build register of IDU Yuriy Kolerov <yuriy.kolerov@synopsys.com> - 2017-01-28 01:10 +0100

csiph-web