Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: npu: rockchip,rknn: Add bindings

Add the bindings for the Neural Processing Unit IP from Rockchip.

v2:
- Adapt to new node structure (one node per core, each with its own
IOMMU)
- Several misc. fixes from Sebastian Reichel

v3:
- Split register block in its constituent subblocks, and only require
the ones that the kernel would ever use (Nicolas Frattaroli)
- Group supplies (Rob Herring)
- Explain the way in which the top core is special (Rob Herring)

v4:
- Change required node name to npu@ (Rob Herring and Krzysztof Kozlowski)
- Remove unneeded items: (Krzysztof Kozlowski)
- Fix use of minItems/maxItems (Krzysztof Kozlowski)
- Add reg-names to list of required properties (Krzysztof Kozlowski)
- Fix example (Krzysztof Kozlowski)

v5:
- Rename file to rockchip,rk3588-rknn-core.yaml (Krzysztof Kozlowski)
- Streamline compatible property (Krzysztof Kozlowski)

v6:
- Remove mention to NVDLA, as the hardware is only incidentally related
(Kever Yang)
- Mark pclk and npu clocks as required by all clocks (Rob Herring)

v7:
- Remove allOf section, not needed now that all nodes require 4 clocks
(Heiko Stübner)

v8:
- Remove notion of top core (Robin Murphy)

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250721-6-10-rocket-v9-6-77ebd484941e@tomeuvizoso.net

authored by

Tomeu Vizoso and committed by
Jeff Hugo
a7352c84 525ad89d

+112
+112
Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/npu/rockchip,rk3588-rknn-core.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Neural Processing Unit IP from Rockchip 8 + 9 + maintainers: 10 + - Tomeu Vizoso <tomeu@tomeuvizoso.net> 11 + 12 + description: 13 + Rockchip IP for accelerating inference of neural networks. 14 + 15 + There is to be a node per each NPU core in the SoC, and each core should reference all the 16 + resources that it needs to function, such as clocks, power domains, and resets. 17 + 18 + properties: 19 + $nodename: 20 + pattern: '^npu@[a-f0-9]+$' 21 + 22 + compatible: 23 + enum: 24 + - rockchip,rk3588-rknn-core 25 + 26 + reg: 27 + maxItems: 3 28 + 29 + reg-names: 30 + items: 31 + - const: pc # Program Control-related registers 32 + - const: cna # Convolution Neural Network Accelerator registers 33 + - const: core # Main NPU core processing unit registers 34 + 35 + clocks: 36 + maxItems: 4 37 + 38 + clock-names: 39 + items: 40 + - const: aclk 41 + - const: hclk 42 + - const: npu 43 + - const: pclk 44 + 45 + interrupts: 46 + maxItems: 1 47 + 48 + iommus: 49 + maxItems: 1 50 + 51 + npu-supply: true 52 + 53 + power-domains: 54 + maxItems: 1 55 + 56 + resets: 57 + maxItems: 2 58 + 59 + reset-names: 60 + items: 61 + - const: srst_a 62 + - const: srst_h 63 + 64 + sram-supply: true 65 + 66 + required: 67 + - compatible 68 + - reg 69 + - reg-names 70 + - clocks 71 + - clock-names 72 + - interrupts 73 + - iommus 74 + - power-domains 75 + - resets 76 + - reset-names 77 + - npu-supply 78 + - sram-supply 79 + 80 + additionalProperties: false 81 + 82 + examples: 83 + - | 84 + #include <dt-bindings/clock/rockchip,rk3588-cru.h> 85 + #include <dt-bindings/interrupt-controller/irq.h> 86 + #include <dt-bindings/interrupt-controller/arm-gic.h> 87 + #include <dt-bindings/power/rk3588-power.h> 88 + #include <dt-bindings/reset/rockchip,rk3588-cru.h> 89 + 90 + bus { 91 + #address-cells = <2>; 92 + #size-cells = <2>; 93 + 94 + npu@fdab0000 { 95 + compatible = "rockchip,rk3588-rknn-core"; 96 + reg = <0x0 0xfdab0000 0x0 0x1000>, 97 + <0x0 0xfdab1000 0x0 0x1000>, 98 + <0x0 0xfdab3000 0x0 0x1000>; 99 + reg-names = "pc", "cna", "core"; 100 + clocks = <&cru ACLK_NPU0>, <&cru HCLK_NPU0>, 101 + <&scmi_clk SCMI_CLK_NPU>, <&cru PCLK_NPU_ROOT>; 102 + clock-names = "aclk", "hclk", "npu", "pclk"; 103 + interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>; 104 + iommus = <&rknn_mmu_0>; 105 + npu-supply = <&vdd_npu_s0>; 106 + power-domains = <&power RK3588_PD_NPUTOP>; 107 + resets = <&cru SRST_A_RKNN0>, <&cru SRST_H_RKNN0>; 108 + reset-names = "srst_a", "srst_h"; 109 + sram-supply = <&vdd_npu_mem_s0>; 110 + }; 111 + }; 112 + ...