From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 34E8A74C14 for ; Tue, 10 Mar 2026 00:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773103157; cv=none; b=U2escU3OYvlvqAaOGOlPTcH4yS63K56lJjW//BsNtIMqvWIt8FdrgjqifMt7c7FeYAiFnsc9J9qTuVZcaNqT3aRpk6HZbGKN/PCX4IjmntbAw5pTgpLHMz9LQPfTUTa29XS2wKl1w1InGRpckGQTsYNP+lA4WKQ9lQ1A9rmZa9M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773103157; c=relaxed/simple; bh=VfnL3Xus5uZmgI4d29ykEWEX73BCxwrdj75GjQPw2jU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IWh/IfDJIWqO6JEBgHUHzkPSwUaCgwLgQYUEGVaXz9jSg5a4/Cvi55ilSfzPYyzZrx3RMI9KLe/uQ7m5DmqpD+nfDdCJzkpRilL3XiX949bkvE4fbu7OybYWRzt0eTST/kjZgxYETRjXGTJF8nmr1HG5Rvvi917EKRDPrf35Xm0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hQ9G3g82; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hQ9G3g82" Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-829b2019b39so1623454b3a.3 for ; Mon, 09 Mar 2026 17:39:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773103155; x=1773707955; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ASXXX0p2ZfcvRm4ZB6M2J7c/IWgAE9q2+BNtra206fc=; b=hQ9G3g82jLdYWGkPo279FL8Jry8/gaccsHLu3jTdvxiHNd7aLBNKfyCeTp+1Q1EGJR BWbua5UAJ0td65RFAXJXEILpXp0F3dYPgjNhLjpVXY8r8Kf3q+7gdaKSltZUeTlx1TOD GW9mhpGZJQlVfKbBCJQ5Gie59lA2oNKqyHwKQK8kUfzaRMgA2HG38uDGtk4vI65+cvS9 RPHsWMQMOpb0oqjEMoDKL3qAYCFC0KPG4YnZcKxeyyipQQvSM6PasagUoC9xQhEuanl+ IWxN8vYC85DecUBMNNdT34fSPRdF2o81EJ4yYdputuSLBc2rCefccF36J5ViIQQOzA8r NeCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773103155; x=1773707955; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ASXXX0p2ZfcvRm4ZB6M2J7c/IWgAE9q2+BNtra206fc=; b=HnSvVDSFXqoLYYLxKzcqc+I8i+M9UOhHoYDYnW0TGjMmSbG0NK5mpmbbr7EMDtKpwz jj6X9FKiae/WOM38cOWe1KI4SssAF7un9A4I0Izq7VxtiS4UQzFYAalU0oH/ygRGoKJ6 Isn8woegvMbmbXbgO66PRTmXq1U3T1oHuNfQ7KQNwsqcYqpIbXaNoOLoumk4IeEclTlt dgbBvih9AU7k82fv+x13tPNWPoIEqhPe8NszYWmLZ+lYu6C5aLQPJvgBrIxwx/vCa/rb qFiYZBQJxZ/tuHLvEwnIeoDlOkiDha8clBcfXrKoCZeAnLiTl0OHIsfZ9zP9N33jKRDD XauQ== X-Forwarded-Encrypted: i=1; AJvYcCUhTHQf1lYGx9fJCyE7hW1tLQgD/pURY4XM0pviKFyIcoqYy3wJYIHpCbds5LBSs0sF6vdC7ZoynNLo/Ao=@vger.kernel.org X-Gm-Message-State: AOJu0YzgBUJBBHDse3mjJGDtDd35lxn+0mAamtGS3VyLs9Z2RqdEpK53 fHdKyYXIE2uQoghBXWX4Cd5IlaTKaWUhJ/vtasihwoETCenUOMc2lWFi X-Gm-Gg: ATEYQzySQvqGoY/k2fC8A7jrqjSNjYsVBVtW7EyCOCyU7f1jyRD9MxYUuY0i3U2YbYR 3vTqjQBQCFj3Qc7QH/3M4pTIiXU0qDMYd6UlpkrR8uY8O1qKvM7VZEp+37exQgjy6DMlsHhe8ab mBtPSmbGFN7bb7A/mSpGYOBsRsGWbrlCzkQzO6u37cMAuml6Zfy3AwU05NSb8vVxCwPW249wYW4 77KJibic0CTZUCgEHYuZE1GLjMkCVuAfYhlXL1hM+XtB5RernynyWOFdYMe9y62w+PSy1xlvxHN aXF9ozz4VwGC67qdFjCn5ci1sEvQUP8Mgu28YnRxHx4uVb7ozJ8unOXRE6H0ORuo/688HoudleA prbdcPy38ylVT+G02lic1Op/4ljaJ+vbtCKTWjb7lJD4keBfe1Uag865RKDlgfcLeTikjFisLbo rhYVS2zTdQ5zR9dEWY2lErGu6LndEmUiAPQFyuTOshQQyWUWNS4hQtwcMlgQgJlY1nSxZQk1w6z a7H4Vk= X-Received: by 2002:a05:6a00:179f:b0:829:7a62:5f with SMTP id d2e1a72fcca58-829a2db4d91mr10719774b3a.9.1773103155495; Mon, 09 Mar 2026 17:39:15 -0700 (PDT) Received: from lima-default (103.95.112.190.qld.leaptel.network. [103.95.112.190]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a46369d3sm11381583b3a.2.2026.03.09.17.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 17:39:14 -0700 (PDT) From: Nicholas Piggin To: devicetree@vger.kernel.org Cc: Nicholas Piggin , Tomasz Jeznach , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Drew Fustini Subject: [RFC PATCH 1/1] dt-bindings: iommu: riscv: Add bindings for Tenstorrent RISC-V IOMMU Date: Tue, 10 Mar 2026 10:38:49 +1000 Message-ID: <20260310003850.3837030-1-npiggin@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Extend the binding to cover details specific to the Tenstorrent RISC-V IOMMU. In particular, a second register range is added which contains M-privileged registers, e.g., PMAs and PMPs. The RISC-V spec S-privileged registers remain in the first register range and are compatible with "riscv,iommu" so the Linux driver does not notice any difference, but the binding will be used by OpenSBI and potentially other M-mode software. Signed-off-by: Nicholas Piggin --- Hi, This binding will be used in a Tenstorrent SoC platform device-tree that we plan to get upstream some time, but I wanted to ask for any comments here before the OpenSBI platform code that uses it is merged. Thanks, Nick --- .../bindings/iommu/riscv,iommu.yaml | 67 +++++++++++++++++-- 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml b/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml index d4838c3b3741..3c680e53af64 100644 --- a/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml +++ b/Documentation/devicetree/bindings/iommu/riscv,iommu.yaml @@ -32,22 +32,40 @@ properties: # should be specified along with 'reg' property providing MMIO location. compatible: oneOf: - - items: + - description: Platform (non-PCIe) IOMMU implementations + items: - enum: - qemu,riscv-iommu - const: riscv,iommu - - items: + - description: PCIe IOMMU implementations + items: - enum: - pci1efd,edf1 - const: riscv,pci-iommu + - description: Tenstorrent IOMMUs implementing "riscv,iommu" + items: + - enum: + - tenstorrent,riscv-iommu + - const: riscv,iommu reg: - maxItems: 1 + minItems: 1 + maxItems: 2 description: - For non-PCI devices this represents base address and size of for the - IOMMU memory mapped registers interface. - For PCI IOMMU hardware implementation this should represent an address - of the IOMMU, as defined in the PCI Bus Binding reference. + For non-PCI devices the first item represents base address and size of + for the IOMMU memory mapped registers interface. + For PCI IOMMU hardware implementation the first item should represent + an address of the IOMMU, as defined in the PCI Bus Binding reference. + + reg-names: + items: + - const: base + description: + Minimum 4KiB region beginning with RISC-V IOMMU MMRs. + - const: machine + description: + Optional region containing platform specific MMRs for machine-mode + configuration, for example PMA and PMP registers. '#iommu-cells': const: 1 @@ -75,6 +93,31 @@ required: additionalProperties: false +allOf: + - if: + properties: + compatible: + contains: + enum: + - tenstorrent,riscv-iommu + then: + properties: + reg: + items: + - description: IOMMU base registers + - description: Tenstorrent IOMMU machine mode registers. + reg-names: + items: + - const: base + - const: machine + description: + Region containing platform specific MMRs for machine-mode + configuration, such as PMA and PMP registers. + else: + properties: + reg: + maxItems: 1 + examples: - |+ /* Example 1 (IOMMU device with wired interrupts) */ @@ -145,3 +188,13 @@ examples: }; }; }; + + - |+ + /* Example 5 (Tenstorrent IOMMU device with MSIs) */ + iommu5: iommu@d2020000 { + compatible = "tenstorrent,riscv-iommu", "riscv,iommu"; + reg = <0x0 0xd2020000 0x0 0x10000 0x0 0xaa000000 0x0 0x10000>; + reg-names = "base", "machine"; + msi-parent = <&imsics_smode>; + #iommu-cells = <1>; + }; -- 2.51.0