From patchwork Tue Jun 30 16:38:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Andrianov X-Patchwork-Id: 6697401 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 11C239F39B for ; Tue, 30 Jun 2015 16:36:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FEC820412 for ; Tue, 30 Jun 2015 16:36:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C7C4D203C4 for ; Tue, 30 Jun 2015 16:36:12 +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 1Z9yU4-0007S1-8z; Tue, 30 Jun 2015 16:34:08 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z9yU1-0007PF-Iu for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2015 16:34:06 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t5UGXTuV023656; Tue, 30 Jun 2015 11:33:29 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5UGXT1H009829; Tue, 30 Jun 2015 11:33:29 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Tue, 30 Jun 2015 11:33:25 -0500 Received: from [158.218.103.119] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5UGXSlr022143; Tue, 30 Jun 2015 11:33:28 -0500 Message-ID: <5592C5F5.4020307@ti.com> Date: Tue, 30 Jun 2015 12:38:13 -0400 From: Vitaly Andrianov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Russell King - ARM Linux Subject: Re: [PATCH] keystone: adds cpu_die implementation References: <1435600352-32733-1-git-send-email-vitalya@ti.com> <20150629175223.GC19863@leverpostej> <559191E0.4080808@ti.com> <20150629212814.GE7557@n2100.arm.linux.org.uk> <20150629213737.GF7557@n2100.arm.linux.org.uk> <55929E0B.9070704@ti.com> <20150630145412.GG7557@n2100.arm.linux.org.uk> In-Reply-To: <20150630145412.GG7557@n2100.arm.linux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150630_093405_739835_EB6EEB24 X-CRM114-Status: GOOD ( 17.69 ) X-Spam-Score: -7.5 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Lorenzo Pieralisi , "linux-kernel@vger.kernel.org" , "grygorii.strashko@ti.com" , "ssantosh@kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 On 06/30/2015 10:54 AM, Russell King - ARM Linux wrote: > On Tue, Jun 30, 2015 at 09:47:55AM -0400, Vitaly Andrianov wrote: >> >> >> On 06/29/2015 05:37 PM, Russell King - ARM Linux wrote: >>> Oh, it was Murali who tested it, not yourself. Sorry. Suggest you >>> dig out the patches either from mainline (they're in Linus' tip) or >>> ask Murali for them... >>> >> Thanks Russell, >> >> Excellent. I'll test how it will work using PSCI framework. > > The commits in mainline are: > > b2c3e38a5471 ARM: redo TTBR setup code for LPAE > 1221ed10f2a5 ARM: cleanup early_paging_init() calling > d8dc7fbd53ee ARM: re-implement physical address space switching > c0b759d87eab ARM: keystone2: rename init_meminfo to pv_fixup > 39b74fe82f73 ARM: keystone2: move address space switch printk into generic code > c8ca2b4b2928 ARM: keystone2: move update of the phys-to-virt constants into generic code > 30b5f4d6128e ARM: keystone2: move platform notifier initialisation into platform init > > There are an additional three which are worthwhile testing with them as > they clean up this same code (and fix a subtle but very minor bug in the > errata code paths): > > c76f238e261b ARM: proc-v7: sanitise and document registers around errata > 4419496884ed ARM: proc-v7: clean up MIDR access > 17e7bf86690e ARM: proc-v7: move CPU errata out of line > > So, picking the range b787f68c36d4..c76f238e261b will get all of them. > (That's v4.1-rc1 to the tip of the branch holding those commits.) > I just finished testing. Here is what I did. 1) checkout commit c76f238e261b 2) applied Grygorii's "ARM: psci: boot_secondary: replace __pa with virt_to_idmap" 3) applied "keystone: dts: add psci command definition" commit. This commit is not posted yet. So, here it's content: 5) enabled CONFIG_ARM_PSCI and CONFIG_HOTPLUG_CPU The K2HK EVM booted fine with all 4 CPUs on. The HOTPLUG also works fine. I was able to get CPUs off and on multiple times. Thanks, Vitaly diff --git a/arch/arm/boot/dts/keystone.dtsi b/arch/arm/boot/dts/keystone.dtsi index c06542b..ab60fca 100644 --- a/arch/arm/boot/dts/keystone.dtsi +++ b/arch/arm/boot/dts/keystone.dtsi @@ -58,6 +58,14 @@ ; }; + psci { + compatible = "arm,psci"; + method = "smc"; + cpu_suspend = <0x84000001>; + cpu_off = <0x84000002>; + cpu_on = <0x84000003>; + }; + soc { #address-cells = <1>; #size-cells = <1>; 4) excluded platsmp.c from build diff --git a/arch/arm/mach-keystone/Makefile b/arch/arm/mach-keystone/Makefile index 25d9239..5cc5ca4 100644 --- a/arch/arm/mach-keystone/Makefile +++ b/arch/arm/mach-keystone/Makefile @@ -3,7 +3,9 @@ obj-y := keystone.o smc.o plus_sec := $(call as-instr,.arch_extension sec,+sec) AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec) +ifneq ($(CONFIG_ARM_PSCI),y) obj-$(CONFIG_SMP) += platsmp.o +endif # PM domain driver for Keystone SOCs obj-$(CONFIG_ARCH_KEYSTONE) += pm_domain.o diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index e2880105..9cc489c 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -105,7 +105,9 @@ DT_MACHINE_START(KEYSTONE, "Keystone") #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) .dma_zone_size = SZ_2G, #endif +#ifndef CONFIG_ARM_PSCI .smp = smp_ops(keystone_smp_ops), +#endif .init_machine = keystone_init, .dt_compat = keystone_match, .pv_fixup = keystone_pv_fixup,