2013-07-29 06:13:52 +08:00
|
|
|
bcm53xx: initial support for the BCM5301/BCM470X SoC
|
2013-07-12 21:46:27 +08:00
|
|
|
with ARM CPU
|
|
|
|
|
|
|
|
This patch adds support for the BCM5301/BCM470X SoCs with an ARM CPU.
|
|
|
|
Currently just booting to a shell is working and nothing else, no
|
|
|
|
Ethernet, wifi, flash, ...
|
|
|
|
|
|
|
|
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
---
|
|
|
|
arch/arm/Kconfig | 2 +
|
|
|
|
arch/arm/Kconfig.debug | 5 ++
|
|
|
|
arch/arm/Makefile | 1 +
|
|
|
|
arch/arm/boot/dts/Makefile | 1 +
|
|
|
|
arch/arm/boot/dts/bcm5301-netgear-r6250.dts | 20 +++++++
|
|
|
|
arch/arm/boot/dts/bcm5301.dtsi | 83 +++++++++++++++++++++++++++
|
|
|
|
arch/arm/include/debug/bcm53xx.S | 19 ++++++
|
|
|
|
arch/arm/mach-bcm53xx/Kconfig | 15 +++++
|
|
|
|
arch/arm/mach-bcm53xx/Makefile | 1 +
|
|
|
|
arch/arm/mach-bcm53xx/bcm53xx.c | 69 ++++++++++++++++++++++
|
|
|
|
10 files changed, 216 insertions(+)
|
|
|
|
create mode 100644 arch/arm/boot/dts/bcm5301-netgear-r6250.dts
|
|
|
|
create mode 100644 arch/arm/boot/dts/bcm5301.dtsi
|
|
|
|
create mode 100644 arch/arm/include/debug/bcm53xx.S
|
|
|
|
create mode 100644 arch/arm/mach-bcm53xx/Kconfig
|
|
|
|
create mode 100644 arch/arm/mach-bcm53xx/Makefile
|
|
|
|
create mode 100644 arch/arm/mach-bcm53xx/bcm53xx.c
|
|
|
|
|
|
|
|
--- a/arch/arm/Kconfig
|
|
|
|
+++ b/arch/arm/Kconfig
|
|
|
|
@@ -922,6 +922,8 @@ source "arch/arm/mach-bcm/Kconfig"
|
|
|
|
|
|
|
|
source "arch/arm/mach-bcm2835/Kconfig"
|
|
|
|
|
|
|
|
+source "arch/arm/mach-bcm53xx/Kconfig"
|
|
|
|
+
|
|
|
|
source "arch/arm/mach-clps711x/Kconfig"
|
|
|
|
|
|
|
|
source "arch/arm/mach-cns3xxx/Kconfig"
|
|
|
|
--- a/arch/arm/Kconfig.debug
|
|
|
|
+++ b/arch/arm/Kconfig.debug
|
|
|
|
@@ -93,6 +93,10 @@ choice
|
|
|
|
bool "Kernel low-level debugging on BCM2835 PL011 UART"
|
|
|
|
depends on ARCH_BCM2835
|
|
|
|
|
2014-01-05 07:46:44 +08:00
|
|
|
+ config DEBUG_BCM_5301X
|
2013-07-12 21:46:27 +08:00
|
|
|
+ bool "Kernel low-level debugging on BCM53XX UART1"
|
2014-01-05 07:46:44 +08:00
|
|
|
+ depends on ARCH_BCM_5301X
|
2013-07-12 21:46:27 +08:00
|
|
|
+
|
|
|
|
config DEBUG_CLPS711X_UART1
|
|
|
|
bool "Kernel low-level debugging messages via UART1"
|
|
|
|
depends on ARCH_CLPS711X
|
|
|
|
@@ -620,6 +624,7 @@ endchoice
|
|
|
|
config DEBUG_LL_INCLUDE
|
|
|
|
string
|
|
|
|
default "debug/bcm2835.S" if DEBUG_BCM2835
|
2014-01-05 07:46:44 +08:00
|
|
|
+ default "debug/bcm53xx.S" if DEBUG_BCM_5301X
|
2013-07-12 21:46:27 +08:00
|
|
|
default "debug/cns3xxx.S" if DEBUG_CNS3XXX
|
|
|
|
default "debug/exynos.S" if DEBUG_EXYNOS_UART
|
|
|
|
default "debug/highbank.S" if DEBUG_HIGHBANK_UART
|
|
|
|
--- a/arch/arm/Makefile
|
|
|
|
+++ b/arch/arm/Makefile
|
|
|
|
@@ -145,6 +145,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x0020
|
|
|
|
machine-$(CONFIG_ARCH_AT91) += at91
|
|
|
|
machine-$(CONFIG_ARCH_BCM) += bcm
|
|
|
|
machine-$(CONFIG_ARCH_BCM2835) += bcm2835
|
2014-01-05 07:46:44 +08:00
|
|
|
+machine-$(CONFIG_ARCH_BCM_5301X) += bcm53xx
|
2013-07-12 21:46:27 +08:00
|
|
|
machine-$(CONFIG_ARCH_CLPS711X) += clps711x
|
|
|
|
machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx
|
|
|
|
machine-$(CONFIG_ARCH_DAVINCI) += davinci
|
|
|
|
--- a/arch/arm/boot/dts/Makefile
|
|
|
|
+++ b/arch/arm/boot/dts/Makefile
|
|
|
|
@@ -209,6 +209,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07
|
|
|
|
wm8650-mid.dtb \
|
|
|
|
wm8850-w70v2.dtb
|
|
|
|
dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
|
2014-01-05 07:46:44 +08:00
|
|
|
+dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb
|
2013-07-12 21:46:27 +08:00
|
|
|
|
|
|
|
targets += dtbs
|
|
|
|
targets += $(dtb-y)
|
|
|
|
--- /dev/null
|
2014-01-05 07:46:44 +08:00
|
|
|
+++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
|
2013-07-12 21:46:27 +08:00
|
|
|
@@ -0,0 +1,20 @@
|
|
|
|
+/*
|
2014-01-05 07:46:44 +08:00
|
|
|
+ * Broadcom BCM470X / BCM5301X arm platform code.
|
2013-07-12 21:46:27 +08:00
|
|
|
+ *
|
|
|
|
+ * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
+ *
|
|
|
|
+ * Licensed under the GNU/GPL. See COPYING for details.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+/dts-v1/;
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+#include "bcm4708.dtsi"
|
2013-07-12 21:46:27 +08:00
|
|
|
+
|
|
|
|
+/ {
|
2014-01-05 07:46:44 +08:00
|
|
|
+ compatible = "netgear,r6250v1", "broadcom,bcm4708";
|
2013-07-12 21:46:27 +08:00
|
|
|
+ model = "Netgear R6250 V1 (BCM4708)";
|
|
|
|
+
|
|
|
|
+ memory {
|
|
|
|
+ reg = <0x00000000 0x08000000>;
|
|
|
|
+ };
|
|
|
|
+};
|
|
|
|
--- /dev/null
|
2014-01-05 07:46:44 +08:00
|
|
|
+++ b/arch/arm/boot/dts/bcm4708.dtsi
|
|
|
|
@@ -0,0 +1,100 @@
|
2013-07-12 21:46:27 +08:00
|
|
|
+/*
|
2014-01-05 07:46:44 +08:00
|
|
|
+ * Broadcom BCM470X / BCM5301X ARM platform code.
|
2013-07-12 21:46:27 +08:00
|
|
|
+ *
|
|
|
|
+ * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
+ *
|
|
|
|
+ * Licensed under the GNU/GPL. See COPYING for details.
|
|
|
|
+ */
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+#include <dt-bindings/interrupt-controller/arm-gic.h>
|
|
|
|
+#include <dt-bindings/interrupt-controller/irq.h>
|
|
|
|
+
|
|
|
|
+#include "skeleton.dtsi"
|
2013-07-12 21:46:27 +08:00
|
|
|
+
|
|
|
|
+/ {
|
2014-01-05 07:46:44 +08:00
|
|
|
+ compatible = "broadcom,bcm4708";
|
|
|
|
+ model = "Broadcom BCM4708";
|
2013-07-12 21:46:27 +08:00
|
|
|
+ interrupt-parent = <&gic>;
|
|
|
|
+
|
|
|
|
+ chosen {
|
2014-01-05 07:46:44 +08:00
|
|
|
+ bootargs = "console=ttyS0,115200 debug earlyprintk";
|
2013-07-12 21:46:27 +08:00
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ cpus {
|
|
|
|
+ #address-cells = <1>;
|
|
|
|
+ #size-cells = <0>;
|
|
|
|
+
|
|
|
|
+ cpu@0 {
|
|
|
|
+ device_type = "cpu";
|
|
|
|
+ compatible = "arm,cortex-a9";
|
2014-01-05 07:46:44 +08:00
|
|
|
+ next-level-cache = <&L2>;
|
2013-07-12 21:46:27 +08:00
|
|
|
+ reg = <0>;
|
|
|
|
+ };
|
|
|
|
+ cpu@1 {
|
|
|
|
+ device_type = "cpu";
|
|
|
|
+ compatible = "arm,cortex-a9";
|
2014-01-05 07:46:44 +08:00
|
|
|
+ next-level-cache = <&L2>;
|
2013-07-12 21:46:27 +08:00
|
|
|
+ reg = <1>;
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ clocks {
|
|
|
|
+ #address-cells = <1>;
|
|
|
|
+ #size-cells = <0>;
|
|
|
|
+
|
|
|
|
+ clk_periph: periph {
|
|
|
|
+ compatible = "fixed-clock";
|
|
|
|
+ #clock-cells = <0>;
|
|
|
|
+ clock-frequency = <400000000>;
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ uart@18000300 {
|
|
|
|
+ compatible = "ns16550";
|
|
|
|
+ reg = <0x18000300 0x100>;
|
2014-01-05 07:46:44 +08:00
|
|
|
+ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
|
2013-07-12 21:46:27 +08:00
|
|
|
+ clock-frequency = <100000000>;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ uart@18000400 {
|
|
|
|
+ compatible = "ns16550";
|
|
|
|
+ reg = <0x18000400 0x100>;
|
2014-01-05 07:46:44 +08:00
|
|
|
+ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
|
2013-07-12 21:46:27 +08:00
|
|
|
+ clock-frequency = <100000000>;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ gic: interrupt-controller@19021000 {
|
|
|
|
+ compatible = "arm,cortex-a9-gic";
|
|
|
|
+ #interrupt-cells = <3>;
|
|
|
|
+ #address-cells = <0>;
|
|
|
|
+ interrupt-controller;
|
|
|
|
+ reg = <0x19021000 0x1000>,
|
|
|
|
+ <0x19020100 0x100>;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ timer@19020200 {
|
|
|
|
+ compatible = "arm,cortex-a9-global-timer";
|
|
|
|
+ reg = <0x19020200 0x100>;
|
2014-01-05 07:46:44 +08:00
|
|
|
+ interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
2013-07-12 21:46:27 +08:00
|
|
|
+ clocks = <&clk_periph>;
|
|
|
|
+ };
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+ local-timer@19020600 {
|
2013-07-12 21:46:27 +08:00
|
|
|
+ compatible = "arm,cortex-a9-twd-timer";
|
|
|
|
+ reg = <0x19020600 0x100>;
|
2014-01-05 07:46:44 +08:00
|
|
|
+ interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
|
|
|
|
+ clocks = <&clk_periph>;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ L2: cache-controller@19022000 {
|
|
|
|
+ compatible = "arm,pl310-cache";
|
|
|
|
+ reg = <0x19022000 0x1000>;
|
|
|
|
+ cache-unified;
|
|
|
|
+ cache-level = <2>;
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ scu@19020000 {
|
|
|
|
+ compatible = "arm,cortex-a9-scu";
|
|
|
|
+ reg = <0x19020000 0x100>;
|
2013-07-12 21:46:27 +08:00
|
|
|
+ };
|
|
|
|
+};
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/arch/arm/include/debug/bcm53xx.S
|
|
|
|
@@ -0,0 +1,19 @@
|
|
|
|
+/*
|
|
|
|
+ * Macros used for EARLY_PRINTK, in low-level UART debug console
|
|
|
|
+ *
|
|
|
|
+ * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
+ *
|
|
|
|
+ * Licensed under the GNU/GPL. See COPYING for details.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+#define BCM53XX_UART1_PHYS 0x18000300
|
|
|
|
+#define BCM53XX_UART1_VIRT 0xf1000300
|
|
|
|
+#define BCM53XX_UART1_SH 0
|
|
|
|
+
|
|
|
|
+ .macro addruart, rp, rv, tmp
|
|
|
|
+ ldr \rp, =BCM53XX_UART1_PHYS @ MMU off, Physical
|
|
|
|
+ ldr \rv, =BCM53XX_UART1_VIRT @ MMU on, Virtual
|
|
|
|
+ .endm
|
|
|
|
+
|
|
|
|
+#define UART_SHIFT BCM53XX_UART1_SH
|
|
|
|
+#include <asm/hardware/debug-8250.S>
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/arch/arm/mach-bcm53xx/Kconfig
|
2014-01-05 07:46:44 +08:00
|
|
|
@@ -0,0 +1,26 @@
|
|
|
|
+config ARCH_BCM_5301X
|
|
|
|
+ bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
|
|
|
|
+ depends on MMU
|
2013-07-12 21:46:27 +08:00
|
|
|
+ select ARM_GIC
|
2014-01-05 07:46:44 +08:00
|
|
|
+ select CACHE_L2X0
|
2013-07-12 21:46:27 +08:00
|
|
|
+ select HAVE_ARM_SCU if SMP
|
2014-01-05 07:46:44 +08:00
|
|
|
+ select HAVE_ARM_TWD if SMP
|
2013-07-12 21:46:27 +08:00
|
|
|
+ select HAVE_SMP
|
2014-01-05 07:46:44 +08:00
|
|
|
+ select COMMON_CLK
|
2013-07-12 21:46:27 +08:00
|
|
|
+ select GENERIC_CLOCKEVENTS
|
2014-01-05 07:46:44 +08:00
|
|
|
+ select GENERIC_TIME
|
2013-07-12 21:46:27 +08:00
|
|
|
+ select ARM_GLOBAL_TIMER
|
2014-01-05 07:46:44 +08:00
|
|
|
+ select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
|
2013-07-29 05:10:42 +08:00
|
|
|
+ select MIGHT_HAVE_PCI
|
2013-07-12 21:46:27 +08:00
|
|
|
+ help
|
2014-01-05 07:46:44 +08:00
|
|
|
+ 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.
|
|
|
|
+ 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
|
2013-07-12 21:46:27 +08:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/arch/arm/mach-bcm53xx/Makefile
|
|
|
|
@@ -0,0 +1 @@
|
|
|
|
+obj-y += bcm53xx.o
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/arch/arm/mach-bcm53xx/bcm53xx.c
|
2014-01-05 07:46:44 +08:00
|
|
|
@@ -0,0 +1,60 @@
|
2013-07-12 21:46:27 +08:00
|
|
|
+/*
|
2014-01-05 07:46:44 +08:00
|
|
|
+ * Broadcom BCM470X / BCM5301X ARM platform code.
|
2013-07-12 21:46:27 +08:00
|
|
|
+ *
|
|
|
|
+ * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
|
|
|
|
+ *
|
|
|
|
+ * Licensed under the GNU/GPL. See COPYING for details.
|
|
|
|
+ */
|
|
|
|
+#include <linux/of_address.h>
|
|
|
|
+#include <linux/of_platform.h>
|
|
|
|
+#include <linux/clocksource.h>
|
|
|
|
+#include <linux/clk-provider.h>
|
2014-01-05 07:46:44 +08:00
|
|
|
+#include <asm/hardware/cache-l2x0.h>
|
2013-07-12 21:46:27 +08:00
|
|
|
+
|
|
|
|
+#include <asm/mach/arch.h>
|
|
|
|
+#include <asm/mach/map.h>
|
|
|
|
+#include <asm/signal.h>
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
|
2013-07-12 21:46:27 +08:00
|
|
|
+ struct pt_regs *regs)
|
|
|
|
+{
|
|
|
|
+ /*
|
2014-01-05 07:46:44 +08:00
|
|
|
+ * These happen for no good reason, possibly left over from CFE
|
2013-07-12 21:46:27 +08:00
|
|
|
+ */
|
|
|
|
+ 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;
|
|
|
|
+}
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+static void __init bcm5301x_init_early(void)
|
2013-07-12 21:46:27 +08:00
|
|
|
+{
|
|
|
|
+ /* Install our hook */
|
2014-01-05 07:46:44 +08:00
|
|
|
+ hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, 0,
|
2013-07-12 21:46:27 +08:00
|
|
|
+ "imprecise external abort");
|
|
|
|
+}
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+static void __init bcm5301x_timer_init(void)
|
2013-07-12 21:46:27 +08:00
|
|
|
+{
|
|
|
|
+ of_clk_init(NULL);
|
|
|
|
+ clocksource_of_init();
|
|
|
|
+}
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+static void __init bcm5301x_dt_init(void)
|
2013-07-12 21:46:27 +08:00
|
|
|
+{
|
2014-01-05 07:46:44 +08:00
|
|
|
+ l2x0_of_init(0, ~0UL);
|
2013-07-12 21:46:27 +08:00
|
|
|
+ of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
|
|
|
|
+}
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+static const char __initconst *bcm5301x_dt_compat[] = {
|
|
|
|
+ "broadcom,bcm4708",
|
2013-07-12 21:46:27 +08:00
|
|
|
+ NULL,
|
|
|
|
+};
|
|
|
|
+
|
2014-01-05 07:46:44 +08:00
|
|
|
+DT_MACHINE_START(BCM5301X, "BCM5301X")
|
|
|
|
+ .init_early = bcm5301x_init_early,
|
|
|
|
+ .init_time = bcm5301x_timer_init,
|
|
|
|
+ .init_machine = bcm5301x_dt_init,
|
|
|
|
+ .dt_compat = bcm5301x_dt_compat,
|
2013-07-12 21:46:27 +08:00
|
|
|
+MACHINE_END
|