linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 0/3] soc: qcom: Add download mode support for QTI platforms
       [not found] <cover.1628757036.git.saiprakash.ranjan@codeaurora.org>
@ 2021-08-13  0:16 ` Stephen Boyd
  2021-08-13  4:31   ` Trilok Soni
       [not found] ` <217c22d40e0a9db713e2a55623408eca88166897.1628757036.git.saiprakash.ranjan@codeaurora.org>
       [not found] ` <39064a2db95ccc2cb5eef003569bef2de651c8ed.1628757036.git.saiprakash.ranjan@codeaurora.org>
  2 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2021-08-13  0:16 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Rob Herring, Sai Prakash Ranjan
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Rajendra Nayak, Sibi Sankar

Quoting Sai Prakash Ranjan (2021-08-12 02:17:39)
> Collecting ramdumps on QTI platforms mainly require two things,
> SDI (System Debug Image) enabled firmware and kernel support to
> configure download mode cookies and SDI settings. Ramdumps can
> be collected once the system enters the download mode. To enter
> download mode, magic values or cookies need to be set in IMEM
> which is used by firmware to decide to enter download mode or not.
> Download mode cookies remain the same across targets and SDI disable
> register needs to be set or SDI needs to be disabled in case of normal
> reboot since ramdumps are supposed to be for crash debugging and
> not for every reboot. This series adds the kernel support required
> to enter download mode.

I don't recall if we discussed this on the list, but I'd really prefer
that we don't make kernel changes to support this beyond implementing
PSCI SYSTEM_RESET2 support and then some sort of vendor specific (or if
ARM is willing to update the spec then ARM specific) reset command on
panic reboot paths. The idea is to set the cookie in the bootloader
before the kernel is booted, then any insta-reboots/watchdogs would go
into download mode, no special init code required to lay down the cookie
or clear it on normal reboot. The normal reboot PSCI call would clear
the cookie in the firmware, in case something goes wrong after the
kernel hands off control to PSCI, and then panics that want to go into
download mode would make the SYSTEM_RESET2 reboot call into PSCI that
sets the cookie.

Maybe it could be a linux specific psci number or maybe we could
configure the reboot call in the psci node to be this specific number so
that it can be different based on the firmware implementation if
consolidating around a single number doesn't work. Either way, that all
seems manageable and we can keep these cookie details out of the kernel
and the reboot/panic paths.

>
> Currently this series doesn't add support for android targets where
> a couple of SCM calls are required to set/unset the download mode
> cookies and SDI configuration but can be easily added gradually to
> the same driver, so as of now only chrome platforms are supported
> and tested.
>
> Sai Prakash Ranjan (3):
>   soc: qcom: Add download mode support
>   dt-bindings: msm: Add QTI download mode support binding
>   arm64: dts: qcom: sc7180: Add IMEM, pil info and download mode region
>
>  .../bindings/arm/msm/qcom,dload-mode.yaml     |  53 ++++++
>  MAINTAINERS                                   |   7 +
>  arch/arm64/boot/dts/qcom/sc7180.dtsi          |  21 +++
>  drivers/soc/qcom/Kconfig                      |  10 ++
>  drivers/soc/qcom/Makefile                     |   1 +
>  drivers/soc/qcom/download_mode.c              | 152 ++++++++++++++++++
>  6 files changed, 244 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,dload-mode.yaml
>  create mode 100644 drivers/soc/qcom/download_mode.c

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/3] soc: qcom: Add download mode support for QTI platforms
  2021-08-13  0:16 ` [PATCH 0/3] soc: qcom: Add download mode support for QTI platforms Stephen Boyd
@ 2021-08-13  4:31   ` Trilok Soni
  0 siblings, 0 replies; 4+ messages in thread
From: Trilok Soni @ 2021-08-13  4:31 UTC (permalink / raw)
  To: Stephen Boyd, Andy Gross, Bjorn Andersson, Rob Herring,
	Sai Prakash Ranjan
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-arm-msm,
	Rajendra Nayak, Sibi Sankar, quic_eberman

Stephen,

On 8/12/2021 5:16 PM, Stephen Boyd wrote:
> Quoting Sai Prakash Ranjan (2021-08-12 02:17:39)
>> Collecting ramdumps on QTI platforms mainly require two things,
>> SDI (System Debug Image) enabled firmware and kernel support to
>> configure download mode cookies and SDI settings. Ramdumps can
>> be collected once the system enters the download mode. To enter
>> download mode, magic values or cookies need to be set in IMEM
>> which is used by firmware to decide to enter download mode or not.
>> Download mode cookies remain the same across targets and SDI disable
>> register needs to be set or SDI needs to be disabled in case of normal
>> reboot since ramdumps are supposed to be for crash debugging and
>> not for every reboot. This series adds the kernel support required
>> to enter download mode.
> 
> I don't recall if we discussed this on the list, but I'd really prefer
> that we don't make kernel changes to support this beyond implementing
> PSCI SYSTEM_RESET2 support and then some sort of vendor specific (or if
> ARM is willing to update the spec then ARM specific) reset command on
> panic reboot paths. The idea is to set the cookie in the bootloader
> before the kernel is booted, then any insta-reboots/watchdogs would go
> into download mode, no special init code required to lay down the cookie
>>   create mode 100644 drivers/soc/qcom/download_mode.c

