1 From 6c55b7f2fe06eb01f4ca6dad35d54c6e2ecbff25 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 29 Jun 2013 22:06:43 +0200
4 Subject: [PATCH 08/17] bcm53xx: initial support for the BCM5301/BCM470X SoC
7 This patch adds support for the BCM5301/BCM470X SoCs with an ARM CPU.
8 Currently just booting to a shell is working and nothing else, no
9 Ethernet, wifi, flash, ...
11 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
13 arch/arm/Kconfig | 2 +
14 arch/arm/Kconfig.debug | 5 ++
15 arch/arm/Makefile | 1 +
16 arch/arm/boot/dts/Makefile | 1 +
17 arch/arm/boot/dts/bcm5301-netgear-r6250.dts | 20 +++++++
18 arch/arm/boot/dts/bcm5301.dtsi | 83 +++++++++++++++++++++++++++
19 arch/arm/include/debug/bcm53xx.S | 19 ++++++
20 arch/arm/mach-bcm53xx/Kconfig | 15 +++++
21 arch/arm/mach-bcm53xx/Makefile | 1 +
22 arch/arm/mach-bcm53xx/bcm53xx.c | 69 ++++++++++++++++++++++
23 10 files changed, 216 insertions(+)
24 create mode 100644 arch/arm/boot/dts/bcm5301-netgear-r6250.dts
25 create mode 100644 arch/arm/boot/dts/bcm5301.dtsi
26 create mode 100644 arch/arm/include/debug/bcm53xx.S
27 create mode 100644 arch/arm/mach-bcm53xx/Kconfig
28 create mode 100644 arch/arm/mach-bcm53xx/Makefile
29 create mode 100644 arch/arm/mach-bcm53xx/bcm53xx.c
31 --- a/arch/arm/Kconfig
32 +++ b/arch/arm/Kconfig
33 @@ -922,6 +922,8 @@ source "arch/arm/mach-bcm/Kconfig"
35 source "arch/arm/mach-bcm2835/Kconfig"
37 +source "arch/arm/mach-bcm53xx/Kconfig"
39 source "arch/arm/mach-clps711x/Kconfig"
41 source "arch/arm/mach-cns3xxx/Kconfig"
42 --- a/arch/arm/Kconfig.debug
43 +++ b/arch/arm/Kconfig.debug
44 @@ -93,6 +93,10 @@ choice
45 bool "Kernel low-level debugging on BCM2835 PL011 UART"
46 depends on ARCH_BCM2835
48 + config DEBUG_BCM53XX
49 + bool "Kernel low-level debugging on BCM53XX UART1"
50 + depends on ARCH_BCM53XX
52 config DEBUG_CLPS711X_UART1
53 bool "Kernel low-level debugging messages via UART1"
54 depends on ARCH_CLPS711X
55 @@ -620,6 +624,7 @@ endchoice
56 config DEBUG_LL_INCLUDE
58 default "debug/bcm2835.S" if DEBUG_BCM2835
59 + default "debug/bcm53xx.S" if DEBUG_BCM53XX
60 default "debug/cns3xxx.S" if DEBUG_CNS3XXX
61 default "debug/exynos.S" if DEBUG_EXYNOS_UART
62 default "debug/highbank.S" if DEBUG_HIGHBANK_UART
63 --- a/arch/arm/Makefile
64 +++ b/arch/arm/Makefile
65 @@ -145,6 +145,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x0020
66 machine-$(CONFIG_ARCH_AT91) += at91
67 machine-$(CONFIG_ARCH_BCM) += bcm
68 machine-$(CONFIG_ARCH_BCM2835) += bcm2835
69 +machine-$(CONFIG_ARCH_BCM53XX) += bcm53xx
70 machine-$(CONFIG_ARCH_CLPS711X) += clps711x
71 machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx
72 machine-$(CONFIG_ARCH_DAVINCI) += davinci
73 --- a/arch/arm/boot/dts/Makefile
74 +++ b/arch/arm/boot/dts/Makefile
75 @@ -209,6 +209,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07
78 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
79 +dtb-$(CONFIG_ARCH_BCM53XX) += bcm5301-netgear-r6250.dtb
84 +++ b/arch/arm/boot/dts/bcm5301-netgear-r6250.dts
87 + * Broadcom BCM47XX / BCM53XX arm platform code.
89 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
91 + * Licensed under the GNU/GPL. See COPYING for details.
96 +/include/ "bcm5301.dtsi"
99 + model = "Netgear R6250 V1 (BCM4708)";
100 + compatible = "netgear,r6250v1", "brcm,bcm5301";
103 + reg = <0x00000000 0x08000000>;
107 +++ b/arch/arm/boot/dts/bcm5301.dtsi
110 + * Broadcom BCM47XX / BCM53XX ARM platform code.
112 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
114 + * Licensed under the GNU/GPL. See COPYING for details.
117 +/include/ "skeleton.dtsi"
120 + compatible = "brcm,bcm5301";
121 + model = "BCM5301/BCM4707/BCM4708/BCM4709 SoC";
122 + interrupt-parent = <&gic>;
125 + bootargs = "console=ttyS0,115200 earlyprintk debug vmalloc=64M";
129 + #address-cells = <1>;
133 + device_type = "cpu";
134 + compatible = "arm,cortex-a9";
138 + device_type = "cpu";
139 + compatible = "arm,cortex-a9";
145 + #address-cells = <1>;
148 + clk_periph: periph {
149 + compatible = "fixed-clock";
150 + #clock-cells = <0>;
151 + clock-frequency = <400000000>;
156 + compatible = "ns16550";
157 + reg = <0x18000300 0x100>;
158 + interrupts = <0 85 4>;
159 + clock-frequency = <100000000>;
163 + compatible = "ns16550";
164 + reg = <0x18000400 0x100>;
165 + interrupts = <0 85 4>;
166 + clock-frequency = <100000000>;
169 + gic: interrupt-controller@19021000 {
170 + compatible = "arm,cortex-a9-gic";
171 + #interrupt-cells = <3>;
172 + #address-cells = <0>;
173 + interrupt-controller;
174 + reg = <0x19021000 0x1000>,
175 + <0x19020100 0x100>;
179 + compatible = "arm,cortex-a9-global-timer";
180 + reg = <0x19020200 0x100>;
181 + interrupts = <1 11 0xf04>;
182 + clocks = <&clk_periph>;
183 + #clock-cells = <0>;
186 + local-timer@19020200 {
187 + compatible = "arm,cortex-a9-twd-timer";
188 + reg = <0x19020600 0x100>;
189 + interrupts = <1 13 0xf04>;
193 +++ b/arch/arm/include/debug/bcm53xx.S
196 + * Macros used for EARLY_PRINTK, in low-level UART debug console
198 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
200 + * Licensed under the GNU/GPL. See COPYING for details.
203 +#define BCM53XX_UART1_PHYS 0x18000300
204 +#define BCM53XX_UART1_VIRT 0xf1000300
205 +#define BCM53XX_UART1_SH 0
207 + .macro addruart, rp, rv, tmp
208 + ldr \rp, =BCM53XX_UART1_PHYS @ MMU off, Physical
209 + ldr \rv, =BCM53XX_UART1_VIRT @ MMU on, Virtual
212 +#define UART_SHIFT BCM53XX_UART1_SH
213 +#include <asm/hardware/debug-8250.S>
215 +++ b/arch/arm/mach-bcm53xx/Kconfig
218 + bool "Broadcom BCM47XX / BCM53XX ARM SoC"
221 + select HAVE_ARM_SCU if SMP
222 + select HAVE_ARM_TWD if LOCAL_TIMERS
225 + select LOCAL_TIMERS if SMP
226 + select GENERIC_TIME
227 + select GENERIC_CLOCKEVENTS_BUILD
228 + select GENERIC_CLOCKEVENTS
229 + select ARM_GLOBAL_TIMER
231 + Support for Broadcom BCM47XX and BCM53XX SoCs with ARM CPU cores.
233 +++ b/arch/arm/mach-bcm53xx/Makefile
237 +++ b/arch/arm/mach-bcm53xx/bcm53xx.c
240 + * Broadcom BCM47XX / BCM53XX ARM platform code.
242 + * Copyright 2013 Hauke Mehrtens <hauke@hauke-m.de>
244 + * Licensed under the GNU/GPL. See COPYING for details.
246 +#include <linux/of_address.h>
247 +#include <linux/of_platform.h>
248 +#include <linux/irqchip.h>
249 +#include <linux/clocksource.h>
250 +#include <linux/clk-provider.h>
252 +#include <asm/mach/arch.h>
253 +#include <asm/mach/map.h>
254 +#include <asm/smp_scu.h>
255 +#include <asm/signal.h>
257 +static int bcm53xx_abort_handler(unsigned long addr, unsigned int fsr,
258 + struct pt_regs *regs)
261 + * These happen for no good reason
262 + * possibly left over from CFE
264 + pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
267 + /* Returning non-zero causes fault display and panic */
271 +static void bcm53xx_aborts_enable(void)
273 + /* Install our hook */
274 + hook_fault_code(16 + 6, bcm53xx_abort_handler, SIGBUS, 0,
275 + "imprecise external abort");
278 +static void __init bcm53xx_timer_init(void)
281 + clocksource_of_init();
284 +void __init bcm53xx_map_io(void)
286 + debug_ll_io_init();
287 + bcm53xx_aborts_enable();
290 +static void __init bcm53xx_dt_init(void)
292 + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
295 +static const char const *bcm53xx_dt_compat[] = {
301 +DT_MACHINE_START(BCM53XX, "BCM53XX")
302 + .init_machine = bcm53xx_dt_init,
303 + .map_io = bcm53xx_map_io,
304 + .init_irq = irqchip_init,
305 + .init_time = bcm53xx_timer_init,
306 + .dt_compat = bcm53xx_dt_compat,