From patchwork Fri Mar 16 14:53:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 887016 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=verge.net.au Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TVZDgHPz"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=verge.net.au header.i=@verge.net.au header.b="cnGROfV/"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 402sFc4lv1z9sQr for ; Sat, 17 Mar 2018 04:02:12 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=6qYJrS8Mk72awCRbE0sXesjzcUw5pXRxAVVzNq5ycsE=; b=TVZDgHPzN/7Tl4 +tdZmI84tyl5YA+iF+BVLEJ11A2xlEf2wTKXVh71+UYUrobRo8vz3JzHEnbQN+PQqxKH5v0oHizlG Z5YCGttYkjkm0LErKWpjtdEEgISNBNhPYQCkQ8Z1wUcfzYaK8b2Gx6zh5TTDnlvq9ciiJTyBEsPGp SgNZFHP5xVbgMpIH8/+uTQX+PJJ6BVXENDP7bMpQcrZlktbhq8/Fo16D1MgkW4YtFAy1ltVeCbWNg HcgrzngDqerlNSVxHqHcTftgyQj2f9QgNF/VfrKg16B1YfjMYkFv1YY27FhQOZ29hu6/52MQwlS5/ +4kPwyYqF3POCoJ+n/Pw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewsk3-0003YC-Nz; Fri, 16 Mar 2018 17:02:07 +0000 Received: from kirsty.vergenet.net ([202.4.237.240]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ewro6-00011A-EU for linux-arm-kernel@lists.infradead.org; Fri, 16 Mar 2018 16:03:29 +0000 Received: from penelope.horms.nl (unknown [217.111.208.18]) by kirsty.vergenet.net (Postfix) with ESMTPA id 1FA3C25BE97; Sat, 17 Mar 2018 01:53:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1521212018; bh=2tAsfqKDvAT+st9h3A75LiA9to2kZ4ICYDTg3aapBcg=; h=From:To:Cc:Subject:Date:From; b=cnGROfV/R7BYC1wOSmWMj4gPTc6n3N5auif1zQWSvWYOW6gIO/cPEkHGn7TyTEd1M sIov8+Ulfo1boph+FC/gZcUvqUcWjZtiN1iFDcIpuJIuILb6M6goKyrIzmoesUa2al ZM8pbRo3xTSbcxvqT9lUrrHwK+I3O32ngfeM36L4= Received: by penelope.horms.nl (Postfix, from userid 7100) id 1EA70E213E1; Fri, 16 Mar 2018 15:53:36 +0100 (CET) From: Simon Horman To: arm@kernel.org Subject: [GIT PULL] Renesas ARM Based SoC Updates for v4.17 Date: Fri, 16 Mar 2018 15:53:34 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180316_090215_459654_A2829238 X-CRM114-Status: GOOD ( 21.08 ) X-Spam-Score: -2.2 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [202.4.237.240 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Kevin Hilman , Magnus Damm , linux-renesas-soc@vger.kernel.org, Olof Johansson , Simon Horman , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Hi Olof, Hi Kevin, Hi Arnd, Please consider these Renesas ARM based SoC updates for v4.17. The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2: Linux 4.16-rc1 (2018-02-11 15:04:29 -0800) are available in the git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-soc-for-v4.17 for you to fetch changes up to 01d675f159e0f0792947fb823cf2425da4d747ad: ARM: shmobile: rcar-gen2: Add watchdog support (2018-03-13 20:54:16 +0100) ---------------------------------------------------------------- Renesas ARM Based SoC Updates for v4.17 01d675f159e0 ARM: shmobile: rcar-gen2: Add watchdog support 58adf1ba0d22 ARM: shmobile: Add watchdog support * SoC - Identify R-Car V3H (r8a77980) and M3N (r8a77965) - Enable R-Car Gen2 regulator quirk for Stout board with H3 (r8a7790) SoC Marek Vaust says "Regulator setup is suboptimal on H2 Stout too. The Stout newly has two DA9210 regulators, so the quirk is extended to handle another DA9210 at i2c address 0x70." - Add watchdog support This is the SoC portion of the following solution. It is not yet enabled in DT as it is not functional without clock dependencies in place. Fabrizio Castro says "this series has been around for some time as RFC, and it has collected useful comments from the community along the way. The solution proposed by this patch set works for most R-Car Gen2 and RZ/G1 devices, but not all of them. We now know that for some R-Car Gen2 early revisions there is no proper software fix. Anyway, no product has been built around early revisions, but development boards mounting early revisions (basically prototypes) are still out there. As a result, this series isn't enabling the internal watchdog on R-Car Gen2 boards, developers may enable it in board specific device trees if needed. This series has been tested by me on the iwg20d, iwg22d, Lager, Alt, and Koelsch boards. The problem =========== To deal with SMP on R-Car Gen2 and RZ/G1, we install a reset vector to ICRAM1 and we program the [S]BAR registers so that when we turn ON the non-boot CPUs they are redirected to the reset vector installed by Linux in ICRAM1, and eventually they continue the execution to RAM, where the SMP bring-up code will take care of the rest. The content of the [S]BAR registers survives a watchdog triggered reset, and as such after the watchdog fires the boot core will try and execute the SMP bring-up code instead of jumping to the bootrom code. The fix ======= The main strategy for the solution is to let the reset vector decide if it needs to jump to shmobile_boot_fn or to the bootrom code. In a watchdog triggered reset scenario, since the [S]BAR registers keep their values, the boot CPU will jump into the newly designed reset vector, the assembly routine will eventually test WOVF (a bit in register RWTCSRA that indicates if the watchdog counter has overflown, the value of this bit gets retained in this scenario), and jump to the bootrom code which will in turn load up the bootloader, etc. When bringing up SMP or using CPU hotplug, the reset vector will jump to shmobile_boot_fn instead." * R-Car Rst - Add support for R-Car V3H (r8a77980) and V3H (r8a77980) * R-Car SYSC - Mark rcar_sysc_matches[] __initconst Geert Uytterhoeven says "This frees another 1764 bytes (arm32/shmobile_defconfig) or 1000 bytes (arm64/renesas_defconfig) of memory after kernel init." - Fix power area parents Sergei Shtylyov says "According to the figure 9.2(b) of the R-Car Series, 3rd Generation User’s Manual: Hardware Rev. 0.80 the A2IRn and A2SCn power areas in R8A77970 have the A3IR area as a parent, thus the SYSC driver has those parents wrong.." - Add support for R-Car V3H (r8a77980) and V3H (r8a77980) ---------------------------------------------------------------- Fabrizio Castro (3): soc: renesas: rcar-rst: Enable watchdog as reset trigger for Gen2 ARM: shmobile: Add watchdog support ARM: shmobile: rcar-gen2: Add watchdog support Geert Uytterhoeven (2): soc: renesas: rcar-sysc: Mark rcar_sysc_matches[] __initconst ARM: shmobile: rcar-gen2: Fix error check in regulator quirk Jacopo Mondi (3): soc: renesas: Identify R-Car M3-N soc: renesas: rcar-sysc: Add R-Car M3-N support soc: renesas: rcar-rst: Add support for R-Car M3-N Marek Vasut (1): ARM: shmobile: stout: enable R-Car Gen2 regulator quirk Sergei Shtylyov (5): soc: renesas: identify R-Car V3H soc: renesas: rcar-rst: add R8A77980 support soc: renesas: r8a77970-sysc: fix power area parents dt-bindings: power: add R8A77980 SYSC power domain definitions soc: renesas: rcar-sysc: add R8A77980 support .../bindings/power/renesas,rcar-sysc.txt | 2 + .../devicetree/bindings/reset/renesas,rst.txt | 2 + arch/arm/mach-shmobile/common.h | 4 ++ arch/arm/mach-shmobile/headsmp.S | 55 ++++++++++++++++++++++ arch/arm/mach-shmobile/platsmp-apmu.c | 1 + arch/arm/mach-shmobile/pm-rcar-gen2.c | 15 ++++-- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 25 ++++++---- drivers/soc/renesas/Kconfig | 14 +++++- drivers/soc/renesas/Makefile | 2 + drivers/soc/renesas/r8a77965-sysc.c | 37 +++++++++++++++ drivers/soc/renesas/r8a77970-sysc.c | 12 ++--- drivers/soc/renesas/r8a77980-sysc.c | 52 ++++++++++++++++++++ drivers/soc/renesas/rcar-rst.c | 37 ++++++++++++--- drivers/soc/renesas/rcar-sysc.c | 8 +++- drivers/soc/renesas/rcar-sysc.h | 2 + drivers/soc/renesas/renesas-soc.c | 16 +++++++ include/dt-bindings/power/r8a77965-sysc.h | 30 ++++++++++++ include/dt-bindings/power/r8a77980-sysc.h | 43 +++++++++++++++++ 18 files changed, 331 insertions(+), 26 deletions(-) create mode 100644 drivers/soc/renesas/r8a77965-sysc.c create mode 100644 drivers/soc/renesas/r8a77980-sysc.c create mode 100644 include/dt-bindings/power/r8a77965-sysc.h create mode 100644 include/dt-bindings/power/r8a77980-sysc.h