From nobody Fri Dec 19 14:37:44 2025 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A931221C19E; Tue, 20 May 2025 10:27:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747736850; cv=none; b=fdY2+XgeIMFjg0hG189Wuu6/RIVmOFaKgmc/Jcsu3spe5V84dVgaVna/nFvX/bJK5lf5wiy9ltCcdW0rWRXLkIKd6GeIhA/4rjhgjTlBqgU6zCTCsplsYA2cS1Ltpfbn54+mpgHpd3Q2x9R3twx9hGRWD2djFg0R+s6/ISl65HI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747736850; c=relaxed/simple; bh=+o7PLRyztiUT3BBNzHkyk2aF/xJ7+yHZvJb5sT+D7T4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XxQaphcCV/nRabGcp69VnlCS0dwxcWduBPGNJRtLoadSaKgjtHNBZuKLJDNvFHjaAHT21goI+VHe7vIB/lj/X7qsp8X48OEMtjmWsGV4i+52SGEEyqgek0+Jkya/cW0A3CtsEX1DZpy7DloXqb80cIvVLaseBtKqIEQN7gadhjw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tomeuvizoso.net; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tomeuvizoso.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-43cfe63c592so60006145e9.2; Tue, 20 May 2025 03:27:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747736847; x=1748341647; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PXhoVUi0+m1gZCgJKohaV7IW2GiBpameMIg/gICe73c=; b=P2979p6PY+Yt3bpWBulL3VUOJClD5zN4uQEmlI/4cAxFiT3zSngxQBZYeMYZwHlrlK Az13vIbUet13rBfb9EvOGLXmhVzGupdGOcbHGcBz9ETjaLKHpPwqLNfg+GwtI8NO5low WfQmeTQlCw6fVU0FU4j9/f8+y73mBdQInnBNNRv/PfrqAbFGgd+UJjqmyAA1ZZfWA6HF F9MVhSAxycr1syjrUUrUZaQh7/5s13GLXkOa6gcK69m//VyzjyY5xSEqzyr3EJQ0yS10 TvkAo7byzXcasBaUJaFEBEzROSwNB3W/fQHmB4+za+Xx7itld0jcDR53FODrHSaIS0jo FpOg== X-Forwarded-Encrypted: i=1; AJvYcCUBF8xW3DOI45vRq8V2P9gwLi7uZqH+mUmcSuHpusa0/JTeMJCs1qDTv6ZScM8sg7LsH8M+WRuKQN6a5vk=@vger.kernel.org, AJvYcCUJldLwMFVyHrjdhPDq7nr7fWcgrk0X8fc0zOcQBTtXLWJZm4LAGsvRUS8xHEMmaqHtidUZ/DMMZaI=@vger.kernel.org, AJvYcCVBU1s+vEiIDz++zmMZc4Dxly5cy3g9MzwTYDmmIdxhafd00NDAoZt9HOIL+OuAM4cm+rczYCEKqQIBb1Nj@vger.kernel.org X-Gm-Message-State: AOJu0YwGW78INRKYnSKDeQ2pEIekMe8azF+6+lSq14hlJ3PSTdgcPolc nrbbN5zl+jVbbHVxpgpFkBTljD8X5M8GcTzBaJKbTKmi1rjxSFhJLDIkXjTKe/cj X-Gm-Gg: ASbGncty4d/D42zbMneRkpHihlg25esKBbe3/0UoWPxdQ3gPK4+qg2J3cp7lW7KglIA U15115X8Uzk4edvI99xE2m64xPi8pGVrAtEhEiP1GcnQfdKEnOtP0DFMsVimCgA8IELAVq3A2pi q9CVtD2u4Fs8hrchdIo+pFK9abdW2U2tAnYb5quUjrYUGv1dffQV2gngioS6cT2L3qHQFN7Zp2C ibm19aotZ1tqXYUvCl8T2QWZDO4qRYuJhStJg2nfnnVTTIb9Wr84hodS6phxuvueRiQ1v14r0Xs v70v1tcR7B5mn1IOIhb8kqTYAHgKLnc7tp5UmbBNtCRhM8q7oHtX9leGVQ6zL8z2y8vIH0Z4Isu zHLFwBAijng== X-Google-Smtp-Source: AGHT+IHv94G5hkxtUwn1EnqN1XVOVVJksOTAOYoYtlVyJF0D9UTpIdTOo1WTTeXt5HNCSsUqmuSgjw== X-Received: by 2002:a05:600c:1d8d:b0:43c:f44c:72a6 with SMTP id 5b1f17b1804b1-442fd60a41cmr168843945e9.2.1747736846693; Tue, 20 May 2025 03:27:26 -0700 (PDT) Received: from [10.42.0.1] (cst-prg-46-162.cust.vodafone.cz. [46.135.46.162]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-447f73d3defsm24680025e9.18.2025.05.20.03.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 May 2025 03:27:26 -0700 (PDT) From: Tomeu Vizoso Date: Tue, 20 May 2025 12:26:54 +0200 Subject: [PATCH v5 01/10] dt-bindings: npu: rockchip,rknn: Add bindings Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250520-6-10-rocket-v5-1-18c9ca0fcb3c@tomeuvizoso.net> References: <20250520-6-10-rocket-v5-0-18c9ca0fcb3c@tomeuvizoso.net> In-Reply-To: <20250520-6-10-rocket-v5-0-18c9ca0fcb3c@tomeuvizoso.net> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Oded Gabbay , Jonathan Corbet , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Sebastian Reichel , Nicolas Frattaroli , Jeff Hugo Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Tomeu Vizoso X-Mailer: b4 0.14.2 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) Signed-off-by: Sebastian Reichel Signed-off-by: Tomeu Vizoso Reviewed-by: Krzysztof Kozlowski --- .../bindings/npu/rockchip,rk3588-rknn-core.yaml | 147 +++++++++++++++++= ++++ 1 file changed, 147 insertions(+) diff --git a/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-cor= e.yaml b/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.ya= ml new file mode 100644 index 0000000000000000000000000000000000000000..9eb426367afcbc03c387d43c4b8= 250cdd1b9ee86 --- /dev/null +++ b/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml @@ -0,0 +1,147 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/npu/rockchip,rk3588-rknn-core.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Neural Processing Unit IP from Rockchip + +maintainers: + - Tomeu Vizoso + +description: + Rockchip IP for accelerating inference of neural networks, based on NVID= IA's + open source NVDLA IP. + + There is to be a node per each core in the NPU. In Rockchip's design the= re + will be one core that is special and needs to be powered on before any o= f the + other cores can be used. This special core is called the top core and sh= ould + have the compatible string that corresponds to top cores. + +properties: + $nodename: + pattern: '^npu@[a-f0-9]+$' + + compatible: + enum: + - rockchip,rk3588-rknn-core-top + - rockchip,rk3588-rknn-core + + reg: + maxItems: 3 + + reg-names: + items: + - const: pc + - const: cna + - const: core + + clocks: + minItems: 2 + maxItems: 4 + + clock-names: + items: + - const: aclk + - const: hclk + - const: npu + - const: pclk + minItems: 2 + + interrupts: + maxItems: 1 + + iommus: + maxItems: 1 + + npu-supply: true + + power-domains: + maxItems: 1 + + resets: + maxItems: 2 + + reset-names: + items: + - const: srst_a + - const: srst_h + + sram-supply: true + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - interrupts + - iommus + - power-domains + - resets + - reset-names + - npu-supply + - sram-supply + +allOf: + - if: + properties: + compatible: + contains: + enum: + - rockchip,rknn-core-top + then: + properties: + clocks: + minItems: 4 + + clock-names: + minItems: 4 + - if: + properties: + compatible: + contains: + enum: + - rockchip,rknn-core + then: + properties: + clocks: + maxItems: 2 + clock-names: + maxItems: 2 + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + #include + + bus { + #address-cells =3D <2>; + #size-cells =3D <2>; + + npu@fdab0000 { + compatible =3D "rockchip,rk3588-rknn-core-top"; + reg =3D <0x0 0xfdab0000 0x0 0x1000>, + <0x0 0xfdab1000 0x0 0x1000>, + <0x0 0xfdab3000 0x0 0x1000>; + reg-names =3D "pc", "cna", "core"; + assigned-clocks =3D <&scmi_clk SCMI_CLK_NPU>; + assigned-clock-rates =3D <200000000>; + clocks =3D <&cru ACLK_NPU0>, <&cru HCLK_NPU0>, + <&scmi_clk SCMI_CLK_NPU>, <&cru PCLK_NPU_ROOT>; + clock-names =3D "aclk", "hclk", "npu", "pclk"; + interrupts =3D ; + iommus =3D <&rknn_mmu_top>; + npu-supply =3D <&vdd_npu_s0>; + power-domains =3D <&power RK3588_PD_NPUTOP>; + resets =3D <&cru SRST_A_RKNN0>, <&cru SRST_H_RKNN0>; + reset-names =3D "srst_a", "srst_h"; + sram-supply =3D <&vdd_npu_mem_s0>; + }; + }; +... --=20 2.49.0