Skip to content

Commit 2dded77

Browse files
Ciprian Marian Costeajfvogel
authored andcommitted
can: flexcan: add NXP S32G2/S32G3 SoC support
[ Upstream commit 8503a4b1a24d32e95f3a233062e8f1dc0b2052bd ] 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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 8e7bb6636082a9c64da88aff2af82e2466de060f) Signed-off-by: Jack Vogel <[email protected]>
1 parent 1ae2624 commit 2dded77

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/net/can/flexcan/flexcan-core.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,16 @@ static const struct flexcan_devtype_data fsl_lx2160a_r1_devtype_data = {
386386
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR,
387387
};
388388

389+
static const struct flexcan_devtype_data nxp_s32g2_devtype_data = {
390+
.quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
391+
FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_BROKEN_PERR_STATE |
392+
FLEXCAN_QUIRK_USE_RX_MAILBOX | FLEXCAN_QUIRK_SUPPORT_FD |
393+
FLEXCAN_QUIRK_SUPPORT_ECC | FLEXCAN_QUIRK_NR_IRQ_3 |
394+
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX |
395+
FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR |
396+
FLEXCAN_QUIRK_SECONDARY_MB_IRQ,
397+
};
398+
389399
static const struct can_bittiming_const flexcan_bittiming_const = {
390400
.name = DRV_NAME,
391401
.tseg1_min = 4,
@@ -2055,6 +2065,7 @@ static const struct of_device_id flexcan_of_match[] = {
20552065
{ .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, },
20562066
{ .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, },
20572067
{ .compatible = "fsl,lx2160ar1-flexcan", .data = &fsl_lx2160a_r1_devtype_data, },
2068+
{ .compatible = "nxp,s32g2-flexcan", .data = &nxp_s32g2_devtype_data, },
20582069
{ /* sentinel */ },
20592070
};
20602071
MODULE_DEVICE_TABLE(of, flexcan_of_match);

0 commit comments

Comments
 (0)