Skip to contentSkip to conversation

Switch to generic syscon regmap based drivers

PATCH New Alim Akhtar 3 participants 9 messages Nov 20, 2015 – Dec 2, 2015

Subsystems (4)
lore
Share & tools
lore

Alim Akhtar

author reviewer
#0 lore raw

v3 cover Switch to generic syscon regmap based drivers

Now we have a nice way to reboot/poweroff system using a generic syscon regmap based drivers, this series moves exynos SoCs to make use of the same.

Changes since v2:
* Merged patch 5 and 6 to keep git bisect happy

Changes since v1:
* Added a comment about the register information
* Droped defconfig changes as disscussed
* Collected various Reviewed-by, Tested-by and Acked-by tags
* Added SYSCON-{RESET, POWEROFF} to select from Kconfig

Alim Akhtar (5):
arm: dts: Add syscon-{reboot, poweroff} nodes for exynos3250 SoCs
arm: dts: Add syscon-{reboot, poweroff} nodes for exynos4
arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5
arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5410 SoC
ARM: exynos: select POWER_RESET_SYSCON and
POWER_RESET_SYSCON_POWEROFF

 arch/arm/boot/dts/exynos3250.dtsi |   14 ++++++++++++
 arch/arm/boot/dts/exynos4.dtsi    |   14 ++++++++++++
 arch/arm/boot/dts/exynos5.dtsi    |   14 ++++++++++++
 arch/arm/boot/dts/exynos5410.dtsi |   14 ++++++++++++
 arch/arm/mach-exynos/Kconfig      |    3 +++
 arch/arm/mach-exynos/pmu.c        |   43 -------------------------------------
 6 files changed, 59 insertions(+), 43 deletions(-)
Signature · 1 line
1.7.10.4
author reviewer
#1 lore raw

PATCH v3 1/5 arm: dts: Add syscon-{reboot, poweroff} nodes for exynos3250 SoCs

This patch adds syscon-{reboot, poweroff} nodes to allow the generic syscon-{reboot, poweroff} driver to reset/poweroff exynos3250 SoC.

---
 arch/arm/boot/dts/exynos3250.dtsi |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/exynos3250.dtsi +14 -0
index 2f30d632f1cc..18e3deffbf48 100644
@@ -152,6 +152,20 @@
 			interrupt-parent = <&gic>;
 		};
 
+		poweroff: syscon-poweroff {
+			compatible = "syscon-poweroff";
+			regmap = <&pmu_system_controller>;
+			offset = <0x330C>; /* PS_HOLD_CONTROL */
+			mask = <0x5200>; /* Reset value */
+		};
+
+		reboot: syscon-reboot {
+			compatible = "syscon-reboot";
+			regmap = <&pmu_system_controller>;
+			offset = <0x0400>; /* SWRESET */
+			mask = <0x1>;
+		};
+
 		mipi_phy: video-phy at 10020710 {
 			compatible = "samsung,s5pv210-mipi-video-phy";
 			#phy-cells = <1>;
Signature · 1 line
1.7.10.4
author reviewer
#2 lore raw

PATCH v3 2/5 arm: dts: Add syscon-{reboot, poweroff} nodes for exynos4

In reply to Alim Akhtar

This patch adds syscon-{reboot, poweroff} nodes to allow the generic syscon-{reboot, poweroff} driver to reset/poweroff exynos4 SoC.

---
 arch/arm/boot/dts/exynos4.dtsi |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/exynos4.dtsi +14 -0
index 3184e10f260a..07e10ee60bd8 100644
@@ -158,6 +158,20 @@
 		interrupt-parent = <&gic>;
 	};
 
