All of lore.kernel.org
 help / color / mirror / Atom feed
From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 9/9] ARM: mvebu: MPIC: read number of interrupts from control register
Date: Mon,  2 Jul 2012 17:39:34 +0200	[thread overview]
Message-ID: <1341243574-3258-10-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1341243574-3258-1-git-send-email-thomas.petazzoni@free-electrons.com>

From: Ben Dooks <ben.dooks@codethink.co.uk>

Read the number of MPIC interrupts from the controller and only register
that many.

[gregory.clement at free-electrons.com: rename armada symbol name to fit
with new name: armada_370_xp]

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Lior Amsalem <alior@marvell.com>
---
 arch/arm/mach-mvebu/irq-armada-370-xp.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-mvebu/irq-armada-370-xp.c b/arch/arm/mach-mvebu/irq-armada-370-xp.c
index 645a8d3..5f5f939 100644
--- a/arch/arm/mach-mvebu/irq-armada-370-xp.c
+++ b/arch/arm/mach-mvebu/irq-armada-370-xp.c
@@ -29,13 +29,12 @@
 #define ARMADA_370_XP_INT_SET_MASK_OFFS		(0x48)
 #define ARMADA_370_XP_INT_CLEAR_MASK_OFFS	(0x4C)
 
+#define ARMADA_370_XP_INT_CONTROL		(0x00)
 #define ARMADA_370_XP_INT_SET_ENABLE_OFFS	(0x30)
 #define ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS	(0x34)
 
 #define ARMADA_370_XP_CPU_INTACK_OFFS		(0x44)
 
-#define ARMADA_370_XP_NR_IRQS			(115)
-
 static void __iomem *per_cpu_int_base;
 static void __iomem *main_int_base;
 static struct irq_domain *armada_370_xp_mpic_domain;
@@ -81,14 +80,18 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
 static int __init armada_370_xp_mpic_of_init(struct device_node *node,
 					     struct device_node *parent)
 {
+	u32 control;
+
 	main_int_base = of_iomap(node, 0);
 	per_cpu_int_base = of_iomap(node, 1);
 
 	BUG_ON(!main_int_base);
 	BUG_ON(!per_cpu_int_base);
 
+	control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
+
 	armada_370_xp_mpic_domain =
-	    irq_domain_add_linear(node, ARMADA_370_XP_NR_IRQS,
+	    irq_domain_add_linear(node, (control >> 2) & 0x3ff,
 				  &armada_370_xp_mpic_irq_ops, NULL);
 
 	if (!armada_370_xp_mpic_domain)
-- 
1.7.9.5

  parent reply	other threads:[~2012-07-02 15:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 15:39 [PATCH v7] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC Thomas Petazzoni
2012-07-02 15:39 ` [PATCH 1/9] clocksource: time-armada-370-xp: Marvell Armada 370/XP SoC timer driver Thomas Petazzoni
2012-07-02 17:40   ` Thomas Gleixner
2012-07-03 15:12   ` Andrew Lunn
2012-07-02 15:39 ` [PATCH 2/9] arm: mach-mvebu: add header Thomas Petazzoni
2012-07-02 18:33   ` Andrew Lunn
2012-07-02 19:08     ` Thomas Petazzoni
2012-07-02 19:16       ` Andrew Lunn
2012-07-02 21:31         ` Arnd Bergmann
2012-07-03  3:48         ` Nicolas Pitre
2012-07-03  7:09           ` Andrew Lunn
2012-07-03  7:20             ` Thomas Petazzoni
2012-07-03 15:13   ` Andrew Lunn
2012-07-02 15:39 ` [PATCH 3/9] arm: mach-mvebu: add source files Thomas Petazzoni
2012-07-03 15:16   ` Andrew Lunn
2012-07-02 15:39 ` [PATCH 4/9] arm: mach-mvebu: add support for Armada 370 and Armada XP with DT Thomas Petazzoni
2012-07-03 15:36   ` Andrew Lunn
2012-07-02 15:39 ` [PATCH 5/9] arm: mach-mvebu: add documentation for new device tree bindings Thomas Petazzoni
2012-07-02 15:39 ` [PATCH 6/9] arm: mach-mvebu: add defconfig Thomas Petazzoni
2012-07-02 15:39 ` [PATCH 7/9] arm: mach-mvebu: add compilation/configuration change Thomas Petazzoni
2012-07-03 15:41   ` Andrew Lunn
2012-07-02 15:39 ` [PATCH 8/9] arm: mach-mvebu: add entry to MAINTAINERS Thomas Petazzoni
2012-07-02 15:39 ` Thomas Petazzoni [this message]
2012-07-03 17:20 ` [PATCH v7] arm: Add basic support for new Marvell Armada 370 and Armada XP SoC Ben Dooks
2012-07-04 12:11 ` Yehuda Yitschak
2012-07-04 13:54   ` Lior Amsalem
  -- strict thread matches above, loose matches on Subject: below --
2012-07-02 11:33 [PATCH v6] " Thomas Petazzoni
2012-07-02 11:33 ` [PATCH 9/9] ARM: mvebu: MPIC: read number of interrupts from control register Thomas Petazzoni

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=1341243574-3258-10-git-send-email-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.