[PATCH 01/10] dt-bindings: riscv: Add SiFive pre-ratified trace components

Leo Yu-Chi Liang leo.liang at sifive.com
Thu Nov 26 01:07:07 PST 2026


From: Eric Lin <eric.lin at sifive.com>

Add compatible strings for the SiFive pre-ratified encoder and funnel
trace components. These implement version 0.x of the RISC-V trace
specification and do not support the generic riscv,trace-component
fallback.

A pre-ratified component with an embedded RAM sink can use a reserved
memory region for its trace buffer, as the sink registers restrict the
buffer to a single 4GB window. Add an optional memory-region property
for this.

Co-developed-by: Nick Hu <nick.hu at sifive.com>
Signed-off-by: Nick Hu <nick.hu at sifive.com>
Co-developed-by: Vincent Chen <vincent.chen at sifive.com>
Signed-off-by: Vincent Chen <vincent.chen at sifive.com>
Signed-off-by: Eric Lin <eric.lin at sifive.com>
Signed-off-by: Leo Yu-Chi Liang <leo.liang at sifive.com>
---
 .../bindings/riscv/riscv,trace-component.yaml      | 96 ++++++++++++++++++++--
 1 file changed, 89 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/riscv/riscv,trace-component.yaml b/Documentation/devicetree/bindings/riscv/riscv,trace-component.yaml
index bb519bc4a163..10660b8ce071 100644
--- a/Documentation/devicetree/bindings/riscv/riscv,trace-component.yaml
+++ b/Documentation/devicetree/bindings/riscv/riscv,trace-component.yaml
@@ -16,16 +16,23 @@ description:
   The RISC-V trace components have implementation specific directed acyclic
   graph style interdependency where output of one component serves as input
   to another component and certain components (such as funnel) can take inputs
-  from multiple components. The type and version of a RISC-V trace component
-  can be discovered from it's IMPL memory mapped register hence component
-  specific compatible strings are not needed.
+  from multiple components. While the type and version of a RISC-V trace component
+  can be discovered from it's IMPL memory mapped register, specific compatible strings
+  are used for pre-ratified trace components.
 
 properties:
   compatible:
-    items:
-      - enum:
-          - qemu,trace-component
-      - const: riscv,trace-component
+    oneOf:
+      - items:
+          - enum:
+              - qemu,trace-component
+          - const: riscv,trace-component
+      - items:
+          - const: sifive,trace-encoder0
+        description: SiFive Pre-ratified Encoder Trace Component
+      - items:
+          - const: sifive,trace-funnel0
+        description: SiFive Pre-ratified Funnel Trace Component
 
   reg:
     maxItems: 1
@@ -35,6 +42,16 @@ properties:
     description:
       phandle to the cpu to which the RISC-V trace component is bound.
 
+  memory-region:
+    maxItems: 1
+    description:
+      phandle to a reserved memory region (shared-dma-pool) used for the
+      trace buffer of a pre-ratified trace component which has an embedded
+      RAM sink. The sink limit and write pointer registers of such a
+      component share their upper 32 bits with the sink base address
+      register, so the trace buffer must not cross a 4GB boundary. The
+      region must be aligned and sized accordingly.
+
   in-ports:
     $ref: /schemas/graph.yaml#/properties/ports
     patternProperties:
@@ -117,4 +134,69 @@ examples:
       };
     };
 
+  - |
+    // Example 2: SiFive trace encoder and funnel connection
+    reserved-memory {
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges;
+
+        trace_buf: trace at 80000000 {
+            compatible = "shared-dma-pool";
+            reg = <0x80000000 0x1000000>;
+            reusable;
+        };
+    };
+
+    encoder-0 at 2000000 {
+        compatible = "sifive,trace-encoder0";
+        reg = <0x2000000 0x1000>;
+        cpus = <&CPU0>;
+
+        out-ports {
+            port {
+                encoder0_out: endpoint {
+                  remote-endpoint = <&funnel_in0>;
+                };
+            };
+        };
+    };
+
+    encoder-1 at 2001000 {
+        compatible = "sifive,trace-encoder0";
+        reg = <0x2001000 0x1000>;
+        cpus = <&CPU1>;
+
+        out-ports {
+            port {
+                encoder1_out: endpoint {
+                  remote-endpoint = <&funnel_in1>;
+                };
+            };
+        };
+    };
+
+    funnel-0 at 2002000 {
+        compatible = "sifive,trace-funnel0";
+        reg = <0x2002000 0x1000>;
+        memory-region = <&trace_buf>;
+
+        in-ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            port at 0 {
+                reg = <0x0>;
+                funnel_in0: endpoint {
+                    remote-endpoint = <&encoder0_out>;
+                };
+            };
+
+            port at 1 {
+                reg = <0x1>;
+                funnel_in1: endpoint {
+                    remote-endpoint = <&encoder1_out>;
+                };
+            };
+        };
+    };
 ...

-- 
2.43.7




More information about the linux-riscv mailing list