devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f7 series
@ 2022-02-09 10:48 Fabrice Gasnier
  2022-02-09 10:48 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2022-02-09 10:48 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/

 arch/arm/boot/dts/stm32746g-eval.dts  | 12 +++++++++
 arch/arm/boot/dts/stm32f746-disco.dts | 12 +++++++++
 arch/arm/boot/dts/stm32f746.dtsi      | 47 -----------------------------------
 arch/arm/boot/dts/stm32f769-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 stm32f7 series
  2022-02-09 10:48 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f7 series Fabrice Gasnier
@ 2022-02-09 10:48 ` Fabrice Gasnier
  2022-02-09 10:48 ` [PATCH 2/2] ARM: dts: stm32: remove timer5 " Fabrice Gasnier
  2022-02-14 10:11 ` [PATCH 0/2] ARM: dts: stm32: remove timer " Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2022-02-09 10:48 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 STM32F7 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/stm32f746.dtsi | 40 ----------------------------------------
 1 file changed, 40 deletions(-)

diff --git a/arch/arm/boot/dts/stm32f746.dtsi b/arch/arm/boot/dts/stm32f746.dtsi
index 014b416..a4f5c6a 100644
--- a/arch/arm/boot/dts/stm32f746.dtsi
+++ b/arch/arm/boot/dts/stm32f746.dtsi
@@ -75,14 +75,6 @@
 	};
 
 	soc {
-		timer2: timer@40000000 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000000 0x400>;
-			interrupts = <28>;
-			clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM2)>;
-			status = "disabled";
-		};
-
 		timers2: timers@40000000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -105,14 +97,6 @@
 			};
 		};
 
-		timer3: timer@40000400 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000400 0x400>;
-			interrupts = <29>;
-			clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM3)>;
-			status = "disabled";
-		};
-
 		timers3: timers@40000400 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -135,14 +119,6 @@
 			};
 		};
 
-		timer4: timer@40000800 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000800 0x400>;
-			interrupts = <30>;
-			clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM4)>;
-			status = "disabled";
-		};
-
 		timers4: timers@40000800 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -194,14 +170,6 @@
 			};
 		};
 
-		timer6: timer@40001000 {
-			compatible = "st,stm32-timer";
-			reg = <0x40001000 0x400>;
-			interrupts = <54>;
-			clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM6)>;
-			status = "disabled";
-		};
-
 		timers6: timers@40001000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -218,14 +186,6 @@
 			};
 		};
 
-		timer7: timer@40001400 {
-			compatible = "st,stm32-timer";
-			reg = <0x40001400 0x400>;
-			interrupts = <55>;
-			clocks = <&rcc 0 STM32F7_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 stm32f7 series
  2022-02-09 10:48 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f7 series Fabrice Gasnier
  2022-02-09 10:48 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
@ 2022-02-09 10:48 ` Fabrice Gasnier
  2022-02-14 10:11 ` [PATCH 0/2] ARM: dts: stm32: remove timer " Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Fabrice Gasnier @ 2022-02-09 10:48 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 stm32f7 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 stm32f746.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/stm32746g-eval.dts  | 12 ++++++++++++
 arch/arm/boot/dts/stm32f746-disco.dts | 12 ++++++++++++
 arch/arm/boot/dts/stm32f746.dtsi      |  7 -------
 arch/arm/boot/dts/stm32f769-disco.dts | 12 ++++++++++++
 4 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/stm32746g-eval.dts b/arch/arm/boot/dts/stm32746g-eval.dts
index 327613f..a293e651 100644
--- a/arch/arm/boot/dts/stm32746g-eval.dts
+++ b/arch/arm/boot/dts/stm32746g-eval.dts
@@ -194,6 +194,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;
+};
+
 &usart1 {
 	pinctrl-0 = <&usart1_pins_a>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f746-disco.dts b/arch/arm/boot/dts/stm32f746-disco.dts
index 569d23c..c11616e 100644
--- a/arch/arm/boot/dts/stm32f746-disco.dts
+++ b/arch/arm/boot/dts/stm32f746-disco.dts
@@ -109,6 +109,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;
+};
+
 &usart1 {
 	pinctrl-0 = <&usart1_pins_b>;
 	pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/stm32f746.dtsi b/arch/arm/boot/dts/stm32f746.dtsi
index a4f5c6a..dc868e6 100644
--- a/arch/arm/boot/dts/stm32f746.dtsi
+++ b/arch/arm/boot/dts/stm32f746.dtsi
@@ -141,13 +141,6 @@
 			};
 		};
 
-		timer5: timer@40000c00 {
-			compatible = "st,stm32-timer";
-			reg = <0x40000c00 0x400>;
-			interrupts = <50>;
-			clocks = <&rcc 0 STM32F7_APB1_CLOCK(TIM5)>;
-		};
-
 		timers5: timers@40000c00 {
 			#address-cells = <1>;
 			#size-cells = <0>;
diff --git a/arch/arm/boot/dts/stm32f769-disco.dts b/arch/arm/boot/dts/stm32f769-disco.dts
index be943b7..b038d0e 100644
--- a/arch/arm/boot/dts/stm32f769-disco.dts
+++ b/arch/arm/boot/dts/stm32f769-disco.dts
@@ -137,6 +137,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;
+};
+
 &usart1 {
 	pinctrl-0 = <&usart1_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 stm32f7 series
  2022-02-09 10:48 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f7 series Fabrice Gasnier
  2022-02-09 10:48 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
  2022-02-09 10:48 ` [PATCH 2/2] ARM: dts: stm32: remove timer5 " Fabrice Gasnier
@ 2022-02-14 10:11 ` Alexandre TORGUE
  2 siblings, 0 replies; 4+ messages in thread
From: Alexandre TORGUE @ 2022-02-14 10:11 UTC (permalink / raw)
  To: Fabrice Gasnier, robh+dt
  Cc: olivier.moysan, devicetree, linux-arm-kernel, linux-kernel,
	linux-stm32

Hi Fabrice

On 2/9/22 11:48, 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/
> 
>   arch/arm/boot/dts/stm32746g-eval.dts  | 12 +++++++++
>   arch/arm/boot/dts/stm32f746-disco.dts | 12 +++++++++
>   arch/arm/boot/dts/stm32f746.dtsi      | 47 -----------------------------------
>   arch/arm/boot/dts/stm32f769-disco.dts | 12 +++++++++
>   4 files changed, 36 insertions(+), 47 deletions(-)
> 

Series applied on stm32-next.

Cheers
Alex

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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-09 10:48 [PATCH 0/2] ARM: dts: stm32: remove timer duplicate unit-address on stm32f7 series Fabrice Gasnier
2022-02-09 10:48 ` [PATCH 1/2] ARM: dts: stm32: remove some " Fabrice Gasnier
2022-02-09 10:48 ` [PATCH 2/2] ARM: dts: stm32: remove timer5 " Fabrice Gasnier
2022-02-14 10:11 ` [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).