From patchwork Mon Aug 31 22:11:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 7101781 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3C76F9F36E for ; Mon, 31 Aug 2015 22:11:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E0CC2068C for ; Mon, 31 Aug 2015 22:11:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 114E22068D for ; Mon, 31 Aug 2015 22:11:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752596AbbHaWLa (ORCPT ); Mon, 31 Aug 2015 18:11:30 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35336 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbbHaWL3 (ORCPT ); Mon, 31 Aug 2015 18:11:29 -0400 Received: by pacdd16 with SMTP id dd16so152275308pac.2 for ; Mon, 31 Aug 2015 15:11:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=eK4qPp30TcNvsE0VmIMbTWFCI94HK1CdeuIAZ0by1Ak=; b=CHr+jqKcrypemi7rbWgfPTABHv8xoUcnq3FGXSIbA1tiAF8U8fyZffxrqPY5QJdpJ+ 4ibmwlzjM0FefEYF4k/osRGJqBYEI+yNj75BKSvPXdPktiuaIO5yUYv1tzvJ6sICOJpa JHtQMRZ9YqSU1oWVShioFz3/X+0L0xETVWZQLvgqdJTcCNdNY1uJfb68Iz1dX0OTvhuz zADlHjuFtPumimUPa6EhItnGulTVRjdJ9S/FRzXqOVgRrYN/CVWC+3C4kME1MpwhRIdx rEtsSRebZaynXczfgOodtyNP8UuVXuR9sact1a6BDlfv1ZGykrRG1MlJYPIcjD3/BE4d L5bw== X-Gm-Message-State: ALoCoQklak25YhwH5U8HL8G0NuR0htRRc/btHYOEHaTY2X7litptjUkZRGtt3OnDxMNkrfoJCAFQ X-Received: by 10.68.88.130 with SMTP id bg2mr40498106pbb.129.1441059088993; Mon, 31 Aug 2015 15:11:28 -0700 (PDT) Received: from localhost (c-67-160-101-93.hsd1.wa.comcast.net. [67.160.101.93]) by smtp.gmail.com with ESMTPSA id fh10sm15702030pdb.95.2015.08.31.15.11.27 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Mon, 31 Aug 2015 15:11:27 -0700 (PDT) From: Kevin Hilman To: Chanho Park Cc: kgene@kernel.org, k.kozlowski@samsung.com, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Joonyoung Shim , Chanwoo Choi , Heesub Shin , Mauro Ribeiro , Abhilash Kesavan , Przemyslaw Marczak , Marek Szyprowski Subject: Re: [PATCH] ARM: EXYNOS: reset KFC cores when cpu is up References: <1441031111-6549-1-git-send-email-parkch98@gmail.com> Date: Mon, 31 Aug 2015 15:11:26 -0700 In-Reply-To: <1441031111-6549-1-git-send-email-parkch98@gmail.com> (Chanho Park's message of "Mon, 31 Aug 2015 23:25:11 +0900") Message-ID: <7hmvx785wx.fsf@deeprootsystems.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Chanho Park writes: > The cpu booting of exynos5422 has been still broken since we discussed > it in last year[1]. This patch is inspired from odroid xu3 > code(Actually, it was from samsung exynos vendor kernel)[2]. This weird > reset code was founded exynos5420 octa cores series SoCs and only > required for the first boot core is the little core(kingfisher core). > Some of the exynos5420 boards and all of the exynos5422 boards will be > required this code. > There is two ways to check the little core is the first cpu. One is > checking GPG2CON[1] gpio value and the other is checking the cluster > number of the first cpu. I selected the latter because it's more easier > than the former. > > Changes since RFC[3]: > - drop checking soc_is_exynos5800 to extend this codes to > exynos5420/5422 boards. > - kfc cores will be reset only if the cpu0 is kfc core. > - Rebase top of the kukjin's for-next branch > > [1]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/350632.html > [2]:https://patchwork.kernel.org/patch/6782891/ > [3]:http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/356610.html > > Cc: Joonyoung Shim > Cc: Chanwoo Choi > Cc: Kevin Hilman > Cc: Heesub Shin > Cc: Mauro Ribeiro > Cc: Abhilash Kesavan > Cc: Przemyslaw Marczak > Cc: Marek Szyprowski > Cc: Krzysztof Kozlowski > Signed-off-by: Chanho Park > --- > arch/arm/mach-exynos/mcpm-exynos.c | 18 +++++++++++++++++- > arch/arm/mach-exynos/regs-pmu.h | 6 ++++++ > 2 files changed, 23 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c > index 9bdf547..5b69ed2 100644 > --- a/arch/arm/mach-exynos/mcpm-exynos.c > +++ b/arch/arm/mach-exynos/mcpm-exynos.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > > #include "regs-pmu.h" > #include "common.h" > @@ -70,7 +71,22 @@ static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster) > cluster >= EXYNOS5420_NR_CLUSTERS) > return -EINVAL; > > - exynos_cpu_power_up(cpunr); > + if (!exynos_cpu_power_state(cpunr)) { > + exynos_cpu_power_up(cpunr); > + > + /* This assumes the cluster number of the eagle is 0 and the > + * kfc is 1. When the system was booted from the kfc core, > + * they should be reset */ minor: fix multi-line comment style (search for 'multi-line' in Documentation/CodingStyle) Also minor, but personally, I prefer seeing A15/A7 instead of eagle/KFC as those names are fading from my memory and I can't seem to remember which one is which. :/ > + if (cluster && > + cluster == MPIDR_AFFINITY_LEVEL(cpu_logical_map(0), 1)) { > + while (!pmu_raw_readl(S5P_PMU_SPARE2)) > + udelay(10); > + > + pmu_raw_writel(EXYNOS5420_KFC_CORE_RESET(cpu), > + EXYNOS_SWRESET); > + } > + } > + > return 0; > } I tested this on top of mainline (v4.2) using exynos_defconfig (with BL_SWITCHER disabled) and I now see all 8 CPUs booting. Nice! Tested-by: Kevin Hilman Also, please note that this does not fix another fundamental problem with this board in that the firmware puts CCI into secure mode, so linux/MCPM cannot manage it, causing hangs whenever CPUidle is enabled (because b.L cpuidle driver tries to use MCPM, which needs to manage CCI.) In order for this to not hang when using CPUidle, the following patch is also needed. Kevin +}; --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts index 78e6a502f320..7891bd05bf8e 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts @@ -49,3 +49,11 @@ shunt-resistor = <10000>; }; }; + +/* + * Secure firmware prevents CCI access/usage from linux, so must be disabled + * to prevent usage by MCPM. + */ +&cci { + status = "disabled";