Received: by 10.192.165.156 with SMTP id m28csp1135630imm; Mon, 16 Apr 2018 14:53:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49knIYpfNGj0gqZcEZBBfrKS0dfxmhufiyoz8TebTXxC9RjCGW/2wzhqcBzMtSRLI+lNrkh X-Received: by 2002:a17:902:820d:: with SMTP id x13-v6mr16438103pln.225.1523915603434; Mon, 16 Apr 2018 14:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523915603; cv=none; d=google.com; s=arc-20160816; b=LH70vf/+S7BRkiXd5KXaOEgCSKUUc68uokhwNMHqlB5SiueTunyqi5udxsdB38av9D cR2XjKnNNMSA3Gw+GglZqq2meu4WAzo8b9+gSw54HGzMajio/t6/S8rCVa8bu5p5YyhL e4A++BmEbOqRV7jYdyGHG6GRK+0R3XrjAzVNXuLl/8BjaGBF02ng4sa58+zUOjXdsfGl e6Du27p2mb2z9y3HnPW8OUquW+Kvwej1BShk1/QruMfEQV1SToH5hxbbjem/KGWyPqdv idXyghh6eMzrlarmCRqt/gZov0w3HvvA7YWKrxTgey7uSOu6CDfJVj3CBq0qWSfymtjz MIYQ== 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=cMPSADDX42LfC7mqMFWOYMJBWpf+sRSwwMtqaeSavbE=; b=c11G8tqjH18V7RWsa/oQJTkWjqHbUAbsT13NqlZiJ8c5hVrlTLcjUdbJ4U/K9NTmKm 3SOzFiO4IaUFUUiCFZUH+v/i0/twR1CiiBcaxzYenjdpaTJAgK9vrZvuftiXasYAfuzl vnJRR8NwtUNw3Nlks1P3QEvRb3R32rnppdYHYBpcrdUCBV/xutipD0m551CfH+0C3U9M 4G0XNGqTfTjDxLe1g6fEW+H5ZI8egCQX7itzvzI1lS272GE84e/zpx63AaReeltsvvX9 FLFirnTXVe67i6EFLHLn7sb0BC8FDaXwpi2zyp7rqsRbTGAjCREnQhYiKVXwmCnpXeKY gIQA== 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 o10si2157605pgq.148.2018.04.16.14.53.09; Mon, 16 Apr 2018 14:53:23 -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 S1753812AbeDPVwD (ORCPT + 99 others); Mon, 16 Apr 2018 17:52:03 -0400 Received: from mail.bootlin.com ([62.4.15.54]:40812 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753775AbeDPVwA (ORCPT ); Mon, 16 Apr 2018 17:52:00 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 643F92159A; Mon, 16 Apr 2018 23:51:58 +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 5940421593; Mon, 16 Apr 2018 23:51:41 +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 v6 11/11] ARM: shmobile: Convert file to use cntvoff Date: Mon, 16 Apr 2018 23:50:32 +0200 Message-Id: <20180416215032.5023-12-mylene.josserand@bootlin.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180416215032.5023-1-mylene.josserand@bootlin.com> References: <20180416215032.5023-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 --- 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 a8fa4f7e1f60..b77ad5b56895 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