devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
To: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
Cc: Linux OMAP Mailing List
	<linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org,
	tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org,
	jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Subject: [PATCH 03/35] arm: omap: irq: start to remove irq_banks array
Date: Mon, 28 Jul 2014 16:15:51 -0500	[thread overview]
Message-ID: <1406582183-696-4-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1406582183-696-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>

We have a single bank in that array, this patch
is in preparation to remove that array. It just
shifts everything to a new set of functions
for register IO while also removing old ones.

Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---
 arch/arm/mach-omap2/irq.c | 64 ++++++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 37 deletions(-)

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 96073a2..83163d0 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -82,21 +82,20 @@ struct omap3_intc_regs {
 };
 
 /* INTC bank register get/set */
-
-static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg)
+static void intc_writel(u32 reg, u32 val)
 {
-	writel_relaxed(val, bank->base_reg + reg);
+	writel_relaxed(val, omap_irq_base + reg);
 }
 
-static u32 intc_bank_read_reg(struct omap_irq_bank *bank, u16 reg)
+static u32 intc_readl(u32 reg)
 {
-	return readl_relaxed(bank->base_reg + reg);
+	return readl_relaxed(omap_irq_base + reg);
 }
 
 /* XXX: FIQ and additional INTC support (only MPU at the moment) */
 static void omap_ack_irq(struct irq_data *d)
 {
-	intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL);
+	intc_writel(INTC_CONTROL, 0x1);
 }
 
 static void omap_mask_ack_irq(struct irq_data *d)
@@ -109,19 +108,19 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
 {
 	unsigned long tmp;
 
-	tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff;
+	tmp = intc_readl(INTC_REVISION) & 0xff;
 	pr_info("IRQ: Found an INTC at 0x%p (revision %ld.%ld) with %d interrupts\n",
 		bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs);
 
-	tmp = intc_bank_read_reg(bank, INTC_SYSCONFIG);
+	tmp = intc_readl(INTC_SYSCONFIG);
 	tmp |= 1 << 1;	/* soft reset */
-	intc_bank_write_reg(tmp, bank, INTC_SYSCONFIG);
+	intc_writel(INTC_SYSCONFIG, tmp);
 
-	while (!(intc_bank_read_reg(bank, INTC_SYSSTATUS) & 0x1))
+	while (!(intc_readl(INTC_SYSSTATUS) & 0x1))
 		/* Wait for reset to complete */;
 
 	/* Enable autoidle */
-	intc_bank_write_reg(1 << 0, bank, INTC_SYSCONFIG);
+	intc_writel(INTC_SYSCONFIG, 1 << 0);
 }
 
 int omap_irq_pending(void)
@@ -133,7 +132,7 @@ int omap_irq_pending(void)
 		int irq;
 
 		for (irq = 0; irq < bank->nr_irqs; irq += 32)
-			if (intc_bank_read_reg(bank, INTC_PENDING_IRQ0 +
+			if (intc_readl(INTC_PENDING_IRQ0 +
 					       ((irq >> 5) << 5)))
 				return 1;
 	}
@@ -307,22 +306,20 @@ void omap_intc_save_context(void)
 {
 	int ind = 0, i = 0;
 	for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
-		struct omap_irq_bank *bank = irq_banks + ind;
 		intc_context[ind].sysconfig =
-			intc_bank_read_reg(bank, INTC_SYSCONFIG);
+			intc_readl(INTC_SYSCONFIG);
 		intc_context[ind].protection =
-			intc_bank_read_reg(bank, INTC_PROTECTION);
+			intc_readl(INTC_PROTECTION);
 		intc_context[ind].idle =
-			intc_bank_read_reg(bank, INTC_IDLE);
+			intc_readl(INTC_IDLE);
 		intc_context[ind].threshold =
-			intc_bank_read_reg(bank, INTC_THRESHOLD);
+			intc_readl(INTC_THRESHOLD);
 		for (i = 0; i < INTCPS_NR_IRQS; i++)
 			intc_context[ind].ilr[i] =
-				intc_bank_read_reg(bank, (0x100 + 0x4*i));
+				intc_readl((INTC_ILR0 + 0x4 * i));
 		for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
 			intc_context[ind].mir[i] =
-				intc_bank_read_reg(&irq_banks[0], INTC_MIR0 +
-				(0x20 * i));
+				intc_readl(INTC_MIR0 + (0x20 * i));
 	}
 }
 
