All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU
@ 2014-02-03 23:01 Hauke Mehrtens
  2014-02-03 23:01 ` [PATCH v8 1/4] " Hauke Mehrtens
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Hauke Mehrtens @ 2014-02-03 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

This adds initial support for Broadcom network SoC from the BCM5301X 
and BCM470X line.

I do not have any documentation, only the vendor source code published 
by Asus and Netgear to conform with the GPL, it would be nice to get 
some documentation for this Soc like this
https://www.broadcom.com/collateral/pg/440X-PG02-R.pdf
for the Broadcom BCM440X Ethernet controller.

With some additional patches I got Ethernet working with ~250 MBit/s.

A bootlog can be found here:
http://hauke-m.de/files/openwrt/devices/R6250/openwrt-boot-2014-01-05.txt

This is based on 3.14-rc1.

Christian Daudt could you please take these patches.

Changes since v7:
 * reorder debug options
 * rebase on 3.14-rc1

Changes since v6:
 * rebase on arm-soc.git branch next/soc
 * use ranges in dts files for SoC blocks

Changes since v5:
 * restructured the dts files, own file for the SoC family, the SoC and
   the device

Changes since v4:
 * removed bcm5301x_timer_init(), this function is not needed
 * removed GENERIC_TIME this is dead
 * made fault handler check for code and just catch the first fault.

Changes since v3:
 * rebase on Linus 3.13-rc7
 * split the workaround into an own patch
 * add L2 cache controller to Device tree
 * rename config option
 * add local-timer and SCU entry to device tree

Changes since v2:
 * use vendor prefix brcm
 * move code to arch/arm/mach-bcm/
 * cleanup arch/arm/mach-bcm/bcm5301x.c
 * rename to bcm5301x
 * split into more patches

Changes since v1:
 * add file Documentation/devicetree/bindings/arm/bcm4708.txt
 * rename bcm5301x to bcm4708 in dts files
 * use preprocessor includes in dts file
 * add CONFIG_ARCH_BCM53XX to multi_v7_defconfig
 * remove init_machine callback
 * rename vendor prefix from brcm to bcm
 * split into two patches 

Hauke Mehrtens (4):
  ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM
    CPU
  ARM: BCM5301X: add early debugging support
  ARM: BCM5301X: add dts files for BCM4708 SoC
  ARM: BCM5301X: workaround suppress fault

 Documentation/devicetree/bindings/arm/bcm4708.txt |    8 ++
 MAINTAINERS                                       |    8 ++
 arch/arm/Kconfig.debug                            |    7 ++
 arch/arm/boot/dts/Makefile                        |    1 +
 arch/arm/boot/dts/bcm4708-netgear-r6250.dts       |   35 ++++++++
 arch/arm/boot/dts/bcm4708.dtsi                    |   34 ++++++++
 arch/arm/boot/dts/bcm5301x.dtsi                   |   95 +++++++++++++++++++++
 arch/arm/configs/multi_v7_defconfig               |    1 +
 arch/arm/mach-bcm/Kconfig                         |   26 ++++++
 arch/arm/mach-bcm/Makefile                        |    1 +
 arch/arm/mach-bcm/bcm_5301x.c                     |   61 +++++++++++++
 11 files changed, 277 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm4708.txt
 create mode 100644 arch/arm/boot/dts/bcm4708-netgear-r6250.dts
 create mode 100644 arch/arm/boot/dts/bcm4708.dtsi
 create mode 100644 arch/arm/boot/dts/bcm5301x.dtsi
 create mode 100644 arch/arm/mach-bcm/bcm_5301x.c

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v8 1/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU
  2014-02-03 23:01 [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Hauke Mehrtens
@ 2014-02-03 23:01 ` Hauke Mehrtens
  2014-02-03 23:01 ` [PATCH v8 2/4] ARM: BCM5301X: add early debugging support Hauke Mehrtens
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Hauke Mehrtens @ 2014-02-03 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds support for the BCM5301X/BCM470X SoCs with an ARM CPUs.
Currently just booting to a shell is working and nothing else, no
Ethernet, wifi, flash, ...
I have some pending patches to make Ethernet work for this device.
Mostly device tree support for bcma is missing.

This SoC is used in small office and home router with Broadcom SoCs
it's internal name is Northstar. This code should support the BCM4707,
BCM4708, BCM4709, BCM53010, BCM53011 and BCM53012 SoC. It uses one or
two ARM Cortex A9 Cores, some highlights are 2 PCIe 2.0 controllers,
4 Gigabit Ethernet MACs and a USB 3.0 host controller.

This SoC uses a dual core CPU, but this is currently not implemented.
More information about this SoC can be found here:
http://www.anandtech.com/show/5925/broadcom-announces-bcm4708x-and-bcm5301x-socs-for-80211ac-routers

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 Documentation/devicetree/bindings/arm/bcm4708.txt |    8 ++++++
 MAINTAINERS                                       |    8 ++++++
 arch/arm/configs/multi_v7_defconfig               |    1 +
 arch/arm/mach-bcm/Kconfig                         |   26 +++++++++++++++++++
 arch/arm/mach-bcm/Makefile                        |    1 +
 arch/arm/mach-bcm/bcm_5301x.c                     |   28 +++++++++++++++++++++
 6 files changed, 72 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm4708.txt
 create mode 100644 arch/arm/mach-bcm/bcm_5301x.c

diff --git a/Documentation/devicetree/bindings/arm/bcm4708.txt b/Documentation/devicetree/bindings/arm/bcm4708.txt
new file mode 100644
index 0000000..6b0f49f
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/bcm4708.txt
@@ -0,0 +1,8 @@
+Broadcom BCM4708 device tree bindings
+-------------------------------------------
+
+Boards with the BCM4708 SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "brcm,bcm4708";
diff --git a/MAINTAINERS b/MAINTAINERS
index b2cf5cf..156de64 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1880,6 +1880,14 @@ F:	arch/arm/boot/dts/bcm2835*
 F:	arch/arm/configs/bcm2835_defconfig
 F:	drivers/*/*bcm2835*
 
+BROADCOM BCM5301X ARM ARCHICTURE
+M:	Hauke Mehrtens <hauke@hauke-m.de>
+L:	linux-arm-kernel at lists.infradead.org
+S:	Maintained
+F:	arch/arm/mach-bcm/bcm_5301x.c
+F:	arch/arm/boot/dts/bcm5301x.dtsi
+F:	arch/arm/boot/dts/bcm470*
+
 BROADCOM TG3 GIGABIT ETHERNET DRIVER
 M:	Nithin Nayak Sujir <nsujir@broadcom.com>
 M:	Michael Chan <mchan@broadcom.com>
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 845bc74..b4b658d 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -11,6 +11,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_ARMADA_370=y
 CONFIG_MACH_ARMADA_XP=y
 CONFIG_ARCH_BCM=y
+CONFIG_ARCH_BCM_5301X=y
 CONFIG_ARCH_BCM_MOBILE=y
 CONFIG_ARCH_BERLIN=y
 CONFIG_MACH_BERLIN_BG2=y
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index b1aa6a9..6201c18 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -32,6 +32,32 @@ config ARCH_BCM_MOBILE
 	  BCM11130, BCM11140, BCM11351, BCM28145 and
 	  BCM28155 variants.
 
+config ARCH_BCM_5301X
+	bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
+	depends on MMU
+	select ARM_GIC
+	select CACHE_L2X0
+	select HAVE_ARM_SCU if SMP
+	select HAVE_ARM_TWD if SMP
+	select HAVE_SMP
+	select COMMON_CLK
+	select GENERIC_CLOCKEVENTS
+	select ARM_GLOBAL_TIMER
+	select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
+	select MIGHT_HAVE_PCI
+	help
+	  Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
+
+	  This is a network SoC line mostly used in home routers and
+	  wifi access points, it's internal name is Northstar.
+	  This inclused the following SoC: BCM53010, BCM53011, BCM53012,
+	  BCM53014, BCM53015, BCM53016, BCM53017, BCM53018, BCM4707,
+	  BCM4708 and BCM4709.
+
+	  Do not confuse this with the BCM4760 which is a totally
+	  different SoC or with the older BCM47XX and BCM53XX based
+	  network SoC using a MIPS CPU, they are supported by arch/mips/bcm47xx
+
 endmenu
 
 endif
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index c2ccd5a..0164913 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -13,3 +13,4 @@
 obj-$(CONFIG_ARCH_BCM_MOBILE)	:= board_bcm281xx.o bcm_kona_smc.o bcm_kona_smc_asm.o kona.o
 plus_sec := $(call as-instr,.arch_extension sec,+sec)
 AFLAGS_bcm_kona_smc_asm.o	:=-Wa,-march=armv7-a$(plus_sec)
+obj-$(CONFIG_ARCH_BCM_5301X)	+= bcm_5301x.o
diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c
new file mode 100644
index 0000000..ef9740a
--- /dev/null
+++ b/arch/arm/mach-bcm/bcm_5301x.c
@@ -0,0 +1,28 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ *
+ * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+#include <linux/of_platform.h>
+#include <asm/hardware/cache-l2x0.h>
+
+#include <asm/mach/arch.h>
+
+
+static void __init bcm5301x_dt_init(void)
+{
+	l2x0_of_init(0, ~0UL);
+	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
+static const char __initconst *bcm5301x_dt_compat[] = {
+	"brcm,bcm4708",
+	NULL,
+};
+
+DT_MACHINE_START(BCM5301X, "BCM5301X")
+	.init_machine	= bcm5301x_dt_init,
+	.dt_compat	= bcm5301x_dt_compat,
+MACHINE_END
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v8 2/4] ARM: BCM5301X: add early debugging support
  2014-02-03 23:01 [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Hauke Mehrtens
  2014-02-03 23:01 ` [PATCH v8 1/4] " Hauke Mehrtens
@ 2014-02-03 23:01 ` Hauke Mehrtens
  2014-02-03 23:01 ` [PATCH v8 3/4] ARM: BCM5301X: add dts files for BCM4708 SoC Hauke Mehrtens
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Hauke Mehrtens @ 2014-02-03 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

This adds support for early debugging of BCM5301X SoC.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Christian Daudt <bcm@fixthebug.org>
---
 arch/arm/Kconfig.debug |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 0531da8..315ce91 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -106,6 +106,11 @@ choice
 		depends on ARCH_BCM2835
 		select DEBUG_UART_PL01X
 
+	config DEBUG_BCM_5301X
+		bool "Kernel low-level debugging on BCM5301X UART1"
+		depends on ARCH_BCM_5301X
+		select DEBUG_UART_PL01X
+
 	config DEBUG_BCM_KONA_UART
 		bool "Kernel low-level debugging messages via BCM KONA UART"
 		depends on ARCH_BCM
@@ -1023,6 +1028,7 @@ config DEBUG_UART_PHYS
 	default 0x101f1000 if ARCH_VERSATILE
 	default 0x101fb000 if DEBUG_NOMADIK_UART
 	default 0x16000000 if ARCH_INTEGRATOR
+	default 0x18000300 if DEBUG_BCM_5301X
 	default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
 	default 0x20060000 if DEBUG_RK29_UART0
 	default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
