linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] power: reset: vf610 system reset controller
@ 2014-12-02 17:11 Stefan Agner
  2014-12-02 17:11 ` [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver Stefan Agner
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Stefan Agner @ 2014-12-02 17:11 UTC (permalink / raw)
  To: shawn.guo, kernel, linux, arnd, sre, fkan, mark.rutland
  Cc: dbaryshkov, dwmw2, linux-arm-kernel, linux-kernel, stefan

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(-)

-- 
2.1.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver
  2014-12-02 17:11 [PATCH v3 0/3] power: reset: vf610 system reset controller Stefan Agner
@ 2014-12-02 17:11 ` Stefan Agner
  2014-12-02 18:32   ` Guenter Roeck
  2014-12-03 10:27   ` Mark Rutland
  2014-12-02 17:11 ` [PATCH v3 2/3] ARM: dts: vf610: add system reset controller and syscon-reboot Stefan Agner
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 7+ messages in thread
From: Stefan Agner @ 2014-12-02 17:11 UTC (permalink / raw)
  To: shawn.guo, kernel, linux, arnd, sre, fkan, mark.rutland
  Cc: dbaryshkov, dwmw2, linux-arm-kernel, linux-kernel, stefan

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.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/power/reset/syscon-reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
index 815b901..c4049f4 100644
--- a/drivers/power/reset/syscon-reboot.c
+++ b/drivers/power/reset/syscon-reboot.c
@@ -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);
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 2/3] ARM: dts: vf610: add system reset controller and syscon-reboot
  2014-12-02 17:11 [PATCH v3 0/3] power: reset: vf610 system reset controller Stefan Agner
  2014-12-02 17:11 ` [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver Stefan Agner
@ 2014-12-02 17:11 ` Stefan Agner
  2014-12-02 17:12 ` [PATCH v3 3/3] ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON Stefan Agner
  2014-12-16  4:11 ` [PATCH v3 0/3] power: reset: vf610 system reset controller Shawn Guo
  3 siblings, 0 replies; 7+ messages in thread
From: Stefan Agner @ 2014-12-02 17:11 UTC (permalink / raw)
  To: shawn.guo, kernel, linux, arnd, sre, fkan, mark.rutland
  Cc: dbaryshkov, dwmw2, linux-arm-kernel, linux-kernel, stefan

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.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/boot/dts/vf500.dtsi |  4 ++++
 arch/arm/boot/dts/vfxxx.dtsi | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/vf500.dtsi b/arch/arm/boot/dts/vf500.dtsi
index de67005..3f38f49 100644
--- a/arch/arm/boot/dts/vf500.dtsi
+++ b/arch/arm/boot/dts/vf500.dtsi
@@ -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>;
 };
diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
index 505969a..dddcd0c 100644
--- a/arch/arm/boot/dts/vfxxx.dtsi
+++ b/arch/arm/boot/dts/vfxxx.dtsi
@@ -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@4006e000 {
+				compatible = "fsl,vf610-src", "syscon";
+				reg = <0x4006e000 0x1000>;
+			};
 		};
 
 		aips1: aips-bus@40080000 {
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v3 3/3] ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON
  2014-12-02 17:11 [PATCH v3 0/3] power: reset: vf610 system reset controller Stefan Agner
  2014-12-02 17:11 ` [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver Stefan Agner
  2014-12-02 17:11 ` [PATCH v3 2/3] ARM: dts: vf610: add system reset controller and syscon-reboot Stefan Agner
@ 2014-12-02 17:12 ` Stefan Agner
  2014-12-16  4:11 ` [PATCH v3 0/3] power: reset: vf610 system reset controller Shawn Guo
  3 siblings, 0 replies; 7+ messages in thread
From: Stefan Agner @ 2014-12-02 17:12 UTC (permalink / raw)
  To: shawn.guo, kernel, linux, arnd, sre, fkan, mark.rutland
  Cc: dbaryshkov, dwmw2, linux-arm-kernel, linux-kernel, stefan

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").

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 arch/arm/configs/imx_v6_v7_defconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index f707cd2..e928075 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -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
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver
  2014-12-02 17:11 ` [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver Stefan Agner
@ 2014-12-02 18:32   ` Guenter Roeck
  2014-12-03 10:27   ` Mark Rutland
  1 sibling, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2014-12-02 18:32 UTC (permalink / raw)
  To: Stefan Agner
  Cc: shawn.guo, kernel, arnd, sre, fkan, mark.rutland, dbaryshkov,
	dwmw2, linux-arm-kernel, linux-kernel

On Tue, Dec 02, 2014 at 06:11:58PM +0100, Stefan Agner wrote:
> 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.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver
  2014-12-02 17:11 ` [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver Stefan Agner
  2014-12-02 18:32   ` Guenter Roeck
@ 2014-12-03 10:27   ` Mark Rutland
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2014-12-03 10:27 UTC (permalink / raw)
  To: Stefan Agner
  Cc: shawn.guo, kernel, linux, arnd, sre, fkan, dbaryshkov, dwmw2,
	linux-arm-kernel, linux-kernel

On Tue, Dec 02, 2014 at 05:11:58PM +0000, Stefan Agner wrote:
> 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.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>

This looks good to me.

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

> ---
>  drivers/power/reset/syscon-reboot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c
> index 815b901..c4049f4 100644
> --- a/drivers/power/reset/syscon-reboot.c
> +++ b/drivers/power/reset/syscon-reboot.c
> @@ -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);
> -- 
> 2.1.3
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/3] power: reset: vf610 system reset controller
  2014-12-02 17:11 [PATCH v3 0/3] power: reset: vf610 system reset controller Stefan Agner
                   ` (2 preceding siblings ...)
  2014-12-02 17:12 ` [PATCH v3 3/3] ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON Stefan Agner
@ 2014-12-16  4:11 ` Shawn Guo
  3 siblings, 0 replies; 7+ messages in thread
From: Shawn Guo @ 2014-12-16  4:11 UTC (permalink / raw)
  To: Stefan Agner
  Cc: kernel, linux, arnd, sre, fkan, mark.rutland, dbaryshkov, dwmw2,
	linux-arm-kernel, linux-kernel

On Tue, Dec 02, 2014 at 06:11:57PM +0100, Stefan Agner wrote:
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-16  4:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-02 17:11 [PATCH v3 0/3] power: reset: vf610 system reset controller Stefan Agner
2014-12-02 17:11 ` [PATCH v3 1/3] power: reset: adjust priority of simple syscon reboot driver Stefan Agner
2014-12-02 18:32   ` Guenter Roeck
2014-12-03 10:27   ` Mark Rutland
2014-12-02 17:11 ` [PATCH v3 2/3] ARM: dts: vf610: add system reset controller and syscon-reboot Stefan Agner
2014-12-02 17:12 ` [PATCH v3 3/3] ARM: imx_v6_v7_defconfig: add POWER_RESET_SYSCON Stefan Agner
2014-12-16  4:11 ` [PATCH v3 0/3] power: reset: vf610 system reset controller Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).