+	poweroff: syscon-poweroff {
+		compatible = "syscon-poweroff";
+		regmap = <&pmu_system_controller>;
+		offset = <0x330C>; /* PS_HOLD_CONTROL */
+		mask = <0x5200>; /* reset value */
+	};
+
+	reboot: syscon-reboot {
+		compatible = "syscon-reboot";
+		regmap = <&pmu_system_controller>;
+		offset = <0x0400>; /* SWRESET */
+		mask = <0x1>;
+	};
+
 	dsi_0: dsi at 11C80000 {
 		compatible = "samsung,exynos4210-mipi-dsi";
 		reg = <0x11C80000 0x10000>;
Signature · 1 line
1.7.10.4
author reviewer
#3 lore raw

PATCH v3 3/5 arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5

In reply to Alim Akhtar

This patch adds syscon-{reboot, poweroff} nodes to allow the generic syscon-{reboot, poweroff} driver to reset/poweroff exynos5 SoCs.

---
 arch/arm/boot/dts/exynos5.dtsi |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/exynos5.dtsi +14 -0
index 110dbd4fb884..e2439e87ee4a 100644
@@ -88,6 +88,20 @@
 		status = "disabled";
 	};
 
+	poweroff: syscon-poweroff {
+		compatible = "syscon-poweroff";
+		regmap = <&pmu_system_controller>;
+		offset = <0x330C>; /* PS_HOLD_CONTROL */
+		mask = <0x5200>; /* reset value */
+	};
+
+	reboot: syscon-reboot {
+		compatible = "syscon-reboot";
+		regmap = <&pmu_system_controller>;
+		offset = <0x0400>; /* SWRESET */
+		mask = <0x1>;
+	};
+
 	fimd: fimd at 14400000 {
 		compatible = "samsung,exynos5250-fimd";
 		interrupt-parent = <&combiner>;
Signature · 1 line
1.7.10.4
author reviewer
#4 lore raw

PATCH v3 4/5 arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5410 SoC

In reply to Alim Akhtar

This patch adds syscon-{reboot, poweroff} nodes to allow the generic syscon-{reboot, poweroff} driver to reset/poweroff exynos5410 SoC.

---
 arch/arm/boot/dts/exynos5410.dtsi |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/exynos5410.dtsi +14 -0
index 731eefd23fa9..fad0779b1b6e 100644
@@ -102,6 +102,20 @@
 			reg = <0x10040000 0x5000>;
 		};
 
