linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] can: m_can: document and add external reset
@ 2025-08-07  6:09 Marc Kleine-Budde
  2025-08-07  6:09 ` [PATCH v2 1/2] dt-binding: can: m_can: add optional resets property Marc Kleine-Budde
  2025-08-07  6:09 ` [PATCH v2 2/2] ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153 Marc Kleine-Budde
  0 siblings, 2 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2025-08-07  6:09 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Chandrasekar Ramakrishnan, Vincent Mailhol
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel,
	linux-can, Marc Kleine-Budde

The m_can IP core has an external reset line. Update the DT bindings
documentation accordingly and add it to the stm32mp153 device tree.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
Changes in v2:
- add dt-bindings update as 1st patch
- move stm32mp153.dtsi update to 2nd patch
- Link to v1: https://patch.msgid.link/20250806-stm32mp15-m_can-add-reset-v1-1-9d81f9c29d65@pengutronix.de

---
Marc Kleine-Budde (2):
      dt-binding: can: m_can: add optional resets property
      ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153

 Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 3 +++
 arch/arm/boot/dts/st/stm32mp153.dtsi                       | 2 ++
 2 files changed, 5 insertions(+)
---
base-commit: 1a32f7427eb3d1248bc64cd745b93f88cc838933
change-id: 20250806-stm32mp15-m_can-add-reset-ccfc47213ba3

Best regards,
--  
Marc Kleine-Budde <mkl@pengutronix.de>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] dt-binding: can: m_can: add optional resets property
  2025-08-07  6:09 [PATCH v2 0/2] can: m_can: document and add external reset Marc Kleine-Budde
@ 2025-08-07  6:09 ` Marc Kleine-Budde
  2025-08-07 16:13   ` Conor Dooley
  2025-08-07  6:09 ` [PATCH v2 2/2] ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153 Marc Kleine-Budde
  1 sibling, 1 reply; 6+ messages in thread
From: Marc Kleine-Budde @ 2025-08-07  6:09 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Chandrasekar Ramakrishnan, Vincent Mailhol
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel,
	linux-can, Marc Kleine-Budde

The m_can IP core has an external reset line. Add it to the bindings
documentation.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 Documentation/devicetree/bindings/net/can/bosch,m_can.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
index c4887522e8fe..61ef60d8f1c7 100644
--- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
+++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
@@ -50,6 +50,9 @@ properties:
       - const: hclk
       - const: cclk
 
+  resets:
+    maxItems: 1
+
   bosch,mram-cfg:
     description: |
       Message RAM configuration data.

-- 
2.47.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153
  2025-08-07  6:09 [PATCH v2 0/2] can: m_can: document and add external reset Marc Kleine-Budde
  2025-08-07  6:09 ` [PATCH v2 1/2] dt-binding: can: m_can: add optional resets property Marc Kleine-Budde
@ 2025-08-07  6:09 ` Marc Kleine-Budde
  2025-09-03 13:10   ` Alexandre TORGUE
  1 sibling, 1 reply; 6+ messages in thread
From: Marc Kleine-Budde @ 2025-08-07  6:09 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Chandrasekar Ramakrishnan, Vincent Mailhol
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel,
	linux-can, Marc Kleine-Budde

