From patchwork Tue Feb 25 07:55:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13989420 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57287C021B8 for ; Tue, 25 Feb 2025 07:56:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D889D10E59A; Tue, 25 Feb 2025 07:56:07 +0000 (UTC) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id A4F5610E59A for ; Tue, 25 Feb 2025 07:56:04 +0000 (UTC) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-438a3216fc2so49848625e9.1 for ; Mon, 24 Feb 2025 23:56:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740470163; x=1741074963; 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=bttKeyS+W49kYKVE/Q0TanEzPtlhvTNN8fcNqxR6WQw=; b=H+qFcCP+n3Jbra+UO5dsFpdzghckJAp/St0HjRSLGSIanLNgCS0nhB0QWypU1QH4g+ ALyRerdlHcW2ACXAZnUb8JdTbem8ZCUQFRfL5Zc4JSiGIjvcDO4PFCdvgvOyT7q0TKQt 13S7+Hyzh9GuvXmCUujhEyXKcAIva3C5IXE+0ZofDsA9Q2MxsA7ynstbDWueSqpLgKKI DYe1lwMpoJdoUoc8pTJ5e+VYTb6kRCoYCfga0cxpEK54trjA8G0OnF1+HXKlEBlEml3+ WXNymv5hr8KK4KdTNkE0JmQbH2sk/Mwtj0DiF3QlIuMiaSunSFhiSVmVbrVyFtRANgC/ 8PNA== X-Forwarded-Encrypted: i=1; AJvYcCXqIDbLQUu3RdUJumFE1ksb3thtxtAQKxKeX1v/mcH33XSpVa7m4W9z3TgbIdIoSENKUIUueO/ao3g=@lists.freedesktop.org X-Gm-Message-State: AOJu0YwMbLob96ThlRLAh/qZhg60ivGUEEoVjqF0STTB8jLsrr6Y1EYO 6JZz3oCFwKeoucfdPkwycfHk/u1UiO1CElGBd2dC/xj6r8vGhpLxFOCWckGDR0I= X-Gm-Gg: ASbGncuN7GCfo76UjYIldDRBWiHn1jmXx5PJpbnopuQU5TwnLAv5qpzYoQXXtCk4MR5 lCOXo2kuNBtxAFA6zVeH2fgCsGybs2uf+60lExhr5/Eb1o34Q+4LU+/rcjIn9aUhJCZxZ4PaGjf 7X0oSBI5EP45gdGuPBfDq4dRlq0962Cq0biu99c7mqI29+9jur0tXLiWq8lJIjEQjXw3Phz42Dj UxqDEiH8/0qPj0efMQyf0JZg74xCbXZHbqNfzHKnvz1wd1PstTv/xnBvBMJKVajHYK0SyXjaWWU 4NBRGNN1gsoGVFj2WCu4mmwZbM7rhjnxU5SVjCNyD4HW5iT9WSGUs7JIcw== X-Google-Smtp-Source: AGHT+IGlnf3zeYcKfw6UHFzFMOBrY9gNCtvaCQ4A3tiD1q4/beEfrfwhp2DF03Do2Fta+a8Paidiyg== X-Received: by 2002:a05:600c:470a:b0:439:a139:7a19 with SMTP id 5b1f17b1804b1-439aebb3155mr125686995e9.23.1740470162856; Mon, 24 Feb 2025 23:56:02 -0800 (PST) Received: from [10.42.0.1] (cst-prg-37-50.cust.vodafone.cz. [46.135.37.50]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02f2475sm130299475e9.20.2025.02.24.23.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 23:56:02 -0800 (PST) From: Tomeu Vizoso Date: Tue, 25 Feb 2025 08:55:48 +0100 Subject: [PATCH v2 2/7] arm64: dts: rockchip: Add nodes for NPU and its MMU to rk3588s MIME-Version: 1.0 Message-Id: <20250225-6-10-rocket-v2-2-d4dbcfafc141@tomeuvizoso.net> References: <20250225-6-10-rocket-v2-0-d4dbcfafc141@tomeuvizoso.net> In-Reply-To: <20250225-6-10-rocket-v2-0-d4dbcfafc141@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 , Jeffrey 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" See Chapter 36 "RKNN" from the RK3588 TRM (Part 1). This is a derivative of NVIDIA's NVDLA, but with its own front-end processor. The IP is divided in three cores, programmed independently. The first core though is special, requiring to be powered on before any of the others can be used. The IOMMU of the first core is also special in that it has two subunits (read/write?) that need to be programmed in sync. v2: - Have one device for each NPU core (Sebastian Reichel) - Have one device for each IOMMU (Sebastian Reichel) - Correctly sort nodes (Diederik de Haas) - Add rockchip,iommu compatible to IOMMU nodes (Sebastian Reichel) Signed-off-by: Tomeu Vizoso --- arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 76 +++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi index 8cfa30837ce72581d0b513a8274ab0177eb5ae15..2680ed854e0c2ba5de167740ef18fcee167016fe 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi @@ -1125,6 +1125,82 @@ power-domain@RK3588_PD_SDMMC { }; }; + rknn_core_top: npu-core@fdab0000 { + compatible = "rockchip,rk3588-rknn-core-top", "rockchip,rknn-core-top"; + reg = <0x0 0xfdab0000 0x0 0x9000>; + interrupts = ; + clocks = <&scmi_clk SCMI_CLK_NPU>, <&cru PCLK_NPU_ROOT>, + <&cru ACLK_NPU0>, <&cru HCLK_NPU0>; + clock-names = "aclk", "hclk", "npu", "pclk"; + assigned-clocks = <&scmi_clk SCMI_CLK_NPU>; + assigned-clock-rates = <200000000>; + resets = <&cru SRST_A_RKNN0>, <&cru SRST_H_RKNN0>; + reset-names = "srst_a", "srst_h"; + power-domains = <&power RK3588_PD_NPUTOP>; + iommus = <&rknn_mmu_top>; + status = "disabled"; + }; + + rknn_mmu_top: iommu@fdab9000 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdab9000 0x0 0x100>, + <0x0 0xfdaba000 0x0 0x100>; + interrupts = ; + clocks = <&cru ACLK_NPU0>, <&cru HCLK_NPU0>; + clock-names = "aclk", "iface"; + #iommu-cells = <0>; + power-domains = <&power RK3588_PD_NPUTOP>; + status = "disabled"; + }; + + rknn_core_1: npu-core@fdac0000 { + compatible = "rockchip,rk3588-rknn-core", "rockchip,rknn-core"; + reg = <0x0 0xfdac0000 0x0 0x9000>; + interrupts = ; + clocks = <&cru ACLK_NPU1>, <&cru HCLK_NPU1>; + clock-names = "aclk", "hclk"; + resets = <&cru SRST_A_RKNN1>, <&cru SRST_H_RKNN1>; + reset-names = "srst_a", "srst_h"; + power-domains = <&power RK3588_PD_NPU1>; + iommus = <&rknn_mmu_1>; + status = "disabled"; + }; + + rknn_mmu_1: iommu@fdac9000 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdaca000 0x0 0x100>; + interrupts = ; + clocks = <&cru ACLK_NPU1>, <&cru HCLK_NPU1>; + clock-names = "aclk", "iface"; + #iommu-cells = <0>; + power-domains = <&power RK3588_PD_NPU1>; + status = "disabled"; + }; + + rknn_core_2: npu-core@fdad0000 { + compatible = "rockchip,rk3588-rknn-core", "rockchip,rknn-core"; + reg = <0x0 0xfdad0000 0x0 0x9000>; + interrupts = ; + clocks = <&cru ACLK_NPU2>, <&cru HCLK_NPU2>; + clock-names = "aclk", "hclk"; + resets = <&cru SRST_A_RKNN2>, <&cru SRST_H_RKNN2>; + reset-names = "srst_a", "srst_h"; + power-domains = <&power RK3588_PD_NPU2>; + iommus = <&rknn_mmu_2>; + status = "disabled"; + }; + + rknn_mmu_2: iommu@fdad9000 { + compatible = "rockchip,rk3588-iommu", "rockchip,rk3568-iommu"; + reg = <0x0 0xfdada000 0x0 0x100>; + interrupts = ; + clocks = <&cru ACLK_NPU2>, <&cru HCLK_NPU2>; + clock-names = "aclk", "iface"; + #iommu-cells = <0>; + power-domains = <&power RK3588_PD_NPU2>; + status = "disabled"; + }; + vpu121: video-codec@fdb50000 { compatible = "rockchip,rk3588-vpu121", "rockchip,rk3568-vpu"; reg = <0x0 0xfdb50000 0x0 0x800>;