From patchwork Wed Oct 1 07:32:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 38216 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7A98520549 for ; Wed, 1 Oct 2014 07:32:19 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf171578lab.1 for ; Wed, 01 Oct 2014 00:32:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=FgP4haHL9qN5wtBlUSGykvG8Kj38WR7ygdrfldNhMj8=; b=OM9kqG0PBmK76VKdu5jUm0tF8KBITjl457cYEKCpVGAxD+Z8fQ9AjwN6Hhs2DjYUEI vTnrrjsJpvgs/lGVGsXNmcexoCBhlFp+J91sH5AdW4/GrSawWXdrQNAZHswS+gygwxAN JWZr5q8D58JvJoAzF0595tiXb93u4NE1v7L+ciLqakWvPQtyMbEQS3Ugv2PDgvXKjSra Hib4rflL12OQm6EDHasShhO0uWid1/u6jjL58uW0vDWfJ3viO9taaBslnJciMCNMYAos y0D4fUE2+e0h+pHB+uMJFsT4BCqs9C9DMNsd0jztz2H6xphSesMzKW4gSURNNHYHkYGj wccA== X-Gm-Message-State: ALoCoQloHiHsOf0xMSH27xvkcaN6Ntx3pCzE8ews5gCUW91DQVHFW1ixUL5agwe4j/SG5a9/UrVD X-Received: by 10.180.221.236 with SMTP id qh12mr1817950wic.4.1412148738258; Wed, 01 Oct 2014 00:32:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.43 with SMTP id cb11ls131471lad.23.gmail; Wed, 01 Oct 2014 00:32:17 -0700 (PDT) X-Received: by 10.152.170.227 with SMTP id ap3mr52826656lac.15.1412148737959; Wed, 01 Oct 2014 00:32:17 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx.google.com with ESMTPS id h4si218476lbd.53.2014.10.01.00.32.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 00:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ge10so214070lab.38 for ; Wed, 01 Oct 2014 00:32:17 -0700 (PDT) X-Received: by 10.152.22.137 with SMTP id d9mr53650619laf.29.1412148737447; Wed, 01 Oct 2014 00:32:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp482196lbb; Wed, 1 Oct 2014 00:32:16 -0700 (PDT) X-Received: by 10.70.131.101 with SMTP id ol5mr95433775pdb.77.1412148735694; Wed, 01 Oct 2014 00:32:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fy10si29540pdb.147.2014.10.01.00.32.14 for ; Wed, 01 Oct 2014 00:32:15 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750846AbaJAHcO (ORCPT + 5 others); Wed, 1 Oct 2014 03:32:14 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:47890 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750780AbaJAHcN (ORCPT ); Wed, 1 Oct 2014 03:32:13 -0400 Received: by mail-wi0-f176.google.com with SMTP id hi2so947289wib.15 for ; Wed, 01 Oct 2014 00:32:12 -0700 (PDT) X-Received: by 10.194.184.166 with SMTP id ev6mr24393841wjc.61.1412148731981; Wed, 01 Oct 2014 00:32:11 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id xm4sm892891wib.9.2014.10.01.00.32.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Oct 2014 00:32:10 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Arnd Bergmann , Russell King Cc: Pawel Moll , Mark Rutland , Marc Zyngier , Will Deacon , Rob Herring , Linus Walleij Subject: [PATCH 1/2] ARM: realview: basic device tree implementation Date: Wed, 1 Oct 2014 09:32:05 +0200 Message-Id: <1412148725-24519-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This implements basic device tree boot support for the RealView platforms, with a basic device tree for ARM PB1176 as an example. The implementation is done with a new DT-specific board file using only pre-existing bindings for the basic IRQ, timer and serial port drivers. A new compatible type is added to the GIC for the ARM1176. This implementation uses the MFD syscon handle from day one to access the system controller registers, and register the devices using the SoC bus. Cc: Arnd Bergmann Cc: Rob Herring Acked-by: Jason Cooper Signed-off-by: Linus Walleij --- ChangeLog v6->v7: - Split in two patches, one with the machine changes, one with the device tree and binding portions. --- arch/arm/mach-realview/Kconfig | 13 +++++++++++++ arch/arm/mach-realview/Makefile | 1 + arch/arm/mach-realview/realview-dt.c | 32 ++++++++++++++++++++++++++++++++ drivers/irqchip/irq-gic.c | 2 ++ 4 files changed, 48 insertions(+) create mode 100644 arch/arm/mach-realview/realview-dt.c diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig index 9db2029aa632..565925f37dc5 100644 --- a/arch/arm/mach-realview/Kconfig +++ b/arch/arm/mach-realview/Kconfig @@ -1,6 +1,19 @@ menu "RealView platform type" depends on ARCH_REALVIEW +config REALVIEW_DT + bool "Support RealView(R) Device Tree based boot" + select ARM_GIC + select MFD_SYSCON + select POWER_RESET + select POWER_RESET_VERSATILE + select POWER_SUPPLY + select SOC_REALVIEW + select USE_OF + help + Include support for booting the ARM(R) RealView(R) evaluation + boards using a device tree machine description. + config MACH_REALVIEW_EB bool "Support RealView(R) Emulation Baseboard" select ARM_GIC diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile index 541fa4c109ef..e07fdf7ae8a7 100644 --- a/arch/arm/mach-realview/Makefile +++ b/arch/arm/mach-realview/Makefile @@ -3,6 +3,7 @@ # obj-y := core.o +obj-$(CONFIG_REALVIEW_DT) += realview-dt.o obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o diff --git a/arch/arm/mach-realview/realview-dt.c b/arch/arm/mach-realview/realview-dt.c new file mode 100644 index 000000000000..cc28b89dd48f --- /dev/null +++ b/arch/arm/mach-realview/realview-dt.c @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2014 Linaro Ltd. + * + * Author: Linus Walleij + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, as + * published by the Free Software Foundation. + * + */ +#include +#include +#include +#include "core.h" + +static const char *realview_dt_platform_compat[] __initconst = { + "arm,realview-eb", + "arm,realview-pb1176", + "arm,realview-pb11mp", + "arm,realview-pba8", + "arm,realview-pbx", + NULL, +}; + +DT_MACHINE_START(REALVIEW_DT, "ARM RealView Machine (Device Tree Support)") +#ifdef CONFIG_ZONE_DMA + .dma_zone_size = SZ_256M, +#endif + .dt_compat = realview_dt_platform_compat, + .l2c_aux_val = 0x0, + .l2c_aux_mask = ~0x0, +MACHINE_END diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 4b959e606fe8..4e75e3f24a97 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1022,6 +1022,8 @@ gic_of_init(struct device_node *node, struct device_node *parent) return 0; } IRQCHIP_DECLARE(gic_400, "arm,gic-400", gic_of_init); +IRQCHIP_DECLARE(arm11mp_gic, "arm,arm11mp-gic", gic_of_init); +IRQCHIP_DECLARE(arm1176jzf_dc_gic, "arm,arm1176jzf-devchip-gic", gic_of_init); IRQCHIP_DECLARE(cortex_a15_gic, "arm,cortex-a15-gic", gic_of_init); IRQCHIP_DECLARE(cortex_a9_gic, "arm,cortex-a9-gic", gic_of_init); IRQCHIP_DECLARE(cortex_a7_gic, "arm,cortex-a7-gic", gic_of_init);