From patchwork Sun Jul 3 01:02:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 102996 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 73526B6F64 for ; Sun, 3 Jul 2011 11:03:17 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QdB5O-00059f-Ss; Sun, 03 Jul 2011 01:02:59 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QdB5O-00085e-H1; Sun, 03 Jul 2011 01:02:58 +0000 Received: from utopia.booyaka.com ([72.9.107.138]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QdB5K-00085L-48 for linux-arm-kernel@lists.infradead.org; Sun, 03 Jul 2011 01:02:55 +0000 Received: (qmail 29223 invoked by uid 1019); 3 Jul 2011 01:02:52 -0000 MBOX-Line: From nobody Sat Jul 2 19:02:08 2011 Subject: [PATCH] OMAP: hwmod: add kernel cmdline flag to avoid resetting IP blocks during init To: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org From: Paul Walmsley Date: Sat, 02 Jul 2011 19:02:08 -0600 Message-ID: <20110703010206.19046.85293.stgit@dusk> In-Reply-To: <20110703010204.19046.85186.stgit@dusk> References: <20110703010204.19046.85186.stgit@dusk> User-Agent: StGit/0.15 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110702_210254_268564_E0B5BC4D X-CRM114-Status: GOOD ( 18.43 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Tony Lindgren , Rajendra Nayak , =?utf-8?q?Beno=C3=AEt?= Cousson , Michael Buesch X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On some boards, it's not possible to reset certain IP blocks during kernel initialization. Some boards connect GPIO lines to external voltage controllers, so resetting them may cause voltage to drop on a critical supply[1]. Other boards connect GPIO lines to reset pins on external devices without open documentation, so if the GPIO blocks are reset, the external devices cannot currently be reconfigured[2]. The correct way to fix these issues on OMAP is to add a hwmod_no_setup_reset(hwmod) call to the board file, that references the IP block that must preserve its state. This allows the OMAP core code to reset the remaining IP blocks. However, during initial bring-up of a new board, it may be desirable to not reset any IP block, for ease of debugging. This patch adds a kernel command line parameter, 'hwmod_no_setup_reset', that prevents the OMAP hwmod code from resetting any IP block during init. 1. Nayak, Rajendra. _[PATCH 7/7] 4460sdp/blaze/panda: hwmod: Prevent gpio1 reset during hwmod init_. 1 July 2011. E-mail to the linux-omap@vger.kernel.org mailing list. Retrieved from http://www.mail-archive.com/linux-omap@vger.kernel.org/msg51992.html 2. Buesch, Michael. _Nokia n810 LCD (MIPID/blizzard) on 2.6.38_. 28 Feb 2011. E-mail to the linux-omap@vger.kernel.org mailing list. Retrieved from http://www.spinics.net/lists/linux-omap/msg47277.html Signed-off-by: Paul Walmsley Cc: BenoƮt Cousson Cc: Rajendra Nayak Cc: Michael Buesch Cc: Tony Lindgren --- Documentation/kernel-parameters.txt | 9 +++++++++ arch/arm/mach-omap2/omap_hwmod.c | 19 +++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index fd248a31..4b1c03f 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -75,6 +75,7 @@ parameter is applicable: NET Appropriate network support is enabled. NUMA NUMA support is enabled. NFS Appropriate NFS support is enabled. + OMAP OMAP sub-architecture is enabled. OSS OSS sound support is enabled. PV_OPS A paravirtualized kernel is enabled. PARIDE The ParIDE (parallel port IDE) subsystem is enabled. @@ -872,6 +873,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted. If specified, z/VM IUCV HVC accepts connections from listed z/VM user IDs only. + hwmod_no_setup_reset + [OMAP] During kernel initialization, + prevent the subarchitecture code from resetting + IP blocks before the driver loads. Useful for + initial bring-up of boards which require some + bootloader configuration to be retained on GPIO or + other IP blocks. + keep_bootcon [KNL] Do not unregister boot console at start. This is only useful for debugging when something happens in the window diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 293fa6c..025bf2f 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -86,7 +86,9 @@ * completely self-reliant and independent from bootloaders. This is * to ensure a repeatable configuration, both to ensure consistent * runtime behavior, and to make it easier for others to reproduce - * bugs. + * bugs. (This behavior can be disabled while bringing up a new board + * by passing the kernel command line parameter + * 'hwmod_no_setup_reset'.) * * OMAP module activity states * --------------------------- @@ -162,6 +164,12 @@ static LIST_HEAD(omap_hwmod_list); /* mpu_oh: used to add/remove MPU initiator from sleepdep list */ static struct omap_hwmod *mpu_oh; +/* + * no_setup_reset: if true, then don't reset any hwmods on boot. This + * can be changed by the 'hwmod_no_setup_reset' kernel command line + * parameter + */ +static bool no_setup_reset; /* Private functions */ @@ -1453,7 +1461,7 @@ static int _setup(struct omap_hwmod *oh, void *data) return 0; } - if (!(oh->flags & HWMOD_INIT_NO_RESET)) { + if (!no_setup_reset && !(oh->flags & HWMOD_INIT_NO_RESET)) { _reset(oh); /* @@ -1542,6 +1550,13 @@ static int __init _register(struct omap_hwmod *oh) return 0; } +static int __init _cmdline_no_setup_reset(char *s) +{ + no_setup_reset = true; + return 1; +} + +__setup("hwmod_no_setup_reset", _cmdline_no_setup_reset); /* Public functions */