@@ -1071,6 +1077,7 @@ config DEBUG_UART_VIRT
 	default 0xf0009000 if DEBUG_CNS3XXX
 	default 0xf01fb000 if DEBUG_NOMADIK_UART
 	default 0xf0201000 if DEBUG_BCM2835
+	default 0xf1000300 if DEBUG_BCM_5301X
 	default 0xf11f1000 if ARCH_VERSATILE
 	default 0xf1600000 if ARCH_INTEGRATOR
 	default 0xf1c28000 if DEBUG_SUNXI_UART0
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v8 3/4] ARM: BCM5301X: add dts files for BCM4708 SoC
  2014-02-03 23:01 [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Hauke Mehrtens
  2014-02-03 23:01 ` [PATCH v8 1/4] " Hauke Mehrtens
  2014-02-03 23:01 ` [PATCH v8 2/4] ARM: BCM5301X: add early debugging support Hauke Mehrtens
@ 2014-02-03 23:01 ` Hauke Mehrtens
  2014-02-03 23:01 ` [PATCH v8 4/4] ARM: BCM5301X: workaround suppress fault Hauke Mehrtens
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Hauke Mehrtens @ 2014-02-03 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

This uses the newly added BCM5301X SoC code.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/boot/dts/Makefile                  |    1 +
 arch/arm/boot/dts/bcm4708-netgear-r6250.dts |   35 ++++++++++
 arch/arm/boot/dts/bcm4708.dtsi              |   34 ++++++++++
 arch/arm/boot/dts/bcm5301x.dtsi             |   95 +++++++++++++++++++++++++++
 4 files changed, 165 insertions(+)
 create mode 100644 arch/arm/boot/dts/bcm4708-netgear-r6250.dts
 create mode 100644 arch/arm/boot/dts/bcm4708.dtsi
 create mode 100644 arch/arm/boot/dts/bcm5301x.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index b9d6a8b..b72e359 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -49,6 +49,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
 dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm11351-brt.dtb \
 	bcm28155-ap.dtb
 dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb
+dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb
 dtb-$(CONFIG_ARCH_BERLIN) += \
 	berlin2-sony-nsz-gs7.dtb	\
 	berlin2cd-google-chromecast.dtb
diff --git a/arch/arm/boot/dts/bcm4708-netgear-r6250.dts b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
new file mode 100644
index 0000000..3b5259d
--- /dev/null
+++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
@@ -0,0 +1,35 @@
+/*
+ * Broadcom BCM470X / BCM5301X arm platform code.
+ * DTS for Netgear R6250 V1
+ *
+ * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+/dts-v1/;
+
+#include "bcm4708.dtsi"
+
+/ {
+	compatible = "netgear,r6250v1", "brcm,bcm4708";
+	model = "Netgear R6250 V1 (BCM4708)";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	memory {
+		reg = <0x00000000 0x08000000>;
+	};
+
+	chipcommonA {
+		uart0: serial at 0300 {
+			status = "okay";
+		};
+
+		uart1: serial at 0400 {
+			status = "okay";
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/bcm4708.dtsi b/arch/arm/boot/dts/bcm4708.dtsi
new file mode 100644
index 0000000..31141e8
--- /dev/null
+++ b/arch/arm/boot/dts/bcm4708.dtsi
@@ -0,0 +1,34 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * DTS for BCM4708 SoC.
+ *
+ * Copyright 2013-2014 Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+#include "bcm5301x.dtsi"
+
+/ {
+	compatible = "brcm,bcm4708";
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu at 0 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			next-level-cache = <&L2>;
+			reg = <0x0>;
+		};
+
+		cpu at 1 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			next-level-cache = <&L2>;
+			reg = <0x1>;
+		};
+	};
+
+};
diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
new file mode 100644
index 0000000..53c624f
--- /dev/null
+++ b/arch/arm/boot/dts/bcm5301x.dtsi
@@ -0,0 +1,95 @@
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * Generic DTS part for all BCM53010, BCM53011, BCM53012, BCM53014, BCM53015,
+ * BCM53016, BCM53017, BCM53018, BCM4707, BCM4708 and BCM4709 SoCs
+ *
+ * Copyright 2013-2014 Hauke Mehrtens <hauke@hauke-m.de>
+ *
+ * Licensed under the GNU/GPL. See COPYING for details.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include "skeleton.dtsi"
+
+/ {
+	interrupt-parent = <&gic>;
+
+	chipcommonA {
+		compatible = "simple-bus";
+		ranges = <0x00000000 0x18000000 0x00001000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		uart0: serial at 0300 {
+			compatible = "ns16550";
+			reg = <0x0300 0x100>;
+			interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+			clock-frequency = <100000000>;
+			status = "disabled";
+		};
+
+		uart1: serial at 0400 {
+			compatible = "ns16550";
+			reg = <0x0400 0x100>;
+			interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+			clock-frequency = <100000000>;
+			status = "disabled";
+		};
+	};
+
+	mpcore {
+		compatible = "simple-bus";
+		ranges = <0x00000000 0x19020000 0x00003000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		scu at 0000 {
+			compatible = "arm,cortex-a9-scu";
+			reg = <0x0000 0x100>;
+		};
+
+		timer at 0200 {
+			compatible = "arm,cortex-a9-global-timer";
+			reg = <0x0200 0x100>;
+			interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk_periph>;
+		};
+
+		local-timer at 0600 {
+			compatible = "arm,cortex-a9-twd-timer";
+			reg = <0x0600 0x100>;
+			interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&clk_periph>;
+		};
+
+		gic: interrupt-controller at 1000 {
+			compatible = "arm,cortex-a9-gic";
+			#interrupt-cells = <3>;
+			#address-cells = <0>;
+			interrupt-controller;
+			reg = <0x1000 0x1000>,
+			      <0x0100 0x100>;
+		};
+
+		L2: cache-controller at 2000 {
+			compatible = "arm,pl310-cache";
+			reg = <0x2000 0x1000>;
+			cache-unified;
+			cache-level = <2>;
+		};
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		/* As long as we do not have a real clock driver us this
+		 * fixed clock */
+		clk_periph: periph {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <400000000>;
+		};
+	};
+};
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v8 4/4] ARM: BCM5301X: workaround suppress fault
  2014-02-03 23:01 [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2014-02-03 23:01 ` [PATCH v8 3/4] ARM: BCM5301X: add dts files for BCM4708 SoC Hauke Mehrtens
@ 2014-02-03 23:01 ` Hauke Mehrtens
  2014-02-14 16:54 ` [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Florian Fainelli
  2014-02-19 15:00 ` Matt Porter
  5 siblings, 0 replies; 8+ messages in thread
From: Hauke Mehrtens @ 2014-02-03 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

Without this patch I am getting a unhandled fault exception like this
one after "Freeing unused kernel memory":

Freeing unused kernel memory: 1260K (c02c1000 - c03fc000)
Unhandled fault: imprecise external abort (0x1c06) at 0xb6f89005
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000007

The address which is here 0xb6f89005 changes from boot to boot, with a
new build the changes are bigger. With kernel 3.10 I have also seen
this fault at different places in the boot process, but starting with
3.11 they are always occurring after the "Freeing unused kernel memory"
message. I never was able to completely boot to userspace without this
handler. The abort code is constant 0x1c06. This fault just happens
once in the boot process I have never seen it happing twice or more.

I also tried changing the CPSR.A bit to 0 in init_early, with this code
like Afzal suggested, but that did not change anything:
asm volatile("mrs r12, cpsr\n"
	"bic r12, r12, #0x00000100\n"
	"msr cpsr_c, r12" ::: "r12", "cc", "memory");

Disabling the L2 cache by building with CONFIG_CACHE_L2X0 unset did not
help.

This workaround was copied from the vendor code including most of the
comments. It says it they think this is caused by the CFE boot loader
used on this device. I do not have any access to any datasheet or
errata document to check this.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-bcm/bcm_5301x.c |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm/mach-bcm/bcm_5301x.c b/arch/arm/mach-bcm/bcm_5301x.c
index ef9740a..edff6976 100644
--- a/arch/arm/mach-bcm/bcm_5301x.c
+++ b/arch/arm/mach-bcm/bcm_5301x.c
@@ -9,8 +9,40 @@
 #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 == 0x1c06 && first_fault) {
+		first_fault = false;
+
+		/*
+		 * These faults with code 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 void __init bcm5301x_dt_init(void)
 {
 	l2x0_of_init(0, ~0UL);
@@ -23,6 +55,7 @@ static const char __initconst *bcm5301x_dt_compat[] = {
 };
 
 DT_MACHINE_START(BCM5301X, "BCM5301X")
+	.init_early	= bcm5301x_init_early,
 	.init_machine	= bcm5301x_dt_init,
 	.dt_compat	= bcm5301x_dt_compat,
 MACHINE_END
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU
  2014-02-03 23:01 [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2014-02-03 23:01 ` [PATCH v8 4/4] ARM: BCM5301X: workaround suppress fault Hauke Mehrtens
@ 2014-02-14 16:54 ` Florian Fainelli
  2014-02-14 21:51   ` Matt Porter
  2014-02-19 15:00 ` Matt Porter
  5 siblings, 1 reply; 8+ messages in thread
From: Florian Fainelli @ 2014-02-14 16:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Christian,

Le 03/02/2014 15:01, Hauke Mehrtens a ?crit :
> This adds initial support for Broadcom network SoC from the BCM5301X
> and BCM470X line.
>
> I do not have any documentation, only the vendor source code published
> by Asus and Netgear to conform with the GPL, it would be nice to get
> some documentation for this Soc like this
> https://www.broadcom.com/collateral/pg/440X-PG02-R.pdf
> for the Broadcom BCM440X Ethernet controller.
>
> With some additional patches I got Ethernet working with ~250 MBit/s.
>
> A bootlog can be found here:
> http://hauke-m.de/files/openwrt/devices/R6250/openwrt-boot-2014-01-05.txt
>
> This is based on 3.14-rc1.
>
> Christian Daudt could you please take these patches.

Christian, have you been able to get a look at those patches? How do you 
want to proceed for patches affecting bcm5301x in the future? Except for 
a few cases (Kconfig, Makefile), support for bcm5301x is orthogonal to 
the other bcm-mobile SoCs, should that be taken care of by the arm-soc 
maintainers directly?

Thanks!

>
> Changes since v7:
>   * reorder debug options
>   * rebase on 3.14-rc1
>
> Changes since v6:
>   * rebase on arm-soc.git branch next/soc
>   * use ranges in dts files for SoC blocks
>
> Changes since v5:
>   * restructured the dts files, own file for the SoC family, the SoC and
>     the device
>
> Changes since v4:
>   * removed bcm5301x_timer_init(), this function is not needed
>   * removed GENERIC_TIME this is dead
>   * made fault handler check for code and just catch the first fault.
>
> Changes since v3:
>   * rebase on Linus 3.13-rc7
>   * split the workaround into an own patch
>   * add L2 cache controller to Device tree
>   * rename config option
>   * add local-timer and SCU entry to device tree
>
> Changes since v2:
>   * use vendor prefix brcm
>   * move code to arch/arm/mach-bcm/
>   * cleanup arch/arm/mach-bcm/bcm5301x.c
>   * rename to bcm5301x
>   * split into more patches
>
> Changes since v1:
>   * add file Documentation/devicetree/bindings/arm/bcm4708.txt
>   * rename bcm5301x to bcm4708 in dts files
>   * use preprocessor includes in dts file
>   * add CONFIG_ARCH_BCM53XX to multi_v7_defconfig
>   * remove init_machine callback
>   * rename vendor prefix from brcm to bcm
>   * split into two patches
>
> Hauke Mehrtens (4):
>    ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM
>      CPU
>    ARM: BCM5301X: add early debugging support
>    ARM: BCM5301X: add dts files for BCM4708 SoC
>    ARM: BCM5301X: workaround suppress fault
>
>   Documentation/devicetree/bindings/arm/bcm4708.txt |    8 ++
>   MAINTAINERS                                       |    8 ++
>   arch/arm/Kconfig.debug                            |    7 ++
>   arch/arm/boot/dts/Makefile                        |    1 +
>   arch/arm/boot/dts/bcm4708-netgear-r6250.dts       |   35 ++++++++
>   arch/arm/boot/dts/bcm4708.dtsi                    |   34 ++++++++
>   arch/arm/boot/dts/bcm5301x.dtsi                   |   95 +++++++++++++++++++++
>   arch/arm/configs/multi_v7_defconfig               |    1 +
>   arch/arm/mach-bcm/Kconfig                         |   26 ++++++
>   arch/arm/mach-bcm/Makefile                        |    1 +
>   arch/arm/mach-bcm/bcm_5301x.c                     |   61 +++++++++++++
>   11 files changed, 277 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/arm/bcm4708.txt
>   create mode 100644 arch/arm/boot/dts/bcm4708-netgear-r6250.dts
>   create mode 100644 arch/arm/boot/dts/bcm4708.dtsi
>   create mode 100644 arch/arm/boot/dts/bcm5301x.dtsi
>   create mode 100644 arch/arm/mach-bcm/bcm_5301x.c
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU
  2014-02-14 16:54 ` [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Florian Fainelli
@ 2014-02-14 21:51   ` Matt Porter
  0 siblings, 0 replies; 8+ messages in thread
From: Matt Porter @ 2014-02-14 21:51 UTC (permalink / raw)
  To: linux-arm-kernel

[Dropped arm at kernel.org as I think it's only intended for pull requests]

On Fri, Feb 14, 2014 at 08:54:26AM -0800, Florian Fainelli wrote:
> Hi Christian,
> 
> Le 03/02/2014 15:01, Hauke Mehrtens a ?crit :
> >This adds initial support for Broadcom network SoC from the BCM5301X
> >and BCM470X line.
> >
> >I do not have any documentation, only the vendor source code published
> >by Asus and Netgear to conform with the GPL, it would be nice to get
> >some documentation for this Soc like this
> >https://www.broadcom.com/collateral/pg/440X-PG02-R.pdf
> >for the Broadcom BCM440X Ethernet controller.
> >
> >With some additional patches I got Ethernet working with ~250 MBit/s.
> >
> >A bootlog can be found here:
> >http://hauke-m.de/files/openwrt/devices/R6250/openwrt-boot-2014-01-05.txt
> >
> >This is based on 3.14-rc1.
> >
> >Christian Daudt could you please take these patches.
> 
> Christian, have you been able to get a look at those patches? How do
> you want to proceed for patches affecting bcm5301x in the future?
> Except for a few cases (Kconfig, Makefile), support for bcm5301x is
> orthogonal to the other bcm-mobile SoCs, should that be taken care
> of by the arm-soc maintainers directly?

Based on Olof's suggestion on IRC, we'll want to take these through
Christian's tree and just give the arm-soc team a single set of pulls
for all platforms sharing mach-bcm/

I'll be helping Christian with this starting for 3.15. However, I'd like
his ack to be sure he's happy with this series too.  We have Arnd's ack
and my comments among others that were addressed so I'm good with it.

-Matt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU
  2014-02-03 23:01 [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2014-02-14 16:54 ` [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Florian Fainelli
@ 2014-02-19 15:00 ` Matt Porter
  5 siblings, 0 replies; 8+ messages in thread
From: Matt Porter @ 2014-02-19 15:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 04, 2014 at 12:01:42AM +0100, Hauke Mehrtens wrote:
> This adds initial support for Broadcom network SoC from the BCM5301X 
> and BCM470X line.
> 
> I do not have any documentation, only the vendor source code published 
> by Asus and Netgear to conform with the GPL, it would be nice to get 
> some documentation for this Soc like this
> https://www.broadcom.com/collateral/pg/440X-PG02-R.pdf
> for the Broadcom BCM440X Ethernet controller.
> 
> With some additional patches I got Ethernet working with ~250 MBit/s.
> 
> A bootlog can be found here:
> http://hauke-m.de/files/openwrt/devices/R6250/openwrt-boot-2014-01-05.txt
> 
> This is based on 3.14-rc1.
> 
> Christian Daudt could you please take these patches.

Applied for 3.15

Note: our tree is now git://git.github.com/broadcom/mach-bcm

-Matt

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-19 15:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-03 23:01 [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Hauke Mehrtens
2014-02-03 23:01 ` [PATCH v8 1/4] " Hauke Mehrtens
2014-02-03 23:01 ` [PATCH v8 2/4] ARM: BCM5301X: add early debugging support Hauke Mehrtens
2014-02-03 23:01 ` [PATCH v8 3/4] ARM: BCM5301X: add dts files for BCM4708 SoC Hauke Mehrtens
2014-02-03 23:01 ` [PATCH v8 4/4] ARM: BCM5301X: workaround suppress fault Hauke Mehrtens
2014-02-14 16:54 ` [PATCH v8 0/4] ARM: BCM5301X: initial support for the BCM5301X/BCM470X SoCs with ARM CPU Florian Fainelli
2014-02-14 21:51   ` Matt Porter
2014-02-19 15:00 ` Matt Porter

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.