AM62x watchdog support
Subsystems (2)
v3 cover AM62x watchdog support
This patch series adds support for AM62x watchdog.
Changes since v0:
- Mark MCU & WKUP watchdogs as reserved
Changes since v1:
- Rebase patch to v6.1-rc3
Changes since v2:
- Rebase patch to v6.1-rc4
- Moved wkup_rti0 status ('reserved') into 'k3-am62-wakeup.dtsi'
Julien Panis (2):
arm64: dts: ti: k3-am62: add watchdog nodes
arm64: dts: ti: k3-am625-sk: mark MCU watchdog as reserved
arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 45 ++++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 9 +++++ arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi | 11 ++++++ arch/arm64/boot/dts/ti/k3-am625-sk.dts | 5 +++ 4 files changed, 70 insertions(+)
base-commit: f0c4d9fc9cc9462659728d168387191387e903cc
Signature · 1 line
2.37.3
PATCH v3 1/2 arm64: dts: ti: k3-am62: add watchdog nodes
Add nodes for watchdogs :
- 5 in main domain
- 1 in MCU domain
- 1 in wakeup domain
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 45 ++++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 9 +++++ arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi | 11 ++++++ 3 files changed, 65 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +45 -0
@@ -591,6 +591,51 @@ main_mcan0: can@20701000 { bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; }; + main_rti0: watchdog@e000000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x00 0x0e000000 0x00 0x100>; + clocks = <&k3_clks 125 0>; + power-domains = <&k3_pds 125 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 125 0>; + assigned-clock-parents = <&k3_clks 125 2>; + }; + + main_rti1: watchdog@e010000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x00 0x0e010000 0x00 0x100>; + clocks = <&k3_clks 126 0>; + power-domains = <&k3_pds 126 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 126 0>; + assigned-clock-parents = <&k3_clks 126 2>; + }; + + main_rti2: watchdog@e020000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x00 0x0e020000 0x00 0x100>; + clocks = <&k3_clks 127 0>; + power-domains = <&k3_pds 127 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 127 0>; + assigned-clock-parents = <&k3_clks 127 2>; + }; + + main_rti3: watchdog@e030000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x00 0x0e030000 0x00 0x100>; + clocks = <&k3_clks 128 0>; + power-domains = <&k3_pds 128 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 128 0>; + assigned-clock-parents = <&k3_clks 128 2>; + }; + + main_rti15: watchdog@e0f0000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x00 0x0e0f0000 0x00 0x100>; + clocks = <&k3_clks 130 0>; + power-domains = <&k3_pds 130 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 130 0>; + assigned-clock-parents = <&k3_clks 130 2>; + }; + epwm0: pwm@23000000 { compatible = "ti,am64-epwm", "ti,am3352-ehrpwm"; #pwm-cells = <3>;
arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi +9 -0
@@ -81,4 +81,13 @@ mcu_gpio0: gpio@4201000 { clocks = <&k3_clks 79 0>; clock-names = "gpio"; }; + + mcu_rti0: watchdog@4880000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x00 0x04880000 0x00 0x100>; + clocks = <&k3_clks 131 0>; + power-domains = <&k3_pds 131 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 131 0>; + assigned-clock-parents = <&k3_clks 131 2>; + }; };
arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi +11 -0
@@ -38,4 +38,15 @@ wkup_i2c0: i2c@2b200000 { clocks = <&k3_clks 107 4>; clock-names = "fck"; }; + + wkup_rti0: watchdog@2b000000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x00 0x2b000000 0x00 0x100>; + clocks = <&k3_clks 132 0>; + power-domains = <&k3_pds 132 TI_SCI_PD_EXCLUSIVE>; + assigned-clocks = <&k3_clks 132 0>; + assigned-clock-parents = <&k3_clks 132 2>; + /* WKUP RTI0 is used by DM firmware */ + status = "reserved"; + }; };
Signature · 1 line
2.37.3
PATCH v3 2/2 arm64: dts: ti: k3-am625-sk: mark MCU watchdog as reserved
In reply to Julien PanisMCU wdt is typically used by M4F.
--- arch/arm64/boot/dts/ti/k3-am625-sk.dts | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/ti/k3-am625-sk.dts +5 -0
@@ -503,6 +503,11 @@ &main_mcan0 { status = "disabled"; }; +&mcu_rti0 { + /* MCU RTI0 is used by M4F firmware */ + status = "reserved"; +}; + &epwm0 { status = "disabled"; };
Signature · 1 line
2.37.3
Re: [PATCH v3 2/2] arm64: dts: ti: k3-am625-sk: mark MCU watchdog as reserved
Quoted 2 lines · Julien Panis
MCU wdt is typically used by M4F.
See it's this "typically" part I'm concerned about.
It depends on the firmware which peripherals will be used. The firmware doesn't communicate this to Linux, and Linux doesn't give the firmware permissions to use one of these peripherals.
We only keep from stepping on the firmware by changing device tree to never use peripherals that are often used by firmware, and that is not a hardware description, nor complete when a remote core firmware can use any device in our systems.
What happens when I change firmware? How do we power sequence this? Who controls the clocks and clock parents if shared for this peripheral?
I'm thinking we can used something like "application nodes"[0] here. These are basically DT nodes for a specific firmware application. The nodes describe the firmware and all hardware it uses (in the linked example, the remote core to run on, DMAs, SRAM, PHYs). All these devices are under exclusive control of the application node. So while Linux will still handle power/clock/state control, no driver will be bound. This also handles the power sequencing question above, sub-devices need to be active before starting the firmware, and firmware needs to go down before the controlled peripherals.
These nodes could be loaded/unloaded as DT overlays, along with the firmware. So resources are only "reserved" for firmware when the firmware is actually active.
Thoughts?
Andrew
[0] https://www.spinics.net/lists/netdev/msg823883.html
Quoted 21 lines
Signed-off-by Julien Panis <[email protected]>--- arch/arm64/boot/dts/ti/k3-am625-sk.dts | 5 +++++ 1 file changed, 5 insertions(+)arch/arm64/boot/dts/ti/k3-am625-sk.dts +5
-0@@ -503,6 +503,11 @@ &main_mcan0 { status = "disabled"; }; +&mcu_rti0 { + /* MCU RTI0 is used by M4F firmware */ + status = "reserved"; +}; + &epwm0 { status = "disabled"; };