xref: /freebsd/sys/contrib/device-tree/Bindings/memory-controllers/st,stm32mp25-omm.yaml (revision ae5de77ed78ae54d86cead5604869212e8008e6b)
1*ae5de77eSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*ae5de77eSEmmanuel Vadot%YAML 1.2
3*ae5de77eSEmmanuel Vadot---
4*ae5de77eSEmmanuel Vadot$id: http://devicetree.org/schemas/memory-controllers/st,stm32mp25-omm.yaml#
5*ae5de77eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*ae5de77eSEmmanuel Vadot
7*ae5de77eSEmmanuel Vadottitle: STM32 Octo Memory Manager (OMM)
8*ae5de77eSEmmanuel Vadot
9*ae5de77eSEmmanuel Vadotmaintainers:
10*ae5de77eSEmmanuel Vadot  - Patrice Chotard <patrice.chotard@foss.st.com>
11*ae5de77eSEmmanuel Vadot
12*ae5de77eSEmmanuel Vadotdescription: |
13*ae5de77eSEmmanuel Vadot  The STM32 Octo Memory Manager is a low-level interface that enables an
14*ae5de77eSEmmanuel Vadot  efficient OCTOSPI pin assignment with a full I/O matrix (before alternate
15*ae5de77eSEmmanuel Vadot  function map) and multiplex of single/dual/quad/octal SPI interfaces over
16*ae5de77eSEmmanuel Vadot  the same bus. It Supports up to:
17*ae5de77eSEmmanuel Vadot    - Two single/dual/quad/octal SPI interfaces
18*ae5de77eSEmmanuel Vadot    - Two ports for pin assignment
19*ae5de77eSEmmanuel Vadot
20*ae5de77eSEmmanuel Vadotproperties:
21*ae5de77eSEmmanuel Vadot  compatible:
22*ae5de77eSEmmanuel Vadot    const: st,stm32mp25-omm
23*ae5de77eSEmmanuel Vadot
24*ae5de77eSEmmanuel Vadot  "#address-cells":
25*ae5de77eSEmmanuel Vadot    const: 2
26*ae5de77eSEmmanuel Vadot
27*ae5de77eSEmmanuel Vadot  "#size-cells":
28*ae5de77eSEmmanuel Vadot    const: 1
29*ae5de77eSEmmanuel Vadot
30*ae5de77eSEmmanuel Vadot  ranges:
31*ae5de77eSEmmanuel Vadot    description: |
32*ae5de77eSEmmanuel Vadot      Reflects the memory layout per OSPI instance.
33*ae5de77eSEmmanuel Vadot      Format:
34*ae5de77eSEmmanuel Vadot      <chip-select> 0 <registers base address> <size>
35*ae5de77eSEmmanuel Vadot    minItems: 2
36*ae5de77eSEmmanuel Vadot    maxItems: 2
37*ae5de77eSEmmanuel Vadot
38*ae5de77eSEmmanuel Vadot  reg:
39*ae5de77eSEmmanuel Vadot    items:
40*ae5de77eSEmmanuel Vadot      - description: OMM registers
41*ae5de77eSEmmanuel Vadot      - description: OMM memory map area
42*ae5de77eSEmmanuel Vadot
43*ae5de77eSEmmanuel Vadot  reg-names:
44*ae5de77eSEmmanuel Vadot    items:
45*ae5de77eSEmmanuel Vadot      - const: regs
46*ae5de77eSEmmanuel Vadot      - const: memory_map
47*ae5de77eSEmmanuel Vadot
48*ae5de77eSEmmanuel Vadot  memory-region:
49*ae5de77eSEmmanuel Vadot    description:
50*ae5de77eSEmmanuel Vadot      Memory region shared between the 2 OCTOSPI instance.
51*ae5de77eSEmmanuel Vadot      One or two phandle to a node describing a memory mapped region
52*ae5de77eSEmmanuel Vadot      depending of child number.
53*ae5de77eSEmmanuel Vadot    minItems: 1
54*ae5de77eSEmmanuel Vadot    maxItems: 2
55*ae5de77eSEmmanuel Vadot
56*ae5de77eSEmmanuel Vadot  memory-region-names:
57*ae5de77eSEmmanuel Vadot    description:
58*ae5de77eSEmmanuel Vadot      Identify to which OSPI instance the memory region belongs to.
59*ae5de77eSEmmanuel Vadot    items:
60*ae5de77eSEmmanuel Vadot      enum: [ospi1, ospi2]
61*ae5de77eSEmmanuel Vadot    minItems: 1
62*ae5de77eSEmmanuel Vadot    maxItems: 2
63*ae5de77eSEmmanuel Vadot
64*ae5de77eSEmmanuel Vadot  clocks:
65*ae5de77eSEmmanuel Vadot    maxItems: 3
66*ae5de77eSEmmanuel Vadot
67*ae5de77eSEmmanuel Vadot  clock-names:
68*ae5de77eSEmmanuel Vadot    items:
69*ae5de77eSEmmanuel Vadot      - const: omm
70*ae5de77eSEmmanuel Vadot      - const: ospi1
71*ae5de77eSEmmanuel Vadot      - const: ospi2
72*ae5de77eSEmmanuel Vadot
73*ae5de77eSEmmanuel Vadot  resets:
74*ae5de77eSEmmanuel Vadot    maxItems: 3
75*ae5de77eSEmmanuel Vadot
76*ae5de77eSEmmanuel Vadot  reset-names:
77*ae5de77eSEmmanuel Vadot    items:
78*ae5de77eSEmmanuel Vadot      - const: omm
79*ae5de77eSEmmanuel Vadot      - const: ospi1
80*ae5de77eSEmmanuel Vadot      - const: ospi2
81*ae5de77eSEmmanuel Vadot
82*ae5de77eSEmmanuel Vadot  access-controllers:
83*ae5de77eSEmmanuel Vadot    maxItems: 1
84*ae5de77eSEmmanuel Vadot
85*ae5de77eSEmmanuel Vadot  power-domains:
86*ae5de77eSEmmanuel Vadot    maxItems: 1
87*ae5de77eSEmmanuel Vadot
88*ae5de77eSEmmanuel Vadot  st,syscfg-amcr:
89*ae5de77eSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle-array
90*ae5de77eSEmmanuel Vadot    description: |
91*ae5de77eSEmmanuel Vadot      The Address Mapping Control Register (AMCR) is used to split the 256MB
92*ae5de77eSEmmanuel Vadot      memory map area shared between the 2 OSPI instance. The Octo Memory
93*ae5de77eSEmmanuel Vadot      Manager sets the AMCR depending of the memory-region configuration.
94*ae5de77eSEmmanuel Vadot      The memory split bitmask description is:
95*ae5de77eSEmmanuel Vadot        - 000: OCTOSPI1 (256 Mbytes), OCTOSPI2 unmapped
96*ae5de77eSEmmanuel Vadot        - 001: OCTOSPI1 (192 Mbytes), OCTOSPI2 (64 Mbytes)
97*ae5de77eSEmmanuel Vadot        - 010: OCTOSPI1 (128 Mbytes), OCTOSPI2 (128 Mbytes)
98*ae5de77eSEmmanuel Vadot        - 011: OCTOSPI1 (64 Mbytes), OCTOSPI2 (192 Mbytes)
99*ae5de77eSEmmanuel Vadot        - 1xx: OCTOSPI1 unmapped, OCTOSPI2 (256 Mbytes)
100*ae5de77eSEmmanuel Vadot    items:
101*ae5de77eSEmmanuel Vadot      - items:
102*ae5de77eSEmmanuel Vadot          - description: phandle to syscfg
103*ae5de77eSEmmanuel Vadot          - description: register offset within syscfg
104*ae5de77eSEmmanuel Vadot          - description: register bitmask for memory split
105*ae5de77eSEmmanuel Vadot
106*ae5de77eSEmmanuel Vadot  st,omm-req2ack-ns:
107*ae5de77eSEmmanuel Vadot    description:
108*ae5de77eSEmmanuel Vadot      In multiplexed mode (MUXEN = 1), this field defines the time in
109*ae5de77eSEmmanuel Vadot      nanoseconds between two transactions.
110*ae5de77eSEmmanuel Vadot    default: 0
111*ae5de77eSEmmanuel Vadot
112*ae5de77eSEmmanuel Vadot  st,omm-cssel-ovr:
113*ae5de77eSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
114*ae5de77eSEmmanuel Vadot    description: |
115*ae5de77eSEmmanuel Vadot      Configure the chip select selector override for the 2 OCTOSPIs.
116*ae5de77eSEmmanuel Vadot      - 0: OCTOSPI1 chip select send to NCS1 OCTOSPI2 chip select send to NCS1
117*ae5de77eSEmmanuel Vadot      - 1: OCTOSPI1 chip select send to NCS2 OCTOSPI2 chip select send to NCS1
118*ae5de77eSEmmanuel Vadot      - 2: OCTOSPI1 chip select send to NCS1 OCTOSPI2 chip select send to NCS2
119*ae5de77eSEmmanuel Vadot      - 3: OCTOSPI1 chip select send to NCS2 OCTOSPI2 chip select send to NCS2
120*ae5de77eSEmmanuel Vadot    minimum: 0
121*ae5de77eSEmmanuel Vadot    maximum: 3
122*ae5de77eSEmmanuel Vadot    default: 0
123*ae5de77eSEmmanuel Vadot
124*ae5de77eSEmmanuel Vadot  st,omm-mux:
125*ae5de77eSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
126*ae5de77eSEmmanuel Vadot    description: |
127*ae5de77eSEmmanuel Vadot      Configure the muxing between the 2 OCTOSPIs busses and the 2 output ports.
128*ae5de77eSEmmanuel Vadot      - 0: direct mode
129*ae5de77eSEmmanuel Vadot      - 1: mux OCTOSPI1 and OCTOSPI2 to port 1
130*ae5de77eSEmmanuel Vadot      - 2: swapped mode
131*ae5de77eSEmmanuel Vadot      - 3: mux OCTOSPI1 and OCTOSPI2 to port 2
132*ae5de77eSEmmanuel Vadot    minimum: 0
133*ae5de77eSEmmanuel Vadot    maximum: 3
134*ae5de77eSEmmanuel Vadot    default: 0
135*ae5de77eSEmmanuel Vadot
136*ae5de77eSEmmanuel VadotpatternProperties:
137*ae5de77eSEmmanuel Vadot  ^spi@[0-9]:
138*ae5de77eSEmmanuel Vadot    type: object
139*ae5de77eSEmmanuel Vadot    $ref: /schemas/spi/st,stm32mp25-ospi.yaml#
140*ae5de77eSEmmanuel Vadot    description: Required spi child node
141*ae5de77eSEmmanuel Vadot
142*ae5de77eSEmmanuel Vadotrequired:
143*ae5de77eSEmmanuel Vadot  - compatible
144*ae5de77eSEmmanuel Vadot  - reg
145*ae5de77eSEmmanuel Vadot  - "#address-cells"
146*ae5de77eSEmmanuel Vadot  - "#size-cells"
147*ae5de77eSEmmanuel Vadot  - clocks
148*ae5de77eSEmmanuel Vadot  - clock-names
149*ae5de77eSEmmanuel Vadot  - resets
150*ae5de77eSEmmanuel Vadot  - reset-names
151*ae5de77eSEmmanuel Vadot  - st,syscfg-amcr
152*ae5de77eSEmmanuel Vadot  - ranges
153*ae5de77eSEmmanuel Vadot
154*ae5de77eSEmmanuel VadotadditionalProperties: false
155*ae5de77eSEmmanuel Vadot
156*ae5de77eSEmmanuel Vadotexamples:
157*ae5de77eSEmmanuel Vadot  - |
158*ae5de77eSEmmanuel Vadot    #include <dt-bindings/clock/st,stm32mp25-rcc.h>
159*ae5de77eSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
160*ae5de77eSEmmanuel Vadot    #include <dt-bindings/reset/st,stm32mp25-rcc.h>
161*ae5de77eSEmmanuel Vadot    ommanager@40500000 {
162*ae5de77eSEmmanuel Vadot      compatible = "st,stm32mp25-omm";
163*ae5de77eSEmmanuel Vadot      reg = <0x40500000 0x400>, <0x60000000 0x10000000>;
164*ae5de77eSEmmanuel Vadot      reg-names = "regs", "memory_map";
165*ae5de77eSEmmanuel Vadot      ranges = <0 0 0x40430000 0x400>,
166*ae5de77eSEmmanuel Vadot               <1 0 0x40440000 0x400>;
167*ae5de77eSEmmanuel Vadot      memory-region = <&mm_ospi1>, <&mm_ospi2>;
168*ae5de77eSEmmanuel Vadot      memory-region-names = "ospi1", "ospi2";
169*ae5de77eSEmmanuel Vadot      pinctrl-0 = <&ospi_port1_clk_pins_a
170*ae5de77eSEmmanuel Vadot                   &ospi_port1_io03_pins_a
171*ae5de77eSEmmanuel Vadot                   &ospi_port1_cs0_pins_a>;
172*ae5de77eSEmmanuel Vadot      pinctrl-1 = <&ospi_port1_clk_sleep_pins_a
173*ae5de77eSEmmanuel Vadot                   &ospi_port1_io03_sleep_pins_a
174*ae5de77eSEmmanuel Vadot                   &ospi_port1_cs0_sleep_pins_a>;
175*ae5de77eSEmmanuel Vadot      pinctrl-names = "default", "sleep";
176*ae5de77eSEmmanuel Vadot      clocks = <&rcc CK_BUS_OSPIIOM>,
177*ae5de77eSEmmanuel Vadot               <&scmi_clk CK_SCMI_OSPI1>,
178*ae5de77eSEmmanuel Vadot               <&scmi_clk CK_SCMI_OSPI2>;
179*ae5de77eSEmmanuel Vadot      clock-names = "omm", "ospi1", "ospi2";
180*ae5de77eSEmmanuel Vadot      resets = <&rcc OSPIIOM_R>,
181*ae5de77eSEmmanuel Vadot               <&scmi_reset RST_SCMI_OSPI1>,
182*ae5de77eSEmmanuel Vadot               <&scmi_reset RST_SCMI_OSPI2>;
183*ae5de77eSEmmanuel Vadot      reset-names = "omm", "ospi1", "ospi2";
184*ae5de77eSEmmanuel Vadot      access-controllers = <&rifsc 111>;
185*ae5de77eSEmmanuel Vadot      power-domains = <&CLUSTER_PD>;
186*ae5de77eSEmmanuel Vadot      #address-cells = <2>;
187*ae5de77eSEmmanuel Vadot      #size-cells = <1>;
188*ae5de77eSEmmanuel Vadot      st,syscfg-amcr = <&syscfg 0x2c00 0x7>;
189*ae5de77eSEmmanuel Vadot      st,omm-req2ack-ns = <0>;
190*ae5de77eSEmmanuel Vadot      st,omm-mux = <0>;
191*ae5de77eSEmmanuel Vadot      st,omm-cssel-ovr = <0>;
192*ae5de77eSEmmanuel Vadot
193*ae5de77eSEmmanuel Vadot      spi@0 {
194*ae5de77eSEmmanuel Vadot        compatible = "st,stm32mp25-ospi";
195*ae5de77eSEmmanuel Vadot        reg = <0 0 0x400>;
196*ae5de77eSEmmanuel Vadot        memory-region = <&mm_ospi1>;
197*ae5de77eSEmmanuel Vadot        interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>;
198*ae5de77eSEmmanuel Vadot        dmas = <&hpdma 2 0x62 0x00003121 0x0>,
199*ae5de77eSEmmanuel Vadot               <&hpdma 2 0x42 0x00003112 0x0>;
200*ae5de77eSEmmanuel Vadot        dma-names = "tx", "rx";
201*ae5de77eSEmmanuel Vadot        clocks = <&scmi_clk CK_SCMI_OSPI1>;
202*ae5de77eSEmmanuel Vadot        resets = <&scmi_reset RST_SCMI_OSPI1>, <&scmi_reset RST_SCMI_OSPI1DLL>;
203*ae5de77eSEmmanuel Vadot        access-controllers = <&rifsc 74>;
204*ae5de77eSEmmanuel Vadot        power-domains = <&CLUSTER_PD>;
205*ae5de77eSEmmanuel Vadot        #address-cells = <1>;
206*ae5de77eSEmmanuel Vadot        #size-cells = <0>;
207*ae5de77eSEmmanuel Vadot        st,syscfg-dlyb = <&syscfg 0x1000>;
208*ae5de77eSEmmanuel Vadot      };
209*ae5de77eSEmmanuel Vadot
210*ae5de77eSEmmanuel Vadot      spi@1 {
211*ae5de77eSEmmanuel Vadot        compatible = "st,stm32mp25-ospi";
212*ae5de77eSEmmanuel Vadot        reg = <1 0 0x400>;
213*ae5de77eSEmmanuel Vadot        memory-region = <&mm_ospi1>;
214*ae5de77eSEmmanuel Vadot        interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
215*ae5de77eSEmmanuel Vadot        dmas = <&hpdma 3 0x62 0x00003121 0x0>,
216*ae5de77eSEmmanuel Vadot               <&hpdma 3 0x42 0x00003112 0x0>;
217*ae5de77eSEmmanuel Vadot        dma-names = "tx", "rx";
218*ae5de77eSEmmanuel Vadot        clocks = <&scmi_clk CK_KER_OSPI2>;
219*ae5de77eSEmmanuel Vadot        resets = <&scmi_reset RST_SCMI_OSPI2>, <&scmi_reset RST_SCMI_OSPI1DLL>;
220*ae5de77eSEmmanuel Vadot        access-controllers = <&rifsc 75>;
221*ae5de77eSEmmanuel Vadot        power-domains = <&CLUSTER_PD>;
222*ae5de77eSEmmanuel Vadot        #address-cells = <1>;
223*ae5de77eSEmmanuel Vadot        #size-cells = <0>;
224*ae5de77eSEmmanuel Vadot        st,syscfg-dlyb = <&syscfg 0x1000>;
225*ae5de77eSEmmanuel Vadot      };
226*ae5de77eSEmmanuel Vadot    };
227