From b139f1cf975f9968eb8bd1182a173b976ecf06f9 Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Mon, 15 Aug 2022 17:12:58 +0200 Subject: feat(ethos-n)!: add support for SMMU streams The Arm(R) Ethos(TM)-N NPU driver now supports configuring the SMMU streams that the NPU shall use and will therefore no longer delegate access to these registers to the non-secure world. In order for the driver to support this, the device tree parsing has been updated to support parsing the allocators used by the NPU and what SMMU stream that is associated with each allocator. To keep track of what NPU device each allocator is associated with, the resulting config from the device tree parsing will now group the NPU cores and allocators into their respective NPU device. The SMC API has been changed to allow the caller to specify what allocator the NPU shall be configured to use and the API version has been bumped to indicate this change. Signed-off-by: Mikael Olsson Change-Id: I6ac43819133138614e3f55a014e93466fe3d5277 --- fdts/juno-ethosn.dtsi | 71 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 11 deletions(-) (limited to 'fdts') diff --git a/fdts/juno-ethosn.dtsi b/fdts/juno-ethosn.dtsi index e2f33550e..460952482 100644 --- a/fdts/juno-ethosn.dtsi +++ b/fdts/juno-ethosn.dtsi @@ -1,12 +1,13 @@ /* - * Copyright (c) 2021, Arm Limited. All rights reserved. + * Copyright (c) 2021-2022, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ /* - * For examples of multi-core and multi-device NPU, refer to the examples given in the - * Arm Ethos-N NPU driver stack. + * This device tree is only an example and some properties have been omitted. + * + * Refer to the Arm(R) Ethos(TM)-N driver stack for complete device tree examples. * https://github.com/ARM-software/ethos-n-driver-stack */ @@ -14,14 +15,62 @@ #address-cells = <2>; #size-cells = <2>; - ethosn0: ethosn@6f300000 { - compatible = "ethosn"; - reg = <0 0x6f300000 0 0x00100000>; + smmu_ethosn0: iommu@6f400000 { + compatible = "arm,smmu-v3"; + reg = <0 0x6f400000 0 0x80000>; status = "okay"; - - core0 { - compatible = "ethosn-core"; - status = "okay"; - }; + /* msi-parent omitted */ + #iommu-cells = <0x1>; }; + + ethosn0: ethosn@6f300000 { + compatible = "ethosn"; + reg = <0 0x6f300000 0 0x00100000>; + status = "okay"; + + core0 { + compatible = "ethosn-core"; + status = "okay"; + + main_allocator { + compatible = "ethosn-main_allocator"; + status = "okay"; + + firmware { + compatible = "ethosn-memory"; + iommus = <&smmu_ethosn0 0>; + }; + + working_data { + compatible = "ethosn-memory"; + iommus = <&smmu_ethosn0 1>; + }; + }; + }; + + asset_allocator { + compatible = "ethosn-asset_allocator"; + status = "okay"; + + command_stream { + compatible = "ethosn-memory"; + iommus = <&smmu_ethosn0 2>; + }; + + weight_data { + compatible = "ethosn-memory"; + iommus = <&smmu_ethosn0 3>; + }; + + buffer_data { + compatible = "ethosn-memory"; + iommus = <&smmu_ethosn0 4>; + }; + + intermediate_data { + compatible = "ethosn-memory"; + iommus = <&smmu_ethosn0 5>; + }; + }; + }; }; -- cgit v1.2.1