From patchwork Thu May 15 11:18:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 4181631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3177D9F387 for ; Thu, 15 May 2014 11:25:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51144201DE for ; Thu, 15 May 2014 11:25:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DF93720158 for ; Thu, 15 May 2014 11:25:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WktkP-0005Wv-TI; Thu, 15 May 2014 11:22:49 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WktkL-0005R3-Ug for linux-arm-kernel@lists.infradead.org; Thu, 15 May 2014 11:22:47 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5M00E164X55M70@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 15 May 2014 12:22:17 +0100 (BST) X-AuditID: cbfec7f4-b7fb36d000006ff7-52-5374a366a72c Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id A2.BB.28663.663A4735; Thu, 15 May 2014 12:22:14 +0100 (BST) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5M0059R4WXDS10@eusync4.samsung.com>; Thu, 15 May 2014 12:22:14 +0100 (BST) From: Krzysztof Kozlowski To: Russell King , Kukjin Kim , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: EXYNOS: SWRESET is needed to boot secondary CPU on Exynos3250 Date: Thu, 15 May 2014 13:18:11 +0200 Message-id: <1400152691-29705-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrGJMWRmVeSWpSXmKPExsVy+t/xa7ppi0uCDe6uk7DYOGM9q8XrF4YW vQuuslmcbXrDbrHp8TVWi8u75rBZzDi/j8ni9mVei7VH7rJbrJ/xmsWBy6OluYfNY/OSeo++ LasYPT5vkgtgieKySUnNySxLLdK3S+DKmNq2jLmgSbRi19k9jA2MiwS7GDk5JARMJH7s/cIK YYtJXLi3nq2LkYtDSGApo8TKtg3MEE4fk0TH4ztMIFVsAsYSm5cvAasSEdjBKLH83mV2kASz wHNGiaffw0FsYYFQiZ2zP7OA2CwCqhKd6y+CNfMKuEssvPyIDWKdnMTJY5NZJzByL2BkWMUo mlqaXFCclJ5rqFecmFtcmpeul5yfu4kREjZfdjAuPmZ1iFGAg1GJh7djf3GwEGtiWXFl7iFG CQ5mJRHexuklwUK8KYmVValF+fFFpTmpxYcYmTg4pRoY+6veazxWjf0+tSFMe/sblVcJc+a7 fVHef56/N2/hBRGWwK4de/Nv99QocJjb2ddsXh70gHsBT0mPzMf/ep8ijO+Zb33d8uXUl0Pf 042f9Zb/X39XxKXXhLXz7Brzk8+u5sXa6yWoW95wXOjw45fGcrZF926cVpzbbHzt4qv2C3d3 zms7abn5rhJLcUaioRZzUXEiAAHEMSL5AQAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140515_042246_174315_95767810 X-CRM114-Status: GOOD ( 12.15 ) X-Spam-Score: -5.7 (-----) Cc: Krzysztof Kozlowski , Kyungmin Park , Bartlomiej Zolnierkiewicz , Tomasz Figa , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Without software reset the secondary CPU does not power up and exynos_boot_secondary() ends with pen_release equal to 1. This can be observed in dmesg: CPU1: failed to come online Brought up 1 CPUs SMP: Total of 1 processors activated. CPU: All CPU(s) started in SVC mode. When booting the secondary CPU on Exynos3250 execute also software reset for core 1. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tomasz Figa --- arch/arm/mach-exynos/platsmp.c | 22 ++++++++++++++++++++++ arch/arm/mach-exynos/regs-pmu.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index 8b88eb2f077b..64ec5ca18f60 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c @@ -76,6 +76,25 @@ static inline void __iomem *cpu_boot_reg(int cpu) } /* + * Set wake up by local power mode and execute software reset for given core. + * + * Currently this is needed only when booting secondary CPU on Exynos3250. + */ +static inline void exynos_core_restart(u32 core_id) +{ + if (of_machine_is_compatible("samsung,exynos3250")) { + u32 val; + + val = __raw_readl(S5P_ARM_CORE_STATUS(core_id)); + val |= S5P_CORE_WAKEUP_FROM_LOCAL_CFG; + __raw_writel(val, S5P_ARM_CORE_STATUS(core_id)); + + pr_info("CPU%u: Software reset\n", core_id); + __raw_writel(EXYNOS_CORE_PO_RESET(core_id), EXYNOS_SWRESET); + } +} + +/* * Write pen_release in a way that is guaranteed to be visible to all * observers, irrespective of whether they're taking part in coherency * or not. This is necessary for the hotplug code to work reliably. @@ -155,6 +174,9 @@ static int exynos_boot_secondary(unsigned int cpu, struct task_struct *idle) return -ETIMEDOUT; } } + + exynos_core_restart(core_id); + /* * Send the secondary CPU a soft interrupt, thereby causing * the boot monitor to read the system wide flags register, diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h index d94bbc85d7e0..3ecbb4fe227b 100644 --- a/arch/arm/mach-exynos/regs-pmu.h +++ b/arch/arm/mach-exynos/regs-pmu.h @@ -26,6 +26,8 @@ #define S5P_USE_STANDBY_WFI0 (1 << 16) #define S5P_USE_STANDBY_WFE0 (1 << 24) +#define EXYNOS_CORE_PO_RESET(n) ((1 << 4) << n) + #define EXYNOS_SWRESET S5P_PMUREG(0x0400) #define EXYNOS5440_SWRESET S5P_PMUREG(0x00C4) @@ -117,6 +119,7 @@ #define S5P_PAD_RET_EBIB_OPTION S5P_PMUREG(0x31A8) #define S5P_CORE_LOCAL_PWR_EN 0x3 +#define S5P_CORE_WAKEUP_FROM_LOCAL_CFG (0x3 << 8) #define S5P_INT_LOCAL_PWR_EN 0x7 #define S5P_CHECK_SLEEP 0x00000BAD