Received: by 10.192.165.148 with SMTP id m20csp711726imm; Fri, 20 Apr 2018 14:15:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/vBI4YcgCYgKfK3qx77+WW39RjnO9ObPlDGC+EkZbjr6FLF5b80kNfgI+tKb4SUoOQBQVB X-Received: by 2002:a17:902:d886:: with SMTP id b6-v6mr11644709plz.335.1524258940250; Fri, 20 Apr 2018 14:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524258940; cv=none; d=google.com; s=arc-20160816; b=QVy+onQOOzm6WjYlk6+GNtsAeP1lS8E/R8HzVgNSnfMfe2Mu4GKmzSNPX2k7T5J7V5 hrd/pezqittaTMwlFhPW2ZT9n6SW3erMY1DgWbrdG77d3/d8DDHhLNDCrk2mwKtJ8udq Aaj2VSPO2kX1tHS3nJu0MWg3rWCC4hopf+Yl5yMYO/ojINlugZxYEPjABgGnN9prqv8/ MaugodE/4yyBBCwedUBYeVC3qVYpFPdJlFeSg0pnEr7UHWigIWwKNB1STH/TJ67IPIIc d/dJnPa/hH65wllJb312eNnXsYb1Fr4NiG1qSeqFGgdqS6PxvurI9DRlma8ZrmCppLYY 62FQ== 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=cqLaLHnDxnxBYvlUBx2hRFtd3XogJkcbCUJmKbHnPsOgQwKJbWCzaAJaDgNVexAX9j wZOCtUTG7OSIU/hVPCrJyNcY9klRJdQKJOaQff/pJ6xCys4SkE2q2JFavr7rh2xajj8G dlTkrUoqvFUQbc3sCdKMbv1ZdQyhAf4SxsCORmmr+z9UpjdA3rwvw7jNsya3YQXthtEc MxPZo9WldYoXH8HBy/W34a2fegSTFG0AlPGCzTOpOLSsxUVhBm0av2IQ5ox3HTh7bOAv ZcxvfkWF7/crFi81LtVVAhWAajptb0rHQcmmcetJ3zJqTCftLKxG1UBTBi2h+IhY9910 Wsfg== 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 135si6007640pfc.21.2018.04.20.14.15.02; Fri, 20 Apr 2018 14:15:40 -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 S1753311AbeDTVMB (ORCPT + 99 others); Fri, 20 Apr 2018 17:12:01 -0400 Received: from mail.bootlin.com ([62.4.15.54]:51484 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752658AbeDTVL7 (ORCPT ); Fri, 20 Apr 2018 17:11:59 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 7A077207B7; Fri, 20 Apr 2018 23:11:57 +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 89FD820719; Fri, 20 Apr 2018 23:11:56 +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 v7 11/11] ARM: shmobile: Convert file to use cntvoff Date: Fri, 20 Apr 2018 23:10:22 +0200 Message-Id: <20180420211022.11759-12-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180420211022.11759-1-mylene.josserand@bootlin.com> References: <20180420211022.11759-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