ARM: bcm2835: implement machine restart hook
Subsystems (6)
PATCH 1/1 ARM: bcm2835: implement machine restart hook
Implement the machine restart hook using the SoC's watchdog timer module. To support this, define a DT binding for the watchdog module, and add it to the device tree.
The downstream rpi-split branch contains a full watchdog timer driver implementation, which also implements the restart hook. However, the restart function is largely separate from the watchdog driver, so for simplicity, the restart hook is implemented here directly in the main machine source file.
Overall structure (separate setup/restart) functions derived from the picoxcell ARM support.
Watchdog register IO sequence taken from code by Simon Arlott. Note that the watchdog module is not documented in BCM2835-ARM-Peripherals.pdf.
--- .../bindings/watchdog/brcm,bcm2835-pm-wdog.txt | 13 ++++++ arch/arm/boot/dts/bcm2835.dtsi | 5 +++ arch/arm/mach-bcm2835/bcm2835.c | 46 ++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt
Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt new file +13 -0
@@ -0,0 +1,13 @@ +BCM2835 Watchdog timer + +Required properties: + +- compatible : should be "brcm,bcm2835-pm-wdog" +- reg : Specifies base physical address and size of the registers. + +Example: + +intc: interrupt-controller { + compatible = "brcm,bcm2835-pm-wdog"; + reg = <0x7e100000 0x28>; +};
arch/arm/boot/dts/bcm2835.dtsi +5 -0
@@ -29,6 +29,11 @@ #interrupt-cells = <2>; }; + watchdog { + compatible = "brcm,bcm2835-pm-wdog"; + reg = <0x7e100000 0x28>; + }; + uart at 20201000 { compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell"; reg = <0x7e201000 0x1000>;
arch/arm/mach-bcm2835/bcm2835.c +46 -0
71 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 1/1 ARM: bcm2835: implement machine restart hook
Stephen,
Quoted 1 line · Stephen Warren
+intc: interrupt-controller {
Isn't this a bizarre name for a watchdog device?
Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt line 13
Quoted 3 lines
Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt new file +3
-0+ compatible = "brcm,bcm2835-pm-wdog"; + reg = <0x7e100000 0x28>; +};
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/1 ARM: bcm2835: implement machine restart hook
Quoted 7 lines · Thomas Petazzoni
Stephen,
Quoted 1 line · Stephen Warren
+intc: interrupt-controller {
Isn't this a bizarre name for a watchdog device?
Yes, certainly! It looks like I only made this cut/paste mistake in the binding document, which is why the code actually worked...
Quoted 3 lines
Quoted 3 lines
Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt new file +3
-0+ compatible = "brcm,bcm2835-pm-wdog"; + reg = <0x7e100000 0x28>; +};
PATCH 1/1 ARM: bcm2835: implement machine restart hook
In reply to Stephen WarrenQuoted 31 lines · Stephen Warren
Implement the machine restart hook using the SoC's watchdog timer module. To support this, define a DT binding for the watchdog module, and add it to the device tree.
The downstream rpi-split branch contains a full watchdog timer driver implementation, which also implements the restart hook. However, the restart function is largely separate from the watchdog driver, so for simplicity, the restart hook is implemented here directly in the main machine source file.
Overall structure (separate setup/restart) functions derived from the picoxcell ARM support.
Watchdog register IO sequence taken from code by Simon Arlott. Note that the watchdog module is not documented in BCM2835-ARM-Peripherals.pdf.
Signed-off-by Stephen Warren <[email protected]>--- .../bindings/watchdog/brcm,bcm2835-pm-wdog.txt | 13 ++++++ arch/arm/boot/dts/bcm2835.dtsi | 5 +++ arch/arm/mach-bcm2835/bcm2835.c | 46 ++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txtDocumentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt new file +1
-0@@ -0,0 +1,13 @@ +BCM2835 Watchdog timer
Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt new file +10
-0+ +Required properties: + +- compatible : should be "brcm,bcm2835-pm-wdog" +- reg : Specifies base physical address and size of the registers. + +Example: + +intc: interrupt-controller { + compatible = "brcm,bcm2835-pm-wdog";
it's seems everyone use -wdt
Best Regards,
J.
PATCH 1/1 ARM: bcm2835: implement machine restart hook
Quoted 11 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Stephen Warren
Implement the machine restart hook using the SoC's watchdog timer module. To support this, define a DT binding for the watchdog module, and add it to the device tree.
The downstream rpi-split branch contains a full watchdog timer driver implementation, which also implements the restart hook. However, the restart function is largely separate from the watchdog driver, so for simplicity, the restart hook is implemented here directly in the main machine source file.
Quoted 8 lines
Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt line 11
Quoted 6 lines
+++
b/Documentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txtDocumentation/devicetree/bindings/watchdog/brcm,bcm2835-pm-wdog.txt new file +4
-0+Example: + +intc: interrupt-controller { + compatible = "brcm,bcm2835-pm-wdog";it's seems everyone use -wdt
That is true. "-wdog" is what was in the downstream patch, but I guess it makes sense to fix it up to be consistent with everything already in the kernel.
Stephen Warren
AppliedPATCH 1/1 ARM: bcm2835: implement machine restart hook
In reply to Stephen WarrenQuoted 10 lines · Stephen Warren
Implement the machine restart hook using the SoC's watchdog timer module. To support this, define a DT binding for the watchdog module, and add it to the device tree.
The downstream rpi-split branch contains a full watchdog timer driver implementation, which also implements the restart hook. However, the restart function is largely separate from the watchdog driver, so for simplicity, the restart hook is implemented here directly in the main machine source file.
Quoted 5 lines
Overall structure (separate setup/restart) functions derived from the picoxcell ARM support.
Watchdog register IO sequence taken from code by Simon Arlott. Note that the watchdog module is not documented in BCM2835-ARM-Peripherals.pdf.
Applied to rpi's for-3.8/soc branch.