From patchwork Tue Mar 3 01:20:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaku Inami X-Patchwork-Id: 5918661 X-Patchwork-Delegate: horms@verge.net.au 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7BB29BF440 for ; Tue, 3 Mar 2015 01:26:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C7022025B for ; Tue, 3 Mar 2015 01:26:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C46292025A for ; Tue, 3 Mar 2015 01:26:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753689AbbCCB0S (ORCPT ); Mon, 2 Mar 2015 20:26:18 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:17379 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753372AbbCCB0S (ORCPT ); Mon, 2 Mar 2015 20:26:18 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie1.idc.renesas.com with ESMTP; 03 Mar 2015 10:26:16 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id A1BA73E73E; Tue, 3 Mar 2015 10:26:16 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 95B158002E; Tue, 3 Mar 2015 10:26:16 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 903AE8002D; Tue, 3 Mar 2015 10:26:16 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id LAA26626; Tue, 3 Mar 2015 10:26:16 +0900 X-IronPort-AV: E=Sophos;i="5.09,679,1418050800"; d="scan'208";a="182108239" Received: from mail-sg1lp0089.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.89]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 03 Mar 2015 10:26:16 +0900 Received: from [10.164.207.238] (211.11.155.149) by SG2PR06MB0538.apcprd06.prod.outlook.com (25.161.10.24) with Microsoft SMTP Server (TLS) id 15.1.99.14; Tue, 3 Mar 2015 01:26:14 +0000 Message-ID: <54F50C76.2060803@bp.renesas.com> Date: Tue, 3 Mar 2015 10:20:54 +0900 From: Gaku Inami User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: CC: , Subject: [PATCH 2/5] ARM: shmobile: Add r8a7794 reset code for SMP X-Originating-IP: [211.11.155.149] X-ClientProxiedBy: HKNPR06CA0042.apcprd06.prod.outlook.com (10.141.16.32) To SG2PR06MB0538.apcprd06.prod.outlook.com (25.161.10.24) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0538; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:SG2PR06MB0538; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0538; X-Forefront-PRVS: 0504F29D72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6049001)(54356999)(83506001)(50986999)(50466002)(33656002)(23736002)(77096005)(2351001)(229853001)(87976001)(120846001)(575784001)(77156002)(110136001)(92566002)(42186005)(47776003)(86362001)(19580405001)(19580395003)(46102003)(65806001)(40100003)(66066001)(122386002)(62966003)(65816999)(65956001); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0538; H:[10.164.207.238]; FPR:; SPF:None; MLV:sfv; LANG:en; X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2015 01:26:14.6285 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0538 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 Since reset vector settings is controlled by SYSC register, this code is added to pm-r8a7794.c. Signed-off-by: Gaku Inami --- arch/arm/mach-shmobile/pm-r8a7794.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/mach-shmobile/pm-r8a7794.c b/arch/arm/mach-shmobile/pm-r8a7794.c index a8a94cf..b990839 100644 --- a/arch/arm/mach-shmobile/pm-r8a7794.c +++ b/arch/arm/mach-shmobile/pm-r8a7794.c @@ -9,9 +9,17 @@ */ #include +#include "common.h" #include "pm-rcar.h" #include "r8a7794.h" +/* RST */ +#define RST 0xe6160000 +#define CA7BAR 0x0030 +#define CA7RESCNT 0x0044 + +#define RAM 0xe63c0000 + /* SYSC */ #define SYSCIER 0x0c #define SYSCIMR 0x10 @@ -35,10 +43,28 @@ static inline void r8a7794_sysc_init(void) {} void __init r8a7794_pm_init(void) { + void __iomem *p; + u32 bar; static int once; if (once++) return; + /* RAM for jump stub, because BAR requires 256KB aligned address */ + p = ioremap_nocache(RAM, shmobile_boot_size); + memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); + iounmap(p); + + /* setup reset vectors */ + p = ioremap_nocache(RST, 0x63); + bar = (RAM >> 8) & 0xfffffc00; + writel_relaxed(bar, p + CA7BAR); + writel_relaxed(bar | 0x10, p + CA7BAR); + + /* de-assert reset for all CPUs */ + writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, + p + CA7RESCNT); + iounmap(p); + r8a7794_sysc_init(); }