From patchwork Tue Jul 16 13:52:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 2828141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3D2EDC0AB2 for ; Tue, 16 Jul 2013 13:53:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2A8020203 for ; Tue, 16 Jul 2013 13:53:11 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7C77920202 for ; Tue, 16 Jul 2013 13:53:09 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz5ge-0004QY-87; Tue, 16 Jul 2013 13:53:04 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz5gb-0005RB-Sm; Tue, 16 Jul 2013 13:53:01 +0000 Received: from hauke-2-pt.tunnel.tserv6.fra1.ipv6.he.net ([2001:470:1f0a:465::2] helo=hauke-m.de) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uz5gY-0005Ps-RV for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2013 13:53:00 +0000 Received: from localhost (localhost [127.0.0.1]) by hauke-m.de (Postfix) with ESMTP id BFB3E8F61; Tue, 16 Jul 2013 15:52:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hauke-m.de Received: from hauke-m.de ([127.0.0.1]) by localhost (hauke-m.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D1nwRkEXAAWf; Tue, 16 Jul 2013 15:52:20 +0200 (CEST) Received: from hauke-desktop.lan (spit-414.wohnheim.uni-bremen.de [134.102.133.158]) by hauke-m.de (Postfix) with ESMTPSA id D50FB857F; Tue, 16 Jul 2013 15:52:19 +0200 (CEST) From: Hauke Mehrtens To: arnd@arndb.de Subject: [PATCH] bcm53xx: initial support for the BCM5301/BCM470X SoC with ARM CPU Date: Tue, 16 Jul 2013 15:52:07 +0200 Message-Id: <1373982727-5492-1-git-send-email-hauke@hauke-m.de> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130716_095259_559078_946D322D X-CRM114-Status: GOOD ( 14.55 ) X-Spam-Score: -1.9 (-) Cc: csd@broadcom.com, matt.porter@linaro.org, linux-arm-kernel@lists.infradead.org, Hauke Mehrtens X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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, ... 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 --- A bootlog can be found here: http://pastebin.com/0MYYC7Fx MAINTAINERS | 7 +++ arch/arm/Kconfig | 2 + arch/arm/Kconfig.debug | 5 ++ arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm5301x-netgear-r6250.dts | 20 +++++++ arch/arm/boot/dts/bcm5301x.dtsi | 72 ++++++++++++++++++++++++++ arch/arm/include/debug/bcm53xx.S | 19 +++++++ arch/arm/mach-bcm53xx/Kconfig | 10 ++++ arch/arm/mach-bcm53xx/Makefile | 1 + arch/arm/mach-bcm53xx/bcm53xx.c | 68 ++++++++++++++++++++++++ 11 files changed, 206 insertions(+) create mode 100644 arch/arm/boot/dts/bcm5301x-netgear-r6250.dts create mode 100644 arch/arm/boot/dts/bcm5301x.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 diff --git a/MAINTAINERS b/MAINTAINERS index bf61e04..b72ba65 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1795,6 +1795,13 @@ F: arch/arm/boot/dts/bcm2835* F: arch/arm/configs/bcm2835_defconfig F: drivers/*/*bcm2835* +BROADCOM BCM53XX ARM ARCHICTURE +M: Hauke Mehrtens +L: linux-arm-kernel@lists.infradead.org +S: Maintained +F: arch/arm/mach-bcm53xx/ +F: arch/arm/boot/dts/bcm53* + BROADCOM TG3 GIGABIT ETHERNET DRIVER M: Nithin Nayak Sujir M: Michael Chan diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ba412e0..ee7362e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -930,6 +930,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" diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index e401a76..74e32f6 100644 --- 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 + config DEBUG_BCM53XX + bool "Kernel low-level debugging on BCM53XX UART1" + depends on ARCH_BCM53XX + config DEBUG_CLPS711X_UART1 bool "Kernel low-level debugging messages via UART1" depends on ARCH_CLPS711X @@ -762,6 +766,7 @@ endchoice config DEBUG_LL_INCLUDE string default "debug/bcm2835.S" if DEBUG_BCM2835 + default "debug/bcm53xx.S" if DEBUG_BCM53XX default "debug/cns3xxx.S" if DEBUG_CNS3XXX default "debug/exynos.S" if DEBUG_EXYNOS_UART default "debug/highbank.S" if DEBUG_HIGHBANK_UART diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c0ac0f5..4a69cd5 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -147,6 +147,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000 machine-$(CONFIG_ARCH_AT91) += at91 machine-$(CONFIG_ARCH_BCM) += bcm machine-$(CONFIG_ARCH_BCM2835) += bcm2835 +machine-$(CONFIG_ARCH_BCM53XX) += bcm53xx machine-$(CONFIG_ARCH_CLPS711X) += clps711x machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx machine-$(CONFIG_ARCH_DAVINCI) += davinci diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 641b3c9..480a68e 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -242,6 +242,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \ zynq-zc706.dtb \ zynq-zed.dtb +dtb-$(CONFIG_ARCH_BCM53XX) += bcm5301x-netgear-r6250.dtb targets += dtbs targets += $(dtb-y) diff --git a/arch/arm/boot/dts/bcm5301x-netgear-r6250.dts b/arch/arm/boot/dts/bcm5301x-netgear-r6250.dts new file mode 100644 index 0000000..d1b97aa --- /dev/null +++ b/arch/arm/boot/dts/bcm5301x-netgear-r6250.dts @@ -0,0 +1,20 @@ +/* + * Broadcom BCM47XX / BCM53XX arm platform code. + * + * Copyright 2013 Hauke Mehrtens + * + * Licensed under the GNU/GPL. See COPYING for details. + */ + +/dts-v1/; + +/include/ "bcm5301x.dtsi" + +/ { + model = "Netgear R6250 V1 (BCM4708)"; + compatible = "netgear,r6250v1", "brcm,bcm5301x"; + + memory { + reg = <0x00000000 0x08000000>; + }; +}; diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi new file mode 100644 index 0000000..638350d --- /dev/null +++ b/arch/arm/boot/dts/bcm5301x.dtsi @@ -0,0 +1,72 @@ +/* + * Broadcom BCM47XX / BCM53XX ARM platform code. + * + * Copyright 2013 Hauke Mehrtens + * + * Licensed under the GNU/GPL. See COPYING for details. + */ + +/include/ "skeleton.dtsi" + +/ { + compatible = "brcm,bcm5301x"; + model = "BCM5301X/BCM4707/BCM4708/BCM4709 SoC"; + interrupt-parent = <&gic>; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk debug"; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a9"; + reg = <0>; + }; + }; + + 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>; + interrupts = <0 85 4>; + clock-frequency = <100000000>; + }; + + uart@18000400 { + compatible = "ns16550"; + reg = <0x18000400 0x100>; + interrupts = <0 85 4>; + 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>; + interrupts = <1 11 0xf04>; + clocks = <&clk_periph>; + #clock-cells = <0>; + }; +}; diff --git a/arch/arm/include/debug/bcm53xx.S b/arch/arm/include/debug/bcm53xx.S new file mode 100644 index 0000000..98c836b --- /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 + * + * 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 diff --git a/arch/arm/mach-bcm53xx/Kconfig b/arch/arm/mach-bcm53xx/Kconfig new file mode 100644 index 0000000..1e16e87 --- /dev/null +++ b/arch/arm/mach-bcm53xx/Kconfig @@ -0,0 +1,10 @@ +config ARCH_BCM53XX + bool "Broadcom BCM47XX / BCM53XX ARM SoC" + select CPU_V7 + select ARM_GIC + select HAVE_CLK + select GENERIC_CLOCKEVENTS + select GENERIC_TIME + select ARM_GLOBAL_TIMER + help + Support for Broadcom BCM47XX and BCM53XX SoCs with ARM CPU cores. diff --git a/arch/arm/mach-bcm53xx/Makefile b/arch/arm/mach-bcm53xx/Makefile new file mode 100644 index 0000000..88da84d --- /dev/null +++ b/arch/arm/mach-bcm53xx/Makefile @@ -0,0 +1 @@ +obj-y += bcm53xx.o diff --git a/arch/arm/mach-bcm53xx/bcm53xx.c b/arch/arm/mach-bcm53xx/bcm53xx.c new file mode 100644 index 0000000..aa5bd397 --- /dev/null +++ b/arch/arm/mach-bcm53xx/bcm53xx.c @@ -0,0 +1,68 @@ +/* + * Broadcom BCM47XX / BCM53XX ARM platform code. + * + * Copyright 2013 Hauke Mehrtens + * + * Licensed under the GNU/GPL. See COPYING for details. + */ +#include +#include +#include +#include +#include + +#include +#include +#include + +static int bcm53xx_abort_handler(unsigned long addr, unsigned int fsr, + struct pt_regs *regs) +{ + /* + * These happen for no good reason + * possibly left over from CFE + */ + 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; +} + +static void bcm53xx_aborts_enable(void) +{ + /* Install our hook */ + hook_fault_code(16 + 6, bcm53xx_abort_handler, SIGBUS, 0, + "imprecise external abort"); +} + +static void __init bcm53xx_timer_init(void) +{ + of_clk_init(NULL); + clocksource_of_init(); +} + +void __init bcm53xx_map_io(void) +{ + debug_ll_io_init(); + bcm53xx_aborts_enable(); +} + +static void __init bcm53xx_dt_init(void) +{ + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + +static const char const *bcm53xx_dt_compat[] = { + "brcm,bcm5301x", + "netgear,r6250v1", + NULL, +}; + +DT_MACHINE_START(BCM53XX, "BCM53XX") + .init_machine = bcm53xx_dt_init, + .map_io = bcm53xx_map_io, + .init_irq = irqchip_init, + .init_time = bcm53xx_timer_init, + .dt_compat = bcm53xx_dt_compat, +MACHINE_END