From patchwork Wed May 25 18:04:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 816932 Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4PI5Hdn009316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 25 May 2011 18:05:39 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QPIQY-00085T-98; Wed, 25 May 2011 18:03:26 +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 1QPIQW-0005HO-Nk; Wed, 25 May 2011 18:03:24 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by canuck.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QPIQS-0005H5-AR for linux-arm-kernel@lists.infradead.org; Wed, 25 May 2011 18:03:22 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 25 May 2011 19:03:17 +0100 Received: from [10.1.67.29] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 25 May 2011 19:03:30 +0100 Subject: Re: [PATCH] ARM: exynos4: fix secondary CPU boot From: Marc Zyngier To: Kukjin Kim In-Reply-To: <4DDD3C57.6020705@samsung.com> References: <1305899190-16732-1-git-send-email-marc.zyngier@arm.com> <4DDD3C57.6020705@samsung.com> Organization: ARM Ltd Date: Wed, 25 May 2011 19:04:05 +0100 Message-ID: <1306346645.27474.182.camel@e102391-lin.cambridge.arm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 X-OriginalArrivalTime: 25 May 2011 18:03:30.0337 (UTC) FILETIME=[0DDEF110:01CC1B06] X-MC-Unique: 111052519031703301 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110525_140320_629296_F5B111F6 X-CRM114-Status: GOOD ( 28.21 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [94.185.240.25 listed in list.dnswl.org] Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 25 May 2011 18:05:39 +0000 (UTC) On Wed, 2011-05-25 at 10:28 -0700, Kukjin Kim wrote: > On 05/20/11 06:46, Marc Zyngier wrote: > > Patch 7d30e8b38 (ARM: EXYNOS4: Add EXYNOS4 CPU initialization support) > > renamed the s5pv310 to exynos4, and also changed the value of > > EXYNOS4_PA_SYSRAM, which is used to release the secondary CPU from > > spinning in BL0. As a result, CPU1 can't be brought up anymore. > > > > This patch simply reverts EXYNOS4_PA_SYSRAM to its original value, > > which results in a working CPU1. > > > > Tested on an SMDK-v310. > > > > Cc: Kukjin Kim > > Signed-off-by: Marc Zyngier > > --- > > arch/arm/mach-exynos4/include/mach/map.h | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h > > index 6330b73..862967f 100644 > > --- a/arch/arm/mach-exynos4/include/mach/map.h > > +++ b/arch/arm/mach-exynos4/include/mach/map.h > > @@ -23,7 +23,7 @@ > > > > #include > > > > -#define EXYNOS4_PA_SYSRAM 0x02020000 > > +#define EXYNOS4_PA_SYSRAM 0x02025000 > > > Hi Marc, > > Hmm...the value, 0x02020000 is correct on Exynos4210 now. > > So can't apply this but I know, you're right on old version of > Exynos4210...let's think again about this. So that address has changed between two SoC revisions? That's unfortunate, to say the least. I'm most probably using an early revision of the hardware (EVT0?), as it doesn't even support MCT. What about the following patch? M. >From c27e75b86e1ee181987a9364286a888421e76205 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Fri, 20 May 2011 14:38:25 +0100 Subject: [PATCH] ARM: exynos4: fix secondary CPU boot on early SoC revisions It appears that the system-wide flags register that used to be at 0x02025000 on the first revision of Exynos4 has moved to 0x02020000. The kernel has been updated accordingly, but this unfortunately leaves early boards without SMP support (the secondary CPU spins endlessly in BL0 waiting for an address to be written at that memory location). Try to solve the problem by poking both locations. This should be safe as this is done early enough in the kernel boot process, and nobody should be using the SRAM yet. Tested on a vintage SMDK-v310. Cc: Kukjin Kim Signed-off-by: Marc Zyngier --- arch/arm/mach-exynos4/include/mach/map.h | 1 + arch/arm/mach-exynos4/platsmp.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-exynos4/include/mach/map.h b/arch/arm/mach-exynos4/include/mach/map.h index 0009e77..781e149 100644 --- a/arch/arm/mach-exynos4/include/mach/map.h +++ b/arch/arm/mach-exynos4/include/mach/map.h @@ -24,6 +24,7 @@ #include #define EXYNOS4_PA_SYSRAM 0x02020000 +#define EXYNOS4_PA_SYSRAM_EVT0 0x02025000 #define EXYNOS4_PA_FIMC0 0x11800000 #define EXYNOS4_PA_FIMC1 0x11810000 diff --git a/arch/arm/mach-exynos4/platsmp.c b/arch/arm/mach-exynos4/platsmp.c index c5e65a0..f261c34 100644 --- a/arch/arm/mach-exynos4/platsmp.c +++ b/arch/arm/mach-exynos4/platsmp.c @@ -155,6 +155,7 @@ void __init smp_init_cpus(void) void __init platform_smp_prepare_cpus(unsigned int max_cpus) { int i; + void __iomem *sysram_evt0; /* * Initialise the present map, which describes the set of CPUs @@ -172,4 +173,17 @@ void __init platform_smp_prepare_cpus(unsigned int max_cpus) * secondary CPU branches to this address. */ __raw_writel(BSYM(virt_to_phys(exynos4_secondary_startup)), S5P_VA_SYSRAM); + + /* + * EVT0 has the system-wide flags register at a different address. + * Poke it as well, in case we're running on an old SoC revision. + */ + sysram_evt0 = ioremap(EXYNOS4_PA_SYSRAM_EVT0, SZ_4K); + if (!sysram_evt0) { + pr_err("Unable to remap EXYNOS4_PA_SYSRAM_EVT0\n"); + return; + } + + __raw_writel(BSYM(virt_to_phys(exynos4_secondary_startup)), sysram_evt0); + iounmap(sysram_evt0); }