From patchwork Tue Jan 30 20:22:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 10192655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3186D6020C for ; Tue, 30 Jan 2018 20:33:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E9D726AE3 for ; Tue, 30 Jan 2018 20:33:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 118C627BA5; Tue, 30 Jan 2018 20:33:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BF85426AE3 for ; Tue, 30 Jan 2018 20:33:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Slc7AHPusycLAzHoCpdSghSxeJpbuWoER/Rgc5xktH0=; b=aQRho8xcyTpLAfyNEvmefbaGhI E0WC4MSb1DlMf2p/35PNKUAl56uzjOb0Z2Hi5JPqdKzlsdiXqcLSrAVOY3FLS2Se8wwSlmPmbeAFe Z9TSsYURaZTf/wD1iEvDH8SPQu/PnyFUFbXtkhw2Ugj7OYfNQ6QiDLZyb8yRw236DM/tcqAMyFR5s 0awkCLWQGWtClmdDWtCBrJarD/6wIir2FW26Iop2ZPtWleX8nyIDsfTc2V4BXqfqIKVL+8xf8iv5Y 1LRXR7iIGV/Aqrs8mJcbiBH+GkuXWVMYB6VJG4xg4u/2M/M2Nu7VYjLnnCmxBcouFTbZW8RRBJbSD GRwHWuHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egcaZ-0007xF-IM; Tue, 30 Jan 2018 20:33:07 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1egcSM-0006tO-2g for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Jan 2018 20:24:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=z87YDrv8xGwN7gGPHyzLBkjrF34rJEslHEwqu5IW3wY=; b=Oc6retPL2duX0XwTF2sxKwphv XVYnZrbHlF1ZqLva7DVk7f7lS/ZdngGBqT9/j3fgXjwlfyRmyg729zDBqqg9CpT0hyxU4i6Y+HEMn pqqpX3pNjlGURCpkDDsn8gJ6LlXeeOqwnlkBzENdDvfi6USG4jUrRCBB+lPYSyZTwhkaHOZ5Ua482 ZXqXxeWDHCl2dxBXeuDKjqHXz1jAqL9xqdu6WJkxV+kUgXRhnelda+7FwzQKA218Wx6KlEKm4Xyhv 0Q85Y4/tYs9vTu9tt+rnewe+/rpv4o4j4vEncon1CHIC+g1bm60KVMgWHZTcw+UA45jdrp4Gba+PY bAAC1MwTg==; Received: from relmlor4.renesas.com ([210.160.252.174] helo=relmlie3.idc.renesas.com) by merlin.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1egcSH-0001L3-K3 for linux-arm-kernel@lists.infradead.org; Tue, 30 Jan 2018 20:24:35 +0000 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 31 Jan 2018 05:24:15 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 026C45B805; Wed, 31 Jan 2018 05:24:15 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,436,1511794800"; d="scan'208";a="269795834" Received: from unknown (HELO fabrizio-dev.ree.adwin.renesas.com) ([10.226.37.88]) by relmlii1.idc.renesas.com with ESMTP; 31 Jan 2018 05:24:09 +0900 From: Fabrizio Castro To: Philipp Zabel , Rob Herring , Mark Rutland , Wim Van Sebroeck , Russell King , Catalin Marinas , Will Deacon , Michael Turquette , Stephen Boyd , Simon Horman , Magnus Damm , Geert Uytterhoeven , Wolfram Sang Subject: [RFC v3 12/25] ARM: shmobile: rcar-gen2: Add watchdog support Date: Tue, 30 Jan 2018 20:22:45 +0000 Message-Id: <1517343778-27902-13-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517343778-27902-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1517343778-27902-1-git-send-email-fabrizio.castro@bp.renesas.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrizio Castro , devicetree@vger.kernel.org, Chris Paterson , linux-watchdog@vger.kernel.org, Biju Das , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ramesh Shanmugasundaram , linux-clk@vger.kernel.org, Guenter Roeck MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds watchdog support by installing shmobile_boot_vector_gen2 to ICRAM1 when enough memory is available, in which case we also keep a copy of MPIDR to complete the reset vector logic. Signed-off-by: Fabrizio Castro Signed-off-by: Ramesh Shanmugasundaram --- v2->v3: * purge shmobile_wdt_clock status and save mpidr of boot cpu v1->v2: * make the reset vector backward compatible arch/arm/mach-shmobile/platsmp-apmu.c | 1 + arch/arm/mach-shmobile/pm-rcar-gen2.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index 4422b61..ba732ef 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -191,6 +191,7 @@ static void __init shmobile_smp_apmu_setup_boot(void) { /* install boot code shared by all CPUs */ shmobile_boot_fn = __pa_symbol(shmobile_smp_boot); + shmobile_boot_fn_gen2 = shmobile_boot_fn; } void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus, diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c index e5f215c..bfad202 100644 --- a/arch/arm/mach-shmobile/pm-rcar-gen2.c +++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "common.h" #include "rcar-gen2.h" @@ -37,7 +38,6 @@ #define CA7RESCNT_CODE 0x5a5a0000 #define CA7RESCNT_CPUS 0xf /* CPU0-3 */ - /* On-chip RAM */ #define ICRAM1 0xe63c0000 /* Inter Connect RAM1 (4 KiB) */ @@ -119,8 +119,15 @@ void __init rcar_gen2_pm_init(void) p = ioremap(res.start, resource_size(&res)); if (!p) return; - - memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); + /* install the reset vector, use the largest version if we have enough + * memory available */ + if (resource_size(&res) >= shmobile_boot_size_gen2) { + shmobile_boot_cpu_gen2 = read_cpuid_mpidr(); + memcpy_toio(p, shmobile_boot_vector_gen2, + shmobile_boot_size_gen2); + } else { + memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); + } iounmap(p); /* setup reset vectors */