From patchwork Tue Feb 18 10:49:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13979526 X-Patchwork-Delegate: geert@linux-m68k.org Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF068239070; Tue, 18 Feb 2025 10:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739875853; cv=none; b=Fw2ezEcJZjhyFes+isyEQaAVauDU2B4+q8STZYeZhDsW/stgTThrTMNnrvUhg6gzTFNGAeo9hsgfUTMU6N4lHHXVQTSKsX/BixyjR3VOMK9WhdiVdkkWl0Iobp0A2fNMI119PnGn3uFcmoY7kS3fCag+OtALQAPHxcq6yyLmLew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739875853; c=relaxed/simple; bh=hSc/80u3LQnzJqBf8Z0qBL64vgBZkyeODrRh/YO+GfM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WLyz3fVi28Mb9tJSPfoiFqpgWHULJ0jRuu9BDiLwXRpzIkQd1baLyyk3mIUimB9ushw/w5hpPdzDncszQY9GRNCfFi2PiiqIZrp3s4XHrYaIiRKb7oWMakhZCOdwfILaKLsmuuVY4/dJcq+fR2FZ1+MLsP92LHBUY/0Hpa8SRK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-CSE-ConnectionGUID: Blbq7tWTQGGFKq1xTsGayg== X-CSE-MsgGUID: RrsSATdNSKGmdqv86IWsXw== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 18 Feb 2025 19:50:51 +0900 Received: from localhost.localdomain (unknown [10.226.92.208]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 80AFE42A47AC; Tue, 18 Feb 2025 19:50:48 +0900 (JST) From: Biju Das To: Marc Kleine-Budde , Vincent Mailhol Cc: Biju Das , Wolfram Sang , Geert Uytterhoeven , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , linux-can@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das , linux-renesas-soc@vger.kernel.org Subject: [PATCH 09/11] can: rcar_canfd: Add RZ/G3E support Date: Tue, 18 Feb 2025 10:49:59 +0000 Message-ID: <20250218105007.66358-10-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250218105007.66358-1-biju.das.jz@bp.renesas.com> References: <20250218105007.66358-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The CAN-FD IP found on the RZ/G3E SoC is similar to R-Car Gen4, but it has no external clock instead it has clk_ram, it has 6 channels and supports 20 interrupts. Add support for RZ/G3E CAN-FD driver. Signed-off-by: Biju Das --- drivers/net/can/rcar/rcar_canfd.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c index d6d7ba3e9ca1..69ccd69f68dd 100644 --- a/drivers/net/can/rcar/rcar_canfd.c +++ b/drivers/net/can/rcar/rcar_canfd.c @@ -607,6 +607,14 @@ static const struct rcar_canfd_hw_info rzg2l_hw_info = { .multi_channel_irqs = 1, }; +static const struct rcar_canfd_hw_info r9a09g047_hw_info = { + .max_channels = 6, + .postdiv = 1, + .multi_channel_irqs = 1, + .gen4_type = 1, + .only_internal_clks = 1, +}; + /* Helper functions */ static inline bool is_gen4(struct rcar_canfd_global *gpriv) { @@ -1861,6 +1869,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) u32 rule_entry = 0; bool fdmode = true; /* CAN FD only mode - default */ char name[9] = "channelX"; + struct clk *clk_ram; int i; info = of_device_get_match_data(dev); @@ -1950,6 +1959,11 @@ static int rcar_canfd_probe(struct platform_device *pdev) gpriv->extclk = !gpriv->info->only_internal_clks; } + clk_ram = devm_clk_get_optional_enabled(dev, "ram_clk"); + if (IS_ERR(clk_ram)) + return dev_err_probe(dev, PTR_ERR(clk_ram), + "cannot get ram clock\n"); + addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(addr)) { err = PTR_ERR(addr); @@ -2112,6 +2126,7 @@ static SIMPLE_DEV_PM_OPS(rcar_canfd_pm_ops, rcar_canfd_suspend, static const __maybe_unused struct of_device_id rcar_canfd_of_table[] = { { .compatible = "renesas,r8a779a0-canfd", .data = &rcar_gen4_hw_info }, + { .compatible = "renesas,r9a09g047-canfd", .data = &r9a09g047_hw_info }, { .compatible = "renesas,rcar-gen3-canfd", .data = &rcar_gen3_hw_info }, { .compatible = "renesas,rcar-gen4-canfd", .data = &rcar_gen4_hw_info }, { .compatible = "renesas,rzg2l-canfd", .data = &rzg2l_hw_info },