From patchwork Tue Nov 25 08:25:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaku Inami X-Patchwork-Id: 5374451 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 0BC89C11AC for ; Tue, 25 Nov 2014 08:30:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1EA1A20154 for ; Tue, 25 Nov 2014 08:30:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90D3B2014A for ; Tue, 25 Nov 2014 08:30:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750804AbaKYIax (ORCPT ); Tue, 25 Nov 2014 03:30:53 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:40474 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750760AbaKYIaw (ORCPT ); Tue, 25 Nov 2014 03:30:52 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 25 Nov 2014 17:30:50 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id C099044E5F; Tue, 25 Nov 2014 17:30:50 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id B1FA4480A4; Tue, 25 Nov 2014 17:30:50 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id AAA67480A3; Tue, 25 Nov 2014 17:30:50 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id TAC14878; Tue, 25 Nov 2014 17:30:50 +0900 X-IronPort-AV: E=Sophos;i="5.07,454,1413212400"; d="scan'208";a="174352794" Received: from mail-sg1lp0089.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.89]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 25 Nov 2014 17:30:49 +0900 Received: from [10.164.207.238] (211.11.155.149) by SIXPR06MB0544.apcprd06.prod.outlook.com (25.160.238.15) with Microsoft SMTP Server (TLS) id 15.1.16.15; Tue, 25 Nov 2014 08:30:48 +0000 Message-ID: <54743D0F.5080307@bp.renesas.com> Date: Tue, 25 Nov 2014 17:25:51 +0900 From: Gaku Inami User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Linux-sh list CC: "linux-arm-kernel@lists.infradead.org" , Magnus Damm , , , , Subject: [PATCH v2] ARM: shmobile: r8a7790 CCI configuration X-Originating-IP: [211.11.155.149] X-ClientProxiedBy: HKXPR02CA0055.apcprd02.prod.outlook.com (25.161.48.40) To SIXPR06MB0544.apcprd06.prod.outlook.com (25.160.238.15) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB0544; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0544; X-Forefront-PRVS: 040655413E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6049001)(6009001)(189002)(199003)(120846001)(59896002)(42186005)(20776003)(64126003)(86362001)(106356001)(65806001)(95666004)(102836001)(50466002)(33656002)(101416001)(40100003)(122386002)(87266999)(19580405001)(46102003)(80316001)(99396003)(21056001)(97736003)(19580395003)(47776003)(229853001)(54356999)(50986999)(62966003)(77096003)(65956001)(92566001)(65816999)(107046002)(31966008)(92726001)(23736002)(87976001)(77156002)(64706001)(110136001)(120916001)(105586002)(83506001)(4396001)(66066001)(99136001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB0544; H:[10.164.207.238]; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:0; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0544; X-OriginatorOrg: bp.renesas.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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Add the settings of CCI-400 for enabling ca15/ca7 snoop on r8a7790. Needed to configure the CCI boot cluster port regardless of MCPM. Signed-off-by: Gaku Inami Signed-off-by: Magnus Damm Signed-off-by: Simon Horman --- Changes since version 1: - Fix a way to wait for the register read. arch/arm/mach-shmobile/smp-r8a7790.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index 9c3da13..b65d908 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c @@ -25,6 +25,12 @@ #include "pm-rcar.h" #include "r8a7790.h" +#define CCI_BASE 0xf0090000 +#define CCI_SLAVE3 0x4000 +#define CCI_SLAVE4 0x5000 +#define CCI_SNOOP 0x0000 +#define CCI_STATUS 0x000c + static struct rcar_sysc_ch r8a7790_ca15_scu = { .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */ .isr_bit = 12, /* CA15-SCU */ @@ -48,6 +54,8 @@ static struct rcar_apmu_config r8a7790_apmu_config[] = { static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) { + void __iomem *p; + /* let APMU code install data related to shmobile_boot_vector */ shmobile_smp_apmu_prepare_cpus(max_cpus, r8a7790_apmu_config, @@ -57,6 +65,17 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) r8a7790_pm_init(); rcar_sysc_power_up(&r8a7790_ca15_scu); rcar_sysc_power_up(&r8a7790_ca7_scu); + + /* enable snoop and DVM */ + p = ioremap_nocache(CCI_BASE, 0x8000); + writel_relaxed(readl_relaxed(p + CCI_SLAVE3 + CCI_SNOOP) | 0x3, + p + CCI_SLAVE3 + CCI_SNOOP); /* ca15 */ + writel_relaxed(readl_relaxed(p + CCI_SLAVE4 + CCI_SNOOP) | 0x3, + p + CCI_SLAVE4 + CCI_SNOOP); /* ca7 */ + while (readl_relaxed(p + CCI_STATUS)) + cpu_relax(); + /* wait for pending bit low */ + iounmap(p); } struct smp_operations r8a7790_smp_ops __initdata = {