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 v2 03/10] ARM: mvebu: add workaround for data abort issue on Armada 375
Date: Wed, 12 Feb 2014 11:23:32 +0100	[thread overview]
Message-ID: <1392200619-3141-4-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1392200619-3141-1-git-send-email-thomas.petazzoni@free-electrons.com>

Early versions of Armada 375 SoC have a bug where the BootROM leaves
an external data abort pending. The kernel is hit by this data abort
as soon as it enters userspace, because it unmasks the data aborts at
this moment. We register a custom abort handler below to ignore the
first data abort to work around this problem.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 arch/arm/mach-mvebu/armada-375.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/mach-mvebu/armada-375.c b/arch/arm/mach-mvebu/armada-375.c
index f13c9de..d772ae2 100644
--- a/arch/arm/mach-mvebu/armada-375.c
+++ b/arch/arm/mach-mvebu/armada-375.c
@@ -22,14 +22,37 @@
 #include <linux/mbus.h>
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
+#include <asm/signal.h>
 #include "common.h"
 
+/*
+ * Early versions of Armada 375 SoC have a bug where the BootROM
+ * leaves an external data abort pending. The kernel is hit by this
+ * data abort as soon as it enters userspace, because it unmasks the
+ * data aborts at this moment. We register a custom abort handler
+ * below to ignore the first data abort to work around this problem.
+ */
+static int armada_375_external_abort_wa(unsigned long addr, unsigned int fsr,
+					struct pt_regs *regs)
+{
+	static int ignore_first;
+
+	if (!ignore_first) {
+		ignore_first = 1;
+		return 0;
+	}
+
+	return 1;
+}
+
 static void __init armada_375_timer_and_clk_init(void)
 {
 	of_clk_init(NULL);
 	clocksource_of_init();
 	BUG_ON(mvebu_mbus_dt_init());
 	l2x0_of_init(0, ~0UL);
+	hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0,
+			"imprecise external abort");
 }
 
 static const char * const armada_375_dt_compat[] = {
-- 
1.8.3.2

  parent reply	other threads:[~2014-02-12 10:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 10:23 [PATCH v2 00/10] Core support for Marvell Armada 375 and 38x Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 01/10] ARM: mvebu: add Armada 375 support to the system-controller driver Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 02/10] ARM: mvebu: add initial support for the Armada 375 SOCs Thomas Petazzoni
2014-02-12 13:08   ` Arnd Bergmann
2014-02-13 10:55     ` Thomas Petazzoni
2014-02-12 10:23 ` Thomas Petazzoni [this message]
2014-02-12 13:10   ` [PATCH v2 03/10] ARM: mvebu: add workaround for data abort issue on Armada 375 Arnd Bergmann
2014-02-13 10:56     ` Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 04/10] ARM: mvebu: add Device Tree description of the Armada 375 SoC Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 05/10] ARM: mvebu: add Device Tree for the Armada 375 DB board Thomas Petazzoni
2014-02-12 13:12   ` Arnd Bergmann
2014-02-13 10:56     ` Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 06/10] ARM: mvebu: add initial support for the Armada 380/385 SOCs Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 07/10] ARM: mvebu: add Device Tree description of the Armada 380/385 SoCs Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 08/10] ARM: mvebu: add Device Tree for the Armada 385 DB board Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 09/10] ARM: mvebu: update defconfigs for Armada 375 and 38x Thomas Petazzoni
2014-02-12 10:23 ` [PATCH v2 10/10] Documentation: arm: update Marvell documentation about Armada 375/38x 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=1392200619-3141-4-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.