diff mbox series

[RFC,3/4] dt-bindings: power: reset: Document arm,psci-vendor-reset

Message ID 20230724223057.1208122-4-quic_eberman@quicinc.com (mailing list archive)
State Not Applicable
Headers show
Series Implement a PSCI SYSTEM_RESET2 reboot-mode driver | expand

Commit Message

Elliot Berman July 24, 2023, 10:30 p.m. UTC
Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor reset  types.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
---
 .../power/reset/arm,psci-vendor-reset.yaml    | 35 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml

Comments

Rob Herring (Arm) July 24, 2023, 11:23 p.m. UTC | #1
On Mon, Jul 24, 2023 at 03:30:53PM -0700, Elliot Berman wrote:
> Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor reset  types.
> 
> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
> ---
>  .../power/reset/arm,psci-vendor-reset.yaml    | 35 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  2 files changed, 36 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> new file mode 100644
> index 000000000000..18b0b8c167a1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: PSCI SYSTEM_RESET2 Vendor Resets
> +
> +maintainers:
> +  - Elliot Berman <quic_eberman@quicinc.com>
> +
> +description: |
> +  PSCI SYSTEM_RESET2 supports vendor-defined reset types. This describes
> +  the conversion of reboot modes to the reset types.
> +
> +properties:
> +  compatible:
> +    const: arm,psci-vendor-reset
> +
> +allOf:
> +  - $ref: reboot-mode.yaml#
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    firmware {
> +      psci-vendor-resets {
> +        compatible = "arm,psci-vendor-reset";

We already have a node for PSCI, we don't need a second one. You can 
have a separate driver without a separate node. 

> +        reboot-normal = <0x100>;

Wouldn't 'normal' be the normal PSCI reset?

> +        reboot-bootloader = <0x101>;
> +        reboot-fastboot = <0x102>;
> +      };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d516295978a4..2da4c5f1917b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -16982,6 +16982,7 @@ M:	Mark Rutland <mark.rutland@arm.com>
>  M:	Lorenzo Pieralisi <lpieralisi@kernel.org>
>  L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
>  S:	Maintained
> +F:	Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>  F:	drivers/firmware/psci/
>  F:	include/linux/psci.h
>  F:	include/uapi/linux/psci.h
> -- 
> 2.41.0
>
Mukesh Ojha July 25, 2023, 8:29 a.m. UTC | #2
On 7/25/2023 4:00 AM, Elliot Berman wrote:
> Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor reset  types.
> 
> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
> ---
>   .../power/reset/arm,psci-vendor-reset.yaml    | 35 +++++++++++++++++++
>   MAINTAINERS                                   |  1 +
>   2 files changed, 36 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> new file mode 100644
> index 000000000000..18b0b8c167a1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: PSCI SYSTEM_RESET2 Vendor Resets
> +
> +maintainers:
> +  - Elliot Berman <quic_eberman@quicinc.com>
> +
> +description: |
> +  PSCI SYSTEM_RESET2 supports vendor-defined reset types. This describes
> +  the conversion of reboot modes to the reset types.
> +
> +properties:
> +  compatible:
> +    const: arm,psci-vendor-reset
> +
> +allOf:
> +  - $ref: reboot-mode.yaml#
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    firmware {
> +      psci-vendor-resets {
> +        compatible = "arm,psci-vendor-reset";
> +        reboot-normal = <0x100>;
> +        reboot-bootloader = <0x101>;
> +        reboot-fastboot = <0x102>;

Should it start with mode-* ?

-Mukesh
> +      };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d516295978a4..2da4c5f1917b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -16982,6 +16982,7 @@ M:	Mark Rutland <mark.rutland@arm.com>
>   M:	Lorenzo Pieralisi <lpieralisi@kernel.org>
>   L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
>   S:	Maintained
> +F:	Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>   F:	drivers/firmware/psci/
>   F:	include/linux/psci.h
>   F:	include/uapi/linux/psci.h
Elliot Berman July 25, 2023, 6:01 p.m. UTC | #3
On 7/24/2023 4:23 PM, Rob Herring wrote:
> On Mon, Jul 24, 2023 at 03:30:53PM -0700, Elliot Berman wrote:
>> Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor reset  types.
>>
>> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
>> ---
>>   .../power/reset/arm,psci-vendor-reset.yaml    | 35 +++++++++++++++++++
>>   MAINTAINERS                                   |  1 +
>>   2 files changed, 36 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>> new file mode 100644
>> index 000000000000..18b0b8c167a1
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>> @@ -0,0 +1,35 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: PSCI SYSTEM_RESET2 Vendor Resets
>> +
>> +maintainers:
>> +  - Elliot Berman <quic_eberman@quicinc.com>
>> +
>> +description: |
>> +  PSCI SYSTEM_RESET2 supports vendor-defined reset types. This describes
>> +  the conversion of reboot modes to the reset types.
>> +
>> +properties:
>> +  compatible:
>> +    const: arm,psci-vendor-reset
>> +
>> +allOf:
>> +  - $ref: reboot-mode.yaml#
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    firmware {
>> +      psci-vendor-resets {
>> +        compatible = "arm,psci-vendor-reset";
> 
> We already have a node for PSCI, we don't need a second one. You can
> have a separate driver without a separate node.
> 

I could also place the reboot-mode functionality straight into 
drivers/firwmare/psci/? I thought that might be more controversial than 
separate driver, but maybe not?

Mark/Loreno, do you have any concerns to add the reboot-mode driver 
functionality directly in drivers/firmware/psci/psci.c?

Sebastian, do you have any concerns to have this reboot-mode driver 
outside drivers/power/reset/?

>> +        reboot-normal = <0x100>;
> 
> Wouldn't 'normal' be the normal PSCI reset?
> 

Ah, right. I had my head buried in the reboot-mode code when creating 
the example. I can remove from the example.

>> +        reboot-bootloader = <0x101>;
>> +        reboot-fastboot = <0x102>;
>> +      };
>> +    };
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index d516295978a4..2da4c5f1917b 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -16982,6 +16982,7 @@ M:	Mark Rutland <mark.rutland@arm.com>
>>   M:	Lorenzo Pieralisi <lpieralisi@kernel.org>
>>   L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
>>   S:	Maintained
>> +F:	Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>   F:	drivers/firmware/psci/
>>   F:	include/linux/psci.h
>>   F:	include/uapi/linux/psci.h
>> -- 
>> 2.41.0
>>
Elliot Berman July 25, 2023, 8:26 p.m. UTC | #4
On 7/25/2023 11:01 AM, Elliot Berman wrote:
> 
> 
> On 7/24/2023 4:23 PM, Rob Herring wrote:
>> On Mon, Jul 24, 2023 at 03:30:53PM -0700, Elliot Berman wrote:
>>> Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor 
>>> reset  types.
>>>
>>> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
>>> ---
>>>   .../power/reset/arm,psci-vendor-reset.yaml    | 35 +++++++++++++++++++
>>>   MAINTAINERS                                   |  1 +
>>>   2 files changed, 36 insertions(+)
>>>   create mode 100644 
>>> Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>>
>>> diff --git 
>>> a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>> new file mode 100644
>>> index 000000000000..18b0b8c167a1
>>> --- /dev/null
>>> +++ 
>>> b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>> @@ -0,0 +1,35 @@
>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>> +# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
>>> +%YAML 1.2
>>> +---
>>> +$id: 
>>> http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml#
>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>> +
>>> +title: PSCI SYSTEM_RESET2 Vendor Resets
>>> +
>>> +maintainers:
>>> +  - Elliot Berman <quic_eberman@quicinc.com>
>>> +
>>> +description: |
>>> +  PSCI SYSTEM_RESET2 supports vendor-defined reset types. This 
>>> describes
>>> +  the conversion of reboot modes to the reset types.
>>> +
>>> +properties:
>>> +  compatible:
>>> +    const: arm,psci-vendor-reset
>>> +
>>> +allOf:
>>> +  - $ref: reboot-mode.yaml#
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> +  - |
>>> +    firmware {
>>> +      psci-vendor-resets {
>>> +        compatible = "arm,psci-vendor-reset";
>>
>> We already have a node for PSCI, we don't need a second one. You can
>> have a separate driver without a separate node.
>>
> 
> I could also place the reboot-mode functionality straight into 
> drivers/firwmare/psci/? I thought that might be more controversial than 
> separate driver, but maybe not?
> 
> Mark/Loreno, do you have any concerns to add the reboot-mode driver 
> functionality directly in drivers/firmware/psci/psci.c?
> 
> Sebastian, do you have any concerns to have this reboot-mode driver 
> outside drivers/power/reset/?
> 

Sebastian, please disregard this question.

Mukesh pointed out that reboot-mode framework isn't the right option 
here since this driver does the actual reset and, as I understand, 
reboot-mode isn't intended to do actual reset. I'm going to implement 
something similar to what reboot-mode framework does but register 
against the restart_handler_list instead of reboot_notifier_list.

>>> +        reboot-normal = <0x100>;
>>
>> Wouldn't 'normal' be the normal PSCI reset?
>>
> 
> Ah, right. I had my head buried in the reboot-mode code when creating 
> the example. I can remove from the example.
> 
>>> +        reboot-bootloader = <0x101>;
>>> +        reboot-fastboot = <0x102>;
>>> +      };
>>> +    };
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index d516295978a4..2da4c5f1917b 100644
>>> --- a/MAINTAINERS
>>> +++ b/MAINTAINERS
>>> @@ -16982,6 +16982,7 @@ M:    Mark Rutland <mark.rutland@arm.com>
>>>   M:    Lorenzo Pieralisi <lpieralisi@kernel.org>
>>>   L:    linux-arm-kernel@lists.infradead.org (moderated for 
>>> non-subscribers)
>>>   S:    Maintained
>>> +F:    
>>> Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>>   F:    drivers/firmware/psci/
>>>   F:    include/linux/psci.h
>>>   F:    include/uapi/linux/psci.h
>>> -- 
>>> 2.41.0
>>>
Rob Herring (Arm) July 26, 2023, 1:45 p.m. UTC | #5
On Tue, Jul 25, 2023 at 12:01 PM Elliot Berman <quic_eberman@quicinc.com> wrote:
>
>
>
> On 7/24/2023 4:23 PM, Rob Herring wrote:
> > On Mon, Jul 24, 2023 at 03:30:53PM -0700, Elliot Berman wrote:
> >> Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor reset  types.
> >>
> >> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
> >> ---
> >>   .../power/reset/arm,psci-vendor-reset.yaml    | 35 +++++++++++++++++++
> >>   MAINTAINERS                                   |  1 +
> >>   2 files changed, 36 insertions(+)
> >>   create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> >>
> >> diff --git a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> >> new file mode 100644
> >> index 000000000000..18b0b8c167a1
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
> >> @@ -0,0 +1,35 @@
> >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> >> +# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: PSCI SYSTEM_RESET2 Vendor Resets
> >> +
> >> +maintainers:
> >> +  - Elliot Berman <quic_eberman@quicinc.com>
> >> +
> >> +description: |
> >> +  PSCI SYSTEM_RESET2 supports vendor-defined reset types. This describes
> >> +  the conversion of reboot modes to the reset types.
> >> +
> >> +properties:
> >> +  compatible:
> >> +    const: arm,psci-vendor-reset
> >> +
> >> +allOf:
> >> +  - $ref: reboot-mode.yaml#
> >> +
> >> +additionalProperties: false
> >> +
> >> +examples:
> >> +  - |
> >> +    firmware {
> >> +      psci-vendor-resets {
> >> +        compatible = "arm,psci-vendor-reset";
> >
> > We already have a node for PSCI, we don't need a second one. You can
> > have a separate driver without a separate node.
> >
>
> I could also place the reboot-mode functionality straight into
> drivers/firwmare/psci/? I thought that might be more controversial than
> separate driver, but maybe not?
>
> Mark/Loreno, do you have any concerns to add the reboot-mode driver
> functionality directly in drivers/firmware/psci/psci.c?

I'm talking about the binding. Why are you talking about driver
design? They are independent.

Rob
Elliot Berman July 26, 2023, 5:18 p.m. UTC | #6
On 7/26/2023 6:45 AM, Rob Herring wrote:
> On Tue, Jul 25, 2023 at 12:01 PM Elliot Berman <quic_eberman@quicinc.com> wrote:
>>
>>
>>
>> On 7/24/2023 4:23 PM, Rob Herring wrote:
>>> On Mon, Jul 24, 2023 at 03:30:53PM -0700, Elliot Berman wrote:
>>>> Add devicetree bindings for using PSCI SYSTEM_RESET2 with vendor reset  types.
>>>>
>>>> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
>>>> ---
>>>>    .../power/reset/arm,psci-vendor-reset.yaml    | 35 +++++++++++++++++++
>>>>    MAINTAINERS                                   |  1 +
>>>>    2 files changed, 36 insertions(+)
>>>>    create mode 100644 Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>>> new file mode 100644
>>>> index 000000000000..18b0b8c167a1
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
>>>> @@ -0,0 +1,35 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>>>> +# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: PSCI SYSTEM_RESET2 Vendor Resets
>>>> +
>>>> +maintainers:
>>>> +  - Elliot Berman <quic_eberman@quicinc.com>
>>>> +
>>>> +description: |
>>>> +  PSCI SYSTEM_RESET2 supports vendor-defined reset types. This describes
>>>> +  the conversion of reboot modes to the reset types.
>>>> +
>>>> +properties:
>>>> +  compatible:
>>>> +    const: arm,psci-vendor-reset
>>>> +
>>>> +allOf:
>>>> +  - $ref: reboot-mode.yaml#
>>>> +
>>>> +additionalProperties: false
>>>> +
>>>> +examples:
>>>> +  - |
>>>> +    firmware {
>>>> +      psci-vendor-resets {
>>>> +        compatible = "arm,psci-vendor-reset";
>>>
>>> We already have a node for PSCI, we don't need a second one. You can
>>> have a separate driver without a separate node.
>>>
>>
>> I could also place the reboot-mode functionality straight into
>> drivers/firwmare/psci/? I thought that might be more controversial than
>> separate driver, but maybe not?
>>
>> Mark/Loreno, do you have any concerns to add the reboot-mode driver
>> functionality directly in drivers/firmware/psci/psci.c?
> 
> I'm talking about the binding. Why are you talking about driver
> design? They are independent.

Apologies, I agree to make it part of the same node. I believe it 
requires some changes to PSCI driver to create/bind the vendor restart 
device. I wanted to see how Mark and Lorenzo wanted to incorporate the 
vendor resets into PSCI driver: maybe I don't even create a 
device/driver and simply incorporate the changes into PSCI driver directly.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
new file mode 100644
index 000000000000..18b0b8c167a1
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
@@ -0,0 +1,35 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/reset/arm,psci-vendor-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PSCI SYSTEM_RESET2 Vendor Resets
+
+maintainers:
+  - Elliot Berman <quic_eberman@quicinc.com>
+
+description: |
+  PSCI SYSTEM_RESET2 supports vendor-defined reset types. This describes
+  the conversion of reboot modes to the reset types.
+
+properties:
+  compatible:
+    const: arm,psci-vendor-reset
+
+allOf:
+  - $ref: reboot-mode.yaml#
+
+additionalProperties: false
+
+examples:
+  - |
+    firmware {
+      psci-vendor-resets {
+        compatible = "arm,psci-vendor-reset";
+        reboot-normal = <0x100>;
+        reboot-bootloader = <0x101>;
+        reboot-fastboot = <0x102>;
+      };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index d516295978a4..2da4c5f1917b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -16982,6 +16982,7 @@  M:	Mark Rutland <mark.rutland@arm.com>
 M:	Lorenzo Pieralisi <lpieralisi@kernel.org>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:	Maintained
+F:	Documentation/devicetree/bindings/power/reset/arm,psci-vendor-reset.yaml
 F:	drivers/firmware/psci/
 F:	include/linux/psci.h
 F:	include/uapi/linux/psci.h