Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754081AbbHFGT0 (ORCPT ); Thu, 6 Aug 2015 02:19:26 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:39175 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751054AbbHFGTY (ORCPT ); Thu, 6 Aug 2015 02:19:24 -0400 Date: Thu, 6 Aug 2015 08:19:18 +0200 From: Sascha Hauer To: Matthias Brugger Cc: Scott Shu , Mark Rutland , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com, loda.chou@mediatek.com, jades.shih@mediatek.com, Mars.Cheng@mediatek.com, scott.shu@gmail.com Subject: Re: [PATCH v3 5/8] ARM: mediatek: add smp bringup code for MT6580 Message-ID: <20150806061918.GK18700@pengutronix.de> References: <1438696464-59858-1-git-send-email-scott.shu@mediatek.com> <1438696464-59858-6-git-send-email-scott.shu@mediatek.com> <1801910.hz53dYUgta@ubix> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1801910.hz53dYUgta@ubix> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:16:28 up 42 days, 37 min, 103 users, load average: 0.11, 0.15, 0.15 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1910 Lines: 50 On Wed, Aug 05, 2015 at 06:47:03PM +0200, Matthias Brugger wrote: > On Tuesday, August 04, 2015 09:54:21 PM Scott Shu wrote: > > Add support for cpu enable-method "mediatek,mt6580-smp" for booting > > secondary CPUs on MT6580. > > > > Signed-off-by: Scott Shu > > --- > > arch/arm/mach-mediatek/platsmp.c | 137 > > ++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) > > + > > +static void __init mt6580_smp_prepare_cpus(unsigned int max_cpus) > > +{ > > + static void __iomem *infracfg_ao_base; > > + > > + infracfg_ao_base = ioremap(MT6580_INFRACFG_AO, 0x1000); > > + if (!infracfg_ao_base) { > > + pr_err("%s: Unable to map I/O memory\n", __func__); > > + return; > > + } > > + > > + /* Enable bootrom power down mode */ > > + writel_relaxed(readl(infracfg_ao_base + 0x804) | SW_ROM_PD, > > + infracfg_ao_base + 0x804); > > Please use a define for the offset. > I prefer to not cascade reads and writes but to use a temporary variable. But > if this is fine with the kernel coding style (I doubt, but I'm not sure) then > this is fine. For what it's worth I also prefer val = readl(infracfg_ao_base + 0x804); val |= SW_ROM_PD: writel_relaxed(val, infracfg_ao_base + 0x804); I find this better readable. I don't think though that there's common agreement that this style is better. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/