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: 3017551 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 AB4899F245 for ; Thu, 10 Oct 2013 16:35:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 551952021B for ; Thu, 10 Oct 2013 16:35:17 +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 D46E6201C7 for ; Thu, 10 Oct 2013 16:35:15 +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 1VUJCi-0005aF-Ak; Thu, 10 Oct 2013 16:35:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUJCf-00050G-W7; Thu, 10 Oct 2013 16:35:10 +0000 Received: from mail-we0-f171.google.com ([74.125.82.171]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VUJCc-0004yu-Qy for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2013 16:35:07 +0000 Received: by mail-we0-f171.google.com with SMTP id t60so2887358wes.30 for ; Thu, 10 Oct 2013 09:34:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=osYM4Pi4guSSVPIs0+klo+pbUSZHucW3N1R+ClH5JTE=; b=kAqyDTsh0utgw7Xtq9ARdDU15aO7iWYprECDHHqh6M+Fl9MfSD9RRCfVbIElbnL4g9 UkujFsx9PU3V1nNcdXkCrLGb8DXGMIs4NLXbqMIV7A3JrVYWGCPmq2p2acwJm7CmTCJm UYN0aXweWRTkdDycn+hmi/KP9iUeCvRFtlu+mp138YnmbGzR8C9BDCq//Zn+9BvUzJQe +nc0DV4XW9naOmayYdFy/0oQz3xQf+Mk2UCEh/vkBy0jreJ2l66PDzJHdYJlBUGJ0I9e MQJRYRjRvUDCB8VDEICj/njmcgkD9hAH5eH4Z+wSKSo5IrAVCco4XHi9ISLnJDG3BPNP 776Q== X-Gm-Message-State: ALoCoQlhcA0c96TN17kbdyf/jKEfNnkzgQ9AsPEIJF6VTVC4ORBXdRdmIf0oO0V+qCBICdptoisZ 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131010_123506_986776_D2120A17 X-CRM114-Status: GOOD ( 16.16 ) X-Spam-Score: -2.6 (--) Cc: Mark Rutland , devicetree@vger.kernel.org, Linus Walleij 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.4 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 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;