From patchwork Fri Aug 29 18:15:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 4812091 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1756DC0338 for ; Fri, 29 Aug 2014 18:16:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA7D720103 for ; Fri, 29 Aug 2014 18:16:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DA73200F3 for ; Fri, 29 Aug 2014 18:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753378AbaH2SP6 (ORCPT ); Fri, 29 Aug 2014 14:15:58 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:56906 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753335AbaH2SP5 (ORCPT ); Fri, 29 Aug 2014 14:15:57 -0400 Received: by mail-wi0-f177.google.com with SMTP id cc10so2974179wib.16 for ; Fri, 29 Aug 2014 11:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=SukTikm9hwkGpbcg5bAi1I0ZTibZrx1jRRik65rz+aQ=; b=S1127Iv2LjVOIx5Pu+p+/bH/0qQsC/kvRT2NUE9U003V4TWf4ot2YOvuankJazuyB5 JGOA/bFv66Ci3kJ6Ab5LqK3nH66JPVXkZoVIVE1QY7Gck/OB3eTBLzK8M4UbUEGIX4a0 9LzNNXUqsO2WiDkSWejfPlwWzVBYrE0SQ17/iwS33GwGDkD/GfgdUNN4Oi9O0YulokKd 0CWRHcbWc5jAuHRAh1tV5d/TpSj+MRrTGEKCwLGMCY7K2Q5udGf4vBA5uus80C5y8PFn P8mJUPvSoyG0/hSnS0wQ/ej8BBZtH+3Ig3A6LveavPJD8/XDTRQZ5OVxkGiJw07bqK6v 4zhQ== X-Received: by 10.194.187.241 with SMTP id fv17mr15387505wjc.13.1409336156440; Fri, 29 Aug 2014 11:15:56 -0700 (PDT) Received: from groucho.site ([91.108.183.74]) by mx.google.com with ESMTPSA id dc9sm49457031wib.5.2014.08.29.11.15.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Aug 2014 11:15:55 -0700 (PDT) From: Ulrich Hecht To: linux-sh@vger.kernel.org Cc: horms@verge.net.au, magnus.damm@gmail.com, Hisashi Nakamura Subject: [PATCH 3/3] ARM: shmobile: Add CA7 arch_timer initialization for secondary CPUs Date: Fri, 29 Aug 2014 20:15:45 +0200 Message-Id: <1409336145-619-4-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1409336145-619-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1409336145-619-1-git-send-email-ulrich.hecht+renesas@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 From: Hisashi Nakamura In case of CA7, arch timer CNTVOFF register is uninitialized. CNTVOFF must be initialized. This patch is for secondary CPUs. Signed-off-by: Hisashi Nakamura --- arch/arm/mach-shmobile/headsmp.S | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S index 50c4915..9dc660d 100644 --- a/arch/arm/mach-shmobile/headsmp.S +++ b/arch/arm/mach-shmobile/headsmp.S @@ -1,6 +1,7 @@ /* * SMP support for R-Mobile / SH-Mobile * + * Copyright (C) 2014 Renesas Electronics Corporation * Copyright (C) 2010 Magnus Damm * Copyright (C) 2010 Takashi Yoshii * @@ -19,6 +20,31 @@ #ifdef CONFIG_SMP ENTRY(shmobile_invalidate_start) bl v7_invalidate_l1 + + mrc p15, 0, r0, c0, c0, 0 + lsr r0, #4 + tst r0, #0x7 + beq 1f + lsr r0, #4 + tst r0, #0xC0 + beq 1f + /* CA7 setup */ + /* 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 0x16 + mrc p15, 0, r1, c1, c1, 0 + orr r0, r1, #1 + mcr p15, 0, r0, c1, c1, 0 + isb + mov r0, #0 + mcrr p15, 4, r0, r0, c14 + isb + mcr p15, 0, r1, c1, c1, 0 + isb + cps 0x13 +1: + b secondary_startup ENDPROC(shmobile_invalidate_start) #endif