diff mbox series

[v1,2/2] arm64: dts: exynos8895: Add syscon-poweroff and syscon-reboot nodes

Message ID 20241210180216.398165-3-ivo.ivanov.ivanov1@gmail.com (mailing list archive)
State New
Headers show
Series arm64: dts: exynos8895: Add m2-pmu, poweroff and reboot | expand

Commit Message

Ivaylo Ivanov Dec. 10, 2024, 6:02 p.m. UTC
For Exynos8895, a reboot is handled by setting the bit(SWRESET_SYSTEM[1])
of SWRESET register(PMU + 0x400) and power-off is handled by setting
bit(DATA[8]) of PS_HOLD_CONTROL register (PMU + 0x330c).

Tested using "reboot" and "poweroff -p" commands.

Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
---
 arch/arm64/boot/dts/exynos/exynos8895.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

Markuss Broks Dec. 10, 2024, 9:10 p.m. UTC | #1
Hi,

On 12/10/24 8:02 PM, Ivaylo Ivanov wrote:
> For Exynos8895, a reboot is handled by setting the bit(SWRESET_SYSTEM[1])
> of SWRESET register(PMU + 0x400) and power-off is handled by setting
> bit(DATA[8]) of PS_HOLD_CONTROL register (PMU + 0x330c).
>
> Tested using "reboot" and "poweroff -p" commands.
>
> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
> ---
>   arch/arm64/boot/dts/exynos/exynos8895.dtsi | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/exynos/exynos8895.dtsi b/arch/arm64/boot/dts/exynos/exynos8895.dtsi
> index 90b318b2f..9eb89dd19 100644
> --- a/arch/arm64/boot/dts/exynos/exynos8895.dtsi
> +++ b/arch/arm64/boot/dts/exynos/exynos8895.dtsi
> @@ -388,6 +388,21 @@ pmu_system_controller: system-controller@16480000 {
>   			compatible = "samsung,exynos8895-pmu",
>   				     "samsung,exynos7-pmu", "syscon";
>   			reg = <0x16480000 0x10000>;
> +
> +			poweroff: syscon-poweroff {
> +				compatible = "syscon-poweroff";
> +				regmap = <&pmu_system_controller>;
> +				offset = <0x330c>; /* PS_HOLD_CONTROL */
> +				mask = <0x100>; /* reset value */
> +			};
> +
> +			reboot: syscon-reboot {
> +				compatible = "syscon-reboot";
> +				regmap = <&pmu_system_controller>;
> +				offset = <0x400>; /* SWRESET */
> +				mask = <0x1>; /* SWRESET_SYSTEM */
> +				value = <0x1>; /* reset value */
> +			};
>   		};
Aren't those already included with 
arm/samsung/exynos-syscon-restart.dtsi? I can see that the values for 
poweroff are different here though, does it not work with the value from 
exynos-syscon-restart?
>   
>   		pinctrl_alive: pinctrl@164b0000 {


- Markuss
Ivaylo Ivanov Dec. 10, 2024, 9:28 p.m. UTC | #2
On 12/10/24 23:10, Markuss Broks wrote:
> Hi,
>
> On 12/10/24 8:02 PM, Ivaylo Ivanov wrote:
>> For Exynos8895, a reboot is handled by setting the bit(SWRESET_SYSTEM[1])
>> of SWRESET register(PMU + 0x400) and power-off is handled by setting
>> bit(DATA[8]) of PS_HOLD_CONTROL register (PMU + 0x330c).
>>
>> Tested using "reboot" and "poweroff -p" commands.
>>
>> Signed-off-by: Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
>> ---
>>   arch/arm64/boot/dts/exynos/exynos8895.dtsi | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/exynos/exynos8895.dtsi b/arch/arm64/boot/dts/exynos/exynos8895.dtsi
>> index 90b318b2f..9eb89dd19 100644
>> --- a/arch/arm64/boot/dts/exynos/exynos8895.dtsi
>> +++ b/arch/arm64/boot/dts/exynos/exynos8895.dtsi
>> @@ -388,6 +388,21 @@ pmu_system_controller: system-controller@16480000 {
>>               compatible = "samsung,exynos8895-pmu",
>>                        "samsung,exynos7-pmu", "syscon";
>>               reg = <0x16480000 0x10000>;
>> +
>> +            poweroff: syscon-poweroff {
>> +                compatible = "syscon-poweroff";
>> +                regmap = <&pmu_system_controller>;
>> +                offset = <0x330c>; /* PS_HOLD_CONTROL */
>> +                mask = <0x100>; /* reset value */
>> +            };
>> +
>> +            reboot: syscon-reboot {
>> +                compatible = "syscon-reboot";
>> +                regmap = <&pmu_system_controller>;
>> +                offset = <0x400>; /* SWRESET */
>> +                mask = <0x1>; /* SWRESET_SYSTEM */
>> +                value = <0x1>; /* reset value */
>> +            };
>>           };
> Aren't those already included with arm/samsung/exynos-syscon-restart.dtsi? I can see that the values for poweroff are different here though, does it not work with the value from exynos-syscon-restart?

Riiight... seems like I've completely omitted that during testing.
Although the poweroff mask should be different, it's meant to set
BIT 8. I'll check it tomorrow and send a v2.

Thanks!
Best regards, Ivo.

>>             pinctrl_alive: pinctrl@164b0000 {
>
>
> - Markuss
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/exynos/exynos8895.dtsi b/arch/arm64/boot/dts/exynos/exynos8895.dtsi
index 90b318b2f..9eb89dd19 100644
--- a/arch/arm64/boot/dts/exynos/exynos8895.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos8895.dtsi
@@ -388,6 +388,21 @@  pmu_system_controller: system-controller@16480000 {
 			compatible = "samsung,exynos8895-pmu",
 				     "samsung,exynos7-pmu", "syscon";
 			reg = <0x16480000 0x10000>;
+
+			poweroff: syscon-poweroff {
+				compatible = "syscon-poweroff";
+				regmap = <&pmu_system_controller>;
+				offset = <0x330c>; /* PS_HOLD_CONTROL */
+				mask = <0x100>; /* reset value */
+			};
+
+			reboot: syscon-reboot {
+				compatible = "syscon-reboot";
+				regmap = <&pmu_system_controller>;
+				offset = <0x400>; /* SWRESET */
+				mask = <0x1>; /* SWRESET_SYSTEM */
+				value = <0x1>; /* reset value */
+			};
 		};
 
 		pinctrl_alive: pinctrl@164b0000 {