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 v3 06/13] ARM: mvebu: add workaround for data abort issue on Armada 375
Date: Thu, 13 Feb 2014 12:04:28 +0100	[thread overview]
Message-ID: <1392289475-8902-7-git-send-email-thomas.petazzoni@free-electrons.com> (raw)
In-Reply-To: <1392289475-8902-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-mvebu.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm/mach-mvebu/armada-mvebu.c b/arch/arm/mach-mvebu/armada-mvebu.c
index 7d1687a..7e50464 100644
--- a/arch/arm/mach-mvebu/armada-mvebu.c
+++ b/arch/arm/mach-mvebu/armada-mvebu.c
@@ -36,6 +36,27 @@ static void __init armada_mvebu_map_io(void)
 	debug_ll_io_init();
 }
 
+/*
+ * 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 && fsr == 0x1406) {
+		ignore_first = 1;
+		return 0;
+	}
+
+	return 1;
+}
+
 static void __init armada_mvebu_timer_and_clk_init(void)
 {
 	of_clk_init(NULL);
@@ -45,6 +66,10 @@ static void __init armada_mvebu_timer_and_clk_init(void)
 #ifdef CONFIG_CACHE_L2X0
 	l2x0_of_init(0, ~0UL);
 #endif
+
+	if (of_machine_is_compatible("marvell,armada375"))
+		hook_fault_code(16 + 6, armada_375_external_abort_wa, SIGBUS, 0,
+				"imprecise external abort");
 }
 
 static void __init i2c_quirk(void)
-- 
1.8.3.2

  parent reply	other threads:[~2014-02-13 11:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 11:04 [PATCH v3 00/13] Core support for Marvell Armada 375 and 38x Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 01/13] ARM: mvebu: rename armada-370-xp.c to armada-mvebu.c Thomas Petazzoni
2014-02-13 11:50   ` Arnd Bergmann
2014-02-13 11:55     ` Thomas Petazzoni
2014-02-13 12:52       ` Arnd Bergmann
2014-02-13 13:07       ` Jason Cooper
2014-02-13 13:13         ` Thomas Petazzoni
2014-02-13 13:24           ` Sebastian Hesselbarth
2014-02-13 13:29             ` Thomas Petazzoni
2014-02-17  2:49               ` Jason Cooper
2014-02-17 10:23                 ` Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 02/13] ARM: mvebu: rename DT machine structure for Armada 370/XP Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 03/13] ARM: mvebu: make CPU_PJ4B selection a per-SoC choice Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 04/13] ARM: mvebu: add Armada 375 support to the system-controller driver Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 05/13] ARM: mvebu: add initial support for the Armada 375 SOCs Thomas Petazzoni
2014-02-13 11:04 ` Thomas Petazzoni [this message]
2014-02-13 11:04 ` [PATCH v3 07/13] ARM: mvebu: add Device Tree description of the Armada 375 SoC Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 08/13] ARM: mvebu: add Device Tree for the Armada 375 DB board Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 09/13] ARM: mvebu: add initial support for the Armada 380/385 SOCs Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 10/13] ARM: mvebu: add Device Tree description of the Armada 380/385 SoCs Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 11/13] ARM: mvebu: add Device Tree for the Armada 385 DB board Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 12/13] ARM: mvebu: update defconfigs for Armada 375 and 38x Thomas Petazzoni
2014-02-13 11:04 ` [PATCH v3 13/13] 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=1392289475-8902-7-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.