From patchwork Tue Mar 3 01:21:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaku Inami X-Patchwork-Id: 5918691 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 7F646BF440 for ; Tue, 3 Mar 2015 01:27:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 865632025B for ; Tue, 3 Mar 2015 01:27:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 930382025A for ; Tue, 3 Mar 2015 01:27:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753543AbbCCB1J (ORCPT ); Mon, 2 Mar 2015 20:27:09 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:56442 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751589AbbCCB1I (ORCPT ); Mon, 2 Mar 2015 20:27:08 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 03 Mar 2015 10:27:07 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 41AC94247A; Tue, 3 Mar 2015 10:27:07 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 36B098002E; Tue, 3 Mar 2015 10:27:07 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 17B2F8002F; Tue, 3 Mar 2015 10:27:07 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id LAE26868; Tue, 3 Mar 2015 10:27:06 +0900 X-IronPort-AV: E=Sophos;i="5.09,679,1418050800"; d="scan'208";a="180974723" Received: from mail-hk1lp0121.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.121]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 03 Mar 2015 10:27:06 +0900 Received: from [10.164.207.238] (211.11.155.149) by HKXPR06MB0535.apcprd06.prod.outlook.com (25.161.137.25) with Microsoft SMTP Server (TLS) id 15.1.93.16; Tue, 3 Mar 2015 01:27:05 +0000 Message-ID: <54F50CA9.5080900@bp.renesas.com> Date: Tue, 3 Mar 2015 10:21:45 +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: , Simon Horman Subject: [PATCH 5/5] ARM: shmobile: r8a7794 SMP support X-Originating-IP: [211.11.155.149] X-ClientProxiedBy: HKNPR06CA0031.apcprd06.prod.outlook.com (10.141.16.21) To HKXPR06MB0535.apcprd06.prod.outlook.com (25.161.137.25) Authentication-Results: verge.net.au; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB0535; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006); SRVR:HKXPR06MB0535; X-Forefront-PRVS: 0504F29D72 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6049001)(33656002)(77156002)(66066001)(65956001)(50466002)(77096005)(47776003)(62966003)(92566002)(2351001)(50986999)(110136001)(122386002)(65806001)(86362001)(120846001)(42186005)(23736002)(65816999)(40100003)(87976001)(54356999)(46102003)(19580395003)(83506001)(229853001)(19580405001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB0535; H:[10.164.207.238]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB0535; X-OriginatorOrg: bp.renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2015 01:27:05.5076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB0535 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 Signed-off-by: Gaku Inami --- arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/r8a7794.h | 2 ++ arch/arm/mach-shmobile/setup-r8a7794.c | 2 ++ arch/arm/mach-shmobile/smp-r8a7794.c | 49 ++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 arch/arm/mach-shmobile/smp-r8a7794.c diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index cde95f8..50ed8c4 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -39,6 +39,7 @@ smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o +smp-$(CONFIG_ARCH_R8A7794) += smp-r8a7794.o smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o # PM objects diff --git a/arch/arm/mach-shmobile/r8a7794.h b/arch/arm/mach-shmobile/r8a7794.h index b83d387..a1d71e6 100644 --- a/arch/arm/mach-shmobile/r8a7794.h +++ b/arch/arm/mach-shmobile/r8a7794.h @@ -3,4 +3,6 @@ void r8a7794_pm_init(void); +extern struct smp_operations r8a7794_smp_ops; + #endif /* __ASM_R8A7794_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r8a7794.c b/arch/arm/mach-shmobile/setup-r8a7794.c index d2b0930..c6d5a23 100644 --- a/arch/arm/mach-shmobile/setup-r8a7794.c +++ b/arch/arm/mach-shmobile/setup-r8a7794.c @@ -17,6 +17,7 @@ #include #include "common.h" #include "rcar-gen2.h" +#include "r8a7794.h" #include static const char * const r8a7794_boards_compat_dt[] __initconst = { @@ -25,6 +26,7 @@ static const char * const r8a7794_boards_compat_dt[] __initconst = { }; DT_MACHINE_START(R8A7794_DT, "Generic R8A7794 (Flattened Device Tree)") + .smp = smp_ops(r8a7794_smp_ops), .init_early = shmobile_init_delay, .init_late = shmobile_init_late, .init_time = rcar_gen2_timer_init, diff --git a/arch/arm/mach-shmobile/smp-r8a7794.c b/arch/arm/mach-shmobile/smp-r8a7794.c new file mode 100644 index 0000000..eda4d57 --- /dev/null +++ b/arch/arm/mach-shmobile/smp-r8a7794.c @@ -0,0 +1,49 @@ +/* + * SMP support for r8a7794 + * + * Copyright (C) 2015 Renesas Electronics Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include +#include + +#include + +#include "common.h" +#include "platsmp-apmu.h" +#include "r8a7794.h" + +static struct rcar_apmu_config r8a7794_apmu_config[] = { + { + .iomem = DEFINE_RES_MEM(0xe6151000, 0x188), + .cpus = { 0, 1 }, + } +}; + +static void __init r8a7794_smp_prepare_cpus(unsigned int max_cpus) +{ + /* let APMU code install data related to shmobile_boot_vector */ + shmobile_smp_apmu_prepare_cpus(max_cpus, + r8a7794_apmu_config, + ARRAY_SIZE(r8a7794_apmu_config)); + + r8a7794_pm_init(); +} + +struct smp_operations r8a7794_smp_ops __initdata = { + .smp_prepare_cpus = r8a7794_smp_prepare_cpus, + .smp_boot_secondary = shmobile_smp_apmu_boot_secondary, +#ifdef CONFIG_HOTPLUG_CPU + .cpu_disable = shmobile_smp_cpu_disable, + .cpu_die = shmobile_smp_apmu_cpu_die, + .cpu_kill = shmobile_smp_apmu_cpu_kill, +#endif +};