Some discussion by Elliot on the PSCI_SYSTEM_RESET2 and vendor bits was 
done here. You may want to check.

https://lkml.org/lkml/2020/2/24/1137

---Trilok Soni

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] dt-bindings: msm: Add QTI download mode support binding
       [not found] ` <217c22d40e0a9db713e2a55623408eca88166897.1628757036.git.saiprakash.ranjan@codeaurora.org>
@ 2021-08-17 21:28   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2021-08-17 21:28 UTC (permalink / raw)
  To: Sai Prakash Ranjan
  Cc: Andy Gross, Bjorn Andersson, devicetree, Stephen Boyd,
	linux-arm-kernel, linux-kernel, linux-arm-msm, Rajendra Nayak,
	Sibi Sankar

On Thu, Aug 12, 2021 at 02:47:41PM +0530, Sai Prakash Ranjan wrote:
> Add device tree binding for QTI download mode cookies
> region found in IMEM.
> 
> Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> ---
>  .../bindings/arm/msm/qcom,dload-mode.yaml     | 53 +++++++++++++++++++
>  1 file changed, 53 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,dload-mode.yaml
> 
> diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,dload-mode.yaml b/Documentation/devicetree/bindings/arm/msm/qcom,dload-mode.yaml
> new file mode 100644
> index 000000000000..90b9b6a9b75e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/msm/qcom,dload-mode.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/arm/msm/qcom,dload-mode.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm Download Mode binding
> +
> +maintainers:
> +  - Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> +
> +description:
> +  Qualcomm download mode cookies memory region in IMEM is used by SDI
> +  (System Debug Image) firmware to determine whether to enter download
> +  mode or not to collect ramdump for post mortem debug.
> +
> +properties:
> +  compatible:
> +    const: qcom,dload-mode
> +
> +  reg:
> +    maxItems: 1
> +
> +  qcom,sdi-disable-regs:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    description:
> +      Phandle reference to a syscon representing TCSR followed by the
> +      offset and length for SDI disable register.
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    imem@146aa000 {
> +      compatible = "simple-mfd";

If this is just internal RAM, then we already have a binding for it and 
'simple-mfd' is not it.

> +      reg = <0x146aa000 0x2000>;
> +
> +      #address-cells = <1>;
> +      #size-cells = <1>;
> +
> +      ranges = <0 0x146aa000 0x2000>;
> +
> +      dload-mode@1c00 {
> +        compatible = "qcom,dload-mode";
> +        reg = <0x1c00 0x1000>;

0x1c00 + 0x1000 > 0x2000


> +        qcom,sdi-disable-regs = <&tcsr_regs 0x3a000 0x4>;
> +      };
> +    };
> +...
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: (subset) [PATCH 3/3] arm64: dts: qcom: sc7180: Add IMEM, pil info and download mode region
       [not found] ` <39064a2db95ccc2cb5eef003569bef2de651c8ed.1628757036.git.saiprakash.ranjan@codeaurora.org>
@ 2021-09-27 22:56   ` Bjorn Andersson
  0 siblings, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2021-09-27 22:56 UTC (permalink / raw)
  To: Andy Gross, Sai Prakash Ranjan, Rob Herring
  Cc: linux-kernel, Rajendra Nayak, linux-arm-kernel, linux-arm-msm,
	Stephen Boyd, Sibi Sankar, devicetree

On Thu, 12 Aug 2021 14:47:42 +0530, Sai Prakash Ranjan wrote:
> Add IMEM, pil info and download mode DT nodes for SC7180 SoC which
> will help in the post-mortem debug.
> 
> 

Applied, thanks!

[3/3] arm64: dts: qcom: sc7180: Add IMEM, pil info and download mode region
      commit: ede638c42c82b1e6648a3c6ac71aaf088ff830e2

Best regards,
-- 
Bjorn Andersson <bjorn.andersson@linaro.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-09-27 22:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1628757036.git.saiprakash.ranjan@codeaurora.org>
2021-08-13  0:16 ` [PATCH 0/3] soc: qcom: Add download mode support for QTI platforms Stephen Boyd
2021-08-13  4:31   ` Trilok Soni
     [not found] ` <217c22d40e0a9db713e2a55623408eca88166897.1628757036.git.saiprakash.ranjan@codeaurora.org>
2021-08-17 21:28   ` [PATCH 2/3] dt-bindings: msm: Add QTI download mode support binding Rob Herring
     [not found] ` <39064a2db95ccc2cb5eef003569bef2de651c8ed.1628757036.git.saiprakash.ranjan@codeaurora.org>
2021-09-27 22:56   ` (subset) [PATCH 3/3] arm64: dts: qcom: sc7180: Add IMEM, pil info and download mode region Bjorn Andersson

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