From 6cae6c433d38dbe57e54108883dd26200e6d3068 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Thu, 3 Dec 2015 10:18:57 +0000
Subject: bcm53xx: use backported BCM5301X patches from stblinux soc/next
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47707 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 ...X-remove-workaround-imprecise-abort-fault.patch | 68 ++++++++++++++++++++++
 ...-BCM5310X-activate-erratas-needed-for-SoC.patch | 31 ----------
 ...-BCM5310X-activate-erratas-needed-for-SoC.patch | 31 ++++++++++
 3 files changed, 99 insertions(+), 31 deletions(-)
 create mode 100644 target/linux/bcm53xx/patches-4.4/020-ARM-BCM5301X-remove-workaround-imprecise-abort-fault.patch
 delete mode 100644 target/linux/bcm53xx/patches-4.4/020-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch
 create mode 100644 target/linux/bcm53xx/patches-4.4/021-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch

(limited to 'target')

diff --git a/target/linux/bcm53xx/patches-4.4/020-ARM-BCM5301X-remove-workaround-imprecise-abort-fault.patch b/target/linux/bcm53xx/patches-4.4/020-ARM-BCM5301X-remove-workaround-imprecise-abort-fault.patch
new file mode 100644
index 0000000000..bc115b11f8
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/020-ARM-BCM5301X-remove-workaround-imprecise-abort-fault.patch
@@ -0,0 +1,68 @@
+From 937b12306ea79044c86f2e69b3061c7279245825 Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Thu, 15 Oct 2015 12:32:22 +0200
+Subject: [PATCH] ARM: BCM5301X: remove workaround imprecise abort fault
+ handler
+
+This is not needed anymore. Handling a potentially pending imprecise external
+abort left behind by the bootloader is now done in a slightly safer way inside
+the common ARM startup code.
+
+Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
+Tested-by: Tyler Baker <tyler.baker@linaro.org>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ arch/arm/mach-bcm/bcm_5301x.c | 35 -----------------------------------
+ 1 file changed, 35 deletions(-)
+
+--- a/arch/arm/mach-bcm/bcm_5301x.c
++++ b/arch/arm/mach-bcm/bcm_5301x.c
+@@ -9,40 +9,6 @@
+ #include <asm/hardware/cache-l2x0.h>
+ 
+ #include <asm/mach/arch.h>
+-#include <asm/siginfo.h>
+-#include <asm/signal.h>
+-
+-
+-static bool first_fault = true;
+-
+-static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
+-				 struct pt_regs *regs)
+-{
+-	if ((fsr == 0x1406 || fsr == 0x1c06) && first_fault) {
+-		first_fault = false;
+-
+-		/*
+-		 * These faults with codes 0x1406 (BCM4709) or 0x1c06 happens
+-		 * for no good reason, possibly left over from the CFE boot
+-		 * loader.
+-		 */
+-		pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
+-			addr, fsr);
+-
+-		/* Returning non-zero causes fault display and panic */
+-		return 0;
+-	}
+-
+-	/* Others should cause a fault */
+-	return 1;
+-}
+-
+-static void __init bcm5301x_init_early(void)
+-{
+-	/* Install our hook */
+-	hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
+-			"imprecise external abort");
+-}
+ 
+ static const char *const bcm5301x_dt_compat[] __initconst = {
+ 	"brcm,bcm4708",
+@@ -52,6 +18,5 @@ static const char *const bcm5301x_dt_compat[] __initconst = {
+ DT_MACHINE_START(BCM5301X, "BCM5301X")
+ 	.l2c_aux_val	= 0,
+ 	.l2c_aux_mask	= ~0,
+-	.init_early	= bcm5301x_init_early,
+ 	.dt_compat	= bcm5301x_dt_compat,
+ MACHINE_END
diff --git a/target/linux/bcm53xx/patches-4.4/020-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch b/target/linux/bcm53xx/patches-4.4/020-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch
deleted file mode 100644
index 8169da90c5..0000000000
--- a/target/linux/bcm53xx/patches-4.4/020-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From f4ce7effe2253a325f8ba182903cbdf0d8698593 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Sat, 21 Nov 2015 15:29:47 +0100
-Subject: [PATCH] ARM: BCM5310X: activate erratas needed for SoC
-
-The BCM4708 I have, which is probably the first generation which got
-to the consumer market, is using a ARM Cortex-A9 rev r3p0 and a
-L2C-310 rev r3p2 L2 cache controller. There are 3 workarounds for known
-erratas in the Linux kernel which could be activated and will be in
-this patch. There are currently no workarounds which have to be
-activated for the L2C-310 rev r3p2 in Linux.
-
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
----
- arch/arm/mach-bcm/Kconfig | 4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/arch/arm/mach-bcm/Kconfig
-+++ b/arch/arm/mach-bcm/Kconfig
-@@ -52,6 +52,10 @@ config ARCH_BCM_NSP
- config ARCH_BCM_5301X
- 	bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
- 	select ARCH_BCM_IPROC
-+	select ARM_ERRATA_754322
-+	select ARM_ERRATA_775420
-+	select ARM_ERRATA_764369 if SMP
-+
- 	help
- 	  Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
- 
diff --git a/target/linux/bcm53xx/patches-4.4/021-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch b/target/linux/bcm53xx/patches-4.4/021-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch
new file mode 100644
index 0000000000..8169da90c5
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.4/021-ARM-BCM5310X-activate-erratas-needed-for-SoC.patch
@@ -0,0 +1,31 @@
+From f4ce7effe2253a325f8ba182903cbdf0d8698593 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sat, 21 Nov 2015 15:29:47 +0100
+Subject: [PATCH] ARM: BCM5310X: activate erratas needed for SoC
+
+The BCM4708 I have, which is probably the first generation which got
+to the consumer market, is using a ARM Cortex-A9 rev r3p0 and a
+L2C-310 rev r3p2 L2 cache controller. There are 3 workarounds for known
+erratas in the Linux kernel which could be activated and will be in
+this patch. There are currently no workarounds which have to be
+activated for the L2C-310 rev r3p2 in Linux.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+---
+ arch/arm/mach-bcm/Kconfig | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/arch/arm/mach-bcm/Kconfig
++++ b/arch/arm/mach-bcm/Kconfig
+@@ -52,6 +52,10 @@ config ARCH_BCM_NSP
+ config ARCH_BCM_5301X
+ 	bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
+ 	select ARCH_BCM_IPROC
++	select ARM_ERRATA_754322
++	select ARM_ERRATA_775420
++	select ARM_ERRATA_764369 if SMP
++
+ 	help
+ 	  Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
+ 
-- 
cgit v1.2.3