+		poweroff: syscon-poweroff {
+			compatible = "syscon-poweroff";
+			regmap = <&pmu_system_controller>;
+			offset = <0x330C>; /* PS_HOLD_CONTROL */
+			mask = <0x5200>; /* reset value */
+		};
+
+		reboot: syscon-reboot {
+			compatible = "syscon-reboot";
+			regmap = <&pmu_system_controller>;
+			offset = <0x0400>; /* SWRESET */
+			mask = <0x1>;
+		};
+
 		mct: mct at 101C0000 {
 			compatible = "samsung,exynos4210-mct";
 			reg = <0x101C0000 0xB00>;
Signature · 1 line
1.7.10.4
author reviewer
#5 lore raw

PATCH v3 5/5 ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF

In reply to Alim Akhtar

Since we switch to use generic syscon regmap based reset/poweroff driver for exynos SoC, lets select it from ARCH_EXYNOS instead of enabling it from various defconfigs. This also select POWER_RESET as SYSCON-{reset, poweroff} drivers depends on it.

Also because of the above changes we don't need special handling for reboot/poweroff in exynos pmu driver. This patch also removes the same from exynos pmu driver to keep git bisect working.

Note: This will break reboot/poweroff on boards with older dtbs with a newer kernel.

---
 arch/arm/mach-exynos/Kconfig |    3 +++
 arch/arm/mach-exynos/pmu.c   |   43 ------------------------------------------
 2 files changed, 3 insertions(+), 43 deletions(-)
arch/arm/mach-exynos/Kconfig +3 -0
index 3a10f1a8317a..d279edf9b10d 100644
@@ -27,6 +27,9 @@ menuconfig ARCH_EXYNOS
 	select SRAM
 	select THERMAL
 	select MFD_SYSCON
+	select POWER_RESET
+	select POWER_RESET_SYSCON
+	select POWER_RESET_SYSCON_POWEROFF
 	help
 	  Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
 
arch/arm/mach-exynos/pmu.c +0 -43

78 lines not on this page · raw message

Signature · 1 line
1.7.10.4
#6 lore raw

PATCH v3 5/5 ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF

Quoted 12 lines · Alim Akhtar

Since we switch to use generic syscon regmap based reset/poweroff driver for exynos SoC, lets select it from ARCH_EXYNOS instead of enabling it from various defconfigs. This also select POWER_RESET as SYSCON-{reset, poweroff} drivers depends on it.

Also because of the above changes we don't need special handling for reboot/poweroff in exynos pmu driver. This patch also removes the same from exynos pmu driver to keep git bisect working.

Note: This will break reboot/poweroff on boards with older dtbs with a newer kernel.

Quoted 8 lines
---
 arch/arm/mach-exynos/Kconfig |    3 +++
 arch/arm/mach-exynos/pmu.c   |   43 ------------------------------------------
 2 files changed, 3 insertions(+), 43 deletions(-)

Thanks, applied with different title:
"ARM: EXYNOS: Switch to syscon reboot and poweroff"
https://git.kernel.org/cgit/linux/kernel/git/krzk/linux.git/log/?h=next/soc

I'll be pushing this to Kukjin for v4.5 (unless he picks it by himself).

Best regards,
Krzysztof

#7 lore raw

PATCH v3 5/5 ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF

In reply to Alim Akhtar

Hello!

Tested it on top of 4.4-rc3.

arch/arm/mach-exynos/Kconfig menuconfig ARCH_EXYNOS · line 32

Quoted 11 lines
arch/arm/mach-exynos/Kconfig +3 -0
index 3a10f1a8317a..d279edf9b10d 100644
@@ -27,6 +27,9 @@ menuconfig ARCH_EXYNOS
 	select SRAM
 	select THERMAL
 	select MFD_SYSCON
+	select POWER_RESET
+	select POWER_RESET_SYSCON
+	select POWER_RESET_SYSCON_POWEROFF

"select POWER_SUPPLY" is missing here. Without is we get:
--- cut ---
warning: (ARCH_HISI && ARCH_INTEGRATOR && ARCH_EXYNOS && ARCH_VEXPRESS && REALVIEW_DT) selects POWER_RESET which has unmet direct dependencies (POWER_SUPPLY)
warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON which has unmet direct dependencies (POWER_SUPPLY && POWER_RESET && OF)
warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON_POWEROFF which has unmet direct dependencies (POWER_SUPPLY && POWER_RESET && OF) --- cut ---

arch/arm/mach-exynos/Kconfig menuconfig ARCH_EXYNOS · line 34

Quoted 2 lines
arch/arm/mach-exynos/Kconfig +0 -0
 	help
 	  Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)

Otherwise works fine.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#8 lore raw

PATCH v3 5/5 ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF

Quoted 24 lines · Pavel Fedin

Hello!

Tested it on top of 4.4-rc3.

arch/arm/mach-exynos/Kconfig menuconfig ARCH_EXYNOS · line 32

Quoted 11 lines
arch/arm/mach-exynos/Kconfig +3 -0
index 3a10f1a8317a..d279edf9b10d 100644
@@ -27,6 +27,9 @@ menuconfig ARCH_EXYNOS
 	select SRAM
 	select THERMAL
 	select MFD_SYSCON
+	select POWER_RESET
+	select POWER_RESET_SYSCON
+	select POWER_RESET_SYSCON_POWEROFF

"select POWER_SUPPLY" is missing here. Without is we get:
--- cut ---
warning: (ARCH_HISI && ARCH_INTEGRATOR && ARCH_EXYNOS && ARCH_VEXPRESS && REALVIEW_DT) selects POWER_RESET which has unmet direct dependencies (POWER_SUPPLY)
warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON which has unmet direct dependencies (POWER_SUPPLY && POWER_RESET && OF)
warning: (ARCH_EXYNOS) selects POWER_RESET_SYSCON_POWEROFF which has unmet direct dependencies (POWER_SUPPLY && POWER_RESET && OF) --- cut ---

Quoted 6 lines

arch/arm/mach-exynos/Kconfig menuconfig ARCH_EXYNOS · line 34

Quoted 2 lines
arch/arm/mach-exynos/Kconfig +0 -0
 	help
 	  Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)

Otherwise works fine.

Testing was a little bit too late (late not only looking at date of v1 and v2 but even for v3)... I appreciate it but I applied it already and in fact I sent a pull request with it.

Actually the proper fix I think is to remove the dependency between POWER_RESET and POWER_SUPPLY.

Best regards,
Krzysztof