On 26.07.2023 11:50:32, haibo.chen@xxxxxxx wrote: > From: Haibo Chen <haibo.chen@xxxxxxx> > > IMX93 A0 chip involve the internal q-channel handshake in LPCG and > CCM to automatically handle the Flex-CAN IPG STOP signal. Only after > FLEX-CAN enter stop mode then can support the self-wakeup feature. > > But meet issue when do the continue system PM stress test. When config > the CAN as wakeup source, the first time after system suspend, any data > on CAN bus can wakeup the system, this is as expect. But the second time > when system suspend, data on CAN bus can't wakeup the system. If continue > this test, we find in odd time system enter suspend, CAN can wakeup the > system, but in even number system enter suspend, CAN can't wakeup the > system. > > IC find a bug in the auto stop mode logic when handle the q-channel, and > can't fix it easily. So for the new imx93 A1, IC drop the auto stop mode > and involve the GPR to support stop mode (used before). IC define a bit > in GPR which can trigger the IPG STOP signal to Flex-CAN, let it go into > stop mode. > > Now NXP claim to drop IMX93 A0, and only support IMX93 A1. So this patch > remove the auto stop mode, and add flag FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR > to imx93. > > Signed-off-by: Haibo Chen <haibo.chen@xxxxxxx> > --- > drivers/net/can/flexcan/flexcan-core.c | 37 ++++---------------------- > drivers/net/can/flexcan/flexcan.h | 2 -- > 2 files changed, 5 insertions(+), 34 deletions(-) > > diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c > index ff0fc18baf13..a3f3a9c909be 100644 > --- a/drivers/net/can/flexcan/flexcan-core.c > +++ b/drivers/net/can/flexcan/flexcan-core.c > @@ -348,7 +348,7 @@ static struct flexcan_devtype_data fsl_imx8mp_devtype_data = { > static struct flexcan_devtype_data fsl_imx93_devtype_data = { > .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS | > FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_RX_MAILBOX | > - FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_AUTO_STOP_MODE | > + FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR | AFAICS this change breaks systems with old device trees (i.e. without "fsl,stop-mode") and new kernels. The flexcan driver will not probe anymore. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature