Skip to contentSkip to conversation

arm: dts: syscon based reboot in DT

PATCH In review Jon Mason 2 participants 5 messages Jun 28, 2016

Subsystems (2)
lore
Share & tools
lore

Jon Mason

author
#0 lore raw

cover arm: dts: syscon based reboot in DT

Splitting off the bcm5301x reset device tree changes from the patch
series (originally sent on http://lists.infradead.org/pipermail/linux-arm-kernel/2015-December/395155.html
and resent on https://lkml.org/lkml/2016/5/11/953) and adding a
Northstar Plus reset device tree change.

I'd like to get Arnd's ack/nack on these, as I am uncertain if I am doing the correct thing based on the last email from him. Per my comment in the original email thread:

The CRU (Clock and Reset Unit) starts at 0x1800c100, with the following layout:

CRU Clock Management at 0x1800c100-0x1800c180
CRU Reset at 0x1800c184
CRU Period Sample Clock at 0x1800c188
CRU Interrupt register at 0x1800c18c
CRU MDIO Control at 0x1800c190
CRU GPIO at 0x1800c1c0-0x1800c1e0
CRU SDIO 0x1800c200-0x1800c214
CRU RoboSW Interrupt at 0x1800c280
CRU Straps Control at 0x1800c2a0

The clock driver is already referencing the registers between 0x1800c100-0x1800c180, and the GPIO driver is referencing registers between 0x1800c1c0-0x1800c1e0.

The reset part of the syscon seems to be the only useful thing in this block.

So, are these patches acceptable given those constrains or am I better off doing a reset driver that is more or less identical to syscon-reboot?

Thanks,
Jon

Jon Mason (2):
arm: dts: bcm5301x: Add syscon based reboot in DT
arm: dts: nsp: Add syscon based reboot in DT

 arch/arm/boot/dts/bcm-nsp.dtsi  | 12 ++++++++++++
 arch/arm/boot/dts/bcm5301x.dtsi | 12 ++++++++++++
 2 files changed, 24 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/2 arm: dts: bcm5301x: Add syscon based reboot in DT

From: Jon Mason <[email protected]>

Add the ability to reboot via a reset of the processor. This is achieved via a write of 0x39 to the CRU Reset Register. Unfortunately, this only resets the core and not the other IP blocks. So if possible, other methods should be used on the individual boards.

---
 arch/arm/boot/dts/bcm5301x.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/bcm5301x.dtsi +12 -0
index 7d4d29b..f878d0d 100644
@@ -260,6 +260,18 @@
 				     "sata2";
 	};
 
+	cru: system-controller at 1800c184 {
+		compatible = "brcm,bcm53010-cru", "syscon";
+		reg = <0x1800c184 0x4>;
+	};
+
+	reboot at 1800c184 {
+		compatible ="syscon-reboot";
+		regmap = <&cru>;
+		offset = <0>;
+		mask = <0x39>;
+	};
+
 	nand: nand at 18028000 {
 		compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1", "brcm,brcmnand";
 		reg = <0x18028000 0x600>, <0x1811a408 0x600>, <0x18028f00 0x20>;
Signature · 1 line
1.9.1
author
#4 lore raw

PATCH 2/2 arm: dts: nsp: Add syscon based reboot in DT

In reply to Jon Mason

From: Jon Mason <[email protected]>

Add the ability to reboot via a reset of the processor. This is achieved via a write of 0x2f9 to the CRU Reset Register. Unfortunately, this only resets the core and not the other IP blocks. So if possible, other methods should be used on the individual boards.

---
 arch/arm/boot/dts/bcm-nsp.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/bcm-nsp.dtsi +12 -0
index 1759e65..d56166b 100644
@@ -266,6 +266,18 @@
 			      <0x30028 0x04>,
 			      <0x3f408 0x04>;
 		};
+
+		cru: system-controller at 3f184 {
+			compatible = "brcm,nsp-cru", "syscon";
+			reg = <0x3f184 0x4>;
+		};
+
+		reboot: reboot at 3f184 {
+			compatible ="syscon-reboot";
+			regmap = <&cru>;
+			offset = <0>;
+			mask = <0x2f9>;
+		};
 	};
 
 	pcie0: pcie at 18012000 {
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 1/2] arm: dts: bcm5301x: Add syscon based reboot in DT

In reply to Jon Mason
Quoted 6 lines · Jon Mason

From: Jon Mason <[email protected]>

Add the ability to reboot via a reset of the processor. This is achieved via a write of 0x39 to the CRU Reset Register. Unfortunately, this only resets the core and not the other IP blocks. So if possible, other methods should be used on the individual boards.

Is it possible to force a watchdog reset instead for reboot?

Quoted 30 lines
---
  arch/arm/boot/dts/bcm5301x.dtsi | 12 ++++++++++++
  1 file changed, 12 insertions(+)
arch/arm/boot/dts/bcm5301x.dtsi +12 -0
index 7d4d29b..f878d0d 100644
@@ -260,6 +260,18 @@
  				     "sata2";
  	};
 
+	cru: system-controller at 1800c184 {
+		compatible = "brcm,bcm53010-cru", "syscon";
+		reg = <0x1800c184 0x4>;
+	};
+
+	reboot at 1800c184 {
+		compatible ="syscon-reboot";
+		regmap = <&cru>;
+		offset = <0>;
+		mask = <0x39>;
+	};
+
  	nand: nand at 18028000 {
  		compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1", "brcm,brcmnand";
  		reg = <0x18028000 0x600>, <0x1811a408 0x600>, <0x18028f00 0x20>;
author
#3 lore raw

Re: [PATCH 1/2] arm: dts: bcm5301x: Add syscon based reboot in DT

Quoted 4 lines · Scott Branden
Quoted 1 line · Jon Mason
Quoted 8 lines
Quoted 6 lines

From: Jon Mason <[email protected]>

Add the ability to reboot via a reset of the processor. This is achieved via a write of 0x39 to the CRU Reset Register. Unfortunately, this only resets the core and not the other IP blocks. So if possible, other methods should be used on the individual boards.

Is it possible to force a watchdog reset instead for reboot?

There is a "Power Watchdog" in both NS and NSP (and possibly others). This isn't a working driver to test, but it might be possible to use that to reset the system if the syscon and a unique NS/NSP reset driver are not acceptable solutions.

Quoted 34 lines
Quoted 33 lines
---
  arch/arm/boot/dts/bcm5301x.dtsi | 12 ++++++++++++
  1 file changed, 12 insertions(+)
arch/arm/boot/dts/bcm5301x.dtsi +12 -0
index 7d4d29b..f878d0d 100644
@@ -260,6 +260,18 @@
                                     "sata2";
        };
 
+       cru: system-controller at 1800c184 {
+               compatible = "brcm,bcm53010-cru", "syscon";
+               reg = <0x1800c184 0x4>;
+       };
+
+       reboot at 1800c184 {
+               compatible ="syscon-reboot";
+               regmap = <&cru>;
+               offset = <0>;
+               mask = <0x39>;
+       };
+
        nand: nand at 18028000 {
                compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1",
 "brcm,brcmnand";
                reg = <0x18028000 0x600>, <0x1811a408 0x600>, <0x18028f00

0x20>;