]> www.infradead.org Git - users/jedix/linux-maple.git/commit
can: flexcan: add wakeup support for imx95
authorHaibo Chen <haibo.chen@nxp.com>
Thu, 1 Aug 2024 00:00:26 +0000 (20:00 -0400)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 5 Aug 2024 14:45:45 +0000 (16:45 +0200)
commit5b512f42e098df280f0b3f680ac806827a25d1dd
tree435bbd695fb1ac35ff1c13bab008f969f2d9b3ef
parent3eea16ba7c69ecab78bc458795ccd08de6fc4b1c
can: flexcan: add wakeup support for imx95

iMX95 defines a bit in GPR that sets/unsets the IPG_STOP signal to the
FlexCAN module, controlling its entry into STOP mode. Wakeup should work
even if FlexCAN is in STOP mode.

Due to iMX95 architecture design, the A-Core cannot access GPR; only the
system manager (SM) can configure GPR. To support the wakeup feature,
follow these steps:

- For suspend:
  1) During Linux suspend, when CAN suspends, do nothing for GPR and keep
     CAN-related clocks on.
  2) In ATF, check whether CAN needs to support wakeup; if yes, send a
     request to SM through the SCMI protocol.
  3) In SM, configure the GPR and unset IPG_STOP.
  4) A-Core suspends.

- For wakeup and resume:
  1) A-Core wakeup event arrives.
  2) In SM, deassert IPG_STOP.
  3) Linux resumes.

Add a new fsl_imx95_devtype_data and FLEXCAN_QUIRK_SETUP_STOP_MODE_SCMI to
reflect this.

Reviewed-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/all/20240731-flexcan-v4-2-82ece66e5a76@nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan/flexcan-core.c
drivers/net/can/flexcan/flexcan.h