Received: by 10.192.165.148 with SMTP id m20csp4876477imm; Tue, 1 May 2018 05:33:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo2M0fsXm7Tk5ckXlqg6Aoh3K2sKAg3+3KSmmilSsJQvhUeNPaI/jySBC3WmJnkSJtBVNcU X-Received: by 2002:a65:4502:: with SMTP id n2-v6mr12502960pgq.95.1525178017797; Tue, 01 May 2018 05:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525178017; cv=none; d=google.com; s=arc-20160816; b=gGWUWvF61kDCPyY/3CySb2ZnI6Y13JVmWR2FTMVlkddXyIPAmnbOL2OdS1jHNVjJYP 2Wi+eGlzVJfbqCfFHfil69dE4Gsk5q5ZuCcGgAAtpmshBxJVRGhlHuONzeLlQl40xu7Q TzONvko6/I+df1i77+6DhSGCQVf2bmFluRpSboQL1FjSrDcTuD89HngEIQ/PHBMlqOap fHmkp7kZZ5MZSiNQ+T/BarrV4IXx0uTywcczOP0o1AwfA9yFlN6IMtdInG7tK9s4KNQ9 T1uI/Rw5t3hqo48XyIeO1sOyP/KGtZR+V2Y+CtmMRcSWgJfJQkv4Q33z6evxWDyRgBsf EinQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=THHQd0/bYiFTJ7TuIqOeuFndpKaHo+hqwiqzWNq0P40=; b=s66O0In2/eEWn48DBp6HBDM6DHGj6+Hs1d88yRpzB9I9sKGvS6fmbIR9zplJ5mVyRY AQg0jGP1BTd7gWDd6gsxyYGZrQ2OsczXwEC7EI96VHI50bARqxf0nFnT9IuPMfz9gWN6 h2Fd2GTfDo/paRkbHioWBWHVwvlVifomnOX+Am11u/Z7nWPCPIn3UUDfr4cE4VkEQ38s M6dtkWcsWPnfE1IelGLlMyJ9cDxwp+KaL7SvyEbsrqQy+shYiWoSNjczFoHSOUdjv8R5 1+B4lEBLo3sFgePqbJVTz6fgRholQM+u12VDIULC+RL1OJqFP+rHKVjDrtvO5ZKPNeRv QlAg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si9180531plb.549.2018.05.01.05.33.23; Tue, 01 May 2018 05:33:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755797AbeEAMcx (ORCPT + 99 others); Tue, 1 May 2018 08:32:53 -0400 Received: from mail.bootlin.com ([62.4.15.54]:46175 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755149AbeEAMcg (ORCPT ); Tue, 1 May 2018 08:32:36 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id D19EF20A58; Tue, 1 May 2018 14:32:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from dell-desktop.home (176-137-37-244.abo.bbox.fr [176.137.37.244]) by mail.bootlin.com (Postfix) with ESMTPSA id E854B20A46; Tue, 1 May 2018 14:32:32 +0200 (CEST) From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?= To: linux@armlinux.org.uk, maxime.ripard@bootlin.com, wens@csie.org, marc.zyngier@arm.com, mark.rutland@arm.com, robh+dt@kernel.org, horms@verge.net.au, geert@linux-m68k.org, magnus.damm@gmail.com Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, clabbe.montjoie@gmail.com, quentin.schulz@bootlin.com, thomas.petazzoni@bootlin.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mylene.josserand@bootlin.com Subject: [PATCH v8 12/12] ARM: shmobile: Convert file to use cntvoff Date: Tue, 1 May 2018 14:31:31 +0200 Message-Id: <20180501123131.7738-13-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180501123131.7738-1-mylene.josserand@bootlin.com> References: <20180501123131.7738-1-mylene.josserand@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that a common function is available for CNTVOFF's initialization, let's convert shmobile-apmu code to use this function. Signed-off-by: Mylène Josserand Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven --- arch/arm/mach-shmobile/common.h | 1 - arch/arm/mach-shmobile/headsmp-apmu.S | 22 +--------------------- arch/arm/mach-shmobile/setup-rcar-gen2.c | 3 ++- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 43c1ac696274..2109f123bdfb 100644 --- a/arch/arm/mach-shmobile/common.h +++ b/arch/arm/mach-shmobile/common.h @@ -2,7 +2,6 @@ #ifndef __ARCH_MACH_COMMON_H #define __ARCH_MACH_COMMON_H -extern void shmobile_init_cntvoff(void); extern void shmobile_init_delay(void); extern void shmobile_boot_vector(void); extern unsigned long shmobile_boot_fn; diff --git a/arch/arm/mach-shmobile/headsmp-apmu.S b/arch/arm/mach-shmobile/headsmp-apmu.S index 5672b5849401..d49ab194766a 100644 --- a/arch/arm/mach-shmobile/headsmp-apmu.S +++ b/arch/arm/mach-shmobile/headsmp-apmu.S @@ -11,29 +11,9 @@ #include #include -ENTRY(shmobile_init_cntvoff) - /* - * CNTVOFF has to be initialized either from non-secure Hypervisor - * mode or secure Monitor mode with SCR.NS==1. If TrustZone is enabled - * then it should be handled by the secure code - */ - cps #MON_MODE - mrc p15, 0, r1, c1, c1, 0 /* Get Secure Config */ - orr r0, r1, #1 - mcr p15, 0, r0, c1, c1, 0 /* Set Non Secure bit */ - instr_sync - mov r0, #0 - mcrr p15, 4, r0, r0, c14 /* CNTVOFF = 0 */ - instr_sync - mcr p15, 0, r1, c1, c1, 0 /* Set Secure bit */ - instr_sync - cps #SVC_MODE - ret lr -ENDPROC(shmobile_init_cntvoff) - #ifdef CONFIG_SMP ENTRY(shmobile_boot_apmu) - bl shmobile_init_cntvoff + bl secure_cntvoff_init b secondary_startup ENDPROC(shmobile_boot_apmu) #endif diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 5561dbed7a33..4a881026d740 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "common.h" #include "rcar-gen2.h" @@ -70,7 +71,7 @@ void __init rcar_gen2_timer_init(void) void __iomem *base; u32 freq; - shmobile_init_cntvoff(); + secure_cntvoff_init(); if (of_machine_is_compatible("renesas,r8a7745") || of_machine_is_compatible("renesas,r8a7792") || -- 2.11.0