Skip to contentSkip to conversation

power: reset: vf610 system reset controller

PATCH In review Stefan Agner 4 participants 7 messages Dec 2, 2014 – Dec 16, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v3 cover power: reset: vf610 system reset controller

This third version does essentially the same as v1, but with a lot less code due to the usage of syscon and syscon-reboot driver. My earlier misgivings that it might be a problem for the suspend/resume implementation later on did not hold true: I tested my prelinear suspend code and in case the code really needs to access some registers form assembler, it is possible to map temporarly the relevant region again.

I refrained from adding POWER_RESET_SYSCON as a hard dependency for Vybrid (SOC_VF610): In its dual-core configuration, one might want have the Cortex-M4 in charge of the system reset... Hence the user should be able to build a kernel without the system reset (beside the option to create a board specific device tree with disabled SRC node).

Shawn, the defconfig change is based on the latest (almost-merged?) defconfig patch.

Changes since v2:
- Drop priority property for syscon-reboot
- Alter default priority of syscon-reboot, set it to 192

Changes since v1:
- Total rework using syscon/syscon-reboot capabilities
- Enhance syscon-reboot with priority capabilities

Stefan Agner (3):
power: reset: adjust priority of simple syscon reboot driver
ARM: dts: vf610: add system reset controller and syscon-reboot
ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON

 arch/arm/boot/dts/vf500.dtsi         |  4 ++++
 arch/arm/boot/dts/vfxxx.dtsi         | 12 ++++++++++++
 arch/arm/configs/imx_v6_v7_defconfig |  8 ++++----
 drivers/power/reset/syscon-reboot.c  |  2 +-
 4 files changed, 21 insertions(+), 5 deletions(-)
Signature · 1 line
2.1.3
#1 lore raw

PATCH v3 1/3 power: reset: adjust priority of simple syscon reboot driver

Currently, all restart handler use the priority 128, including watchdogs. Probably most SoC have a watchdog, and some of them register it also as a restart handler. But if a SoC specifies a dedicated reboot capability using this syscon driver, this is usually the preferred reboot method. Hence, raise the priority of this driver to 192.

---
 drivers/power/reset/syscon-reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/reset/syscon-reboot.c +1 -1
index 815b901..c4049f4 100644
@@ -68,7 +68,7 @@ static int syscon_reboot_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	ctx->restart_handler.notifier_call = syscon_restart_handle;
-	ctx->restart_handler.priority = 128;
+	ctx->restart_handler.priority = 192;
 	err = register_restart_handler(&ctx->restart_handler);
 	if (err)
 		dev_err(dev, "can't register restart notifier (err=%d)\n", err);
Signature · 1 line
2.1.3
#4 lore raw

PATCH v3 2/3 ARM: dts: vf610: add system reset controller and syscon-reboot

In reply to Stefan Agner

Add the system reset controller (SRC) module and use syscon-reboot to register a restart handler which restarts the SoC using the SRC SW_RST bit.

---
 arch/arm/boot/dts/vf500.dtsi |  4 ++++
 arch/arm/boot/dts/vfxxx.dtsi | 12 ++++++++++++
 2 files changed, 16 insertions(+)
arch/arm/boot/dts/vf500.dtsi +4 -0
index de67005..3f38f49 100644
@@ -130,6 +130,10 @@
 	interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 };
 
+&src {
+	interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+};
+
 &uart0 {
 	interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
 };
arch/arm/boot/dts/vfxxx.dtsi +12 -0
index 505969a..dddcd0c 100644
@@ -43,6 +43,13 @@
 		clock-frequency = <32768>;
 	};
 
+	reboot: syscon-reboot {
+		compatible = "syscon-reboot";
+		regmap = <&src>;
+		offset = <0x0>;
+		mask = <0x1000>;
+	};
+
 	soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -318,6 +325,11 @@
 				clocks = <&clks VF610_CLK_USBC0>;
 				status = "disabled";
 			};
+
+			src: src at 4006e000 {
+				compatible = "fsl,vf610-src", "syscon";
+				reg = <0x4006e000 0x1000>;
+			};
 		};
 
 		aips1: aips-bus at 40080000 {
Signature · 1 line
2.1.3
#5 lore raw

PATCH v3 3/3 ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON

In reply to Stefan Agner

Add POWER_RESET_SYSCON since Vybrid SoC's now make use of this driver to provide software reset capabilities through the SRC module.

Also regenerated using savedefconfig which removed the config BACKLIGHT_LCD_SUPPORT which is now selected by default since commit 9c8ee3c734139 ("video: mx3fb: always enable BACKLIGHT_LCD_SUPPORT").

---
 arch/arm/configs/imx_v6_v7_defconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/configs/imx_v6_v7_defconfig +4 -4
index f707cd2..e928075 100644
@@ -163,13 +163,14 @@ CONFIG_SPI_IMX=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_MC9S08DZ60=y
 CONFIG_GPIO_STMPE=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_IMX=y
+CONFIG_POWER_RESET_SYSCON=y
 CONFIG_SENSORS_GPIO_FAN=y
 CONFIG_THERMAL=y
 CONFIG_CPU_THERMAL=y
 CONFIG_IMX_THERMAL=y
-CONFIG_POWER_SUPPLY=y
-CONFIG_POWER_RESET=y
-CONFIG_POWER_RESET_IMX=y
 CONFIG_WATCHDOG=y
 CONFIG_IMX2_WDT=y
 CONFIG_MFD_DA9052_I2C=y
@@ -198,7 +199,6 @@ CONFIG_SOC_CAMERA_OV2640=y
 CONFIG_IMX_IPUV3_CORE=y
 CONFIG_DRM=y
 CONFIG_DRM_PANEL_SIMPLE=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_LCD_L4F00242T03=y
 CONFIG_LCD_PLATFORM=y
Signature · 1 line
2.1.3
Reviewed-by on v3 1/3
#2 lore raw

Re: [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver

In reply to Stefan Agner
Quoted 8 lines · Stefan Agner

Currently, all restart handler use the priority 128, including watchdogs. Probably most SoC have a watchdog, and some of them register it also as a restart handler. But if a SoC specifies a dedicated reboot capability using this syscon driver, this is usually the preferred reboot method. Hence, raise the priority of this driver to 192.

Acked-by on v3 1/3
#3 lore raw

Re: [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver

In reply to Stefan Agner
Quoted 8 lines · Stefan Agner

Currently, all restart handler use the priority 128, including watchdogs. Probably most SoC have a watchdog, and some of them register it also as a restart handler. But if a SoC specifies a dedicated reboot capability using this syscon driver, this is usually the preferred reboot method. Hence, raise the priority of this driver to 192.

This looks good to me.

Thanks,
Mark.

Quoted 21 lines
---
 drivers/power/reset/syscon-reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/reset/syscon-reboot.c +1 -1
index 815b901..c4049f4 100644
@@ -68,7 +68,7 @@ static int syscon_reboot_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	ctx->restart_handler.notifier_call = syscon_restart_handle;
-	ctx->restart_handler.priority = 128;
+	ctx->restart_handler.priority = 192;
 	err = register_restart_handler(&ctx->restart_handler);
 	if (err)
 		dev_err(dev, "can't register restart notifier (err=%d)\n", err);
Signature · 1 line
2.1.3
#6 lore raw
In reply to Stefan Agner
Quoted 4 lines · Stefan Agner

Stefan Agner (3):
power: reset: adjust priority of simple syscon reboot driver
ARM: dts: vf610: add system reset controller and syscon-reboot
ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON

Applied the last two.

Shawn