devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu@tomeuvizoso.net>
To: Robin Murphy <robin.murphy@arm.com>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Oded Gabbay" <ogabbay@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	"Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>,
	"Kever Yang" <kever.yang@rock-chips.com>,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Da Xue" <da@libre.computer>,
	"Jeff Hugo" <jeff.hugo@oss.qualcomm.com>,
	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,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH v7 06/10] dt-bindings: npu: rockchip,rknn: Add bindings
Date: Fri, 11 Jul 2025 18:02:29 +0200	[thread overview]
Message-ID: <CAAObsKCinmbFwRqWTOCB3uoH0YLUm3wkvQ7GUhtESzHnAieGxw@mail.gmail.com> (raw)
In-Reply-To: <a8c3df16-a460-49bb-ba4e-1a07135d24e5@arm.com>

On Tue, Jun 24, 2025 at 3:27 PM Robin Murphy <robin.murphy@arm.com> wrote:
>
> On 2025-06-06 7:28 am, Tomeu Vizoso wrote:
> > 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)
> >
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > ---
> >   .../bindings/npu/rockchip,rk3588-rknn-core.yaml    | 118 +++++++++++++++++++++
> >   1 file changed, 118 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml b/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..0588c085a723a34f4fa30a9680ea948d960b092f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/npu/rockchip,rk3588-rknn-core.yaml
> > @@ -0,0 +1,118 @@
> > +# 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 <tomeu@tomeuvizoso.net>
> > +
> > +description:
> > +  Rockchip IP for accelerating inference of neural networks.
> > +
> > +  There is to be a node per each core in the NPU. In Rockchip's design there
> > +  will be one core that is special because it is able to redistribute work to
> > +  the other cores by forwarding register writes and sharing data. This special
> > +  core is called the top core and should have the compatible string that
> > +  corresponds to top cores.
>
> Say a future SoC, for scaling reasons, puts down two or more whole NPUs
> rather than just increasing the number of sub-cores in one? How is a DT
> consumer then going to know which "cores" are associated with which "top
> cores"? I think at the very least they want phandles in one direction or
> the other, but if there is a real functional hierarchy then I'd be
> strongly tempted to have the "core" nodes as children of their "top
> core", particularly since "forwarding register writes" sounds absolutely
> like something which could justify being represented as a "bus" in the
> DT sense.

Actually, I experimented with having the three cores as completely
independent units and things just work with how resources are
referenced in the DT nodes.

So I'm just having a top-level node per core with the same compatible.

Thanks,

Tomeu

