Message ID | 20250408-wdt_reset_reason-v1-3-e6ec30c2c926@oss.qualcomm.com |
---|---|
State | New |
Headers | show |
Series | Add support to read the restart reason from IMEM | expand |
On Tue, 08 Apr 2025 14:19:53 +0530, Kathiravan Thirumoorthy wrote: > Add a devicetree binding for the Qualcomm IPQ SOCs restart reason > information region found in the IMEM, allowing the system to identify > the cause of a restart. > > Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> > --- > .../bindings/watchdog/qcom,restart-reason.yaml | 46 ++++++++++++++++++++++ > 1 file changed, 46 insertions(+) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.example.dtb: imem@8600000 (qcom,ipq5424-imem): 'restart-reason@7b0' does not match any of the regexes: '^pil-reloc@[0-9a-f]+$', 'pinctrl-[0-9]+' from schema $id: http://devicetree.org/schemas/sram/qcom,imem.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250408-wdt_reset_reason-v1-3-e6ec30c2c926@oss.qualcomm.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On 08/04/2025 10:49, Kathiravan Thirumoorthy wrote: > Add a devicetree binding for the Qualcomm IPQ SOCs restart reason > information region found in the IMEM, allowing the system to identify > the cause of a restart. > > Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> > --- > .../bindings/watchdog/qcom,restart-reason.yaml | 46 ++++++++++++++++++++++ > 1 file changed, 46 insertions(+) > > diff --git a/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml b/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml > new file mode 100644 > index 0000000000000000000000000000000000000000..babbaa70b114f9691018ed6cb10bfa78e18fad64 > --- /dev/null > +++ b/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml > @@ -0,0 +1,46 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/watchdog/qcom,restart-reason.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Qualcomm IPQ SoC restart reason location > + > +maintainers: > + - Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> > + > +description: > + The Qualcomm IPQ SoC restart reason memory region, in IMEM, is used to > + identify the cause of the system restart. This will be helpful to identify > + the cause when the RAM dump collection is disabled. > + > +properties: > + compatible: > + const: qcom,restart-reason-info No generic compatibles. OTOH, I don't see much of a value of this being a separate node. > + > + reg: > + maxItems: 1 > + > +required: > + - compatible > + - reg > + > +additionalProperties: false > + > +examples: > + - | > + imem@8600000 { > + compatible = "qcom,ipq5424-imem", "syscon", "simple-mfd"; > + reg = <0x08600000 0x1000>; > + > + #address-cells = <1>; > + #size-cells = <1>; > + > + ranges = <0 0x08600000 0x1000>; Drop all above. > + > + restart-reason@7b0 { > + compatible = "qcom,restart-reason-info"; > + reg = <0x7b0 0x4>; > + }; > + }; > +... > Best regards, Krzysztof
On 4/9/2025 12:30 PM, Krzysztof Kozlowski wrote: > On 08/04/2025 10:49, Kathiravan Thirumoorthy wrote: >> Add a devicetree binding for the Qualcomm IPQ SOCs restart reason >> information region found in the IMEM, allowing the system to identify >> the cause of a restart. >> >> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> >> --- >> .../bindings/watchdog/qcom,restart-reason.yaml | 46 ++++++++++++++++++++++ >> 1 file changed, 46 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml b/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml >> new file mode 100644 >> index 0000000000000000000000000000000000000000..babbaa70b114f9691018ed6cb10bfa78e18fad64 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml >> @@ -0,0 +1,46 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/watchdog/qcom,restart-reason.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Qualcomm IPQ SoC restart reason location >> + >> +maintainers: >> + - Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> >> + >> +description: >> + The Qualcomm IPQ SoC restart reason memory region, in IMEM, is used to >> + identify the cause of the system restart. This will be helpful to identify >> + the cause when the RAM dump collection is disabled. >> + >> +properties: >> + compatible: >> + const: qcom,restart-reason-info > No generic compatibles. > > OTOH, I don't see much of a value of this being a separate node. I leveraged this based on the qcom,pil-info.yaml [1]. I guess, I see the point. I will drop all these. Just define IMEM node and in the watchdog driver, I will get the regmap of the syscon / IMEM node and do regmap_read at the desired offset. Please let me know if this approach is fine. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/remoteproc/qcom,pil-info.yaml
diff --git a/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml b/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml new file mode 100644 index 0000000000000000000000000000000000000000..babbaa70b114f9691018ed6cb10bfa78e18fad64 --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/qcom,restart-reason.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/qcom,restart-reason.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm IPQ SoC restart reason location + +maintainers: + - Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> + +description: + The Qualcomm IPQ SoC restart reason memory region, in IMEM, is used to + identify the cause of the system restart. This will be helpful to identify + the cause when the RAM dump collection is disabled. + +properties: + compatible: + const: qcom,restart-reason-info + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + imem@8600000 { + compatible = "qcom,ipq5424-imem", "syscon", "simple-mfd"; + reg = <0x08600000 0x1000>; + + #address-cells = <1>; + #size-cells = <1>; + + ranges = <0 0x08600000 0x1000>; + + restart-reason@7b0 { + compatible = "qcom,restart-reason-info"; + reg = <0x7b0 0x4>; + }; + }; +...
Add a devicetree binding for the Qualcomm IPQ SOCs restart reason information region found in the IMEM, allowing the system to identify the cause of a restart. Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@oss.qualcomm.com> --- .../bindings/watchdog/qcom,restart-reason.yaml | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+)