From patchwork Thu Aug 1 13:54:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13750556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E43DFC3DA64 for ; Thu, 1 Aug 2024 13:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NXEZXobZxmsyiBQg7O7RiuuI5//qvmMHD2AC3swoudI=; b=aTgUebV7DPWNl9q5Yyz6Em61PX vLbRTZS1b8C9EDkV9UVP/OdByjVJh4rCHG1z90OEx6FgrA0Hns7EibTOKFRAcl9qPYNL/gnGanoY4 2xKGW/saf8/CwtKNW2CraQs/Mq4fEDoHywMlNkowPMuMZKoO3AB74YCWMWggE+NwnL2Bl+G0unXfi 5hA9KSMF34Hxs1YCDyf1LqmeQxT2Pdq2faq1QBRRKGo5F/L6ciyh2bF14c4WvAqrwOXlPVb1MhKk/ 0V+kLillAK3OO96MhxM2sQ+Dp/r/nTzDkuWZZlyPeurTaC3sawi8XdZopoXPgrS9x0U+WXJ1vn9Lq G9c77uGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZWH1-00000005aMB-2OE9; Thu, 01 Aug 2024 13:55:19 +0000 Received: from albert.telenet-ops.be ([2a02:1800:110:4::f00:1a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZWGX-00000005aGh-0RHg for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2024 13:54:50 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:fff7:d11a:41d8:a195]) by albert.telenet-ops.be with bizsmtp id uduh2C00J5XJrhx06duhEc; Thu, 01 Aug 2024 15:54:41 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1sZWG0-004S9v-Uc; Thu, 01 Aug 2024 15:54:41 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1sZWGP-00HOE3-4d; Thu, 01 Aug 2024 15:54:41 +0200 From: Geert Uytterhoeven To: Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Duy Nguyen , Geert Uytterhoeven Subject: [PATCH v2 1/2] arm64: dts: renesas: r8a779h0: Add CAN-FD node Date: Thu, 1 Aug 2024 15:54:35 +0200 Message-Id: <43b786db932f5c53103d34fd530365c445c0425e.1722519717.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_065449_309515_4B7900C4 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Duy Nguyen Add device nodes for the CAN-FD interface and the related external CAN clock on the Renesas R-Car V4M (R8A779H0) SoC. Signed-off-by: Duy Nguyen Signed-off-by: Geert Uytterhoeven --- v2: - No changes. Changes compared to the BSP: - Add can_clk comment, - Add "-clk" suffix to clock node name. --- arch/arm64/boot/dts/renesas/r8a779h0.dtsi | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi index 7147f88401893d3d..c18a70b5552fef93 100644 --- a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi @@ -21,6 +21,13 @@ audio_clkin: audio_clkin { clock-frequency = <0>; }; + /* External CAN clock - to be overridden by boards that provide it */ + can_clk: can-clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <0>; + }; + cluster0_opp: opp-table-0 { compatible = "operating-points-v2"; @@ -641,6 +648,40 @@ hscif3: serial@e66a0000 { status = "disabled"; }; + canfd: can@e6660000 { + compatible = "renesas,r8a779h0-canfd", + "renesas,rcar-gen4-canfd"; + reg = <0 0xe6660000 0 0x8500>; + interrupts = , + ; + interrupt-names = "ch_int", "g_int"; + clocks = <&cpg CPG_MOD 328>, + <&cpg CPG_CORE R8A779H0_CLK_CANFD>, + <&can_clk>; + clock-names = "fck", "canfd", "can_clk"; + assigned-clocks = <&cpg CPG_CORE R8A779H0_CLK_CANFD>; + assigned-clock-rates = <80000000>; + power-domains = <&sysc R8A779H0_PD_ALWAYS_ON>; + resets = <&cpg 328>; + status = "disabled"; + + channel0 { + status = "disabled"; + }; + + channel1 { + status = "disabled"; + }; + + channel2 { + status = "disabled"; + }; + + channel3 { + status = "disabled"; + }; + }; + avb0: ethernet@e6800000 { compatible = "renesas,etheravb-r8a779h0", "renesas,etheravb-rcar-gen4"; From patchwork Thu Aug 1 13:54:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13750558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8320FC3DA64 for ; Thu, 1 Aug 2024 13:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WGMgA/DFZZYXPlgWkSwb2GLGQxoiYiGrG45KNHHwGTY=; b=E8RSJAhF6SBYBim9E7fAouQWez n9ZPI/+YJbiWphV8+tLGDEp1GQ34KClRO3xl6E+0EC/3ij80QXRmwkJQaLhVkLw4NXuvBJLnyb84y 0KQr8PzQGTgavl61Ay9NKVqyEXmb13XVi6vM8sg4k49McvANYbqUsYjnWJlXF8ekjNOW76YuaVFzK alSFH4i76tDoy5KXpMk5MdvKfYw2zUXRzjhAwZmtYb4oGtY+1STd1Hpq0pt6mO3xoEMa3z3XhEhMa 4eSVJQXWlStrSleIdkiqN+laMelHTrFIZisyrOSsBc5443KhD8oVkmZ/Q4zOd3Vzo2T0DXFs8+bSL vBOr23bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZWHu-00000005aVR-0ppj; Thu, 01 Aug 2024 13:56:14 +0000 Received: from andre.telenet-ops.be ([2a02:1800:120:4::f00:15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZWGX-00000005aGs-0heL for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2024 13:54:51 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:fff7:d11a:41d8:a195]) by andre.telenet-ops.be with bizsmtp id uduh2C0085XJrhx01duhqM; Thu, 01 Aug 2024 15:54:44 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1sZWG0-004S9w-V5; Thu, 01 Aug 2024 15:54:41 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1sZWGP-00HOE6-5G; Thu, 01 Aug 2024 15:54:41 +0200 From: Geert Uytterhoeven To: Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven Subject: [PATCH v2 2/2] arm64: dts: renesas: gray-hawk-single: Add CAN-FD support Date: Thu, 1 Aug 2024 15:54:36 +0200 Message-Id: <7c2a06b7abec4ce1025761003ccdbce559789708.1722519717.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240801_065449_367615_8D3F7C35 X-CRM114-Status: GOOD ( 12.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Enable confirmed-working CAN-FD channels 0 and 1 on the Gray Hawk Single development board: - Channel 0 uses an NXP TJR1443AT CAN transceiver, which must be enabled through a GPIO, - Channels 1-3 use Microchip MCP2558FD-H/SN CAN transceivers, which do not need explicit description, but channels 2-3 do not seem to work. Inspired by a patch for Gray Hawk in the BSP by Duy Nguyen. Signed-off-by: Geert Uytterhoeven --- v2: - Add missing pinctrl-names, - Correct TJR1443AT Enable GPIO, - Reword now channels 0 and 1 work. Changes compared to the BSP: - Add can_clk, - Add missing can_transceiver0, - Keep channels 2 and 3 disabled, - Preserve sort order. --- .../dts/renesas/r8a779h0-gray-hawk-single.dts | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts index 88f813562832c21b..9a1917b87f6138af 100644 --- a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts +++ b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts @@ -47,6 +47,13 @@ aliases { ethernet0 = &avb0; }; + can_transceiver0: can-phy0 { + compatible = "nxp,tjr1443"; + #phy-cells = <0>; + enable-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + max-bitrate = <5000000>; + }; + chosen { bootargs = "ignore_loglevel rw root=/dev/nfs ip=on"; stdout-path = "serial0:921600n8"; @@ -174,6 +181,25 @@ phy0: ethernet-phy@0 { }; }; +&can_clk { + clock-frequency = <40000000>; +}; + +&canfd { + pinctrl-0 = <&canfd0_pins>, <&canfd1_pins>, <&can_clk_pins>; + pinctrl-names = "default"; + status = "okay"; + + channel0 { + status = "okay"; + phys = <&can_transceiver0>; + }; + + channel1 { + status = "okay"; + }; +}; + &extal_clk { clock-frequency = <16666666>; }; @@ -305,6 +331,21 @@ pins_mii { }; }; + can_clk_pins: can-clk { + groups = "can_clk"; + function = "can_clk"; + }; + + canfd0_pins: canfd0 { + groups = "canfd0_data"; + function = "canfd0"; + }; + + canfd1_pins: canfd1 { + groups = "canfd1_data"; + function = "canfd1"; + }; + hscif0_pins: hscif0 { groups = "hscif0_data", "hscif0_ctrl"; function = "hscif0";