From patchwork Fri Sep 28 19:37:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1522601 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by patchwork1.kernel.org (Postfix) with ESMTP id CF8983FE80 for ; Fri, 28 Sep 2012 19:40:46 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8SJdIX5022977; Fri, 28 Sep 2012 14:39:18 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8SJdIaF021964; Fri, 28 Sep 2012 14:39:18 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Fri, 28 Sep 2012 14:39:18 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8SJdId6026386; Fri, 28 Sep 2012 14:39:18 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 5F4B48062B; Fri, 28 Sep 2012 14:39:18 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 1EEC58062A for ; Fri, 28 Sep 2012 14:37:56 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id q8SJbtW0003659 for ; Fri, 28 Sep 2012 14:37:55 -0500 (CDT) Received: from psmtp.com (na3sys009amx186.postini.com [74.125.149.167]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id q8SJbsJQ028228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 28 Sep 2012 14:37:54 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]) (using TLSv1) by na3sys009amx186.postini.com ([74.125.148.10]) with SMTP; Fri, 28 Sep 2012 15:37:55 EDT Received: by mail-ie0-f173.google.com with SMTP id 17so7532626iea.4 for ; Fri, 28 Sep 2012 12:37:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=3P86DwuYbCqmvNQ06ytPkrU70merMPqZworku74cQS8=; b=iZJ1y2F1/e+r13WI70VBb37zDa9xWrOMPtsUX3/vquSVtPBUKd2oft9tGI+JjN+SvO 8G/Zi01o2NA2NTRXHAZHe6C1kAM155v2X1dQQZWKZwuI8sxhXswAZlWYgdBJRBc8bnE1 uOuOggZSk1ducHoT3yVvOoYuuv6f+t+UuZ745qg7HEnbiORUgLYoeCCL/MvGD3FuauMp LLX212KLNla0+Q4fNC3mj6aF7Z2AZl2PYe6htKJ7jsvxIHjOmg5xlDPQ2kkLRrjhIY5n 4ahJlun4tF4swNDoIIZrQsNBN4VZ+RzSsg/WHIUf8YqeDM82TnPM/PgrCs2GorsnOmCS 2iSg== Received: by 10.50.212.97 with SMTP id nj1mr2622404igc.26.1348861074364; Fri, 28 Sep 2012 12:37:54 -0700 (PDT) Received: from beef.ohporter.com (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id q1sm449747igj.15.2012.09.28.12.37.52 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Sep 2012 12:37:53 -0700 (PDT) From: Matt Porter To: Greg Kroah-Hartman , "Hans J. Koch" , Benoit Cousson , Paul Walmsley , Sekhar Nori Subject: [PATCH v2 6/7] ARM: omap: add DT support for deasserting hardware reset lines Date: Fri, 28 Sep 2012 15:37:51 -0400 Message-ID: <1348861072-14507-7-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348861072-14507-1-git-send-email-mporter@ti.com> References: <1348861072-14507-1-git-send-email-mporter@ti.com> X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: Linux DaVinci Kernel List , Russell King , Tony Lindgren , Linux Kernel Mailing List , Linux OMAP List , Linux ARM Kernel List X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com This optional binding extension allows specification of a hwmod and associate hardware reset line which should be deasserted for the device to be functional. The implementation works for reference as to the problem that exists for utilizing uio_pruss on AM33xx but is suboptimal. The problem is that this deassertion occurs before clocks are enabled and we are warned that the hard reset failed. Ideally the list of rst lines requested to be deasserted would be cached and used within the hwmod enable sequencing (instead of it just returning if any hardware reset line is asserted). Signed-off-by: Matt Porter --- .../devicetree/bindings/arm/omap/omap.txt | 2 ++ arch/arm/plat-omap/omap_device.c | 25 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/omap/omap.txt b/Documentation/devicetree/bindings/arm/omap/omap.txt index d0051a7..3133a4b 100644 --- a/Documentation/devicetree/bindings/arm/omap/omap.txt +++ b/Documentation/devicetree/bindings/arm/omap/omap.txt @@ -21,6 +21,8 @@ Required properties: Optional properties: - ti,no_idle_on_suspend: When present, it prevents the PM to idle the module during suspend. +- ti,deassert-hard-reset: list of hwmod and hardware reset line name pairs + (ascii strings) to be deasserted upon device instantiation. Example: diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index d5f617c..d1ae68c 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c @@ -330,8 +330,8 @@ static int omap_device_build_from_dt(struct platform_device *pdev) struct omap_device *od; struct omap_hwmod *oh; struct device_node *node = pdev->dev.of_node; - const char *oh_name; - int oh_cnt, i, ret = 0; + const char *oh_name, *rst_name; + int oh_cnt, dstr_cnt, i, ret = 0; oh_cnt = of_property_count_strings(node, "ti,hwmods"); if (!oh_cnt || IS_ERR_VALUE(oh_cnt)) { @@ -376,6 +376,27 @@ static int omap_device_build_from_dt(struct platform_device *pdev) if (of_get_property(node, "ti,no_idle_on_suspend", NULL)) omap_device_disable_idle_on_suspend(pdev); + dstr_cnt = + of_property_count_strings(node, "ti,deassert-hard-reset"); + if (dstr_cnt > 0) { + for (i = 0; i < dstr_cnt; i += 2) { + of_property_read_string_index( + node, "ti,deassert-hard-reset", i, + &oh_name); + of_property_read_string_index( + node, "ti,deassert-hard-reset", i+1, + &rst_name); + oh = omap_hwmod_lookup(oh_name); + if (!oh) { + dev_warn(&pdev->dev, + "Cannot parse deassert property for '%s'\n", + oh_name); + break; + } + omap_hwmod_deassert_hardreset(oh, rst_name); + } + } + pdev->dev.pm_domain = &omap_device_pm_domain; odbfd_exit1: