linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f4 series
@ 2021-12-08 10:33 Fabrice Gasnier
  2021-12-08 10:33 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2021-12-08 10:33 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt
  Cc: olivier.moysan, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Remove a series of warnings seen when building with W=1, like:
Warning (unique_unit_address): /soc/timer@40000c00: duplicate unit-address
(also used in node /soc/timers@40000c00)

This approach is based on some discussions[1], to restructure the dtsi
and dts files.
[1] https://lore.kernel.org/linux-arm-kernel/Yaf4jiZIp8+ndaXs@robh.at.kernel.org/

Fabrice Gasnier (2):
  ARM: dts: stm32: remove some timer duplicate unit-address on stm32f4
    series
  ARM: dts: stm32: remove timer5 duplicate unit-address on stm32f4
    series

 arch/arm/boot/dts/stm32429i-eval.dts  | 12 +++++++++
 arch/arm/boot/dts/stm32f429-disco.dts | 12 +++++++++
 arch/arm/boot/dts/stm32f429.dtsi      | 47 -----------------------------------
 arch/arm/boot/dts/stm32f469-disco.dts | 12 +++++++++
 4 files changed, 36 insertions(+), 47 deletions(-)

-- 
2.7.4


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

* [PATCH 1/2] ARM: dts: stm32: remove some timer duplicate unit-address on stm32f4 series
  2021-12-08 10:33 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f4 series Fabrice Gasnier
@ 2021-12-08 10:33 ` Fabrice Gasnier
  2021-12-08 10:33 ` [PATCH 2/2] ARM: dts: stm32: remove timer5 " Fabrice Gasnier
  2022-02-07  9:15 ` [PATCH 0/2] ARM: dts: stm32: remove timer " Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2021-12-08 10:33 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt
  Cc: olivier.moysan, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Several unused "timer" are duplicate nodes of "timers" nodes.
There are two dt-schemas:
- timer/st,stm32-timer.yaml: A timer is needed on STM32F4 series, on all
  boards, to act as clockevent.
- mfd/st,stm32-timers.yaml: Timers can be used for other purpose.

By default, timer5 is left enabled to be used as clockevent. Remove all
other timer clockevent nodes that are currently unused and duplicated.

This removes several messages: Warning (unique_unit_address): /soc/timer@..
duplicate unit-address (also used in node /soc/timers@...)

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32f429.dtsi | 40 ----------------------------------------
 1 file changed, 40 deletions(-)

diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi
index 8748d58..f21b322 100644
--- a/arch/arm/boot/dts/stm32f429.dtsi
+++ b/arch/arm/boot/dts/stm32f429.dtsi
@@ -93,14 +93,6 @@
 			};
 		};
 
-		timer2: timer@40000000 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000000 0x400>;
-			interrupts = <28>;
-			clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM2)>;
-			status = "disabled";
-		};
-
 		timers2: timers@40000000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -123,14 +115,6 @@
 			};
 		};
 
-		timer3: timer@40000400 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000400 0x400>;
-			interrupts = <29>;
-			clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM3)>;
-			status = "disabled";
-		};
-
 		timers3: timers@40000400 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -153,14 +137,6 @@
 			};
 		};
 
-		timer4: timer@40000800 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000800 0x400>;
-			interrupts = <30>;
-			clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM4)>;
-			status = "disabled";
-		};
-
 		timers4: timers@40000800 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -212,14 +188,6 @@
 			};
 		};
 
-		timer6: timer@40001000 {
-			compatible = "st,stm32-timer";
-			reg = <0x40001000 0x400>;
-			interrupts = <54>;
-			clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM6)>;
-			status = "disabled";
-		};
-
 		timers6: timers@40001000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -236,14 +204,6 @@
 			};
 		};
 
-		timer7: timer@40001400 {
-			compatible = "st,stm32-timer";
-			reg = <0x40001400 0x400>;
-			interrupts = <55>;
-			clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM7)>;
-			status = "disabled";
-		};
-
 		timers7: timers@40001400 {
 			#address-cells = <1>;
 			#size-cells = <0>;
-- 
2.7.4


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

* [PATCH 2/2] ARM: dts: stm32: remove timer5 duplicate unit-address on stm32f4 series
  2021-12-08 10:33 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f4 series Fabrice Gasnier
  2021-12-08 10:33 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
@ 2021-12-08 10:33 ` Fabrice Gasnier
  2022-02-07  9:15 ` [PATCH 0/2] ARM: dts: stm32: remove timer " Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2021-12-08 10:33 UTC (permalink / raw)
  To: alexandre.torgue, robh+dt
  Cc: olivier.moysan, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32, fabrice.gasnier

Remove the following warnings seen when building with W=1.
Warning (unique_unit_address): /soc/timer@40000c00: duplicate unit-address
(also used in node /soc/timers@40000c00)
This approach is based on some discussions[1], to restructure the dtsi
and dts files.

Timer5 is enabled by default on stm32f4 series, to act as clockevent. In
order to get rid of the W=1 warning, and be compliant with dt-schemas
(e.g. dtbs_check):
- In stm32f429.dtsi:
  . Keep the more complete timers5 description
  . Remove the most simple timer5 node that is duplicate
- In each board:
  . adopt "st,stm32-timer" compatible for timers5, also add the interrupt
  . use /delete-property/ and /delete-node/ so the it matches the
    clockevent bindings

Note: all this is done in one shot (e.g. not split) to keep clockevent
functionality.

[1] https://lore.kernel.org/linux-arm-kernel/Yaf4jiZIp8+ndaXs@robh.at.kernel.org/

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 arch/arm/boot/dts/stm32429i-eval.dts  | 12 ++++++++++++
 arch/arm/boot/dts/stm32f429-disco.dts | 12 ++++++++++++
 arch/arm/boot/dts/stm32f429.dtsi      |  7 -------
 arch/arm/boot/dts/stm32f469-disco.dts | 12 ++++++++++++
 4 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts
index cb46326..0d98aca 100644
--- a/arch/arm/boot/dts/stm32429i-eval.dts
+++ b/arch/arm/boot/dts/stm32429i-eval.dts
@@ -308,6 +308,18 @@
 	};
 };
 
+&timers5 {
+	/* Override timer5 to act as clockevent */
+	compatible = "st,stm32-timer";
+	interrupts = <50>;
+	status = "okay";
+	/delete-property/#address-cells;
+	/delete-property/#size-cells;
+	/delete-property/clock-names;
+	/delete-node/pwm;
+	/delete-node/timer@4;
+};
+
 &usart1 {
 	pinctrl-0 = <&usart1_pins_a>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f429-disco.dts b/arch/arm/boot/dts/stm32f429-disco.dts
index 075ac57..06a7091 100644
--- a/arch/arm/boot/dts/stm32f429-disco.dts
+++ b/arch/arm/boot/dts/stm32f429-disco.dts
@@ -205,6 +205,18 @@
 	};
 };
 
+&timers5 {
+	/* Override timer5 to act as clockevent */
+	compatible = "st,stm32-timer";
+	interrupts = <50>;
+	status = "okay";
+	/delete-property/#address-cells;
+	/delete-property/#size-cells;
+	/delete-property/clock-names;
+	/delete-node/pwm;
+	/delete-node/timer@4;
+};
+
 &usart1 {
 	pinctrl-0 = <&usart1_pins_a>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi
index f21b322..1723346 100644
--- a/arch/arm/boot/dts/stm32f429.dtsi
+++ b/arch/arm/boot/dts/stm32f429.dtsi
@@ -159,13 +159,6 @@
 			};
 		};
 
-		timer5: timer@40000c00 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000c00 0x400>;
-			interrupts = <50>;
-			clocks = <&rcc 0 STM32F4_APB1_CLOCK(TIM5)>;
-		};
-
 		timers5: timers@40000c00 {
 			#address-cells = <1>;
 			#size-cells = <0>;
diff --git a/arch/arm/boot/dts/stm32f469-disco.dts b/arch/arm/boot/dts/stm32f469-disco.dts
index 30905ce6..cac3a67 100644
--- a/arch/arm/boot/dts/stm32f469-disco.dts
+++ b/arch/arm/boot/dts/stm32f469-disco.dts
@@ -224,6 +224,18 @@
 	bus-width = <4>;
 };
 
+&timers5 {
+	/* Override timer5 to act as clockevent */
+	compatible = "st,stm32-timer";
+	interrupts = <50>;
+	status = "okay";
+	/delete-property/#address-cells;
+	/delete-property/#size-cells;
+	/delete-property/clock-names;
+	/delete-node/pwm;
+	/delete-node/timer@4;
+};
+
 &usart3 {
 	pinctrl-0 = <&usart3_pins_a>;
 	pinctrl-names = "default";
-- 
2.7.4


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

* Re: [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f4 series
  2021-12-08 10:33 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f4 series Fabrice Gasnier
  2021-12-08 10:33 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
  2021-12-08 10:33 ` [PATCH 2/2] ARM: dts: stm32: remove timer5 " Fabrice Gasnier
@ 2022-02-07  9:15 ` Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre TORGUE @ 2022-02-07  9:15 UTC (permalink / raw)
  To: Fabrice Gasnier, robh+dt
  Cc: olivier.moysan, devicetree, linux-arm-kernel, linux-kernel, linux-stm32

Hi Fabrice

On 12/8/21 11:33, Fabrice Gasnier wrote:
> Remove a series of warnings seen when building with W=1, like:
> Warning (unique_unit_address): /soc/timer@40000c00: duplicate unit-address
> (also used in node /soc/timers@40000c00)
> 
> This approach is based on some discussions[1], to restructure the dtsi
> and dts files.
> [1] https://lore.kernel.org/linux-arm-kernel/Yaf4jiZIp8+ndaXs@robh.at.kernel.org/
> 
> Fabrice Gasnier (2):
>    ARM: dts: stm32: remove some timer duplicate unit-address on stm32f4
>      series
>    ARM: dts: stm32: remove timer5 duplicate unit-address on stm32f4
>      series
> 
>   arch/arm/boot/dts/stm32429i-eval.dts  | 12 +++++++++
>   arch/arm/boot/dts/stm32f429-disco.dts | 12 +++++++++
>   arch/arm/boot/dts/stm32f429.dtsi      | 47 -----------------------------------
>   arch/arm/boot/dts/stm32f469-disco.dts | 12 +++++++++
>   4 files changed, 36 insertions(+), 47 deletions(-)
> 

Series applied on stm32-next.

Thanks
Alex

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

end of thread, other threads:[~2022-02-07 10:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 10:33 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f4 series Fabrice Gasnier
2021-12-08 10:33 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
2021-12-08 10:33 ` [PATCH 2/2] ARM: dts: stm32: remove timer5 " Fabrice Gasnier
2022-02-07  9:15 ` [PATCH 0/2] ARM: dts: stm32: remove timer " Alexandre TORGUE

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).