linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: linux-mips@vger.kernel.org
Cc: tsbogend@alpha.franken.de, maz@kernel.org, chenhc@lemote.com,
	Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: [RFC PATCH 4/6] MIPS: kernel: Use mips_cpu_map_virq helper
Date: Thu, 26 Mar 2020 14:17:02 +0800	[thread overview]
Message-ID: <20200326061704.387483-7-jiaxun.yang@flygoat.com> (raw)
In-Reply-To: <20200326061704.387483-1-jiaxun.yang@flygoat.com>

Remove the use of MIPS_CPU_IRQ_BASE and step forward
to purely irq domain based platform.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 arch/mips/kernel/cevt-r4k.c          | 2 +-
 arch/mips/kernel/perf_event_mipsxx.c | 3 ++-
 arch/mips/kernel/rtlx-mt.c           | 7 +++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index 17a9cbb8b3df..d838b1cad0f7 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -247,7 +247,7 @@ int c0_compare_int_usable(void)
 
 unsigned int __weak get_c0_compare_int(void)
 {
-	return MIPS_CPU_IRQ_BASE + cp0_compare_irq;
+	return mips_cpu_map_virq(p0_compare_irq);
 }
 
 int r4k_clockevent_init(void)
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index 128fc9999c56..8fc484fe8afa 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -20,6 +20,7 @@
 #include <linux/uaccess.h>
 
 #include <asm/irq.h>
+#include <asm/irq_cpu.h>
 #include <asm/irq_regs.h>
 #include <asm/stacktrace.h>
 #include <asm/time.h> /* For perf_irq */
@@ -1702,7 +1703,7 @@ init_hw_perf_events(void)
 	if (get_c0_perfcount_int)
 		irq = get_c0_perfcount_int();
 	else if (cp0_perfcount_irq >= 0)
-		irq = MIPS_CPU_IRQ_BASE + cp0_perfcount_irq;
+		irq = mips_cpu_map_virq(cp0_perfcount_irq);
 	else
 		irq = -1;
 
diff --git a/arch/mips/kernel/rtlx-mt.c b/arch/mips/kernel/rtlx-mt.c
index 38c6925a1bea..110ed768d2ef 100644
--- a/arch/mips/kernel/rtlx-mt.c
+++ b/arch/mips/kernel/rtlx-mt.c
@@ -16,14 +16,17 @@
 
 #include <asm/mips_mt.h>
 #include <asm/vpe.h>
+#include <asm/irq_cpu.h>
 #include <asm/rtlx.h>
 
 static int major;
 
 static void rtlx_dispatch(void)
 {
-	if (read_c0_cause() & read_c0_status() & C_SW0)
-		do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_RTLX_IRQ);
+	if (read_c0_cause() & read_c0_status() & C_SW0) {
+		do_IRQ(irq_linear_revmap(mips_cpu_irq_domain,
+						MIPS_CPU_RTLX_IRQ);
+	}
 }
 
 /*
-- 
2.26.0.rc2



  parent reply	other threads:[~2020-03-26  6:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  6:16 [RFC PATCH 0/6] MIPS: Handle CPU IRQ in domain's way Jiaxun Yang
2020-03-26  6:16 ` [RFC PATCH 1/6] MIPS: irq_cpu: Add a helper to map virq for CPU IRQ Jiaxun Yang
2020-03-26  6:16 ` [PATCH 1/2] MIPS: Kill MIPS_GIC_IRQ_BASE Jiaxun Yang
2020-03-26  6:16 ` [RFC PATCH 2/6] irqchip: mips-cpu: Allocate fwnode for non-DT platforms Jiaxun Yang
2020-03-26  6:17 ` [PATCH 2/2] MIPS: Kill RM7K & RM9K IRQ Code Jiaxun Yang
2020-03-26  6:17 ` [RFC PATCH 3/6] irqchip: mips-cpu: Convert to simple domain Jiaxun Yang
2020-03-26  6:17 ` Jiaxun Yang [this message]
2020-03-26  6:17 ` [RFC PATCH 5/6] MIPS: loongson64: Use mips_cpu_map_virq helper Jiaxun Yang
2020-03-26  6:20 ` [RFC PATCH 6/6] MIPS: ip22: " Jiaxun Yang
2020-03-26 15:38 ` [RFC PATCH 0/6] MIPS: Handle CPU IRQ in domain's way Thomas Bogendoerfer
2020-03-26 15:46   ` Marc Zyngier

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=20200326061704.387483-7-jiaxun.yang@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhc@lemote.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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).