> Thanks,
> Robin.
>
> > +
> > +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:
> > +    maxItems: 4
> > +
> > +  clock-names:
> > +    items:
> > +      - const: aclk
> > +      - const: hclk
> > +      - const: npu
> > +      - const: pclk
> > +
> > +  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
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/clock/rockchip,rk3588-cru.h>
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +    #include <dt-bindings/power/rk3588-power.h>
> > +    #include <dt-bindings/reset/rockchip,rk3588-cru.h>
> > +
> > +    bus {
> > +      #address-cells = <2>;
> > +      #size-cells = <2>;
> > +
> > +      npu@fdab0000 {
> > +        compatible = "rockchip,rk3588-rknn-core-top";
> > +        reg = <0x0 0xfdab0000 0x0 0x1000>,
> > +              <0x0 0xfdab1000 0x0 0x1000>,
> > +              <0x0 0xfdab3000 0x0 0x1000>;
> > +        reg-names = "pc", "cna", "core";
> > +        assigned-clocks = <&scmi_clk SCMI_CLK_NPU>;
> > +        assigned-clock-rates = <200000000>;
> > +        clocks = <&cru ACLK_NPU0>, <&cru HCLK_NPU0>,
> > +                 <&scmi_clk SCMI_CLK_NPU>, <&cru PCLK_NPU_ROOT>;
> > +        clock-names = "aclk", "hclk", "npu", "pclk";
> > +        interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH 0>;
> > +        iommus = <&rknn_mmu_top>;
> > +        npu-supply = <&vdd_npu_s0>;
> > +        power-domains = <&power RK3588_PD_NPUTOP>;
> > +        resets = <&cru SRST_A_RKNN0>, <&cru SRST_H_RKNN0>;
> > +        reset-names = "srst_a", "srst_h";
> > +        sram-supply = <&vdd_npu_mem_s0>;
> > +      };
> > +    };
> > +...
> >
>

  reply	other threads:[~2025-07-11 16:02 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06  6:28 [PATCH v7 00/10] New DRM accel driver for Rockchip's RKNN NPU Tomeu Vizoso
2025-06-06  6:28 ` [PATCH v7 01/10] accel/rocket: Add registers header Tomeu Vizoso
2025-06-19  8:39   ` Robert Foss
2025-06-06  6:28 ` [PATCH v7 02/10] accel/rocket: Add a new driver for Rockchip's NPU Tomeu Vizoso
2025-06-19  8:59   ` Robert Foss
2025-07-11 17:38   ` Andrew Davis
2025-07-12  8:10     ` Tomeu Vizoso
2025-06-06  6:28 ` [PATCH v7 03/10] accel/rocket: Add IOCTL for BO creation Tomeu Vizoso
2025-06-24 10:17   ` Robin Murphy
2025-07-01 19:31   ` Heiko Stübner
2025-07-11 17:40   ` Andrew Davis
2025-06-06  6:28 ` [PATCH v7 04/10] accel/rocket: Add job submission IOCTL Tomeu Vizoso
2025-06-24 13:50   ` Robin Murphy
2025-07-11 16:00     ` Tomeu Vizoso
2025-07-11 16:40       ` Robin Murphy
2025-07-11 16:45         ` Tomeu Vizoso
2025-06-30 20:56   ` Rob Herring
2025-06-06  6:28 ` [PATCH v7 05/10] accel/rocket: Add IOCTLs for synchronizing memory accesses Tomeu Vizoso
2025-06-24 16:52   ` Robin Murphy
2025-06-06  6:28 ` [PATCH v7 06/10] dt-bindings: npu: rockchip,rknn: Add bindings Tomeu Vizoso
2025-06-24 13:27   ` Robin Murphy
2025-07-11 16:02     ` Tomeu Vizoso [this message]
2025-06-06  6:28 ` [PATCH v7 07/10] arm64: dts: rockchip: add pd_npu label for RK3588 power domains Tomeu Vizoso
2025-06-06  6:28 ` [PATCH v7 08/10] arm64: dts: rockchip: Add nodes for NPU and its MMU to rk3588-base Tomeu Vizoso
2025-06-06  6:28 ` [PATCH v7 09/10] arm64: dts: rockchip: Enable the NPU on quartzpro64 Tomeu Vizoso
2025-06-06  6:28 ` [PATCH v7 10/10] arm64: dts: rockchip: enable NPU on ROCK 5B Tomeu Vizoso
2025-06-06  9:20   ` Nicolas Frattaroli
2025-06-07 12:24     ` Heiko Stübner
2025-06-19  9:01 ` [PATCH v7 00/10] New DRM accel driver for Rockchip's RKNN NPU Heiko Stuebner
2025-06-20  9:28 ` Heiko Stuebner
2025-06-24  5:03   ` Tomeu Vizoso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAObsKCinmbFwRqWTOCB3uoH0YLUm3wkvQ7GUhtESzHnAieGxw@mail.gmail.com \
    --to=tomeu@tomeuvizoso.net \
    --cc=airlied@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=da@libre.computer \
    --cc=daniel@fooishbar.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=jeff.hugo@oss.qualcomm.com \
    --cc=kever.yang@rock-chips.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=ogabbay@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sebastian.reichel@collabora.com \
    --cc=simona@ffwll.ch \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).