Re: [PATCH v2 3/4] firmware: qcom: scm: Add minidump SRAM support
From: Konrad Dybcio
Date: Thu May 21 2026 - 06:28:25 EST
On 5/19/26 7:14 PM, Mukesh Ojha wrote:
> On most Qualcomm SoCs where minidump is supported, a word in always-on
> SRAM is shared between the kernel and boot firmware. Before DDR is
> initialised on the warm reset following a crash, firmware reads this
> word to decide if minidump is enabled and collect a minidump and where
> to deliver it (USB upload to a host, or save to local storage).
>
> The SRAM region is described by a 'sram' phandle on the SCM DT node.
> If the property is absent the feature is silently disabled, keeping
> existing SoCs unaffected.
>
> Expose a 'minidump_dest' module parameter (default: usb) so the user can
> select the destination. Only the string names "usb" or "storage" are
> accepted; an invalid value is rejected with -EINVAL. Changing the
> destination while minidump mode is already active updates SRAM immediately.
>
> Signed-off-by: Mukesh Ojha <mukesh.ojha@xxxxxxxxxxxxxxxx>
> ---
[...]
> +static int qcom_scm_map_minidump_sram(struct device *dev, void __iomem **out)
> +{
> + struct device_node *np = dev->of_node;
> + struct device_node *sram_np;
> + struct resource res;
> + int ret;
> +
> + if (!of_property_present(np, "sram"))
> + return 0;
I think of_parse_phandle() calls this indirectly already
> +
> + sram_np = of_parse_phandle(np, "sram", 0);
> + if (!sram_np)
> + return -EINVAL;
> +
> + ret = of_address_to_resource(sram_np, 0, &res);
> + of_node_put(sram_np);
> + if (ret)
> + return ret;
> +
> + if (resource_size(&res) < sizeof(u32)) {
> + dev_err(dev, "minidump SRAM region too small\n");
> + return -EINVAL;
I don't know if this is possible in practice
Konrad