From: Duc Dang <dhdang@apm.com>
To: Marc Zyngier <marc.zyngier@arm.com>,
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
Jason Cooper <jason@lakedaemon.net>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org,
linux-arm <linux-arm-kernel@lists.infradead.org>,
Duc Dang <dhdang@apm.com>
Subject: [PATCH 1/1] irqchip/GICv2m: Add workaround for APM X-Gene GICv2m erratum
Date: Fri, 2 Oct 2015 15:16:49 -0700 [thread overview]
Message-ID: <1443824209-23611-1-git-send-email-dhdang@apm.com> (raw)
APM X-Gene GICv2m implementation has an erratum where the
MSI data needs to be the offset from the spi_start in order to
trigger the correct MSI interrupt. This is different from the
standard GICv2m implementation where the MSI data is the absolute
value within the range from spi_start to (spi_start + num_spis)
of each v2m frame.
This patch reads MSI_IIDR register (present in all GICv2m
implementations) to identify X-Gene GICv2m implementation and
apply workaround to change the data portion of MSI vector.
Signed-off-by: Duc Dang <dhdang@apm.com>
---
drivers/irqchip/irq-gic-v2m.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c
index db04fc1..470972c 100644
--- a/drivers/irqchip/irq-gic-v2m.c
+++ b/drivers/irqchip/irq-gic-v2m.c
@@ -43,6 +43,10 @@
#define V2M_MSI_TYPER_NUM_SPI(x) ((x) & V2M_MSI_TYPER_NUM_MASK)
+#define V2M_MSI_IIDR 0xFCC
+/* APM X-Gene with GICv2m MSI_IIDR register value */
+#define XGENE_GICV2M_MSI_IIDR 0x06000170
+
struct v2m_data {
spinlock_t msi_cnt_lock;
struct resource res; /* GICv2m resource */
@@ -98,6 +102,16 @@ static void gicv2m_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
msg->address_hi = (u32) (addr >> 32);
msg->address_lo = (u32) (addr);
msg->data = data->hwirq;
+ /*
+ * APM X-Gene GICv2m implementation has an erratum where
+ * the MSI data needs to be the offset from the spi_start
+ * in order to trigger the correct MSI interrupt. This is
+ * different from the standard GICv2m implementation where
+ * the MSI data is the absolute value within the range from
+ * spi_start to (spi_start + num_spis).
+ */
+ if (readl_relaxed(v2m->base + V2M_MSI_IIDR) == XGENE_GICV2M_MSI_IIDR)
+ msg->data = data->hwirq - v2m->spi_start;
}
static struct irq_chip gicv2m_irq_chip = {
--
1.9.1
next reply other threads:[~2015-10-02 22:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 22:16 Duc Dang [this message]
2015-10-03 13:26 ` Marc Zyngier
2015-10-06 22:30 ` Duc Dang
2015-10-06 22:32 ` [PATCH v2 " Duc Dang
2015-10-07 7:12 ` Marc Zyngier
2015-10-07 18:08 ` Duc Dang
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=1443824209-23611-1-git-send-email-dhdang@apm.com \
--to=dhdang@apm.com \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=tglx@linutronix.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
all inboxes | Powered by JetHome®