From patchwork Sun Oct 14 22:14:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 1591841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 4FEED3FD9C for ; Sun, 14 Oct 2012 22:33:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TNWiR-0000jw-Ot; Sun, 14 Oct 2012 22:31:24 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TNWha-0000Uu-OS for linux-arm-kernel@lists.infradead.org; Sun, 14 Oct 2012 22:30:34 +0000 Received: by mail-wg0-f49.google.com with SMTP id gg4so2697861wgb.18 for ; Sun, 14 Oct 2012 15:30:27 -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=ZfzgqpNi9Vkwq46W3NkL2bYlf8+pkAw+583vYRpR2XI=; b=ns+E0fSoZoZn8ZdwgB7xIq+cie5+y3h+IBJF1zjlxLjw7lNbGsElYw/pRRpa34emJ/ 3wBWChW44mU7vxVuMeZbbVxVL1rDEpFuLTCxkIQbiZHEf7nEshOVjjkv/m+OxUKjnogm JzKevmm1rUWIZKdsu3pHFJP5iCBgZXEUM2Xaj6Nb3rAgnVl8AJc4Ti7qlXD2JFKnYKPn DFyDmFlCdiFMg7hzw6HcM4zYw6NQWVcXPozJ7FD16n5KG0nkchrLzXgStKgrlfnMuH8a ucYsOR6nMZ8NYpD3bQPGXAaMW7w1h+UebB2L8kNu5gB6S7osPVxyjhesox5NTgRh2hgv wkXA== Received: by 10.180.106.2 with SMTP id gq2mr19297848wib.18.1350253827625; Sun, 14 Oct 2012 15:30:27 -0700 (PDT) Received: from raptus.dandreoli.com (178-85-163-250.dynamic.upc.nl. [178.85.163.250]) by mx.google.com with ESMTPS id b7sm10897131wiz.3.2012.10.14.15.30.25 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 14 Oct 2012 15:30:26 -0700 (PDT) Received: by raptus.dandreoli.com (Postfix, from userid 1000) id 1D9473F6208; Mon, 15 Oct 2012 00:30:23 +0200 (CEST) Message-Id: <20121014223023.611069832@gmail.com> User-Agent: quilt/0.60-1 Date: Mon, 15 Oct 2012 00:14:51 +0200 From: Domenico Andreoli To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/5] ARM: bcm476x: Add platform infrastructure References: <20121014221450.866288977@gmail.com> Content-Disposition: inline; filename=arm-bcm476x-add-infrastructure.patch X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (cavokz[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Domenico Andreoli , Olof Johansson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Domenico Andreoli Platform infrastructure for the Broadcom BCM476x ARMv6 SoCs. v2: * splited bcm46x.dtsi in bcm4760.dtsi and bcm4761.dtsi * squashed in the low-level debug support * dropped Makefile.boot, not needed * adopted IOMEM() in macros referring to virtual addresses * fixed compilation of .dts files * saved a saner defconfig v1: * initial release Signed-off-by: Domenico Andreoli Acked-by: Olof Johansson --- Documentation/devicetree/bindings/arm/bcm476x.txt | 15 ++++ MAINTAINERS | 11 +++ arch/arm/Kconfig | 2 + arch/arm/Kconfig.debug | 20 +++++ arch/arm/Makefile | 1 + arch/arm/boot/dts/Makefile | 1 + arch/arm/boot/dts/bcm4760-catalina.dts | 11 +++ arch/arm/boot/dts/bcm4760.dtsi | 48 +++++++++++++ arch/arm/boot/dts/bcm4761.dtsi | 48 +++++++++++++ arch/arm/configs/bcm476x_defconfig | 81 +++++++++++++++++++++ arch/arm/include/debug/bcm476x.S | 35 +++++++++ arch/arm/mach-bcm476x/Kconfig | 17 ++++ arch/arm/mach-bcm476x/Makefile | 1 + arch/arm/mach-bcm476x/bcm476x.c | 84 ++++++++++++++++++++++ 14 files changed, 375 insertions(+) Index: b/Documentation/devicetree/bindings/arm/bcm476x.txt =================================================================== --- /dev/null +++ b/Documentation/devicetree/bindings/arm/bcm476x.txt @@ -0,0 +1,15 @@ +Broadcom BCM4760 and BCM4761 SoCs device tree bindings +------------------------------------------------------ + +Boards with the BCM4760 SoC shall have the following properties: + +Required root node property: + +compatible = "brcm,bcm4760"; + + +Boards with the BCM4761 SoC shall have the following properties: + +Required root node property: + +compatible = "brcm,bcm4761"; Index: b/arch/arm/Kconfig =================================================================== --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1022,6 +1022,8 @@ source "arch/arm/mach-mvebu/Kconfig" source "arch/arm/mach-at91/Kconfig" +source "arch/arm/mach-bcm476x/Kconfig" + source "arch/arm/mach-clps711x/Kconfig" source "arch/arm/mach-cns3xxx/Kconfig" Index: b/arch/arm/Makefile =================================================================== --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -137,6 +137,7 @@ textofs-$(CONFIG_ARCH_MSM8960) := 0x0020 # by CONFIG_* macro name. machine-$(CONFIG_ARCH_AT91) += at91 machine-$(CONFIG_ARCH_BCM2835) += bcm2835 +machine-$(CONFIG_ARCH_BCM476X) := bcm476x machine-$(CONFIG_ARCH_CLPS711X) += clps711x machine-$(CONFIG_ARCH_CNS3XXX) += cns3xxx machine-$(CONFIG_ARCH_DAVINCI) += davinci Index: b/arch/arm/configs/bcm476x_defconfig =================================================================== --- /dev/null +++ b/arch/arm/configs/bcm476x_defconfig @@ -0,0 +1,81 @@ +CONFIG_EXPERIMENTAL=y +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_BCM476X=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_PINCONF=y +CONFIG_DEBUG_PINCTRL=y +CONFIG_PINCTRL_BCM476X=y +# 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_EXT4_FS_XATTR is not set +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_MAGIC_SYSRQ=y +CONFIG_STRIP_ASM_SYMS=y +CONFIG_DEBUG_SECTION_MISMATCH=y +# CONFIG_SCHED_DEBUG is not set +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_ATOMIC_SLEEP=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_INFO_REDUCED=y +# CONFIG_FTRACE is not set +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_HW is not set Index: b/arch/arm/mach-bcm476x/Makefile =================================================================== --- /dev/null +++ b/arch/arm/mach-bcm476x/Makefile @@ -0,0 +1 @@ +obj-y += bcm476x.o Index: b/arch/arm/mach-bcm476x/bcm476x.c =================================================================== --- /dev/null +++ b/arch/arm/mach-bcm476x/bcm476x.c @@ -0,0 +1,84 @@ +/* + * Broadcom BCM476x 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 +#include +#include +#include + +#define BCM476X_PERIPH_PHYS 0x00080000 +#define BCM476X_PERIPH_VIRT IOMEM(0xd0080000) +#define BCM476X_PERIPH_SIZE SZ_512K + +static struct map_desc io_map __initdata = { + .virtual = (unsigned long) BCM476X_PERIPH_VIRT, + .pfn = __phys_to_pfn(BCM476X_PERIPH_PHYS), + .length = BCM476X_PERIPH_SIZE, + .type = MT_DEVICE, +}; + +static void __init bcm476x_map_io(void) +{ + iotable_init(&io_map, 1); +} + +static void __init bcm476x_init(void) +{ + int err; + + err = of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); + if (err) { + pr_err("of_platform_populate failed: %d\n", err); + BUG(); + } +} + +static const struct of_device_id vic_of_match[] __initconst = { + { .compatible = "arm,pl192-vic", .data = vic_of_init, }, + {} +}; + +static void __init bcm476x_init_irq(void) +{ + of_irq_init(vic_of_match); +} + +static void __init bcm476x_timer_init(void) +{ +} + +static struct sys_timer bcm476x_timer = { + .init = bcm476x_timer_init +}; + +static const char * const bcm476x_compat[] __initconst = { + "brcm,bcm4760", + "brcm,bcm4761", + NULL +}; + +DT_MACHINE_START(BCM476X, "Broadcom BCM476x") + .map_io = bcm476x_map_io, + .init_irq = bcm476x_init_irq, + .handle_irq = vic_handle_irq, + .init_machine = bcm476x_init, + .timer = &bcm476x_timer, + .dt_compat = bcm476x_compat +MACHINE_END Index: b/arch/arm/mach-bcm476x/Kconfig =================================================================== --- /dev/null +++ b/arch/arm/mach-bcm476x/Kconfig @@ -0,0 +1,17 @@ +config ARCH_BCM476X + bool "Broadcom BCM476X family" if ARCH_MULTI_V6 + select ARCH_WANT_OPTIONAL_GPIOLIB + select ARM_AMBA + select ARM_VIC + select CLKDEV_LOOKUP + select CLKSRC_MMIO + select COMMON_CLK + select CPU_V6 + select GENERIC_CLOCKEVENTS + select GENERIC_IRQ_CHIP + select MULTI_IRQ_HANDLER + select NO_IOPORT + select PINCTRL + select PINMUX + select SPARSE_IRQ + select USE_OF Index: b/MAINTAINERS =================================================================== --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1649,6 +1649,17 @@ F: arch/arm/boot/dts/bcm2835* F: arch/arm/configs/bcm2835_defconfig F: drivers/*/*bcm2835* +BROADCOM BCM476x ARM ARCHITECTURE +M: Domenico Andreoli +L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) +S: Maintained +F: arch/arm/mach-bcm476x +F: arch/arm/boot/dts/bcm4760* +F: arch/arm/boot/dts/bcm4761* +F: arch/arm/configs/bcm476x_defconfig +F: drivers/*/*bcm4760* +F: drivers/*/*bcm4761* + BROADCOM TG3 GIGABIT ETHERNET DRIVER M: Matt Carlson M: Michael Chan Index: b/arch/arm/boot/dts/Makefile =================================================================== --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -17,6 +17,7 @@ dtb-$(CONFIG_ARCH_AT91) += aks-cdu.dtb \ usb_a9263.dtb \ usb_a9g20.dtb dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb +dtb-$(CONFIG_ARCH_BCM476X) += bcm4760-catalina.dtb dtb-$(CONFIG_ARCH_DOVE) += dove-cm-a510.dtb \ dove-cubox.dtb \ dove-dove-db.dtb Index: b/arch/arm/Kconfig.debug =================================================================== --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -89,6 +89,24 @@ choice bool "Kernel low-level debugging on 9263 and 9g45" depends on HAVE_AT91_DBGU1 + config DEBUG_BCM476X_UART0 + depends on ARCH_BCM476X + bool "Kernel low-level debugging on BCM476x UART 0" + help + This option selects UART0 at 0xc0000. + + config DEBUG_BCM476X_UART1 + depends on ARCH_BCM476X + bool "Kernel low-level debugging on BCM476x UART 1" + help + This option selects UART1 at 0xc1000. + + config DEBUG_BCM476X_UART2 + depends on ARCH_BCM476X + bool "Kernel low-level debugging on BCM476x UART 2" + help + This option selects UART2 at 0xb2000. + config DEBUG_CLPS711X_UART1 bool "Kernel low-level debugging messages via UART1" depends on ARCH_CLPS711X @@ -411,6 +429,8 @@ endchoice config DEBUG_LL_INCLUDE string + default "debug/bcm476x.S" if DEBUG_BCM476X_UART0 || \ + DEBUG_BCM476X_UART1 || DEBUG_BCM476X_UART2 default "debug/icedcc.S" if DEBUG_ICEDCC default "debug/highbank.S" if DEBUG_HIGHBANK_UART default "debug/mvebu.S" if DEBUG_MVEBU_UART Index: b/arch/arm/include/debug/bcm476x.S =================================================================== --- /dev/null +++ b/arch/arm/include/debug/bcm476x.S @@ -0,0 +1,35 @@ +/* + * Broadcom BCM476x SoCs DEBUG_LL 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. + */ + +#if defined(CONFIG_DEBUG_BCM476X_UART0) +# define BCM476X_DEBUG_PHYS 0x000c0000 +# define BCM476X_DEBUG_VIRT 0xd00c0000 +#elif defined(CONFIG_DEBUG_BCM476X_UART1) +# define BCM476X_DEBUG_PHYS 0x000c1000 +# define BCM476X_DEBUG_VIRT 0xd00c1000 +#elif defined(CONFIG_DEBUG_BCM476X_UART2) +# define BCM476X_DEBUG_PHYS 0x000b2000 +# define BCM476X_DEBUG_VIRT 0xd00b2000 +#else +# error Unknown BCM476x debug port +#endif + + .macro addruart, rp, rv, tmp + ldr \rp, =BCM476X_DEBUG_PHYS + ldr \rv, =BCM476X_DEBUG_VIRT + .endm + +#include 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,48 @@ +/include/ "skeleton.dtsi" + +/ { + compatible = "brcm,bcm4760"; + model = "Broadcom BCM4760"; + + 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>; + }; + + vic1: interrupt-controller@81000 { + compatible = "brcm,bcm4760-pl192", "arm,pl192-vic", "arm,primecell"; + reg = <0x81000 0x1000>; + interrupt-controller; + #interrupt-cells = <1>; + }; + + uart0@c0000 { + compatible = "brcm,bcm4760-pl011", "arm,pl011", "arm,primecell"; + reg = <0xc0000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <14>; + }; + + uart1@c1000 { + compatible = "brcm,bcm4760-pl011", "arm,pl011", "arm,primecell"; + reg = <0xc1000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <15>; + }; + + uart2@b2000 { + compatible = "brcm,bcm4760-pl011", "arm,pl011", "arm,primecell"; + reg = <0xb2000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <16>; + }; + }; +}; Index: b/arch/arm/boot/dts/bcm4761.dtsi =================================================================== --- /dev/null +++ b/arch/arm/boot/dts/bcm4761.dtsi @@ -0,0 +1,48 @@ +/include/ "skeleton.dtsi" + +/ { + compatible = "brcm,bcm4761"; + model = "Broadcom BCM4761"; + + amba { + compatible = "arm,amba-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + vic0: interrupt-controller@80000 { + compatible = "brcm,bcm4761-pl192", "arm,pl192-vic", "arm,primecell"; + reg = <0x80000 0x1000>; + interrupt-controller; + #interrupt-cells = <1>; + }; + + vic1: interrupt-controller@81000 { + compatible = "brcm,bcm4761-pl192", "arm,pl192-vic", "arm,primecell"; + reg = <0x81000 0x1000>; + interrupt-controller; + #interrupt-cells = <1>; + }; + + uart0@c0000 { + compatible = "brcm,bcm4761-pl011", "arm,pl011", "arm,primecell"; + reg = <0xc0000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <14>; + }; + + uart1@c1000 { + compatible = "brcm,bcm4761-pl011", "arm,pl011", "arm,primecell"; + reg = <0xc1000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <15>; + }; + + uart2@b2000 { + compatible = "brcm,bcm4761-pl011", "arm,pl011", "arm,primecell"; + reg = <0xb2000 0x1000>; + interrupt-parent = <&vic0>; + interrupts = <16>; + }; + }; +};