* [PATCH v7 1/2] dt-bindings: can: m_can: add ti,am62-mcan compatible
2026-09-24 21:54 [PATCH v7 0/2] can: m_can: introduce ti,am62-mcan compatible for out-of-band wakeup Kendall Willis
@ 2026-09-24 21:54 ` Kendall Willis
2026-09-24 21:54 ` [PATCH v7 2/2] can: m_can: add ti,am62-mcan compatible with out-of-band wakeup support Kendall Willis
2026-09-29 14:29 ` [PATCH v7 0/2] can: m_can: introduce ti,am62-mcan compatible for out-of-band wakeup Marc Kleine-Budde
2 siblings, 0 replies; 6+ messages in thread
From: Kendall Willis @ 2026-09-24 21:54 UTC (permalink / raw)
To: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chandrasekar Ramakrishnan
Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis, linux-can,
devicetree, linux-kernel, Krzysztof Kozlowski
Add "ti,am62-mcan" device. Device is fully compatible with Bosch.
The device supports out-of-band wakeup capability.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
index 2c9d37975bedd652b3060ab11ba75c37565edaad..b1d77b57cb75d8c0b48491f2376d8e186a3ad27c 100644
--- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
+++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
@@ -16,7 +16,11 @@ allOf:
properties:
compatible:
- const: bosch,m_can
+ oneOf:
+ - const: bosch,m_can
+ - items:
+ - const: ti,am62-mcan
+ - const: bosch,m_can
reg:
items:
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v7 2/2] can: m_can: add ti,am62-mcan compatible with out-of-band wakeup support
2026-09-24 21:54 [PATCH v7 0/2] can: m_can: introduce ti,am62-mcan compatible for out-of-band wakeup Kendall Willis
2026-09-24 21:54 ` [PATCH v7 1/2] dt-bindings: can: m_can: add ti,am62-mcan compatible Kendall Willis
@ 2026-09-24 21:54 ` Kendall Willis
2026-10-01 9:51 ` Markus Schneider-Pargmann
2026-09-29 14:29 ` [PATCH v7 0/2] can: m_can: introduce ti,am62-mcan compatible for out-of-band wakeup Marc Kleine-Budde
2 siblings, 1 reply; 6+ messages in thread
From: Kendall Willis @ 2026-09-24 21:54 UTC (permalink / raw)
To: Markus Schneider-Pargmann, Marc Kleine-Budde, Vincent Mailhol,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chandrasekar Ramakrishnan
Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis, linux-can,
devicetree, linux-kernel
In TI K3 AM62 SoCs, the M_CAN controllers are in power domains which are
OFF in the deepest low power states. However, the m_can pins are able to
wakeup the system from states where the power domain is OFF through its
out-of-band wakeup functionality.
Introduce the ti,am62-mcan compatible with match data to identify the
out-of-band wakeup capability for TI AM62 SoCs. During suspend, set the
out-of-band wakeup flag when the device is configured as a wakeup
source, the "wakeup" pinctrl state is present, and the match data
indicates out-of-band wakeup support.
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
drivers/net/can/m_can/m_can.c | 10 ++++++++--
drivers/net/can/m_can/m_can.h | 6 ++++++
drivers/net/can/m_can/m_can_platform.c | 9 +++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 91a0c5eca260c19fa97c6f5724341cad0c1c95b8..815a11531ff47b8460aa3efa3075804b4f769848 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -2628,8 +2628,14 @@ int m_can_class_suspend(struct device *dev)
cdev->can.state = CAN_STATE_SLEEPING;
}
- if (!m_can_class_wakeup_pinctrl_enabled(cdev))
- pinctrl_pm_select_sleep_state(dev);
+ if (!ret) {
+ if (m_can_class_wakeup_pinctrl_enabled(cdev)) {
+ if (cdev->out_band_wakeup)
+ device_set_out_band_wakeup(dev);
+ } else {
+ pinctrl_pm_select_sleep_state(dev);
+ }
+ }
return 0;
diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h
index 4743342b2fba3823819b9e2bc5b085cc0fe6d1e2..da64e6bbcef2a721a330e67fd852ca4a703c5794 100644
--- a/drivers/net/can/m_can/m_can.h
+++ b/drivers/net/can/m_can/m_can.h
@@ -132,6 +132,12 @@ struct m_can_classdev {
struct pinctrl *pinctrl;
struct pinctrl_state *pinctrl_state_wakeup;
+
+ bool out_band_wakeup;
+};
+
+struct m_can_of_data {
+ bool out_band_wakeup;
};
struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv);
diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
index 51dd41dbf2c9a971295994946e190ec0187addd5..dbd59730c0bc16f519cb2c40bcd8093ca1bcb369 100644
--- a/drivers/net/can/m_can/m_can_platform.c
+++ b/drivers/net/can/m_can/m_can_platform.c
@@ -83,6 +83,7 @@ static int m_can_plat_probe(struct platform_device *pdev)
void __iomem *addr;
void __iomem *mram_addr;
struct phy *transceiver;
+ const struct m_can_of_data *of_data;
int irq = 0, ret = 0;
mcan_class = m_can_class_allocate_dev(&pdev->dev,
@@ -148,6 +149,9 @@ static int m_can_plat_probe(struct platform_device *pdev)
mcan_class->is_peripheral = false;
+ of_data = of_device_get_match_data(&pdev->dev);
+ mcan_class->out_band_wakeup = of_data && of_data->out_band_wakeup;
+
platform_set_drvdata(pdev, mcan_class);
pm_runtime_enable(mcan_class->dev);
@@ -218,8 +222,13 @@ static const struct dev_pm_ops m_can_pmops = {
SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume)
};
+static const struct m_can_of_data m_can_plat_am62 = {
+ .out_band_wakeup = true,
+};
+
static const struct of_device_id m_can_of_table[] = {
{ .compatible = "bosch,m_can", .data = NULL },
+ { .compatible = "ti,am62-mcan", .data = &m_can_plat_am62 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, m_can_of_table);
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v7 2/2] can: m_can: add ti,am62-mcan compatible with out-of-band wakeup support
2026-09-24 21:54 ` [PATCH v7 2/2] can: m_can: add ti,am62-mcan compatible with out-of-band wakeup support Kendall Willis
@ 2026-10-01 9:51 ` Markus Schneider-Pargmann
2026-10-01 16:06 ` Kendall Willis
0 siblings, 1 reply; 6+ messages in thread
From: Markus Schneider-Pargmann @ 2026-10-01 9:51 UTC (permalink / raw)
To: Kendall Willis, Markus Schneider-Pargmann, Marc Kleine-Budde,
Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Chandrasekar Ramakrishnan
Cc: s-kochidanadu, a-kaur, s-tripathi1, vishalm, linux-can,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 4027 bytes --]
Hi Kendall,
On Thu Sep 24, 2026 at 11:54 PM CEST, Kendall Willis wrote:
> In TI K3 AM62 SoCs, the M_CAN controllers are in power domains which are
> OFF in the deepest low power states. However, the m_can pins are able to
> wakeup the system from states where the power domain is OFF through its
> out-of-band wakeup functionality.
>
> Introduce the ti,am62-mcan compatible with match data to identify the
> out-of-band wakeup capability for TI AM62 SoCs. During suspend, set the
> out-of-band wakeup flag when the device is configured as a wakeup
> source, the "wakeup" pinctrl state is present, and the match data
> indicates out-of-band wakeup support.
>
> Signed-off-by: Kendall Willis <k-willis@ti.com>
> ---
> drivers/net/can/m_can/m_can.c | 10 ++++++++--
> drivers/net/can/m_can/m_can.h | 6 ++++++
> drivers/net/can/m_can/m_can_platform.c | 9 +++++++++
> 3 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 91a0c5eca260c19fa97c6f5724341cad0c1c95b8..815a11531ff47b8460aa3efa3075804b4f769848 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -2628,8 +2628,14 @@ int m_can_class_suspend(struct device *dev)
> cdev->can.state = CAN_STATE_SLEEPING;
> }
>
> - if (!m_can_class_wakeup_pinctrl_enabled(cdev))
> - pinctrl_pm_select_sleep_state(dev);
> + if (!ret) {
I guess this !ret is from an earlier iteration? Code at this point is
only executed if everything was successful so far. So I think you can
drop this outer if.
> + if (m_can_class_wakeup_pinctrl_enabled(cdev)) {
> + if (cdev->out_band_wakeup)
> + device_set_out_band_wakeup(dev);
> + } else {
> + pinctrl_pm_select_sleep_state(dev);
> + }
> + }
>
> return 0;
>
> diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h
> index 4743342b2fba3823819b9e2bc5b085cc0fe6d1e2..da64e6bbcef2a721a330e67fd852ca4a703c5794 100644
> --- a/drivers/net/can/m_can/m_can.h
> +++ b/drivers/net/can/m_can/m_can.h
> @@ -132,6 +132,12 @@ struct m_can_classdev {
>
> struct pinctrl *pinctrl;
> struct pinctrl_state *pinctrl_state_wakeup;
> +
> + bool out_band_wakeup;
> +};
> +
> +struct m_can_of_data {
> + bool out_band_wakeup;
Can you please move struct m_can_of_data to the top of m_can_platform.c
to keep it local to where it is used?
The rest looks good to me.
Best
Markus
> };
>
> struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv);
> diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
> index 51dd41dbf2c9a971295994946e190ec0187addd5..dbd59730c0bc16f519cb2c40bcd8093ca1bcb369 100644
> --- a/drivers/net/can/m_can/m_can_platform.c
> +++ b/drivers/net/can/m_can/m_can_platform.c
> @@ -83,6 +83,7 @@ static int m_can_plat_probe(struct platform_device *pdev)
> void __iomem *addr;
> void __iomem *mram_addr;
> struct phy *transceiver;
> + const struct m_can_of_data *of_data;
> int irq = 0, ret = 0;
>
> mcan_class = m_can_class_allocate_dev(&pdev->dev,
> @@ -148,6 +149,9 @@ static int m_can_plat_probe(struct platform_device *pdev)
>
> mcan_class->is_peripheral = false;
>
> + of_data = of_device_get_match_data(&pdev->dev);
> + mcan_class->out_band_wakeup = of_data && of_data->out_band_wakeup;
> +
> platform_set_drvdata(pdev, mcan_class);
>
> pm_runtime_enable(mcan_class->dev);
> @@ -218,8 +222,13 @@ static const struct dev_pm_ops m_can_pmops = {
> SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume)
> };
>
> +static const struct m_can_of_data m_can_plat_am62 = {
> + .out_band_wakeup = true,
> +};
> +
> static const struct of_device_id m_can_of_table[] = {
> { .compatible = "bosch,m_can", .data = NULL },
> + { .compatible = "ti,am62-mcan", .data = &m_can_plat_am62 },
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, m_can_of_table);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v7 2/2] can: m_can: add ti,am62-mcan compatible with out-of-band wakeup support
2026-10-01 9:51 ` Markus Schneider-Pargmann
@ 2026-10-01 16:06 ` Kendall Willis
0 siblings, 0 replies; 6+ messages in thread
From: Kendall Willis @ 2026-10-01 16:06 UTC (permalink / raw)
To: Markus Schneider-Pargmann
Cc: Marc Kleine-Budde, Vincent Mailhol, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Chandrasekar Ramakrishnan,
s-kochidanadu, a-kaur, s-tripathi1, vishalm, linux-can,
devicetree, linux-kernel
Hi Markus,
On 11:51-20261001, Markus Schneider-Pargmann wrote:
> On Thu Sep 24, 2026 at 11:54 PM CEST, Kendall Willis wrote:
> > In TI K3 AM62 SoCs, the M_CAN controllers are in power domains which are
> > OFF in the deepest low power states. However, the m_can pins are able to
> > wakeup the system from states where the power domain is OFF through its
> > out-of-band wakeup functionality.
> >
> > Introduce the ti,am62-mcan compatible with match data to identify the
> > out-of-band wakeup capability for TI AM62 SoCs. During suspend, set the
> > out-of-band wakeup flag when the device is configured as a wakeup
> > source, the "wakeup" pinctrl state is present, and the match data
> > indicates out-of-band wakeup support.
> >
> > Signed-off-by: Kendall Willis <k-willis@ti.com>
> > ---
> > drivers/net/can/m_can/m_can.c | 10 ++++++++--
> > drivers/net/can/m_can/m_can.h | 6 ++++++
> > drivers/net/can/m_can/m_can_platform.c | 9 +++++++++
> > 3 files changed, 23 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> > index 91a0c5eca260c19fa97c6f5724341cad0c1c95b8..815a11531ff47b8460aa3efa3075804b4f769848 100644
> > --- a/drivers/net/can/m_can/m_can.c
> > +++ b/drivers/net/can/m_can/m_can.c
> > @@ -2628,8 +2628,14 @@ int m_can_class_suspend(struct device *dev)
> > cdev->can.state = CAN_STATE_SLEEPING;
> > }
> >
> > - if (!m_can_class_wakeup_pinctrl_enabled(cdev))
> > - pinctrl_pm_select_sleep_state(dev);
> > + if (!ret) {
>
> I guess this !ret is from an earlier iteration? Code at this point is
> only executed if everything was successful so far. So I think you can
> drop this outer if.
>
You're right this is redundant. Thanks for pointing it out, will fix in
next version.
> > + if (m_can_class_wakeup_pinctrl_enabled(cdev)) {
> > + if (cdev->out_band_wakeup)
> > + device_set_out_band_wakeup(dev);
> > + } else {
> > + pinctrl_pm_select_sleep_state(dev);
> > + }
> > + }
> >
> > return 0;
> >
> > diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h
> > index 4743342b2fba3823819b9e2bc5b085cc0fe6d1e2..da64e6bbcef2a721a330e67fd852ca4a703c5794 100644
> > --- a/drivers/net/can/m_can/m_can.h
> > +++ b/drivers/net/can/m_can/m_can.h
> > @@ -132,6 +132,12 @@ struct m_can_classdev {
> >
> > struct pinctrl *pinctrl;
> > struct pinctrl_state *pinctrl_state_wakeup;
> > +
> > + bool out_band_wakeup;
> > +};
> > +
> > +struct m_can_of_data {
> > + bool out_band_wakeup;
>
> Can you please move struct m_can_of_data to the top of m_can_platform.c
> to keep it local to where it is used?
>
Will fix it in the next version.
Thanks,
Kendall
> The rest looks good to me.
>
> Best
> Markus
>
> > };
> >
> > struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv);
> > diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
> > index 51dd41dbf2c9a971295994946e190ec0187addd5..dbd59730c0bc16f519cb2c40bcd8093ca1bcb369 100644
> > --- a/drivers/net/can/m_can/m_can_platform.c
> > +++ b/drivers/net/can/m_can/m_can_platform.c
> > @@ -83,6 +83,7 @@ static int m_can_plat_probe(struct platform_device *pdev)
> > void __iomem *addr;
> > void __iomem *mram_addr;
> > struct phy *transceiver;
> > + const struct m_can_of_data *of_data;
> > int irq = 0, ret = 0;
> >
> > mcan_class = m_can_class_allocate_dev(&pdev->dev,
> > @@ -148,6 +149,9 @@ static int m_can_plat_probe(struct platform_device *pdev)
> >
> > mcan_class->is_peripheral = false;
> >
> > + of_data = of_device_get_match_data(&pdev->dev);
> > + mcan_class->out_band_wakeup = of_data && of_data->out_band_wakeup;
> > +
> > platform_set_drvdata(pdev, mcan_class);
> >
> > pm_runtime_enable(mcan_class->dev);
> > @@ -218,8 +222,13 @@ static const struct dev_pm_ops m_can_pmops = {
> > SET_SYSTEM_SLEEP_PM_OPS(m_can_suspend, m_can_resume)
> > };
> >
> > +static const struct m_can_of_data m_can_plat_am62 = {
> > + .out_band_wakeup = true,
> > +};
> > +
> > static const struct of_device_id m_can_of_table[] = {
> > { .compatible = "bosch,m_can", .data = NULL },
> > + { .compatible = "ti,am62-mcan", .data = &m_can_plat_am62 },
> > { /* sentinel */ }
> > };
> > MODULE_DEVICE_TABLE(of, m_can_of_table);
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v7 0/2] can: m_can: introduce ti,am62-mcan compatible for out-of-band wakeup
2026-09-24 21:54 [PATCH v7 0/2] can: m_can: introduce ti,am62-mcan compatible for out-of-band wakeup Kendall Willis
2026-09-24 21:54 ` [PATCH v7 1/2] dt-bindings: can: m_can: add ti,am62-mcan compatible Kendall Willis
2026-09-24 21:54 ` [PATCH v7 2/2] can: m_can: add ti,am62-mcan compatible with out-of-band wakeup support Kendall Willis
@ 2026-09-29 14:29 ` Marc Kleine-Budde
2 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2026-09-29 14:29 UTC (permalink / raw)
To: Kendall Willis
Cc: Markus Schneider-Pargmann, Vincent Mailhol, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Chandrasekar Ramakrishnan,
s-kochidanadu, a-kaur, s-tripathi1, vishalm, linux-can,
devicetree, linux-kernel, Krzysztof Kozlowski
[-- Attachment #1: Type: text/plain, Size: 840 bytes --]
On 24.09.2026 16:54:30, Kendall Willis wrote:
> This series introduces the "ti,am62-mcan" compatible which adds support
> for out-of-band wakeup capability in m_can devices.
>
> A corresponding DTS series enabling this feature on TI K3 AM62 family
> of devices has been submitted separately:
> "arm64: dts: ti: use ti,am62-mcan compatible for m_can devices"
>
> Rebased on top of "can: m_can: Fix suspend deinit() error path" [1]
This should go mainline with the next can-fixes PR. Please ping me after
net has been merged back to net-next.
regards,
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread