1 bcm53xx: initial support for the BCM5301/BCM470X SoC
4 This patch adds support for the BCM5301/BCM470X SoCs with an ARM CPU.
5 Currently just booting to a shell is working and nothing else, no
6 Ethernet, wifi, flash, ...
8 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
10 arch/arm/Kconfig | 2 +
11 arch/arm/Kconfig.debug | 5 ++
12 arch/arm/Makefile | 1 +
13 arch/arm/boot/dts/Makefile | 1 +
14 arch/arm/boot/dts/bcm5301-netgear-r6250.dts | 20 +++++++
15 arch/arm/boot/dts/bcm5301.dtsi | 83 +++++++++++++++++++++++++++
16 arch/arm/include/debug/bcm53xx.S | 19 ++++++
17 arch/arm/mach-bcm53xx/Kconfig | 15 +++++
18 arch/arm/mach-bcm53xx/Makefile | 1 +
19 arch/arm/mach-bcm53xx/bcm53xx.c | 69 ++++++++++++++++++++++
20 10 files changed, 216 insertions(+)
21 create mode 100644 arch/arm/boot/dts/bcm5301-netgear-r6250.dts
22 create mode 100644 arch/arm/boot/dts/bcm5301.dtsi
23 create mode 100644 arch/arm/include/debug/bcm53xx.S
24 create mode 100644 arch/arm/mach-bcm53xx/Kconfig
25 create mode 100644 arch/arm/mach-bcm53xx/Makefile
26 create mode 100644 arch/arm/mach-bcm53xx/bcm53xx.c
28 --- a/arch/arm/Kconfig
29 +++ b/arch/arm/Kconfig
30 @@ -922,6 +922,8 @@ source "arch/arm/mach-bcm/Kconfig"
32 source "arch/arm/mach-bcm2835/Kconfig"
34 +source "arch/arm/mach-bcm53xx/Kconfig"
36 source "arch/arm/mach-clps711x/Kconfig"
38 source "arch/arm/mach-cns3xxx/Kconfig"
39 --- a/arch/arm/Kconfig.debug
40 +++ b/arch/arm/Kconfig.debug
41 @@ -93,6 +93,10 @@ choice
42 bool "Kernel low-level debugging on BCM2835 PL011 UART"
43 depends on ARCH_BCM2835
45 + config DEBUG_BCM_5301X
46 + bool "Kernel low-level debugging on BCM53XX UART1"
47 + depends on ARCH_BCM_5301X
49 config DEBUG_CLPS711X_UART1
50 bool "Kernel low-level debugging messages via UART1"
51 depends on ARCH_CLPS711X
52 @@ -620,6 +624,7 @@ endchoice
53 config DEBUG_LL_INCLUDE
55 default "debug/bcm2835.S" if DEBUG_BCM2835
56 + default "debug/bcm53xx.S" if DEBUG_BCM_5301X
57 default "debug/cns3xxx.S" if DEBUG_CNS3XXX
58 default "debug/exynos.S" if DEBUG_EXYNOS_UART
59 default "debug/highbank.S" if DEBUG_HIGHBANK_UART
60 --- a/arch/arm/Makefile
61 +++ b/arch/arm/Makefile
62 @@ -145,6 +145,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x0020
63 machine-$(CONFIG_ARCH_AT91) += at91
64 machine-$(CONFIG_ARCH_BCM) += bcm
65 machine-$(CONFIG_ARCH_BCM2835) += bcm2835
66 +machine-$(CONFIG_ARCH_BCM_5301X) += bcm53xx
67 machine-$(CONFIG_ARCH_CLPS711X) += clps711x
68 machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx
69 machine-$(CONFIG_ARCH_DAVINCI) += davinci
70 --- a/arch/arm/boot/dts/Makefile
71 +++ b/arch/arm/boot/dts/Makefile
72 @@ -209,6 +209,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07
75 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
76 +dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb
81 +++ b/arch/arm/boot/dts/bcm4708-netgear-r6250.dts
84 + * Broadcom BCM470X / BCM5301X arm platform code.
86 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
88 + * Licensed under the GNU/GPL. See COPYING for details.
93 +#include "bcm4708.dtsi"
96 + compatible = "netgear,r6250v1", "broadcom,bcm4708";
97 + model = "Netgear R6250 V1 (BCM4708)";
100 + reg = <0x00000000 0x08000000>;
104 +++ b/arch/arm/boot/dts/bcm4708.dtsi
107 + * Broadcom BCM470X / BCM5301X ARM platform code.
109 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
111 + * Licensed under the GNU/GPL. See COPYING for details.
114 +#include <dt-bindings/interrupt-controller/arm-gic.h>
115 +#include <dt-bindings/interrupt-controller/irq.h>
117 +#include "skeleton.dtsi"
120 + compatible = "broadcom,bcm4708";
121 + model = "Broadcom BCM4708";
122 + interrupt-parent = <&gic>;
125 + bootargs = "console=ttyS0,115200 debug earlyprintk";
129 + #address-cells = <1>;
133 + device_type = "cpu";
134 + compatible = "arm,cortex-a9";
135 + next-level-cache = <&L2>;
139 + device_type = "cpu";
140 + compatible = "arm,cortex-a9";
141 + next-level-cache = <&L2>;
147 + #address-cells = <1>;
150 + clk_periph: periph {
151 + compatible = "fixed-clock";
152 + #clock-cells = <0>;
153 + clock-frequency = <400000000>;
158 + compatible = "ns16550";
159 + reg = <0x18000300 0x100>;
160 + interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
161 + clock-frequency = <100000000>;
165 + compatible = "ns16550";
166 + reg = <0x18000400 0x100>;
167 + interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
168 + clock-frequency = <100000000>;
171 + gic: interrupt-controller@19021000 {
172 + compatible = "arm,cortex-a9-gic";
173 + #interrupt-cells = <3>;
174 + #address-cells = <0>;
175 + interrupt-controller;
176 + reg = <0x19021000 0x1000>,
177 + <0x19020100 0x100>;
181 + compatible = "arm,cortex-a9-global-timer";
182 + reg = <0x19020200 0x100>;
183 + interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
184 + clocks = <&clk_periph>;
187 + local-timer@19020600 {
188 + compatible = "arm,cortex-a9-twd-timer";
189 + reg = <0x19020600 0x100>;
190 + interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
191 + clocks = <&clk_periph>;
194 + L2: cache-controller@19022000 {
195 + compatible = "arm,pl310-cache";
196 + reg = <0x19022000 0x1000>;
202 + compatible = "arm,cortex-a9-scu";
203 + reg = <0x19020000 0x100>;
207 +++ b/arch/arm/include/debug/bcm53xx.S
210 + * Macros used for EARLY_PRINTK, in low-level UART debug console
212 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
214 + * Licensed under the GNU/GPL. See COPYING for details.
217 +#define BCM53XX_UART1_PHYS 0x18000300
218 +#define BCM53XX_UART1_VIRT 0xf1000300
219 +#define BCM53XX_UART1_SH 0
221 + .macro addruart, rp, rv, tmp
222 + ldr \rp, =BCM53XX_UART1_PHYS @ MMU off, Physical
223 + ldr \rv, =BCM53XX_UART1_VIRT @ MMU on, Virtual
226 +#define UART_SHIFT BCM53XX_UART1_SH
227 +#include <asm/hardware/debug-8250.S>
229 +++ b/arch/arm/mach-bcm53xx/Kconfig
231 +config ARCH_BCM_5301X
232 + bool "Broadcom BCM470X / BCM5301X ARM SoC" if ARCH_MULTI_V7
236 + select HAVE_ARM_SCU if SMP
237 + select HAVE_ARM_TWD if SMP
240 + select GENERIC_CLOCKEVENTS
241 + select GENERIC_TIME
242 + select ARM_GLOBAL_TIMER
243 + select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK
244 + select MIGHT_HAVE_PCI
246 + Support for Broadcom BCM470X and BCM5301X SoCs with ARM CPU cores.
248 + This is a network SoC line mostly used in home routers and
249 + wifi access points.
250 + This inclused the following SoC: BCM53010, BCM53011, BCM53012,
251 + BCM53014, BCM53015, BCM53016, BCM53017, BCM53018, BCM4707,
252 + BCM4708 and BCM4709.
254 + Do not confuse this with the BCM4760 which is a totally
255 + different SoC or with the older BCM47XX and BCM53XX based
256 + network SoC using a MIPS CPU, they are supported by arch/mips/bcm47xx
258 +++ b/arch/arm/mach-bcm53xx/Makefile
262 +++ b/arch/arm/mach-bcm53xx/bcm53xx.c
265 + * Broadcom BCM470X / BCM5301X ARM platform code.
267 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
269 + * Licensed under the GNU/GPL. See COPYING for details.
271 +#include <linux/of_address.h>
272 +#include <linux/of_platform.h>
273 +#include <linux/clocksource.h>
274 +#include <linux/clk-provider.h>
275 +#include <asm/hardware/cache-l2x0.h>
277 +#include <asm/mach/arch.h>
278 +#include <asm/mach/map.h>
279 +#include <asm/signal.h>
281 +static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
282 + struct pt_regs *regs)
285 + * These happen for no good reason, possibly left over from CFE
287 + pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
290 + /* Returning non-zero causes fault display and panic */
294 +static void __init bcm5301x_init_early(void)
296 + /* Install our hook */
297 + hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, 0,
298 + "imprecise external abort");
301 +static void __init bcm5301x_timer_init(void)
304 + clocksource_of_init();
307 +static void __init bcm5301x_dt_init(void)
309 + l2x0_of_init(0, ~0UL);
310 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
313 +static const char __initconst *bcm5301x_dt_compat[] = {
314 + "broadcom,bcm4708",
318 +DT_MACHINE_START(BCM5301X, "BCM5301X")
319 + .init_early = bcm5301x_init_early,
320 + .init_time = bcm5301x_timer_init,
321 + .init_machine = bcm5301x_dt_init,
322 + .dt_compat = bcm5301x_dt_compat,