From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
kernel@pengutronix.de,
Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 07/12] can: flexcan: add NXP S32G2/S32G3 SoC support
Date: Wed, 19 Feb 2025 12:21:12 +0100 [thread overview]
Message-ID: <20250219113354.529611-8-mkl@pengutronix.de> (raw)
In-Reply-To: <20250219113354.529611-1-mkl@pengutronix.de>
From: Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>
Add device type data for S32G2/S32G3 SoC.
FlexCAN module from S32G2/S32G3 is similar with i.MX SoCs, but interrupt
management is different.
On S32G2/S32G3 SoC, there are separate interrupts for state change, bus
errors, Mailboxes 0-7 and Mailboxes 8-127 respectively.
In order to handle this FlexCAN hardware particularity, first reuse the
'FLEXCAN_QUIRK_NR_IRQ_3' quirk provided by mcf5441x's irq handling
support. Secondly, use the newly introduced
'FLEXCAN_QUIRK_SECONDARY_MB_IRQ' quirk which handles the case where two
separate mailbox ranges are controlled by independent hardware interrupt
lines.
Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@oss.nxp.com>
Link: https://patch.msgid.link/20250113120704.522307-4-ciprianmarian.costea@oss.nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/flexcan/flexcan-core.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index a8a4cc4c064d..b347a1c93536 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -386,6 +386,16 @@ static const struct flexcan_devtype_data fsl_lx2160a_r1_devtype_data = {
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR,
};
+static const struct flexcan_devtype_data nxp_s32g2_devtype_data = {
+ .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
+ FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE |
+ FLEXCAN_QUIRK_USE_RX_MAILBOX | FLEXCAN_QUIRK_SUPPORT_FD |
+ FLEXCAN_QUIRK_SUPPORT_ECC | FLEXCAN_QUIRK_NR_IRQ_3 |
+ FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX |
+ FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR |
+ FLEXCAN_QUIRK_SECONDARY_MB_IRQ,
+};
+
static const struct can_bittiming_const flexcan_bittiming_const = {
.name = DRV_NAME,
.tseg1_min = 4,
@@ -2055,6 +2065,7 @@ static const struct of_device_id flexcan_of_match[] = {
{ .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, },
{ .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, },
{ .compatible = "fsl,lx2160ar1-flexcan", .data = &fsl_lx2160a_r1_devtype_data, },
+ { .compatible = "nxp,s32g2-flexcan", .data = &nxp_s32g2_devtype_data, },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, flexcan_of_match);
--
2.47.2
next prev parent reply other threads:[~2025-02-19 11:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 11:21 [PATCH net-next 0/12] pull-request: can-next 2025-02-19 Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 01/12] can: c_can: Drop useless final probe failure message Marc Kleine-Budde
2025-02-20 9:40 ` patchwork-bot+netdevbpf
2025-02-19 11:21 ` [PATCH net-next 02/12] can: c_can: Simplify handling syscon error path Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 03/12] can: c_can: Use of_property_present() to test existence of DT property Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 04/12] can: c_can: Use syscon_regmap_lookup_by_phandle_args Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 05/12] dt-bindings: can: fsl,flexcan: add S32G2/S32G3 SoC support Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 06/12] can: flexcan: Add quirk to handle separate interrupt lines for mailboxes Marc Kleine-Budde
2025-02-19 11:21 ` Marc Kleine-Budde [this message]
2025-02-19 11:21 ` [PATCH net-next 08/12] dt-binding: can: mcp251xfd: remove duplicate word Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 09/12] can: j1939: Extend stack documentation with buffer size behavior Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 10/12] can: canxl: support Remote Request Substitution bit access Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 11/12] can: gs_usb: add VID/PID for the CANnectivity firmware Marc Kleine-Budde
2025-02-19 11:21 ` [PATCH net-next 12/12] can: rockchip_canfd: rkcanfd_chip_fifo_setup(): remove duplicated setup of RX FIFO Marc Kleine-Budde
2025-02-20 9:23 ` [PATCH net-next 0/12] pull-request: can-next 2025-02-19 Paolo Abeni
2025-02-20 9:27 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250219113354.529611-8-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox