* [PATCH v3 1/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos3250 SoCs
2015-11-20 5:17 [PATCH v3 0/5] Switch to generic syscon regmap based drivers Alim Akhtar
@ 2015-11-20 5:17 ` Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 2/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos4 Alim Akhtar
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Alim Akhtar @ 2015-11-20 5:17 UTC (permalink / raw)
To: linux-samsung-soc
Cc: k.kozlowski, kgene, javier, devicetree, linux-arm-kernel,
m.reichl, tjakobi, ulf.hansson
This patch adds syscon-{reboot, poweroff} nodes to allow the
generic syscon-{reboot, poweroff} driver to reset/poweroff exynos3250 SoC.
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
---
arch/arm/boot/dts/exynos3250.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi
index 2f30d632f1cc..18e3deffbf48 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -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@10020710 {
compatible = "samsung,s5pv210-mipi-video-phy";
#phy-cells = <1>;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 2/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos4
2015-11-20 5:17 [PATCH v3 0/5] Switch to generic syscon regmap based drivers Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 1/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos3250 SoCs Alim Akhtar
@ 2015-11-20 5:17 ` Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 3/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5 Alim Akhtar
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Alim Akhtar @ 2015-11-20 5:17 UTC (permalink / raw)
To: linux-samsung-soc
Cc: k.kozlowski, kgene, javier, devicetree, linux-arm-kernel,
m.reichl, tjakobi, ulf.hansson
This patch adds syscon-{reboot, poweroff} nodes to allow the
generic syscon-{reboot, poweroff} driver to reset/poweroff exynos4 SoC.
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
---
arch/arm/boot/dts/exynos4.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 3184e10f260a..07e10ee60bd8 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -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@11C80000 {
compatible = "samsung,exynos4210-mipi-dsi";
reg = <0x11C80000 0x10000>;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 3/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5
2015-11-20 5:17 [PATCH v3 0/5] Switch to generic syscon regmap based drivers Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 1/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos3250 SoCs Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 2/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos4 Alim Akhtar
@ 2015-11-20 5:17 ` Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 4/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5410 SoC Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF Alim Akhtar
4 siblings, 0 replies; 9+ messages in thread
From: Alim Akhtar @ 2015-11-20 5:17 UTC (permalink / raw)
To: linux-samsung-soc
Cc: k.kozlowski, kgene, javier, devicetree, linux-arm-kernel,
m.reichl, tjakobi, ulf.hansson
This patch adds syscon-{reboot, poweroff} nodes to allow the
generic syscon-{reboot, poweroff} driver to reset/poweroff exynos5 SoCs.
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
---
arch/arm/boot/dts/exynos5.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5.dtsi b/arch/arm/boot/dts/exynos5.dtsi
index 110dbd4fb884..e2439e87ee4a 100644
--- a/arch/arm/boot/dts/exynos5.dtsi
+++ b/arch/arm/boot/dts/exynos5.dtsi
@@ -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@14400000 {
compatible = "samsung,exynos5250-fimd";
interrupt-parent = <&combiner>;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 4/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5410 SoC
2015-11-20 5:17 [PATCH v3 0/5] Switch to generic syscon regmap based drivers Alim Akhtar
` (2 preceding siblings ...)
2015-11-20 5:17 ` [PATCH v3 3/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5 Alim Akhtar
@ 2015-11-20 5:17 ` Alim Akhtar
2015-11-20 5:17 ` [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF Alim Akhtar
4 siblings, 0 replies; 9+ messages in thread
From: Alim Akhtar @ 2015-11-20 5:17 UTC (permalink / raw)
To: linux-samsung-soc
Cc: k.kozlowski, kgene, javier, devicetree, linux-arm-kernel,
m.reichl, tjakobi, ulf.hansson
This patch adds syscon-{reboot, poweroff} nodes to allow the
generic syscon-{reboot, poweroff} driver to reset/poweroff exynos5410 SoC.
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
---
arch/arm/boot/dts/exynos5410.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5410.dtsi b/arch/arm/boot/dts/exynos5410.dtsi
index 731eefd23fa9..fad0779b1b6e 100644
--- a/arch/arm/boot/dts/exynos5410.dtsi
+++ b/arch/arm/boot/dts/exynos5410.dtsi
@@ -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@101C0000 {
compatible = "samsung,exynos4210-mct";
reg = <0x101C0000 0xB00>;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF
2015-11-20 5:17 [PATCH v3 0/5] Switch to generic syscon regmap based drivers Alim Akhtar
` (3 preceding siblings ...)
2015-11-20 5:17 ` [PATCH v3 4/5] arm: dts: Add syscon-{reboot, poweroff} nodes for exynos5410 SoC Alim Akhtar
@ 2015-11-20 5:17 ` Alim Akhtar
2015-11-20 6:49 ` Krzysztof Kozlowski
2015-12-01 9:03 ` Pavel Fedin
4 siblings, 2 replies; 9+ messages in thread
From: Alim Akhtar @ 2015-11-20 5:17 UTC (permalink / raw)
To: linux-samsung-soc
Cc: k.kozlowski, kgene, javier, devicetree, linux-arm-kernel,
m.reichl, tjakobi, ulf.hansson
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.
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
---
arch/arm/mach-exynos/Kconfig | 3 +++
arch/arm/mach-exynos/pmu.c | 43 ------------------------------------------
2 files changed, 3 insertions(+), 43 deletions(-)
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 3a10f1a8317a..d279edf9b10d 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -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)
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index de68938ee6aa..393c04aa727e 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -14,9 +14,6 @@
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
-
#include "exynos-pmu.h"
#include "regs-pmu.h"
@@ -681,23 +678,6 @@ static unsigned int const exynos5420_list_disable_pmu_reg[] = {
EXYNOS5420_CMU_RESET_FSYS_SYS_PWR_REG,
};
-static void exynos_power_off(void)
-{
- unsigned int tmp;
-
- pr_info("Power down.\n");
- tmp = pmu_raw_readl(EXYNOS_PS_HOLD_CONTROL);
- tmp ^= (1 << 8);
- pmu_raw_writel(tmp, EXYNOS_PS_HOLD_CONTROL);
-
- /* Wait a little so we don't give a false warning below */
- mdelay(100);
-
- pr_err("Power down failed, please power off system manually.\n");
- while (1)
- ;
-}
-
static void exynos5420_powerdown_conf(enum sys_powerdown mode)
{
u32 this_cluster;
@@ -875,14 +855,6 @@ static void exynos5420_pmu_init(void)
pr_info("EXYNOS5420 PMU initialized\n");
}
-static int pmu_restart_notify(struct notifier_block *this,
- unsigned long code, void *unused)
-{
- pmu_raw_writel(0x1, EXYNOS_SWRESET);
-
- return NOTIFY_DONE;
-}
-
static const struct exynos_pmu_data exynos3250_pmu_data = {
.pmu_config = exynos3250_pmu_config,
.pmu_init = exynos3250_pmu_init,
@@ -940,20 +912,11 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
{ /*sentinel*/ },
};
-/*
- * Exynos PMU restart notifier, handles restart functionality
- */
-static struct notifier_block pmu_restart_handler = {
- .notifier_call = pmu_restart_notify,
- .priority = 128,
-};
-
static int exynos_pmu_probe(struct platform_device *pdev)
{
const struct of_device_id *match;
struct device *dev = &pdev->dev;
struct resource *res;
- int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pmu_base_addr = devm_ioremap_resource(dev, res);
@@ -978,12 +941,6 @@ static int exynos_pmu_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pmu_context);
- ret = register_restart_handler(&pmu_restart_handler);
- if (ret)
- dev_warn(dev, "can't register restart handler err=%d\n", ret);
-
- pm_power_off = exynos_power_off;
-
dev_dbg(dev, "Exynos PMU Driver probe done\n");
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF
2015-11-20 5:17 ` [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF Alim Akhtar
@ 2015-11-20 6:49 ` Krzysztof Kozlowski
2015-12-01 9:03 ` Pavel Fedin
1 sibling, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2015-11-20 6:49 UTC (permalink / raw)
To: Alim Akhtar, linux-samsung-soc
Cc: kgene, javier, devicetree, linux-arm-kernel, m.reichl, tjakobi,
ulf.hansson
On 20.11.2015 14:17, Alim Akhtar wrote:
> 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.
>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Acked-by: Moritz Fischer <moritz.fischer@ettus.com>
> ---
> arch/arm/mach-exynos/Kconfig | 3 +++
> arch/arm/mach-exynos/pmu.c | 43 ------------------------------------------
> 2 files changed, 3 insertions(+), 43 deletions(-)
>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
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
^ permalink raw reply [flat|nested] 9+ messages in thread* RE: [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF
2015-11-20 5:17 ` [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF Alim Akhtar
2015-11-20 6:49 ` Krzysztof Kozlowski
@ 2015-12-01 9:03 ` Pavel Fedin
2015-12-02 5:21 ` Krzysztof Kozlowski
1 sibling, 1 reply; 9+ messages in thread
From: Pavel Fedin @ 2015-12-01 9:03 UTC (permalink / raw)
To: 'Alim Akhtar', linux-samsung-soc
Cc: k.kozlowski, kgene, javier, devicetree, linux-arm-kernel,
m.reichl, tjakobi, ulf.hansson
Hello!
Tested it on top of 4.4-rc3.
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index 3a10f1a8317a..d279edf9b10d 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -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 ---
> help
> Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
Otherwise works fine.
Tested-by: Pavel Fedin <p.fedin@samsung.com>
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 5/5] ARM: exynos: select POWER_RESET_SYSCON and POWER_RESET_SYSCON_POWEROFF
2015-12-01 9:03 ` Pavel Fedin
@ 2015-12-02 5:21 ` Krzysztof Kozlowski
0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2015-12-02 5:21 UTC (permalink / raw)
To: Pavel Fedin, 'Alim Akhtar', linux-samsung-soc
Cc: kgene, javier, devicetree, linux-arm-kernel, m.reichl, tjakobi,
ulf.hansson
On 01.12.2015 18:03, Pavel Fedin wrote:
> Hello!
>
> Tested it on top of 4.4-rc3.
>
>> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
>> index 3a10f1a8317a..d279edf9b10d 100644
>> --- a/arch/arm/mach-exynos/Kconfig
>> +++ b/arch/arm/mach-exynos/Kconfig
>> @@ -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 ---
>
>> help
>> Support for SAMSUNG EXYNOS SoCs (EXYNOS4/5)
>
> Otherwise works fine.
>
> Tested-by: Pavel Fedin <p.fedin@samsung.com>
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
^ permalink raw reply [flat|nested] 9+ messages in thread