Received: by 10.192.165.148 with SMTP id m20csp404107imm; Fri, 4 May 2018 12:07:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp0Sn/0q47O1aNoOgFhLPCbistKPlQK3KsDmjrACqS8IhrQ2oZAbx6SWQwCDT8r4cMFSqn9 X-Received: by 2002:a17:902:a70b:: with SMTP id w11-v6mr28743326plq.342.1525460861709; Fri, 04 May 2018 12:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525460861; cv=none; d=google.com; s=arc-20160816; b=qwLbwEDV05PfMunZ0SYFJDpcS+1N8nr1148HPrnmeF+JnaQ+AHBczFUlWBHw9PCwUx 6Yplry7InYj67xDf0gaZe7aMzlqG7n07sAN55G53abJ6apuGddoD5GagZZGluJgiat3N 7h5SVrNMS5yIKCm5VbMubgqrCM9Yg8c3msF/yt1eqCfi9wFoyx51oGMM2HyatwqB0dOg dK0d1icl9BekT7FtFTVuSNh2l2+sQERP9XcZNJW5isN7AG7fynUY+svjNtCfF9DL1yGM VatcF/6N0NV9Y9dMPBZ9trx6NrF6JT8ibDmyBG76d6IApA8BpeL65qQ8f6h36SHeNQzT AHgw== 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=cevt9zU3KaTQ5Z2z90T5l7lPoRKdwj+8Keb6NT2rFH0=; b=fqIbyHBSgtRKnt5oCf0OEN5rKoQykRktTy0dh6tGEzN8zWsFSFR/xkpw7fhjfN6UvQ tYdpQKfMxWoNjpyMqIkXkhzMYdG8/skUF+sBg16RL9/a61qDP6fyMYJ6PW049cyhMJx5 3C8t1Ge9I2LAS+Xudk8az+EwMgf8Os3A908SD8COPdhZElt+uhat9PKPc3g6jHHrWmMZ 3xvBtMPv4dY9J04TjDMIpqo4gtJhXfqoV34YiOTlXzwti2aK3su+7pYZRTPHZ8rVh2vQ l1bklnwtgOJszCUD9d6KP52mRFzSRpR+XHyCR6ddVQWD+um48BJtJt8Uy3GoSolB8u2i i8Vg== 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 r9-v6si16481720plo.442.2018.05.04.12.07.27; Fri, 04 May 2018 12:07:41 -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 S1751988AbeEDTHM (ORCPT + 99 others); Fri, 4 May 2018 15:07:12 -0400 Received: from mail.bootlin.com ([62.4.15.54]:43040 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbeEDTHK (ORCPT ); Fri, 4 May 2018 15:07:10 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 41E0F20829; Fri, 4 May 2018 21:07:08 +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 41F6C20650; Fri, 4 May 2018 21:07:07 +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: f.fainelli@gmail.com, opendmb@gmail.com, 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 v9 12/12] ARM: shmobile: Convert file to use cntvoff Date: Fri, 4 May 2018 21:05:45 +0200 Message-Id: <20180504190545.5114-13-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180504190545.5114-1-mylene.josserand@bootlin.com> References: <20180504190545.5114-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 Acked-by: Simon Horman --- 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