@@ -331,23 +328,16 @@ void omap_intc_restore_context(void)
 	int ind = 0, i = 0;
 
 	for (ind = 0; ind < ARRAY_SIZE(irq_banks); ind++) {
-		struct omap_irq_bank *bank = irq_banks + ind;
-		intc_bank_write_reg(intc_context[ind].sysconfig,
-					bank, INTC_SYSCONFIG);
-		intc_bank_write_reg(intc_context[ind].sysconfig,
-					bank, INTC_SYSCONFIG);
-		intc_bank_write_reg(intc_context[ind].protection,
-					bank, INTC_PROTECTION);
-		intc_bank_write_reg(intc_context[ind].idle,
-					bank, INTC_IDLE);
-		intc_bank_write_reg(intc_context[ind].threshold,
-					bank, INTC_THRESHOLD);
+		intc_writel(INTC_SYSCONFIG, intc_context[ind].sysconfig);
+		intc_writel(INTC_PROTECTION, intc_context[ind].protection);
+		intc_writel(INTC_IDLE, intc_context[ind].idle);
+		intc_writel(INTC_THRESHOLD, intc_context[ind].threshold);
 		for (i = 0; i < INTCPS_NR_IRQS; i++)
-			intc_bank_write_reg(intc_context[ind].ilr[i],
-				bank, (0x100 + 0x4*i));
+			intc_writel(INTC_ILR0 + 0x4 * i,
+					intc_context[ind].ilr[i]);
 		for (i = 0; i < INTCPS_NR_MIR_REGS; i++)
-			intc_bank_write_reg(intc_context[ind].mir[i],
-				 &irq_banks[0], INTC_MIR0 + (0x20 * i));
+			intc_writel(INTC_MIR0 + 0x20 * i,
+				intc_context[ind].mir[i]);
 	}
 	/* MIRs are saved and restore with other PRCM registers */
 }
@@ -364,13 +354,13 @@ void omap3_intc_prepare_idle(void)
 	 * Disable autoidle as it can stall interrupt controller,
 	 * cf. errata ID i540 for 3430 (all revisions up to 3.1.x)
 	 */
-	intc_bank_write_reg(0, &irq_banks[0], INTC_SYSCONFIG);
+	intc_writel(INTC_SYSCONFIG, 0);
 }
 
 void omap3_intc_resume_idle(void)
 {
 	/* Re-enable autoidle */
-	intc_bank_write_reg(1, &irq_banks[0], INTC_SYSCONFIG);
+	intc_writel(INTC_SYSCONFIG, 1);
 }
 
 asmlinkage void __exception_irq_entry omap3_intc_handle_irq(struct pt_regs *regs)
-- 
2.0.1.563.g66f467c

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-07-28 21:15 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 21:15 [PATCH 00/35] arm: omap: move intc to drivers/irqchip/ Felipe Balbi
2014-07-28 21:15 ` [PATCH 01/35] arm: omap: irq: make omap_irq_base global Felipe Balbi
2014-07-28 21:15 ` [PATCH 02/35] arm: omap: irq: define INTC_ILR0 register Felipe Balbi
2014-07-28 21:15 ` [PATCH 04/35] arm: omap: irq: add a global omap_nr_irqs variable Felipe Balbi
2014-07-28 21:15 ` [PATCH 06/35] arm: omap: irq: remove unused macro Felipe Balbi
2014-07-28 21:15 ` [PATCH 07/35] arm: omap: irq: switch over to intc_readl on omap_intc_handle_irq Felipe Balbi
2014-07-28 21:15 ` [PATCH 08/35] arm: omap: irq: remove unnecessary base_addr argument Felipe Balbi
2014-07-28 21:15 ` [PATCH 09/35] arm: omap: irq: rename omap3_intc_regs Felipe Balbi
2014-07-28 21:15 ` [PATCH 10/35] arm: omap: irq: always define omap3 support Felipe Balbi
2014-07-28 21:15 ` [PATCH 11/35] arm: omap: irq: reorganize code a little bit Felipe Balbi
2014-07-28 21:16 ` [PATCH 12/35] arm: omap: irq: make intc_of_init static Felipe Balbi
2014-07-28 21:16 ` [PATCH 13/35] arm: omap: irq: call set_handle_irq() from intc_of_init Felipe Balbi
     [not found]   ` <1406582183-696-14-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2014-07-29  2:20     ` Sebastian Reichel
2014-07-29 15:36       ` Felipe Balbi
     [not found]         ` <20140729153649.GD17808-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2014-07-29 16:00           ` Sebastian Reichel
