From patchwork Mon Feb 12 17:44:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrizio Castro X-Patchwork-Id: 10214403 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 30B4A60467 for ; Mon, 12 Feb 2018 20:45:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24EDF28D08 for ; Mon, 12 Feb 2018 20:45:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 146F328D2E; Mon, 12 Feb 2018 20:45:04 +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 casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C2C328D08 for ; Mon, 12 Feb 2018 20:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=casper.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=IdyBktcHZeB0zfwC+dquxxddFBff3N7ZrWjG8eSrlqE=; b=IBvdnrtODms4UtTRbcBqGJOL2F doFaB3JJ9ZhTbS9eu/aZCGViH3M+OG3MJUk5Kl4+OWZ3uEdmoaBnwqg0o+S39kCi21b85rRPTvcDq 6DthRojt+tXVl2UsDGpDsgtuugiIYioiHpCNmdkkfL5npxmNZ8lndG+ztkUeg6Jf0t2ooEISain8D XsD+Nv744aeMaXX7RFh2/fsIF+s21cWMMLH36/fXZUjo9amRQM6gh9dFf8JHUI5KH4vahvUK4Wy3X BRAwQDlxJYE2jhrkmUfE+rF4Ye241ELG2yi3yEUa0o6f2AdFXZZqVufRalj/HjD6sx4NUgm+fmrlB OeCPTLUA==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elKxz-0001mr-B4; Mon, 12 Feb 2018 20:44:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=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=IdyBktcHZeB0zfwC+dquxxddFBff3N7ZrWjG8eSrlqE=; b=fEYk02GWQzDCmiLWDBDIziZTfQ w8PSjuz1ZxB1DaBzlJpWpnAe+Hwzl70FBsD+XmzdrIEzD1LLHM0+fIqDs67zzrLCExa84kUSxpYsK 54qxNgh1CtAH9UHKrpIq340qB6ibFiKhCNaKMDollMimfNjwhY4UtH7i4GS98/EZO7/RcRfy2AuJ9 FSyVpH4ZSHowe5EEqKsUlgMfoQ94Wcii+KcRJvpIjhMYjBrhS4/nbM44xJQHDczB49B0nN4cjeirx 31e3z2DPVozaJrjW0ICG1RWFfsAVIZqHw9KrprGCoj91GVZN5T0DkqFt/zLG6se752P6rpsldn3np BndWKnRQ==; 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 1elIEE-0004YV-2W; Mon, 12 Feb 2018 17:49:22 +0000 Received: from relmlor3.renesas.com ([210.160.252.173] helo=relmlie2.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1elIAr-0007wG-EA for linux-arm-kernel@lists.infradead.org; Mon, 12 Feb 2018 17:45:55 +0000 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 13 Feb 2018 02:45:41 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 73D1D44AAA; Tue, 13 Feb 2018 02:45:42 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,503,1511794800"; d="scan'208";a="270960055" Received: from unknown (HELO fabrizio-dev.ree.adwin.renesas.com) ([10.226.37.88]) by relmlii1.idc.renesas.com with ESMTP; 13 Feb 2018 02:45:36 +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: [PATCH v5 10/26] ARM: shmobile: rcar-gen2: Add watchdog support Date: Mon, 12 Feb 2018 17:44:19 +0000 Message-Id: <1518457475-4480-11-git-send-email-fabrizio.castro@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518457475-4480-1-git-send-email-fabrizio.castro@bp.renesas.com> References: <1518457475-4480-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 --- v4->v5: * reworked comment style arch/arm/mach-shmobile/platsmp-apmu.c | 1 + arch/arm/mach-shmobile/pm-rcar-gen2.c | 15 ++++++++++++--- 2 files changed, 13 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..5a798b4 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,17 @@ 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 */