From patchwork Thu Jan 24 15:54:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Nelson X-Patchwork-Id: 2033401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id C768FDF264 for ; Thu, 24 Jan 2013 16:07:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TyPHc-0002LQ-Qt; Thu, 24 Jan 2013 16:04:12 +0000 Received: from mail-ob0-f169.google.com ([209.85.214.169]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TyP8d-0001MH-Nx for linux-arm-kernel@lists.infradead.org; Thu, 24 Jan 2013 15:54:53 +0000 Received: by mail-ob0-f169.google.com with SMTP id ta14so1820979obb.0 for ; Thu, 24 Jan 2013 07:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=JmNxl4IQNFOmaILjQDfstWo2G8KrFRCLDJaP/onYEss=; b=e8GDsNVeotTyg8/eEWeIlaNmH2n/wW5sZkLSKaZSwBsKbyUj/A7fO8/yEFa+E+DXV+ HzpgWx2y7iGzWVy6Htg+U0gqMLYHe/m988HA5woGpdyI9y4nxVClc0Z846EQFCmWG3Ux KnkiFMsQxNLodq1p/GayB6X8rMr+KSrJyIKjg7SQz2ascD3eprcEdIsFKIOfsQyD1N8v 9YvhsJNkFoX2/yaOL5FETbAFufjcAU/aIfxAcCWB+2sfg932KpAJl0QJKB9kYb1Qxlrj DaDZEDqnrlvm6qKwM4G+qdDYzNHlZ+J9dIm+pCJPIUfitY5eChAna803kfGPbaz/RUVY uyxg== MIME-Version: 1.0 X-Received: by 10.50.163.104 with SMTP id yh8mr1721177igb.112.1359042889751; Thu, 24 Jan 2013 07:54:49 -0800 (PST) Received: by 10.64.5.233 with HTTP; Thu, 24 Jan 2013 07:54:49 -0800 (PST) In-Reply-To: <1358967038-6615-1-git-send-email-matthias.bgg@gmail.com> References: <1358967038-6615-1-git-send-email-matthias.bgg@gmail.com> Date: Thu, 24 Jan 2013 09:54:49 -0600 Message-ID: Subject: Re: [PATCH] omap2: twl-common: Add default power configuration From: Robert Nelson To: Matthias Brugger X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130124_105451_965639_9737BD59 X-CRM114-Status: GOOD ( 23.17 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.169 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robertcnelson[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: martinez.javier@gmail.com, linux@arm.linux.org.uk, tony@atomide.com, eballetbo@iseebcn.com, ezequiel.garcia@free-electrons.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Wed, Jan 23, 2013 at 12:50 PM, Matthias Brugger wrote: > This patch adds a generic power script configuration. > When rebooting an OMAP3530 at 125 MHz, the reboot hangs. > With the generic power script, TWL4030 will be reset > when a warm reset occures. This way the OMAP3530 does not > hang on reboot. > > Signed-off-by: Matthias Brugger > --- > arch/arm/mach-omap2/twl-common.c | 38 ++++++++++++++++++++++++++++++++++++++ > arch/arm/mach-omap2/twl-common.h | 1 + > 2 files changed, 39 insertions(+) > > diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c > index e49b40b..f096beb 100644 > --- a/arch/arm/mach-omap2/twl-common.c > +++ b/arch/arm/mach-omap2/twl-common.c > @@ -120,6 +120,41 @@ static struct twl4030_audio_data omap3_audio_pdata = { > .codec = &omap3_codec, > }; > > +static struct twl4030_ins wrst_seq[] __initdata = { > + {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2}, > + {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15}, > + {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15}, > + {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60}, > + {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2}, > + {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2}, > +}; > + > +static struct twl4030_script wrst_script __initdata = { > + .script = wrst_seq, > + .size = ARRAY_SIZE(wrst_seq), > + .flags = TWL4030_WRST_SCRIPT, > +}; > + > +static struct twl4030_script *omap3_power_scripts[] __initdata = { > + &wrst_script, > +}; > + > +static struct twl4030_resconfig omap3_rconfig[] = { > + { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1, > + .type2 = -1 }, > + { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1, > + .type2 = -1 }, > + { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1, > + .type2 = -1 }, > + { 0, 0}, > +}; > + > +static struct twl4030_power_data omap3_power_pdata = { > + .scripts = omap3_power_scripts, > + .num = ARRAY_SIZE(omap3_power_scripts), > + .resource_config = omap3_rconfig, > +}; > + > static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = { > REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), > }; > @@ -224,6 +259,9 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, > if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio) > pmic_data->audio = &omap3_audio_pdata; > > + if (pdata_flags & TWL_COMMON_PDATA_POWER && !pmic_data->power) > + pmic_data->power = &omap3_power_pdata; > + > /* Common regulator configurations */ > if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac) > pmic_data->vdac = &omap3_vdac_idata; > diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h > index dcfbad5..dbeb905 100644 > --- a/arch/arm/mach-omap2/twl-common.h > +++ b/arch/arm/mach-omap2/twl-common.h > @@ -7,6 +7,7 @@ > #define TWL_COMMON_PDATA_BCI (1 << 1) > #define TWL_COMMON_PDATA_MADC (1 << 2) > #define TWL_COMMON_PDATA_AUDIO (1 << 3) > +#define TWL_COMMON_PDATA_POWER (1 << 4) > > /* Common LDO regulators for TWL4030/TWL6030 */ > #define TWL_COMMON_REGULATOR_VDAC (1 << 0) > -- > 1.7.11.7 Thanks for making this generic Matthias.. Tested-by: Robert Nelson Tested on Beagle C4 (omap3530) and Beagle xM (DM3730, no regressions) with this patch to enable it on the Beagle.. From 65004dafc8d37c69dd839803dc8ea5dcefd993df Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Thu, 24 Jan 2013 09:43:51 -0600 Subject: [PATCH] ARM: OMAP: Beagle: use TWL4030 generic reset script Enable TWL_COMMON_PDATA_POWER such that OMAP3530 revisions of the Beagle (Bx/Cx) will not hang on reboot when running at 125 Mhz. Signed-off-by: Robert Nelson --- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 22c483d..0974e08 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -353,7 +353,7 @@ static int __init omap3_beagle_i2c_init(void) { omap3_pmic_get_config(&beagle_twldata, TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC | - TWL_COMMON_PDATA_AUDIO, + TWL_COMMON_PDATA_AUDIO | TWL_COMMON_PDATA_POWER, TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); beagle_twldata.vpll2->constraints.name = "VDVI";