From patchwork Thu Oct 10 16:27:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 20945 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CBC9525C9D for ; Thu, 10 Oct 2013 16:27:49 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id n4sf5013005qcx.6 for ; Thu, 10 Oct 2013 09:27:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=osYM4Pi4guSSVPIs0+klo+pbUSZHucW3N1R+ClH5JTE=; b=dkm0vg3xWyvczx1evWzBeDCsbpIjWnaMXH+QN193kNcAHkBENuDzx553Vm6VUWTwCC 9l3S1xf4ZFLtKiNZISRhL0c0T1fCOTllVOvyNVOBRpLcsx9V8VxlojsuRcR7k/OjlXCF Xr6qLo7kN4L4qpiLBBUhXClT7EhBKw6j//fk3V+GwEX3tS3sYGNCgHk2+DiPfLecaHiB ple86+t3VkP8VXcURn7ftfc31fsugdxbehjsWJ3Z/f0tyE3aWEMWQdPHu+NaeqXfjA3r fmu3Ai5VGZ0Q3rx5dv/HlWYDHK5MdU/W7BzlMsWKm+mxBb4GrZfusb5CWU0rGG0Enn5F wXZA== X-Received: by 10.236.56.70 with SMTP id l46mr14873448yhc.2.1381422469064; Thu, 10 Oct 2013 09:27:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.71.209 with SMTP id x17ls1081302qeu.83.gmail; Thu, 10 Oct 2013 09:27:48 -0700 (PDT) X-Received: by 10.52.26.146 with SMTP id l18mr6745979vdg.95.1381422468853; Thu, 10 Oct 2013 09:27:48 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id tj1si14544746vdc.118.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 09:27:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hv10so1805857vcb.22 for ; Thu, 10 Oct 2013 09:27:48 -0700 (PDT) X-Gm-Message-State: ALoCoQlhQhRKekU+YbBZgcdggllaIlLtEdzCnVf3g2omIa7Qw/A80PgWTMADdTGcU8ac7AT+Wys0 X-Received: by 10.52.227.165 with SMTP id sb5mr7272094vdc.85.1381422468514; Thu, 10 Oct 2013 09:27:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp390154vcz; Thu, 10 Oct 2013 09:27:46 -0700 (PDT) X-Received: by 10.180.93.166 with SMTP id cv6mr8538734wib.37.1381422465753; Thu, 10 Oct 2013 09:27:45 -0700 (PDT) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by mx.google.com with ESMTPS id y2si6493096wia.33.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Oct 2013 09:27:45 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.43 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=74.125.82.43; Received: by mail-wg0-f43.google.com with SMTP id c11so1793062wgh.10 for ; Thu, 10 Oct 2013 09:27:45 -0700 (PDT) X-Received: by 10.194.123.8 with SMTP id lw8mr13095869wjb.40.1381422464983; Thu, 10 Oct 2013 09:27:44 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id sh5sm26973432wic.11.1969.12.31.16.00.00 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 10 Oct 2013 09:27:44 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org, Mark Rutland , Linus Walleij Subject: [PATCH] ARM: integrator: core module registers from compatible strings Date: Thu, 10 Oct 2013 18:27:40 +0200 Message-Id: <1381422460-20218-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This augments the core machine code for the Integrator platforms to get their references to the core module device nodes by using compatible strings instead of predefined node names and rename the CP syscon node to be simply "syscon". Reported-by: Mark Rutland Signed-off-by: Linus Walleij --- Documentation/devicetree/bindings/arm/arm-boards | 30 ++++++++++++++---------- arch/arm/boot/dts/integratorap.dts | 2 +- arch/arm/boot/dts/integratorcp.dts | 4 ++-- arch/arm/mach-integrator/integrator_ap.c | 8 ++++++- arch/arm/mach-integrator/integrator_cp.c | 8 ++++++- 5 files changed, 34 insertions(+), 18 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/arm-boards b/Documentation/devicetree/bindings/arm/arm-boards index 0ebf3d9..5fac246 100644 --- a/Documentation/devicetree/bindings/arm/arm-boards +++ b/Documentation/devicetree/bindings/arm/arm-boards @@ -19,18 +19,22 @@ Required nodes: - regs: the location and size of the core module registers, one range of 0x200 bytes. -- cpcon/syscon: the root node the Integrator/CP must have a /cpcon - node pointing to the CP control registers, and the Integrator/AP - must have a /syscon node pointing to the Integrator/AP system - controller. The AP syscon node must include the logical module - interrupts. - -In the root node the Integrator/CP must have a /cpcon node pointing -to the CP control registers, and the Integrator/AP must have a -/syscon node pointing to the Integrator/AP system controller. -The AP syscon node must include the logic module interrupts, stated -in order of module instance -example: +- syscon: the root node of the Integrator platforms must have a + system controller node pointong to the control registers, + with the compatible string + "arm,integrator-ap-syscon" + "arm,integrator-cp-syscon" + respectively. + + Required properties for the system controller: + - regs: the location and size of the system controller registers, + one range of 0x100 bytes. + + Required properties for the AP system controller: + - interrupts: the AP syscon node must include the logical module + interrupts, stated in order of module instance , + , ... for the CP system controller this + is not required not of any use. /dts-v1/; /include/ "integrator.dtsi" @@ -45,7 +49,7 @@ example: }; syscon { - /* AP system controller registers */ + compatible = "arm,integrator-ap-syscon"; reg = <0x11000000 0x100>; interrupt-parent = <&pic>; /* These are the logic module IRQs */ diff --git a/arch/arm/boot/dts/integratorap.dts b/arch/arm/boot/dts/integratorap.dts index 453ab0e..e6be931 100644 --- a/arch/arm/boot/dts/integratorap.dts +++ b/arch/arm/boot/dts/integratorap.dts @@ -19,7 +19,7 @@ }; syscon { - /* AP system controller registers */ + compatible = "arm,integrator-ap-syscon"; reg = <0x11000000 0x100>; interrupt-parent = <&pic>; /* These are the logical module IRQs */ diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts index ff1aea0..a3a06b8 100644 --- a/arch/arm/boot/dts/integratorcp.dts +++ b/arch/arm/boot/dts/integratorcp.dts @@ -18,8 +18,8 @@ bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; }; - cpcon { - /* CP controller registers */ + syscon { + compatible = "arm,integrator-cp-syscon"; reg = <0xcb000000 0x100>; }; diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index ece4755..d50dc2d 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c @@ -470,6 +470,11 @@ static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = { { /* sentinel */ }, }; +static const struct of_device_id ap_syscon_match[] = { + { .compatible = "arm,integrator-ap-syscon"}, + { }, +}; + static void __init ap_init_of(void) { unsigned long sc_dec; @@ -486,7 +491,8 @@ static void __init ap_init_of(void) root = of_find_node_by_path("/"); if (!root) return; - syscon = of_find_node_by_path("/syscon"); + + syscon = of_find_matching_node(root, ap_syscon_match); if (!syscon) return; diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 422c3f9..1df6e76 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -286,6 +286,11 @@ static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = { { /* sentinel */ }, }; +static const struct of_device_id intcp_syscon_match[] = { + { .compatible = "arm,integrator-cp-syscon"}, + { }, +}; + static void __init intcp_init_of(void) { struct device_node *root; @@ -300,7 +305,8 @@ static void __init intcp_init_of(void) root = of_find_node_by_path("/"); if (!root) return; - cpcon = of_find_node_by_path("/cpcon"); + + cpcon = of_find_matching_node(root, intcp_syscon_match); if (!cpcon) return;