2014-07-28 21:16 ` [PATCH 14/35] arm: omap: irq: use IRQCHIP_DECLARE macro Felipe Balbi
2014-07-28 21:16 ` [PATCH 15/35] arm: omap: irq: drop .handle_irq and .init_irq fields Felipe Balbi
2014-07-28 21:16 ` [PATCH 17/35] arm: omap: irq: use compatible flag to figure out number of IRQ lines Felipe Balbi
2014-07-28 21:16 ` [PATCH 18/35] arm: boot: dts: am33xx/omap3: fix intc compatible flag Felipe Balbi
2014-07-28 21:16 ` [PATCH 19/35] arm: omap: irq: drop ti,intc-size support Felipe Balbi
     [not found]   ` <1406582183-696-20-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2014-07-29  2:12     ` Sebastian Reichel
2014-07-28 21:16 ` [PATCH 20/35] arm: boot: dts: omap2/3/am33xx: drop ti,intc-size Felipe Balbi
2014-07-28 21:16 ` [PATCH 21/35] arm: omap: irq: move some more code around Felipe Balbi
2014-07-28 21:16 ` [PATCH 22/35] arm: omap: irq: call set_handle_irq() from .init_irq Felipe Balbi
2014-07-28 21:16 ` [PATCH 24/35] arm: omap: irq: drop omap2_intc_handle_irq() Felipe Balbi
2014-07-28 21:16 ` [PATCH 25/35] arm: omap: irq: remove unnecessary header Felipe Balbi
2014-07-28 21:16 ` [PATCH 26/35] arm: omap: irq: remove nr_irqs argument Felipe Balbi
2014-07-28 21:16 ` [PATCH 27/35] arm: omap: irq: introduce omap_nr_pending Felipe Balbi
2014-07-28 21:16 ` [PATCH 28/35] arm: omap: irq: get rid of ifdef hack Felipe Balbi
2014-07-28 21:16 ` [PATCH 29/35] arm: omap: intc: switch over to linear irq domain Felipe Balbi
2014-07-29 12:14   ` Tony Lindgren
     [not found]     ` <20140729121425.GR29045-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-07-29 14:15       ` Felipe Balbi
2014-07-29 15:20         ` Tony Lindgren
2014-07-29 15:40           ` Felipe Balbi
2014-07-29 16:33             ` Felipe Balbi
2014-07-30  6:04               ` Tony Lindgren
     [not found]                 ` <20140730060420.GY29045-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-07-30 14:40                   ` Felipe Balbi
     [not found]                     ` <20140730144059.GA7272-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2014-07-30 15:45                       ` Nishanth Menon
     [not found]                         ` <CAGo_u6ou+MoKOE_tTTmjxyFNW=jTaN9vnTsHrxR6sQHsieJyLA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-30 16:20                           ` Felipe Balbi
2014-07-31  6:28                             ` Tony Lindgren
     [not found]                               ` <20140731062843.GA29045-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-07-31  7:57                                 ` Tero Kristo
2014-07-31 13:49                                   ` Felipe Balbi
2014-08-01 12:26                                     ` Tero Kristo
2014-08-01 13:54                                       ` Felipe Balbi
2014-07-28 21:16 ` [PATCH 30/35] irqchip: add irq-omap-intc.h header Felipe Balbi
2014-07-29 12:01   ` Tony Lindgren
     [not found]     ` <20140729120133.GQ29045-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2014-07-29 14:10       ` Felipe Balbi
     [not found]         ` <20140729141045.GA17808-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2014-07-29 15:06           ` Tony Lindgren
2014-07-29 15:19             ` Felipe Balbi
     [not found]               ` <20140729151936.GC17808-HgARHv6XitL9zxVx7UNMDg@public.gmane.org>
2014-07-29 15:28                 ` Tony Lindgren
     [not found]   ` <1406582183-696-31-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2014-09-11 21:08     ` Tony Lindgren
2014-09-15 19:29       ` Felipe Balbi
2014-07-28 21:16 ` [PATCH 31/35] arm: omap: irq: move irq.c to drivers/irqchip/ Felipe Balbi
2014-07-28 21:16 ` [PATCH 32/35] irq: intc: minor improvement to omap_irq_pending() Felipe Balbi
2014-07-28 21:16 ` [PATCH 33/35] irq: intc: comment style cleanup Felipe Balbi
2014-07-28 21:16 ` [PATCH 34/35] irq: intc: remove unnecesary of_address_to_resource() call Felipe Balbi
2014-07-28 21:16 ` [PATCH 35/35] irq: intc: enable IP protection Felipe Balbi
2014-07-28 21:19 ` [PATCH 00/35] arm: omap: move intc to drivers/irqchip/ Felipe Balbi
     [not found] ` <1406582183-696-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2014-07-28 21:15   ` Felipe Balbi [this message]
2014-07-28 21:15   ` [PATCH 05/35] arm: omap: irq: remove rest of irq_banks usage Felipe Balbi
2014-07-28 21:16   ` [PATCH 16/35] arm: omap: irq: add specific compatibles for omap3 and am33xx devices Felipe Balbi
2014-07-28 21:16   ` [PATCH 23/35] arm: omap: irq: drop omap3_intc_handle_irq() Felipe Balbi
2014-07-29  2:25   ` [PATCH 00/35] arm: omap: move intc to drivers/irqchip/ Sebastian Reichel
2014-09-09  0:59   ` Tony Lindgren
2014-09-14  5:18 ` Jason Cooper
2014-09-15 15:31   ` Tony Lindgren

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=1406582183-696-4-git-send-email-balbi@ti.com \
    --to=balbi-l0cymroini0@public.gmane.org \
    --cc=bcousson-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org \
    --cc=khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
    --cc=tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.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 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).