From patchwork Thu Aug 9 06:18:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 1298791 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 31B0C3FC23 for ; Thu, 9 Aug 2012 06:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754407Ab2HIGSV (ORCPT ); Thu, 9 Aug 2012 02:18:21 -0400 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:34973 "EHLO mho-01-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754738Ab2HIGST (ORCPT ); Thu, 9 Aug 2012 02:18:19 -0400 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=localhost.localdomain) by mho-01-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1SzM4X-000Dgc-B0; Thu, 09 Aug 2012 06:18:17 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/2T8JT21gKX+Ums9VOioV3 Date: Wed, 8 Aug 2012 23:18:13 -0700 From: Tony Lindgren To: Konstantin Baydarov Cc: balbi@ti.com, kishon@ti.com, amit.kucheria@linaro.org, linux-pm@lists.linux-foundation.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [linux-pm] [PATCH v4 2/4] mfd: omap: control: core system control driver Message-ID: <20120809061813.GK11011@atomide.com> References: <500FD2EC.7060208@dev.rtsoft.ru> <20120808140507.GF11011@atomide.com> <20120808141051.GG11011@atomide.com> <20120808143929.GJ11011@atomide.com> <50227ED9.3010508@dev.rtsoft.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <50227ED9.3010508@dev.rtsoft.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org * Konstantin Baydarov [120808 07:59]: > On 08/08/2012 06:39 PM, Tony Lindgren wrote: > > Yes, omap_type() is called very early , that is why I'm using early_initcall > for omap_control_base initialization. > > Do you mean following?: > void __init omap2_set_globals_control(struct omap_globals *omap2_globals) > { > if (omap2_globals->ctrl) > omap2_ctrl_base = omap2_globals->ctrl; > > if (omap2_globals->ctrl_pad) > omap4_ctrl_pad_base = omap2_globals->ctrl_pad; > > omap_control_base = omap2_ctrl_base; // this line is added > } OK so we already have set_globals_control, but we're not using it.. No need for this line is added above. Let's do the attached clean-up patch and just leave omap_control_base out of the driver for now as it's not currently needed there. If omap_control_base is needed in the driver, then we need to pass it in the platform_data to the driver for the non-DT boot case, or parse it from DT like you're doing. Regards, Tony From: Tony Lindgren Date: Wed, 8 Aug 2012 23:13:03 -0700 Subject: [PATCH] ARM: OMAP2+: Change omap_type() to use omap_ctrl_base_get() We have the SoC specific ctrl_base already initialized in set_globals. Signed-off-by: Tony Lindgren --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -42,28 +42,20 @@ int omap_type(void) { u32 val = 0; - if (cpu_is_omap24xx()) { - val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); - } else if (soc_is_am33xx()) { - val = omap_ctrl_readl(AM33XX_CONTROL_STATUS); - } else if (cpu_is_omap34xx()) { - val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS); - } else if (cpu_is_omap44xx()) { - val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS); - } else if (soc_is_omap54xx()) { - val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS); + val = __raw_readl(omap_ctrl_base_get()); + if (!val) { + pr_err("Cannot detect omap type!\n"); + return 0; + } + + if (soc_is_omap54xx()) { val &= OMAP5_DEVICETYPE_MASK; val >>= 6; - goto out; } else { - pr_err("Cannot detect omap type!\n"); - goto out; + val &= OMAP2_DEVICETYPE_MASK; + val >>= 8; } - val &= OMAP2_DEVICETYPE_MASK; - val >>= 8; - -out: return val; } EXPORT_SYMBOL(omap_type);