Re: [PATCH v30 6/7] arm64: dts: imx8ulp: add secure enclave node

[email protected]
Newsgroups dev.linux.lists.imx,org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing 'memory-region' DT property causes EdgeLock Enclave driver probe failure
--

--- Patch [6]: [PATCH v30 6/7] arm64: dts: imx8ulp: add secure enclave node ---
commit dd89141b9b11f1e2b0130369e668c9487347c666
Author: Pankaj Gupta <[email protected]>

arm64: dts: imx8ulp: add secure enclave node

This commit adds support for the NXP secure enclave called EdgeLock Enclave
firmware for imx8ulp-evk. It adds the sram0 label and a new secure-enclave
device tree node.

> diff --git a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
> index c6d1bb9edf388..182f1444b6434 100644
> --- a/arch/arm64/boot/dts/freescale/imx8ulp.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8ulp.dtsi

[ ... ]

> @@ -185,6 +185,13 @@ scmi_sensor: protocol@15 {
>  				#thermal-sensor-cells = <1>;
>  			};
>  		};
> +
> +		hsm0: secure-enclave {
> +			compatible = "fsl,imx8ulp-se-ele-hsm";
> +			mbox-names = "tx", "rx";
> +			mboxes = <&s4muap 0 0>, <&s4muap 1 0>;
> +			sram = <&sram0>;
> +		};

[Severity: High]
Will this node cause the EdgeLock Enclave driver probe to fail?

Looking at se_if_probe() in drivers/firmware/imx/se_ctrl.c, the driver requires
reserved memory initialization when reserved_dma_ranges is set (which is true
for the fsl,imx8ulp-se-ele-hsm compatibility string):

drivers/firmware/imx/se_ctrl.c:se_if_probe() {
    ...
	if (if_node->reserved_dma_ranges) {
		ret = of_reserved_mem_device_init(dev);
		if (ret)
			return dev_err_probe(dev, ret,
					    "Failed to init reserved memory region.");
	}
    ...
}

Since the memory-region property is missing from this new device tree node,
of_reserved_mem_device_init() will return an error, causing the probe to
unconditionally abort. Should a memory-region property be included here to
prevent the probe failure?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.