From patchwork Tue Jun 24 04:11:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 32401 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D359120540 for ; Tue, 24 Jun 2014 04:11:21 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id rq2sf29444725pbb.10 for ; Mon, 23 Jun 2014 21:11:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe :content-transfer-encoding; bh=+2QVaOBlVgf5MXaLwU+1f50DdBj23au6RHSz0S7pmZA=; b=mQQcrs+7GbMp4ylxOavDUcIBZLqjYh0hLzzIxblhj8zs0LnKhJ9YYz58obIGNUbjQZ DooF+nvTzORIXnlRdYsFjC4Mw/9ZUOd5PSgtdnAErTyzh9qo09+n+FX6gyacdvhKjNaD TdDm3M22iA1+nreqLsKbs2/kaCXKCbfTcw7InseGmVvYjzwTihOWBrdP9vAXSfp+Qjyc GpM7G7i2hq5IwiopMFkoS+vOyBwy2/WZ/WSnp7WxqisNz1l7lcuwJPxtyxx1Xga5bRrg jNGxWsvk1EuatdMrNbTIAltxGJ0jQrlkdbguxbAFMIqtExM75hz1U2F3Yu5dRRaDN09t gtnQ== X-Gm-Message-State: ALoCoQnj9HKi32vpt9r+cFfWboQZOeGmbcNKcvTaMzaC1/5leRC/D2LvULfZM3TkmRvnUIWgcoZE X-Received: by 10.67.5.163 with SMTP id cn3mr11968178pad.25.1403583081098; Mon, 23 Jun 2014 21:11:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.112 with SMTP id n103ls2108560qga.86.gmail; Mon, 23 Jun 2014 21:11:21 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr19329978vdd.24.1403583080980; Mon, 23 Jun 2014 21:11:20 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id x14si10069083vdi.87.2014.06.23.21.11.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 21:11:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so7045314vcb.19 for ; Mon, 23 Jun 2014 21:11:20 -0700 (PDT) X-Received: by 10.220.174.137 with SMTP id t9mr23245195vcz.12.1403583080826; Mon, 23 Jun 2014 21:11:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp176829vcb; Mon, 23 Jun 2014 21:11:20 -0700 (PDT) X-Received: by 10.68.197.134 with SMTP id iu6mr34644592pbc.164.1403583079829; Mon, 23 Jun 2014 21:11:19 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tz6si24466314pbc.165.2014.06.23.21.11.19; Mon, 23 Jun 2014 21:11:19 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751179AbaFXELS (ORCPT + 8 others); Tue, 24 Jun 2014 00:11:18 -0400 Received: from relais.videotron.ca ([24.201.245.36]:28686 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751147AbaFXELS (ORCPT ); Tue, 24 Jun 2014 00:11:18 -0400 Received: from yoda.home ([66.130.143.177]) by VL-VM-MR004.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N7N005WONMSFOJ2@VL-VM-MR004.ip.videotron.ca> for linux-samsung-soc@vger.kernel.org; Tue, 24 Jun 2014 00:11:16 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 02F5F2DA096A; Tue, 24 Jun 2014 00:11:16 -0400 (EDT) From: Nicolas Pitre To: Abhilash Kesavan , Doug Anderson , Andrew Bresticker Cc: Kevin Hilman , Olof Johansson , Lorenzo Pieralisi , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org Subject: [PATCH 2/3] ARM: TC2: test the MCPM loopback during boot Date: Tue, 24 Jun 2014 00:11:10 -0400 Message-id: <1403583071-5650-3-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.4.108.g55ea5f6 In-reply-to: <1403583071-5650-1-git-send-email-nicolas.pitre@linaro.org> References: <1403583071-5650-1-git-send-email-nicolas.pitre@linaro.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-transfer-encoding: 7BIT This is not strictly needed on TC2 but still a good thing to exercise that code. Signed-off-by: nicolas Pitre --- arch/arm/mach-vexpress/tc2_pm.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c index b743a0ae02..54a9fff77c 100644 --- a/arch/arm/mach-vexpress/tc2_pm.c +++ b/arch/arm/mach-vexpress/tc2_pm.c @@ -323,6 +323,21 @@ static void __naked tc2_pm_power_up_setup(unsigned int affinity_level) " b cci_enable_port_for_self "); } +static void __init tc2_cache_off(void) +{ + pr_info("TC2: disabling cache during MCPM loopback test\n"); + if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A15) { + /* disable L2 prefetching on the Cortex-A15 */ + asm volatile( + "mcr p15, 1, %0, c15, c0, 3 \n\t" + "isb \n\t" + "dsb " + : : "r" (0x400) ); + } + v7_exit_coherency_flush(all); + cci_disable_port_by_cpu(read_cpuid_mpidr()); +} + static int __init tc2_pm_init(void) { int ret, irq; @@ -370,6 +385,8 @@ static int __init tc2_pm_init(void) ret = mcpm_platform_register(&tc2_pm_power_ops); if (!ret) { mcpm_sync_init(tc2_pm_power_up_setup); + /* test if we can (re)enable the CCI on our own */ + BUG_ON(mcpm_loopback(tc2_cache_off) != 0); pr_info("TC2 power management initialized\n"); } return ret;