From patchwork Fri May 17 14:57:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13667130 X-Patchwork-Delegate: geert@linux-m68k.org Received: from weierstrass.telenet-ops.be (weierstrass.telenet-ops.be [195.130.137.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2F3C6A039 for ; Fri, 17 May 2024 14:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957856; cv=none; b=FVcrXY/o4doS3VmuNZ/EAKisIn912JsBCsdHxvkY41wQGTS6V9MVdzMkXH+iz03HNXO12XXDs1tnQY7r+UNpFjtLlSDakWgbownyTsA6/8kRy/6xxh+uM1IlY5VuBHNCAJMgv9Rv3DnLMTx/vBkvHLo1Vz/QPoaMlTAosFw1w8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957856; c=relaxed/simple; bh=i+eoLY9l1EHK4ty6OVIKVK28ZFe264agnKOjrfX2PD0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gxn2PWb0b4QOMB57V3Z7qhOiJ5MIP10kcc7Nt8Nyuhm57uhtrTDMSNBP9ScZc0eoNfOexHb52yvedkxTMKPA0wZps6bYyrbcF7nidRcD94ybVsQjU9O5OxpdYmQ4gspsddHXSsPOAjb2FWpPOVdkC9YRbKqkzOuKPyG4dPJ9ob4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by weierstrass.telenet-ops.be (Postfix) with ESMTPS id 4VgqnM3lpCz4x0lm for ; Fri, 17 May 2024 16:57:27 +0200 (CEST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:9706:8977:9494:a7c7]) by baptiste.telenet-ops.be with bizsmtp id QExK2C00F0bc1Xv01ExKSx; Fri, 17 May 2024 16:57:20 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s7z0U-00BDn9-Cj; Fri, 17 May 2024 16:57:19 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s7z1L-00C63H-E5; Fri, 17 May 2024 16:57:19 +0200 From: Geert Uytterhoeven To: linux-renesas-soc@vger.kernel.org Cc: Cong Dang , Geert Uytterhoeven Subject: [PATCH/RFC 1/4] clk: renesas: r8a779h0: Add CANFD clock Date: Fri, 17 May 2024 16:57:13 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Cong Dang Add the CANFD module clock on the Renesas R-Car V4M (R8A779H0) SoC. Signed-off-by: Cong Dang Signed-off-by: Geert Uytterhoeven --- Changes compared to the BSP: - Change clock name from can-fd to canfd0, - Change parent clock from CANFD to SASYNCPERD2. --- drivers/clk/renesas/r8a779h0-cpg-mssr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/renesas/r8a779h0-cpg-mssr.c b/drivers/clk/renesas/r8a779h0-cpg-mssr.c index 079b55b30b23bd50..4b237bb2ca69dc2c 100644 --- a/drivers/clk/renesas/r8a779h0-cpg-mssr.c +++ b/drivers/clk/renesas/r8a779h0-cpg-mssr.c @@ -176,6 +176,7 @@ static const struct mssr_mod_clk r8a779h0_mod_clks[] = { DEF_MOD("avb0:rgmii0", 211, R8A779H0_CLK_S0D8_HSC), DEF_MOD("avb1:rgmii1", 212, R8A779H0_CLK_S0D8_HSC), DEF_MOD("avb2:rgmii2", 213, R8A779H0_CLK_S0D8_HSC), + DEF_MOD("canfd0", 328, R8A779H0_CLK_SASYNCPERD2), DEF_MOD("hscif0", 514, R8A779H0_CLK_SASYNCPERD1), DEF_MOD("hscif1", 515, R8A779H0_CLK_SASYNCPERD1), DEF_MOD("hscif2", 516, R8A779H0_CLK_SASYNCPERD1), From patchwork Fri May 17 14:57:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13667133 X-Patchwork-Delegate: geert@linux-m68k.org Received: from cantor.telenet-ops.be (cantor.telenet-ops.be [195.130.132.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C19B6A339 for ; Fri, 17 May 2024 15:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715958305; cv=none; b=TlN3mddo4bNYMESMVY+VwD36CwqN274HcgDICYgCirnYK9Wj79hOgJ6UXQVVnZUgesrkGdwrfkRELuPOmaTd6R2isgiLGPMa/zzrHs1ob6oHEzSuhUdF2w+YNWXffhH+QPhA9nPvb2RvNmyQyBtqbUSaQeYh8ixhYiMXzu7Rs/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715958305; c=relaxed/simple; bh=NMQ1cLtQX95/HaNYC8uTlwEUdj8PP7r3gN5SSp957EQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=a6OOfyLCCwsYbhEYLlsNxU9GpWQ4y7jaDwzlqkSQ8NkdFzCy2uATI7xT/i72485dgf7y7i7MkCbkIlPqJ1cihat2FA2OwW8zG0dsqO4oghUGgW115F8ftBQcas31By1tt6CQuqnbArPWxyfH7By9VFYljqgJ70Uri73WpLvwJ/Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by cantor.telenet-ops.be (Postfix) with ESMTPS id 4VgqnM3vZSz4x1rJ for ; Fri, 17 May 2024 16:57:27 +0200 (CEST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:9706:8977:9494:a7c7]) by xavier.telenet-ops.be with bizsmtp id QExK2C00B0bc1Xv01ExKtX; Fri, 17 May 2024 16:57:20 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s7z0U-00BDnB-DQ; Fri, 17 May 2024 16:57:19 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s7z1L-00C63K-FF; Fri, 17 May 2024 16:57:19 +0200 From: Geert Uytterhoeven To: linux-renesas-soc@vger.kernel.org Cc: Duy Nguyen , Geert Uytterhoeven Subject: [PATCH/RFC 2/4] dt-bindings: can: renesas,rcar-canfd: Document R-Car V4M support Date: Fri, 17 May 2024 16:57:14 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Duy Nguyen Document support for the CAN-FD Interface on the Renesas R-Car V4M (R8A779H0) SoC, which supports up to four channels. Signed-off-by: Duy Nguyen Signed-off-by: Geert Uytterhoeven --- Changes compared to the BSP: - Restrict number of channels to four. --- .../bindings/net/can/renesas,rcar-canfd.yaml | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml index d3f45d29fa0a550a..7c5ac5d2e880bbb8 100644 --- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml @@ -32,6 +32,7 @@ properties: - enum: - renesas,r8a779a0-canfd # R-Car V3U - renesas,r8a779g0-canfd # R-Car V4H + - renesas,r8a779h0-canfd # R-Car V4M - const: renesas,rcar-gen4-canfd # R-Car Gen4 - items: @@ -163,14 +164,23 @@ allOf: maxItems: 1 - if: - not: - properties: - compatible: - contains: - const: renesas,rcar-gen4-canfd + properties: + compatible: + contains: + const: renesas,r8a779h0-canfd then: patternProperties: - "^channel[2-7]$": false + "^channel[5-7]$": false + else: + if: + not: + properties: + compatible: + contains: + const: renesas,rcar-gen4-canfd + then: + patternProperties: + "^channel[2-7]$": false unevaluatedProperties: false From patchwork Fri May 17 14:57:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13667131 X-Patchwork-Delegate: geert@linux-m68k.org Received: from riemann.telenet-ops.be (riemann.telenet-ops.be [195.130.137.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F398D6A34C for ; Fri, 17 May 2024 14:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.137.80 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957857; cv=none; b=YmJEjVqXv4WvYpB4EvIJtlbB/Fg0JDzo8vSy3eHaXj/9tkaNObZuLf9YGe1rynd6O9EVo6AO/hgHlsK49a12y2C027kIQ4gn82pbjqJsObcsnYzsFQ/WSgIsX2CqYX/MUxwvALc754TfR0iV+wezcTD/A5kZVEv730eY3U8H4L4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957857; c=relaxed/simple; bh=X0IARB3nV+qWnJWaO8TngW3v1MzkcdjwmzY7ZjJ6EpE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X9HksRl7Ca+gFc5mPWgIvfdyiq2LocClU6Bs+A8WnV4589Z/MNvkZT8BV2a1ScQpJ32pbgEi79NSb56wjiITrRcP5txGKrSeEsWtTjKMvEqaGlNm6+SFS48Uy7QOthj98GHOsxiuGiZM+Wq/xwq093thBKIBF0xQhtyshZGgEIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.137.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by riemann.telenet-ops.be (Postfix) with ESMTPS id 4VgqnM3ygkz4x1PZ for ; Fri, 17 May 2024 16:57:27 +0200 (CEST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:9706:8977:9494:a7c7]) by xavier.telenet-ops.be with bizsmtp id QExK2C00C0bc1Xv01ExKtZ; Fri, 17 May 2024 16:57:20 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s7z0U-00BDnF-EJ; Fri, 17 May 2024 16:57:19 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s7z1L-00C63P-GO; Fri, 17 May 2024 16:57:19 +0200 From: Geert Uytterhoeven To: linux-renesas-soc@vger.kernel.org Cc: Duy Nguyen , Geert Uytterhoeven Subject: [PATCH/RFC 3/4] arm64: dts: renesas: r8a779h0: Add CAN-FD node Date: Fri, 17 May 2024 16:57:15 +0200 Message-Id: <9412c1496037417c0f34c8aed10692f17c359677.1715956819.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- 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 ea3d2b2de10b2999..3766652623fd8e5e 100644 --- a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi +++ b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi @@ -14,6 +14,13 @@ / { #address-cells = <2>; #size-cells = <2>; + /* 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"; opp-shared; @@ -635,6 +642,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 Fri May 17 14:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13667129 X-Patchwork-Delegate: geert@linux-m68k.org Received: from andre.telenet-ops.be (andre.telenet-ops.be [195.130.132.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECC8E6A039 for ; Fri, 17 May 2024 14:57:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.130.132.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957850; cv=none; b=qxrJvLNQQAc4bnfcVzmeV6/H7WIq22lT3x2WXvoHihOJ7i44g1hGlSOZSVZ7McQGWHvwY5DpwmW3+l6igm/KT0umhBr/IWL41zYUjh05jcDjOvjBPqSBShhBgM0Mqxpb11zJbKExNeDPf9e4o88N1BToz4s6tPUNqYqF+311cKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715957850; c=relaxed/simple; bh=ry/+zh6uwEiR0ySTkyMz7QdC4jqfSug6fEkCCJhP1yw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tLvsyz4FRJMvH+icyipC7owlYcmxRBBv795lJ0fl3NOCqB1LLSYxYnfu+R7EdVsVb92NSurmMwJKzCcYo0UsG0wX7E/82Ofe4gSPhrWftnMgV8fefPaCV+M1mVTKr0A9iRUUpGbsF8tIORnTuaa9OI/37QlIPmuyjoRu6V5YBcs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be; spf=none smtp.mailfrom=linux-m68k.org; arc=none smtp.client-ip=195.130.132.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed80:9706:8977:9494:a7c7]) by andre.telenet-ops.be with bizsmtp id QExK2C00R0bc1Xv01ExKm7; Fri, 17 May 2024 16:57:19 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1s7z0U-00BDnI-FT; Fri, 17 May 2024 16:57:19 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1s7z1L-00C63T-HE; Fri, 17 May 2024 16:57:19 +0200 From: Geert Uytterhoeven To: linux-renesas-soc@vger.kernel.org Cc: Geert Uytterhoeven Subject: [PATCH/RFC 4/4] arm64: dts: renesas: gray-hawk-single: Add CAN-FD support Date: Fri, 17 May 2024 16:57:16 +0200 Message-Id: <2fe3c8e38b566de09e49056c62fa954ed306a497.1715956819.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Enable 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, - Channel 1 uses a Microchip MCP2558FD-H/SN CAN transceiver, which does not need explicit description. Inspired by a patch for Gray Hawk in the BSP by Duy Nguyen. Signed-off-by: Geert Uytterhoeven --- 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 | 40 +++++++++++++++++++ 1 file changed, 40 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 cfbe8c8680cd8947..294ed2d5a17cbfd5 100644 --- a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts +++ b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts @@ -22,6 +22,13 @@ aliases { ethernet0 = &avb0; }; + can_transceiver0: can-phy0 { + compatible = "nxp,tjr1443"; + #phy-cells = <0>; + enable-gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + max-bitrate = <5000000>; + }; + chosen { bootargs = "ignore_loglevel rw root=/dev/nfs ip=on"; stdout-path = "serial0:921600n8"; @@ -75,6 +82,24 @@ phy0: ethernet-phy@0 { }; }; +&can_clk { + clock-frequency = <40000000>; +}; + +&canfd { + pinctrl-0 = <&canfd0_pins>, <&canfd1_pins>, <&can_clk_pins>; + status = "okay"; + + channel0 { + status = "okay"; + phys = <&can_transceiver0>; + }; + + channel1 { + status = "okay"; + }; +}; + &extal_clk { clock-frequency = <16666666>; }; @@ -174,6 +199,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";