From patchwork Sat Sep 14 15:20:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 2893501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CE1ED9F1C0 for ; Sat, 14 Sep 2013 15:24:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A867A20258 for ; Sat, 14 Sep 2013 15:24:02 +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 A209720251 for ; Sat, 14 Sep 2013 15:24:00 +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 1VKrgQ-0007vj-T5; Sat, 14 Sep 2013 15:22:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKrg6-0004uu-Rd; Sat, 14 Sep 2013 15:22:30 +0000 Received: from mail-ee0-f44.google.com ([74.125.83.44]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKrfU-0004r0-KG for linux-arm-kernel@lists.infradead.org; Sat, 14 Sep 2013 15:22:00 +0000 Received: by mail-ee0-f44.google.com with SMTP id b47so1153691eek.31 for ; Sat, 14 Sep 2013 08:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:user-agent:date:from:to:cc:subject:references :content-disposition; bh=wWJdaPrmn3QKt/neXKXw8uvj1Wp0bi4r1V4FwQpM8sk=; b=vq83Pt6aj+fyY5yqYoRyxbTP7HmlWZ3Mgr9xFcLHwZjN6km2m//nhea8gECxVf33Gb tS/UDnTMoVUWx4KlEe607FLWi9dgw2ILb8SFXwWpHyGhEn7OKw+foQvttqsDp3sQL4N6 xy8KY5EII4DyfNcktEhJnm9wHIQTiYm8zRDgfqFjh/Hp+XhHLwcTUp/xZ5WAn++DYl9O fhXtuYGpmm5rWF3wLRjhUOl8R+4rfxUDqdW2INRgrEPjeKEMLlKJh0Ai8bYiWn58gZRu 7CrM5JuHRuU1dKDsCLu4znNr2G+NTd06MZDLIq+9le/FQWuidP3QjRCVxQZYvecIXNcR /GHw== X-Received: by 10.14.122.132 with SMTP id t4mr27385451eeh.20.1379172087919; Sat, 14 Sep 2013 08:21:27 -0700 (PDT) Received: from shock.dandreoli.com (j115181.upc-j.chello.nl. [24.132.115.181]) by mx.google.com with ESMTPSA id r48sm24851121eev.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Sep 2013 08:21:27 -0700 (PDT) Received: by shock.dandreoli.com (Postfix, from userid 1000) id AA39734014A; Sat, 14 Sep 2013 17:21:23 +0200 (CEST) Message-Id: <20130914152123.491631670@gmail.com> User-Agent: quilt/0.60-1 Date: Sat, 14 Sep 2013 17:20:33 +0200 From: Domenico Andreoli To: Russell King - ARM Linux , Olof Johansson , Arnd Bergmann Subject: [PATCH v4 1/4] ARM: bcm4760: Add platform infrastructure References: <20130914152032.401907974@gmail.com> Content-Disposition: inline; filename=arm-bcm476x-add-infrastructure.patch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130914_112152_916971_066BE919 X-CRM114-Status: GOOD ( 18.85 ) X-Spam-Score: -2.6 (--) Cc: Domenico Andreoli , Jason Cooper , linux-arm-kernel@lists.infradead.org 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=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Domenico Andreoli Platform infrastructure for the Broadcom BCM4760 based ARM11 SoCs. v4: * added low-level debug PL01X parameters * added clocks to the VICs DT stanzas v3: * dropped the idea of unconditionally build mach-bcm v2: * clocks are now configured via DT * uart DT nodes have been renamed and hooked to the proper clock nodes * dropped unneeded config options * dropped misused initialization of system_rev * dropped unneeded early io mapping * build rule of mach-bcm is moved to separated patch v1: * initial release Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Acked-by: Jason Cooper Signed-off-by: Domenico Andreoli Acked-by: Arnd Bergmann --- Documentation/devicetree/bindings/arm/bcm4760.txt | 8 ++ MAINTAINERS | 7 ++ arch/arm/Kconfig.debug | 21 ++++++ arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm4760-catalina.dts | 11 +++ arch/arm/boot/dts/bcm4760.dtsi | 75 ++++++++++++++++++++++ arch/arm/configs/bcm4760_defconfig | 76 ++++++++++++++++++++++ arch/arm/mach-bcm/Kconfig | 7 ++ arch/arm/mach-bcm/Makefile | 2 + arch/arm/mach-bcm/bcm4760.c | 37 +++++++++++ 10 files changed, 245 insertions(+) Index: b/Documentation/devicetree/bindings/arm/bcm4760.txt =================================================================== --- /dev/null +++ b/Documentation/devicetree/bindings/arm/bcm4760.txt @@ -0,0 +1,8 @@ +Broadcom BCM4760 ARM11 SoC device tree bindings +----------------------------------------------- + +Boards with the BCM4760 SoC shall have the following properties: + +Required root node property: + +compatible = "brcm,bcm4760"; Index: b/arch/arm/configs/bcm4760_defconfig =================================================================== --- /dev/null +++ b/arch/arm/configs/bcm4760_defconfig @@ -0,0 +1,76 @@ +CONFIG_IRQ_DOMAIN_DEBUG=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_BLK_DEV_INITRD=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_EMBEDDED=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_IOSCHED_DEADLINE is not set +# CONFIG_IOSCHED_CFQ is not set +CONFIG_ARCH_MULTI_V6=y +# CONFIG_ARCH_MULTI_V7 is not set +CONFIG_ARCH_BCM4760=y +CONFIG_ARM_ERRATA_411920=y +CONFIG_ARM_ERRATA_364296=y +CONFIG_AEABI=y +CONFIG_DEPRECATED_PARAM_STRUCT=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_VFP=y +# CONFIG_SUSPEND is not set +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_CMA=y +CONFIG_PROC_DEVICETREE=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_SCSI=y +# CONFIG_SCSI_PROC_FS is not set +CONFIG_BLK_DEV_SD=y +CONFIG_SCSI_MULTI_LUN=y +# CONFIG_SCSI_LOWLEVEL is not set +# CONFIG_INPUT_MOUSEDEV is not set +CONFIG_INPUT_EVDEV=y +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_SERIO is not set +# CONFIG_VT is not set +# CONFIG_DEVKMEM is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +# CONFIG_HW_RANDOM is not set +# CONFIG_HWMON is not set +# CONFIG_HID is not set +# CONFIG_USB_SUPPORT is not set +CONFIG_COMMON_CLK_DEBUG=y +# CONFIG_IOMMU_SUPPORT is not set +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_XATTR is not set +CONFIG_EXT4_FS=y +CONFIG_FANOTIFY=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_TMPFS=y +CONFIG_CRAMFS=y +CONFIG_ROMFS_FS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_CODEPAGE_850=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NLS_ISO8859_15=y +CONFIG_PRINTK_TIME=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_REDUCED=y +CONFIG_STRIP_ASM_SYMS=y +CONFIG_DEBUG_SECTION_MISMATCH=y +CONFIG_MAGIC_SYSRQ=y +# CONFIG_SCHED_DEBUG is not set +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_ATOMIC_SLEEP=y +# CONFIG_FTRACE is not set +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not set Index: b/arch/arm/mach-bcm/bcm4760.c =================================================================== --- /dev/null +++ b/arch/arm/mach-bcm/bcm4760.c @@ -0,0 +1,37 @@ +/* + * Broadcom BCM4760 based ARM11 SoCs platform support + * + * Copyright (C) 2012 Domenico Andreoli + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include + +#include + +static void __init bcm4760_init(void) +{ + of_clk_init(NULL); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); +} + +static const char * const bcm4760_compat[] __initconst = { + "brcm,bcm4760", + NULL, +}; + +DT_MACHINE_START(BCM4760, "Broadcom BCM4760") + .init_machine = bcm4760_init, + .dt_compat = bcm4760_compat, +MACHINE_END Index: b/MAINTAINERS =================================================================== --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1839,6 +1839,13 @@ F: arch/arm/boot/dts/bcm2835* F: arch/arm/configs/bcm2835_defconfig F: drivers/*/*bcm2835* +BROADCOM BCM4760 ARM ARCHITECTURE +M: Domenico Andreoli +L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) +S: Maintained +F: arch/arm/mach-bcm/bcm4760.c +F: drivers/*/*bcm4760* + BROADCOM TG3 GIGABIT ETHERNET DRIVER M: Nithin Nayak Sujir M: Michael Chan Index: b/arch/arm/boot/dts/Makefile =================================================================== --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -42,6 +42,7 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dt dtb-$(CONFIG_ARCH_AT91) += sama5d35ek.dtb dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb +dtb-$(CONFIG_ARCH_BCM4760) += bcm4760-catalina.dtb dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb \ bcm28155-ap.dtb dtb-$(CONFIG_ARCH_DAVINCI) += da850-enbw-cmc.dtb \ Index: b/arch/arm/boot/dts/bcm4760-catalina.dts =================================================================== --- /dev/null +++ b/arch/arm/boot/dts/bcm4760-catalina.dts @@ -0,0 +1,11 @@ +/dts-v1/; +#include "bcm4760.dtsi" + +/ { + compatible = "brcm,catalina", "brcm,bcm4760"; + model = "Broadcom Catalina"; + + memory { + reg = <0x30000000 0x4000000>; + }; +}; Index: b/arch/arm/boot/dts/bcm4760.dtsi =================================================================== --- /dev/null +++ b/arch/arm/boot/dts/bcm4760.dtsi @@ -0,0 +1,75 @@ +#include "skeleton.dtsi" + +/ { + compatible = "brcm,bcm4760"; + model = "Broadcom BCM4760"; + + clocks { + #address-cells = <1>; + #size-cells = <0>; + + pclk: plc_m1 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100100000>; + }; + + uartclk: pla_m1 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <78000000>; + }; + }; + + amba { + compatible = "arm,amba-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + vic0: interrupt-controller@80000 { + compatible = "brcm,bcm4760-pl192", "arm,pl192-vic", "arm,primecell"; + reg = <0x80000 0x1000>; + interrupt-controller; + #interrupt-cells = <1>; + clocks = <&pclk>; + clock-names = "apb_pclk"; + }; + + vic1: interrupt-controller@81000 { + compatible = "brcm,bcm4760-pl192", "arm,pl192-vic", "arm,primecell"; + reg = <0x81000 0x1000>; + interrupt-controller; + #interrupt-cells = <1>; + clocks = <&pclk>; + clock-names = "apb_pclk"; + }; + + serial0: uart@c0000 { + compatible = "brcm,bcm4760-pl011", "arm,pl011", "arm,primecell"; + reg = <0xc0000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <14>; + clocks = <&uartclk>, <&pclk>; + clock-names = "uartclk", "apb_pclk"; + }; + + serial1: uart@c1000 { + compatible = "brcm,bcm4760-pl011", "arm,pl011", "arm,primecell"; + reg = <0xc1000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <15>; + clocks = <&uartclk>, <&pclk>; + clock-names = "uartclk", "apb_pclk"; + }; + + serial2: uart@b2000 { + compatible = "brcm,bcm4760-pl011", "arm,pl011", "arm,primecell"; + reg = <0xb2000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <16>; + clocks = <&uartclk>, <&pclk>; + clock-names = "uartclk", "apb_pclk"; + }; + }; +}; Index: b/arch/arm/mach-bcm/Kconfig =================================================================== --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -18,3 +18,10 @@ config ARCH_BCM It currently supports the 'BCM281XX' family, which includes BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 variants. + +config ARCH_BCM4760 + bool "Broadcom BCM4760 based SoCs (ARM11)" if ARCH_MULTI_V6 + select ARM_AMBA + select ARM_VIC + select CLKSRC_OF + select SOC_BUS Index: b/arch/arm/mach-bcm/Makefile =================================================================== --- a/arch/arm/mach-bcm/Makefile +++ b/arch/arm/mach-bcm/Makefile @@ -13,3 +13,5 @@ obj-$(CONFIG_ARCH_BCM) := 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_BCM4760) += bcm4760.o Index: b/arch/arm/Kconfig.debug =================================================================== --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -94,6 +94,21 @@ choice depends on ARCH_BCM2835 select DEBUG_UART_PL01X + config DEBUG_BCM4760_UART0 + bool "Kernel low-level debugging on BCM4760 PL011 UART0" + depends on ARCH_BCM4760 + select DEBUG_UART_PL01X + + config DEBUG_BCM4760_UART1 + bool "Kernel low-level debugging on BCM4760 PL011 UART1" + depends on ARCH_BCM4760 + select DEBUG_UART_PL01X + + config DEBUG_BCM4760_UART2 + bool "Kernel low-level debugging on BCM4760 PL011 UART2" + depends on ARCH_BCM4760 + select DEBUG_UART_PL01X + config DEBUG_CLPS711X_UART1 bool "Kernel low-level debugging messages via UART1" depends on ARCH_CLPS711X @@ -929,6 +944,9 @@ config DEBUG_UART_8250 config DEBUG_UART_PHYS hex "Physical base address of debug UART" + default 0x000b2000 if DEBUG_BCM4760_UART2 + default 0x000c0000 if DEBUG_BCM4760_UART0 + default 0x000c1000 if DEBUG_BCM4760_UART1 default 0x01c20000 if DEBUG_DAVINCI_DMx_UART0 default 0x01c28000 if DEBUG_SUNXI_UART0 default 0x01c28400 if DEBUG_SUNXI_UART1 @@ -985,6 +1003,9 @@ config DEBUG_UART_PHYS config DEBUG_UART_VIRT hex "Virtual base address of debug UART" + default 0xd00b2000 if DEBUG_BCM4760_UART2 + default 0xd00c0000 if DEBUG_BCM4760_UART0 + default 0xd00c1000 if DEBUG_BCM4760_UART1 default 0xe0010fe0 if ARCH_RPC default 0xf0000be0 if ARCH_EBSA110 default 0xf0009000 if DEBUG_CNS3XXX