On the STM32MP153 the m_cam IP cores (a.k.a. FDCAN) have an external
shared reset in the RCC. Add the reset to both m_can nodes.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 arch/arm/boot/dts/st/stm32mp153.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/st/stm32mp153.dtsi b/arch/arm/boot/dts/st/stm32mp153.dtsi
index 4640dafb1598..92794b942ab2 100644
--- a/arch/arm/boot/dts/st/stm32mp153.dtsi
+++ b/arch/arm/boot/dts/st/stm32mp153.dtsi
@@ -40,6 +40,7 @@ m_can1: can@4400e000 {
 		interrupt-names = "int0", "int1";
 		clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
 		clock-names = "hclk", "cclk";
+		resets = <&rcc FDCAN_R>;
 		bosch,mram-cfg = <0x0 0 0 32 0 0 2 2>;
 		access-controllers = <&etzpc 62>;
 		status = "disabled";
@@ -54,6 +55,7 @@ m_can2: can@4400f000 {
 		interrupt-names = "int0", "int1";
 		clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
 		clock-names = "hclk", "cclk";
+		resets = <&rcc FDCAN_R>;
 		bosch,mram-cfg = <0x1400 0 0 32 0 0 2 2>;
 		access-controllers = <&etzpc 62>;
 		status = "disabled";

-- 
2.47.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] dt-binding: can: m_can: add optional resets property
  2025-08-07  6:09 ` [PATCH v2 1/2] dt-binding: can: m_can: add optional resets property Marc Kleine-Budde
@ 2025-08-07 16:13   ` Conor Dooley
  0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2025-08-07 16:13 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Alexandre Torgue, Chandrasekar Ramakrishnan, Vincent Mailhol,
	devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel,
	linux-can

[-- Attachment #1: Type: text/plain, Size: 274 bytes --]

On Thu, Aug 07, 2025 at 08:09:30AM +0200, Marc Kleine-Budde wrote:
> The m_can IP core has an external reset line. Add it to the bindings
> documentation.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153
  2025-08-07  6:09 ` [PATCH v2 2/2] ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153 Marc Kleine-Budde
@ 2025-09-03 13:10   ` Alexandre TORGUE
  2025-09-03 15:16     ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandre TORGUE @ 2025-09-03 13:10 UTC (permalink / raw)
  To: Marc Kleine-Budde, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Coquelin, Chandrasekar Ramakrishnan, Vincent Mailhol
  Cc: devicetree, linux-stm32, linux-arm-kernel, linux-kernel, kernel,
	linux-can

Hi Marc

On 8/7/25 08:09, Marc Kleine-Budde wrote:
> On the STM32MP153 the m_cam IP cores (a.k.a. FDCAN) have an external
> shared reset in the RCC. Add the reset to both m_can nodes.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>   arch/arm/boot/dts/st/stm32mp153.dtsi | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/st/stm32mp153.dtsi b/arch/arm/boot/dts/st/stm32mp153.dtsi
> index 4640dafb1598..92794b942ab2 100644
> --- a/arch/arm/boot/dts/st/stm32mp153.dtsi
> +++ b/arch/arm/boot/dts/st/stm32mp153.dtsi
> @@ -40,6 +40,7 @@ m_can1: can@4400e000 {
>   		interrupt-names = "int0", "int1";
>   		clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
>   		clock-names = "hclk", "cclk";
> +		resets = <&rcc FDCAN_R>;
>   		bosch,mram-cfg = <0x0 0 0 32 0 0 2 2>;
>   		access-controllers = <&etzpc 62>;
>   		status = "disabled";
> @@ -54,6 +55,7 @@ m_can2: can@4400f000 {
>   		interrupt-names = "int0", "int1";
>   		clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
>   		clock-names = "hclk", "cclk";
> +		resets = <&rcc FDCAN_R>;
>   		bosch,mram-cfg = <0x1400 0 0 32 0 0 2 2>;
>   		access-controllers = <&etzpc 62>;
>   		status = "disabled";
> 

How those reset are handled at driver side ?

regards
alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153
  2025-09-03 13:10   ` Alexandre TORGUE
@ 2025-09-03 15:16     ` Marc Kleine-Budde
  0 siblings, 0 replies; 6+ messages in thread
From: Marc Kleine-Budde @ 2025-09-03 15:16 UTC (permalink / raw)
  To: Alexandre TORGUE
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
	Chandrasekar Ramakrishnan, Vincent Mailhol, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel, kernel, linux-can

[-- Attachment #1: Type: text/plain, Size: 1994 bytes --]

On 03.09.2025 15:10:42, Alexandre TORGUE wrote:
> Hi Marc
> 
> On 8/7/25 08:09, Marc Kleine-Budde wrote:
> > On the STM32MP153 the m_cam IP cores (a.k.a. FDCAN) have an external
> > shared reset in the RCC. Add the reset to both m_can nodes.
> > 
> > Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > ---
> >   arch/arm/boot/dts/st/stm32mp153.dtsi | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/st/stm32mp153.dtsi b/arch/arm/boot/dts/st/stm32mp153.dtsi
> > index 4640dafb1598..92794b942ab2 100644
> > --- a/arch/arm/boot/dts/st/stm32mp153.dtsi
> > +++ b/arch/arm/boot/dts/st/stm32mp153.dtsi
> > @@ -40,6 +40,7 @@ m_can1: can@4400e000 {
> >   		interrupt-names = "int0", "int1";
> >   		clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
> >   		clock-names = "hclk", "cclk";
> > +		resets = <&rcc FDCAN_R>;
> >   		bosch,mram-cfg = <0x0 0 0 32 0 0 2 2>;
> >   		access-controllers = <&etzpc 62>;
> >   		status = "disabled";
> > @@ -54,6 +55,7 @@ m_can2: can@4400f000 {
> >   		interrupt-names = "int0", "int1";
> >   		clocks = <&rcc CK_HSE>, <&rcc FDCAN_K>;
> >   		clock-names = "hclk", "cclk";
> > +		resets = <&rcc FDCAN_R>;
> >   		bosch,mram-cfg = <0x1400 0 0 32 0 0 2 2>;
> >   		access-controllers = <&etzpc 62>;
> >   		status = "disabled";
> > 
> 
> How those reset are handled at driver side ?

I've created a patch that adds a shared reset to the m_can driver:

| https://lore.kernel.org/all/20250812-m_can-fix-state-handling-v1-7-b739e06c0a3b@pengutronix.de/

The reset is de-asserted during probe and when the interface does up,
otherwise it asserted. This way the IP gets reset only when both
interfaces are down.

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: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-09-03 15:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07  6:09 [PATCH v2 0/2] can: m_can: document and add external reset Marc Kleine-Budde
2025-08-07  6:09 ` [PATCH v2 1/2] dt-binding: can: m_can: add optional resets property Marc Kleine-Budde
2025-08-07 16:13   ` Conor Dooley
2025-08-07  6:09 ` [PATCH v2 2/2] ARM: dts: stm32: add resets property to m_can nodes in the stm32mp153 Marc Kleine-Budde
2025-09-03 13:10   ` Alexandre TORGUE
2025-09-03 15:16     ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).