xref: /freebsd/sys/contrib/device-tree/Bindings/riscv/sifive-l2-cache.yaml (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
16be33864SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
26be33864SEmmanuel Vadot# Copyright (C) 2020 SiFive, Inc.
36be33864SEmmanuel Vadot%YAML 1.2
46be33864SEmmanuel Vadot---
56be33864SEmmanuel Vadot$id: http://devicetree.org/schemas/riscv/sifive-l2-cache.yaml#
66be33864SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
76be33864SEmmanuel Vadot
86be33864SEmmanuel Vadottitle: SiFive L2 Cache Controller
96be33864SEmmanuel Vadot
106be33864SEmmanuel Vadotmaintainers:
116be33864SEmmanuel Vadot  - Sagar Kadam <sagar.kadam@sifive.com>
126be33864SEmmanuel Vadot  - Paul Walmsley  <paul.walmsley@sifive.com>
136be33864SEmmanuel Vadot
146be33864SEmmanuel Vadotdescription:
156be33864SEmmanuel Vadot  The SiFive Level 2 Cache Controller is used to provide access to fast copies
166be33864SEmmanuel Vadot  of memory for masters in a Core Complex. The Level 2 Cache Controller also
176be33864SEmmanuel Vadot  acts as directory-based coherency manager.
186be33864SEmmanuel Vadot  All the properties in ePAPR/DeviceTree specification applies for this platform.
196be33864SEmmanuel Vadot
206be33864SEmmanuel Vadotselect:
216be33864SEmmanuel Vadot  properties:
226be33864SEmmanuel Vadot    compatible:
235956d97fSEmmanuel Vadot      contains:
245956d97fSEmmanuel Vadot        enum:
256be33864SEmmanuel Vadot          - sifive,fu540-c000-ccache
265def4c47SEmmanuel Vadot          - sifive,fu740-c000-ccache
276be33864SEmmanuel Vadot
286be33864SEmmanuel Vadot  required:
296be33864SEmmanuel Vadot    - compatible
306be33864SEmmanuel Vadot
316be33864SEmmanuel Vadotproperties:
326be33864SEmmanuel Vadot  compatible:
33*b97ee269SEmmanuel Vadot    oneOf:
34*b97ee269SEmmanuel Vadot      - items:
355def4c47SEmmanuel Vadot          - enum:
365def4c47SEmmanuel Vadot              - sifive,fu540-c000-ccache
375def4c47SEmmanuel Vadot              - sifive,fu740-c000-ccache
386be33864SEmmanuel Vadot          - const: cache
39*b97ee269SEmmanuel Vadot      - items:
40*b97ee269SEmmanuel Vadot          - const: microchip,mpfs-ccache
41*b97ee269SEmmanuel Vadot          - const: sifive,fu540-c000-ccache
42*b97ee269SEmmanuel Vadot          - const: cache
436be33864SEmmanuel Vadot
446be33864SEmmanuel Vadot  cache-block-size:
456be33864SEmmanuel Vadot    const: 64
466be33864SEmmanuel Vadot
476be33864SEmmanuel Vadot  cache-level:
486be33864SEmmanuel Vadot    const: 2
496be33864SEmmanuel Vadot
506be33864SEmmanuel Vadot  cache-sets:
51*b97ee269SEmmanuel Vadot    enum: [1024, 2048]
526be33864SEmmanuel Vadot
536be33864SEmmanuel Vadot  cache-size:
546be33864SEmmanuel Vadot    const: 2097152
556be33864SEmmanuel Vadot
566be33864SEmmanuel Vadot  cache-unified: true
576be33864SEmmanuel Vadot
586be33864SEmmanuel Vadot  interrupts:
596be33864SEmmanuel Vadot    minItems: 3
605def4c47SEmmanuel Vadot    items:
615def4c47SEmmanuel Vadot      - description: DirError interrupt
625def4c47SEmmanuel Vadot      - description: DataError interrupt
635def4c47SEmmanuel Vadot      - description: DataFail interrupt
645def4c47SEmmanuel Vadot      - description: DirFail interrupt
656be33864SEmmanuel Vadot
666be33864SEmmanuel Vadot  reg:
676be33864SEmmanuel Vadot    maxItems: 1
686be33864SEmmanuel Vadot
696be33864SEmmanuel Vadot  next-level-cache: true
706be33864SEmmanuel Vadot
716be33864SEmmanuel Vadot  memory-region:
725def4c47SEmmanuel Vadot    maxItems: 1
736be33864SEmmanuel Vadot    description: |
746be33864SEmmanuel Vadot      The reference to the reserved-memory for the L2 Loosely Integrated Memory region.
756be33864SEmmanuel Vadot      The reserved memory node should be defined as per the bindings in reserved-memory.txt.
766be33864SEmmanuel Vadot
77*b97ee269SEmmanuel VadotallOf:
78*b97ee269SEmmanuel Vadot  - $ref: /schemas/cache-controller.yaml#
79*b97ee269SEmmanuel Vadot
80*b97ee269SEmmanuel Vadot  - if:
815def4c47SEmmanuel Vadot      properties:
825def4c47SEmmanuel Vadot        compatible:
835def4c47SEmmanuel Vadot          contains:
84*b97ee269SEmmanuel Vadot            enum:
85*b97ee269SEmmanuel Vadot              - sifive,fu740-c000-ccache
86*b97ee269SEmmanuel Vadot              - microchip,mpfs-ccache
875def4c47SEmmanuel Vadot
885def4c47SEmmanuel Vadot    then:
895def4c47SEmmanuel Vadot      properties:
905def4c47SEmmanuel Vadot        interrupts:
915def4c47SEmmanuel Vadot          description: |
92*b97ee269SEmmanuel Vadot            Must contain entries for DirError, DataError, DataFail, DirFail signals.
93*b97ee269SEmmanuel Vadot          minItems: 4
94*b97ee269SEmmanuel Vadot
95*b97ee269SEmmanuel Vadot    else:
96*b97ee269SEmmanuel Vadot      properties:
97*b97ee269SEmmanuel Vadot        interrupts:
98*b97ee269SEmmanuel Vadot          description: |
995def4c47SEmmanuel Vadot            Must contain entries for DirError, DataError and DataFail signals.
1005def4c47SEmmanuel Vadot          maxItems: 3
1015def4c47SEmmanuel Vadot
102*b97ee269SEmmanuel Vadot  - if:
103*b97ee269SEmmanuel Vadot      properties:
104*b97ee269SEmmanuel Vadot        compatible:
105*b97ee269SEmmanuel Vadot          contains:
106*b97ee269SEmmanuel Vadot            const: sifive,fu740-c000-ccache
107*b97ee269SEmmanuel Vadot
108*b97ee269SEmmanuel Vadot    then:
109*b97ee269SEmmanuel Vadot      properties:
110*b97ee269SEmmanuel Vadot        cache-sets:
111*b97ee269SEmmanuel Vadot          const: 2048
112*b97ee269SEmmanuel Vadot
1135def4c47SEmmanuel Vadot    else:
1145def4c47SEmmanuel Vadot      properties:
115*b97ee269SEmmanuel Vadot        cache-sets:
116*b97ee269SEmmanuel Vadot          const: 1024
1175def4c47SEmmanuel Vadot
1186be33864SEmmanuel VadotadditionalProperties: false
1196be33864SEmmanuel Vadot
1206be33864SEmmanuel Vadotrequired:
1216be33864SEmmanuel Vadot  - compatible
1226be33864SEmmanuel Vadot  - cache-block-size
1236be33864SEmmanuel Vadot  - cache-level
1246be33864SEmmanuel Vadot  - cache-sets
1256be33864SEmmanuel Vadot  - cache-size
1266be33864SEmmanuel Vadot  - cache-unified
1276be33864SEmmanuel Vadot  - interrupts
1286be33864SEmmanuel Vadot  - reg
1296be33864SEmmanuel Vadot
1306be33864SEmmanuel Vadotexamples:
1316be33864SEmmanuel Vadot  - |
1326be33864SEmmanuel Vadot    cache-controller@2010000 {
1336be33864SEmmanuel Vadot        compatible = "sifive,fu540-c000-ccache", "cache";
1346be33864SEmmanuel Vadot        cache-block-size = <64>;
1356be33864SEmmanuel Vadot        cache-level = <2>;
1366be33864SEmmanuel Vadot        cache-sets = <1024>;
1376be33864SEmmanuel Vadot        cache-size = <2097152>;
1386be33864SEmmanuel Vadot        cache-unified;
1396be33864SEmmanuel Vadot        reg = <0x2010000 0x1000>;
1406be33864SEmmanuel Vadot        interrupt-parent = <&plic0>;
1416be33864SEmmanuel Vadot        interrupts = <1>,
1426be33864SEmmanuel Vadot                     <2>,
1436be33864SEmmanuel Vadot                     <3>;
1446be33864SEmmanuel Vadot        next-level-cache = <&L25>;
1456be33864SEmmanuel Vadot        memory-region = <&l2_lim>;
1466be33864SEmmanuel Vadot    };
147