1 // THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
2 
3 /**
4  * Copyright (c) 2024 Raspberry Pi Ltd.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 // =============================================================================
9 // Register block : QMI
10 // Version        : 1
11 // Bus type       : apb
12 // Description    : QSPI Memory Interface.
13 //
14 //                  Provides a memory-mapped interface to up to two
15 //                  SPI/DSPI/QSPI flash or PSRAM devices. Also provides a serial
16 //                  interface for programming and configuration of the external
17 //                  device.
18 // =============================================================================
19 #ifndef _HARDWARE_REGS_QMI_H
20 #define _HARDWARE_REGS_QMI_H
21 // =============================================================================
22 // Register    : QMI_DIRECT_CSR
23 // Description : Control and status for direct serial mode
24 //
25 //               Direct serial mode allows the processor to send and receive raw
26 //               serial frames, for programming, configuration and control of
27 //               the external memory devices. Only SPI mode 0 (CPOL=0 CPHA=0) is
28 //               supported.
29 #define QMI_DIRECT_CSR_OFFSET _u(0x00000000)
30 #define QMI_DIRECT_CSR_BITS   _u(0xffdf7ccf)
31 #define QMI_DIRECT_CSR_RESET  _u(0x01800000)
32 // -----------------------------------------------------------------------------
33 // Field       : QMI_DIRECT_CSR_RXDELAY
34 // Description : Delay the read data sample timing, in units of one half of a
35 //               system clock cycle. (Not necessarily half of an SCK cycle.)
36 #define QMI_DIRECT_CSR_RXDELAY_RESET  _u(0x0)
37 #define QMI_DIRECT_CSR_RXDELAY_BITS   _u(0xc0000000)
38 #define QMI_DIRECT_CSR_RXDELAY_MSB    _u(31)
39 #define QMI_DIRECT_CSR_RXDELAY_LSB    _u(30)
40 #define QMI_DIRECT_CSR_RXDELAY_ACCESS "RW"
41 // -----------------------------------------------------------------------------
42 // Field       : QMI_DIRECT_CSR_CLKDIV
43 // Description : Clock divisor for direct serial mode. Divisors of 1..255 are
44 //               encoded directly, and the maximum divisor of 256 is encoded by
45 //               a value of CLKDIV=0.
46 //
47 //               The clock divisor can be changed on-the-fly by software,
48 //               without halting or otherwise coordinating with the serial
49 //               interface. The serial interface will sample the latest clock
50 //               divisor each time it begins the transmission of a new byte.
51 #define QMI_DIRECT_CSR_CLKDIV_RESET  _u(0x06)
52 #define QMI_DIRECT_CSR_CLKDIV_BITS   _u(0x3fc00000)
53 #define QMI_DIRECT_CSR_CLKDIV_MSB    _u(29)
54 #define QMI_DIRECT_CSR_CLKDIV_LSB    _u(22)
55 #define QMI_DIRECT_CSR_CLKDIV_ACCESS "RW"
56 // -----------------------------------------------------------------------------
57 // Field       : QMI_DIRECT_CSR_RXLEVEL
58 // Description : Current level of DIRECT_RX FIFO
59 #define QMI_DIRECT_CSR_RXLEVEL_RESET  _u(0x0)
60 #define QMI_DIRECT_CSR_RXLEVEL_BITS   _u(0x001c0000)
61 #define QMI_DIRECT_CSR_RXLEVEL_MSB    _u(20)
62 #define QMI_DIRECT_CSR_RXLEVEL_LSB    _u(18)
63 #define QMI_DIRECT_CSR_RXLEVEL_ACCESS "RO"
64 // -----------------------------------------------------------------------------
65 // Field       : QMI_DIRECT_CSR_RXFULL
66 // Description : When 1, the DIRECT_RX FIFO is currently full. The serial
67 //               interface will be stalled until data is popped; the interface
68 //               will not begin a new serial frame when the DIRECT_TX FIFO is
69 //               empty or the DIRECT_RX FIFO is full.
70 #define QMI_DIRECT_CSR_RXFULL_RESET  _u(0x0)
71 #define QMI_DIRECT_CSR_RXFULL_BITS   _u(0x00020000)
72 #define QMI_DIRECT_CSR_RXFULL_MSB    _u(17)
73 #define QMI_DIRECT_CSR_RXFULL_LSB    _u(17)
74 #define QMI_DIRECT_CSR_RXFULL_ACCESS "RO"
75 // -----------------------------------------------------------------------------
76 // Field       : QMI_DIRECT_CSR_RXEMPTY
77 // Description : When 1, the DIRECT_RX FIFO is currently empty. If the processor
78 //               attempts to read more data, the FIFO state is not affected, but
79 //               the value returned to the processor is undefined.
80 #define QMI_DIRECT_CSR_RXEMPTY_RESET  _u(0x0)
81 #define QMI_DIRECT_CSR_RXEMPTY_BITS   _u(0x00010000)
82 #define QMI_DIRECT_CSR_RXEMPTY_MSB    _u(16)
83 #define QMI_DIRECT_CSR_RXEMPTY_LSB    _u(16)
84 #define QMI_DIRECT_CSR_RXEMPTY_ACCESS "RO"
85 // -----------------------------------------------------------------------------
86 // Field       : QMI_DIRECT_CSR_TXLEVEL
87 // Description : Current level of DIRECT_TX FIFO
88 #define QMI_DIRECT_CSR_TXLEVEL_RESET  _u(0x0)
89 #define QMI_DIRECT_CSR_TXLEVEL_BITS   _u(0x00007000)
90 #define QMI_DIRECT_CSR_TXLEVEL_MSB    _u(14)
91 #define QMI_DIRECT_CSR_TXLEVEL_LSB    _u(12)
92 #define QMI_DIRECT_CSR_TXLEVEL_ACCESS "RO"
93 // -----------------------------------------------------------------------------
94 // Field       : QMI_DIRECT_CSR_TXEMPTY
95 // Description : When 1, the DIRECT_TX FIFO is currently empty. Unless the
96 //               processor pushes more data, transmission will stop and BUSY
97 //               will go low once the current 8-bit serial frame completes.
98 #define QMI_DIRECT_CSR_TXEMPTY_RESET  _u(0x0)
99 #define QMI_DIRECT_CSR_TXEMPTY_BITS   _u(0x00000800)
100 #define QMI_DIRECT_CSR_TXEMPTY_MSB    _u(11)
101 #define QMI_DIRECT_CSR_TXEMPTY_LSB    _u(11)
102 #define QMI_DIRECT_CSR_TXEMPTY_ACCESS "RO"
103 // -----------------------------------------------------------------------------
104 // Field       : QMI_DIRECT_CSR_TXFULL
105 // Description : When 1, the DIRECT_TX FIFO is currently full. If the processor
106 //               tries to write more data, that data will be ignored.
107 #define QMI_DIRECT_CSR_TXFULL_RESET  _u(0x0)
108 #define QMI_DIRECT_CSR_TXFULL_BITS   _u(0x00000400)
109 #define QMI_DIRECT_CSR_TXFULL_MSB    _u(10)
110 #define QMI_DIRECT_CSR_TXFULL_LSB    _u(10)
111 #define QMI_DIRECT_CSR_TXFULL_ACCESS "RO"
112 // -----------------------------------------------------------------------------
113 // Field       : QMI_DIRECT_CSR_AUTO_CS1N
114 // Description : When 1, automatically assert the CS1n chip select line whenever
115 //               the BUSY flag is set.
116 #define QMI_DIRECT_CSR_AUTO_CS1N_RESET  _u(0x0)
117 #define QMI_DIRECT_CSR_AUTO_CS1N_BITS   _u(0x00000080)
118 #define QMI_DIRECT_CSR_AUTO_CS1N_MSB    _u(7)
119 #define QMI_DIRECT_CSR_AUTO_CS1N_LSB    _u(7)
120 #define QMI_DIRECT_CSR_AUTO_CS1N_ACCESS "RW"
121 // -----------------------------------------------------------------------------
122 // Field       : QMI_DIRECT_CSR_AUTO_CS0N
123 // Description : When 1, automatically assert the CS0n chip select line whenever
124 //               the BUSY flag is set.
125 #define QMI_DIRECT_CSR_AUTO_CS0N_RESET  _u(0x0)
126 #define QMI_DIRECT_CSR_AUTO_CS0N_BITS   _u(0x00000040)
127 #define QMI_DIRECT_CSR_AUTO_CS0N_MSB    _u(6)
128 #define QMI_DIRECT_CSR_AUTO_CS0N_LSB    _u(6)
129 #define QMI_DIRECT_CSR_AUTO_CS0N_ACCESS "RW"
130 // -----------------------------------------------------------------------------
131 // Field       : QMI_DIRECT_CSR_ASSERT_CS1N
132 // Description : When 1, assert (i.e. drive low) the CS1n chip select line.
133 //
134 //               Note that this applies even when DIRECT_CSR_EN is 0.
135 #define QMI_DIRECT_CSR_ASSERT_CS1N_RESET  _u(0x0)
136 #define QMI_DIRECT_CSR_ASSERT_CS1N_BITS   _u(0x00000008)
137 #define QMI_DIRECT_CSR_ASSERT_CS1N_MSB    _u(3)
138 #define QMI_DIRECT_CSR_ASSERT_CS1N_LSB    _u(3)
139 #define QMI_DIRECT_CSR_ASSERT_CS1N_ACCESS "RW"
140 // -----------------------------------------------------------------------------
141 // Field       : QMI_DIRECT_CSR_ASSERT_CS0N
142 // Description : When 1, assert (i.e. drive low) the CS0n chip select line.
143 //
144 //               Note that this applies even when DIRECT_CSR_EN is 0.
145 #define QMI_DIRECT_CSR_ASSERT_CS0N_RESET  _u(0x0)
146 #define QMI_DIRECT_CSR_ASSERT_CS0N_BITS   _u(0x00000004)
147 #define QMI_DIRECT_CSR_ASSERT_CS0N_MSB    _u(2)
148 #define QMI_DIRECT_CSR_ASSERT_CS0N_LSB    _u(2)
149 #define QMI_DIRECT_CSR_ASSERT_CS0N_ACCESS "RW"
150 // -----------------------------------------------------------------------------
151 // Field       : QMI_DIRECT_CSR_BUSY
152 // Description : Direct mode busy flag. If 1, data is currently being shifted
153 //               in/out (or would be if the interface were not stalled on the RX
154 //               FIFO), and the chip select must not yet be deasserted.
155 //
156 //               The busy flag will also be set to 1 if a memory-mapped transfer
157 //               is still in progress when direct mode is enabled. Direct mode
158 //               blocks new memory-mapped transfers, but can't halt a transfer
159 //               that is already in progress. If there is a chance that memory-
160 //               mapped transfers may be in progress, the busy flag should be
161 //               polled for 0 before asserting the chip select.
162 //
163 //               (In practice you will usually discover this timing condition
164 //               through other means, because any subsequent memory-mapped
165 //               transfers when direct mode is enabled will return bus errors,
166 //               which are difficult to ignore.)
167 #define QMI_DIRECT_CSR_BUSY_RESET  _u(0x0)
168 #define QMI_DIRECT_CSR_BUSY_BITS   _u(0x00000002)
169 #define QMI_DIRECT_CSR_BUSY_MSB    _u(1)
170 #define QMI_DIRECT_CSR_BUSY_LSB    _u(1)
171 #define QMI_DIRECT_CSR_BUSY_ACCESS "RO"
172 // -----------------------------------------------------------------------------
173 // Field       : QMI_DIRECT_CSR_EN
174 // Description : Enable direct mode.
175 //
176 //               In direct mode, software controls the chip select lines, and
177 //               can perform direct SPI transfers by pushing data to the
178 //               DIRECT_TX FIFO, and popping the same amount of data from the
179 //               DIRECT_RX FIFO.
180 //
181 //               Memory-mapped accesses will generate bus errors when direct
182 //               serial mode is enabled.
183 #define QMI_DIRECT_CSR_EN_RESET  _u(0x0)
184 #define QMI_DIRECT_CSR_EN_BITS   _u(0x00000001)
185 #define QMI_DIRECT_CSR_EN_MSB    _u(0)
186 #define QMI_DIRECT_CSR_EN_LSB    _u(0)
187 #define QMI_DIRECT_CSR_EN_ACCESS "RW"
188 // =============================================================================
189 // Register    : QMI_DIRECT_TX
190 // Description : Transmit FIFO for direct mode
191 #define QMI_DIRECT_TX_OFFSET _u(0x00000004)
192 #define QMI_DIRECT_TX_BITS   _u(0x001fffff)
193 #define QMI_DIRECT_TX_RESET  _u(0x00000000)
194 // -----------------------------------------------------------------------------
195 // Field       : QMI_DIRECT_TX_NOPUSH
196 // Description : Inhibit the RX FIFO push that would correspond to this TX FIFO
197 //               entry.
198 //
199 //               Useful to avoid garbage appearing in the RX FIFO when pushing
200 //               the command at the beginning of a SPI transfer.
201 #define QMI_DIRECT_TX_NOPUSH_RESET  _u(0x0)
202 #define QMI_DIRECT_TX_NOPUSH_BITS   _u(0x00100000)
203 #define QMI_DIRECT_TX_NOPUSH_MSB    _u(20)
204 #define QMI_DIRECT_TX_NOPUSH_LSB    _u(20)
205 #define QMI_DIRECT_TX_NOPUSH_ACCESS "WF"
206 // -----------------------------------------------------------------------------
207 // Field       : QMI_DIRECT_TX_OE
208 // Description : Output enable (active-high). For single width (SPI), this field
209 //               is ignored, and SD0 is always set to output, with SD1 always
210 //               set to input.
211 //
212 //               For dual and quad width (DSPI/QSPI), this sets whether the
213 //               relevant SDx pads are set to output whilst transferring this
214 //               FIFO record. In this case the command/address should have OE
215 //               set, and the data transfer should have OE set or clear
216 //               depending on the direction of the transfer.
217 #define QMI_DIRECT_TX_OE_RESET  _u(0x0)
218 #define QMI_DIRECT_TX_OE_BITS   _u(0x00080000)
219 #define QMI_DIRECT_TX_OE_MSB    _u(19)
220 #define QMI_DIRECT_TX_OE_LSB    _u(19)
221 #define QMI_DIRECT_TX_OE_ACCESS "WF"
222 // -----------------------------------------------------------------------------
223 // Field       : QMI_DIRECT_TX_DWIDTH
224 // Description : Data width. If 0, hardware will transmit the 8 LSBs of the
225 //               DIRECT_TX DATA field, and return an 8-bit value in the 8 LSBs
226 //               of DIRECT_RX. If 1, the full 16-bit width is used. 8-bit and
227 //               16-bit transfers can be mixed freely.
228 #define QMI_DIRECT_TX_DWIDTH_RESET  _u(0x0)
229 #define QMI_DIRECT_TX_DWIDTH_BITS   _u(0x00040000)
230 #define QMI_DIRECT_TX_DWIDTH_MSB    _u(18)
231 #define QMI_DIRECT_TX_DWIDTH_LSB    _u(18)
232 #define QMI_DIRECT_TX_DWIDTH_ACCESS "WF"
233 // -----------------------------------------------------------------------------
234 // Field       : QMI_DIRECT_TX_IWIDTH
235 // Description : Configure whether this FIFO record is transferred with
236 //               single/dual/quad interface width (0/1/2). Different widths can
237 //               be mixed freely.
238 //               0x0 -> Single width
239 //               0x1 -> Dual width
240 //               0x2 -> Quad width
241 #define QMI_DIRECT_TX_IWIDTH_RESET  _u(0x0)
242 #define QMI_DIRECT_TX_IWIDTH_BITS   _u(0x00030000)
243 #define QMI_DIRECT_TX_IWIDTH_MSB    _u(17)
244 #define QMI_DIRECT_TX_IWIDTH_LSB    _u(16)
245 #define QMI_DIRECT_TX_IWIDTH_ACCESS "WF"
246 #define QMI_DIRECT_TX_IWIDTH_VALUE_S _u(0x0)
247 #define QMI_DIRECT_TX_IWIDTH_VALUE_D _u(0x1)
248 #define QMI_DIRECT_TX_IWIDTH_VALUE_Q _u(0x2)
249 // -----------------------------------------------------------------------------
250 // Field       : QMI_DIRECT_TX_DATA
251 // Description : Data pushed here will be clocked out falling edges of SCK (or
252 //               before the very first rising edge of SCK, if this is the first
253 //               pulse). For each byte clocked out, the interface will
254 //               simultaneously sample one byte, on rising edges of SCK, and
255 //               push this to the DIRECT_RX FIFO.
256 //
257 //               For 16-bit data, the least-significant byte is transmitted
258 //               first.
259 #define QMI_DIRECT_TX_DATA_RESET  _u(0x0000)
260 #define QMI_DIRECT_TX_DATA_BITS   _u(0x0000ffff)
261 #define QMI_DIRECT_TX_DATA_MSB    _u(15)
262 #define QMI_DIRECT_TX_DATA_LSB    _u(0)
263 #define QMI_DIRECT_TX_DATA_ACCESS "WF"
264 // =============================================================================
265 // Register    : QMI_DIRECT_RX
266 // Description : Receive FIFO for direct mode
267 //               With each byte clocked out on the serial interface, one byte
268 //               will simultaneously be clocked in, and will appear in this
269 //               FIFO. The serial interface will stall when this FIFO is full,
270 //               to avoid dropping data.
271 //
272 //               When 16-bit data is pushed into the TX FIFO, the corresponding
273 //               RX FIFO push will also contain 16 bits of data. The least-
274 //               significant byte is the first one received.
275 #define QMI_DIRECT_RX_OFFSET _u(0x00000008)
276 #define QMI_DIRECT_RX_BITS   _u(0x0000ffff)
277 #define QMI_DIRECT_RX_RESET  _u(0x00000000)
278 #define QMI_DIRECT_RX_MSB    _u(15)
279 #define QMI_DIRECT_RX_LSB    _u(0)
280 #define QMI_DIRECT_RX_ACCESS "RF"
281 // =============================================================================
282 // Register    : QMI_M0_TIMING
283 // Description : Timing configuration register for memory address window 0.
284 #define QMI_M0_TIMING_OFFSET _u(0x0000000c)
285 #define QMI_M0_TIMING_BITS   _u(0xf3fff7ff)
286 #define QMI_M0_TIMING_RESET  _u(0x40000004)
287 // -----------------------------------------------------------------------------
288 // Field       : QMI_M0_TIMING_COOLDOWN
289 // Description : Chip select cooldown period. When a memory transfer finishes,
290 //               the chip select remains asserted for 64 x COOLDOWN system clock
291 //               cycles, plus half an SCK clock period (rounded up for odd SCK
292 //               divisors). After this cooldown expires, the chip select is
293 //               always deasserted to save power.
294 //
295 //               If the next memory access arrives within the cooldown period,
296 //               the QMI may be able to append more SCK cycles to the currently
297 //               ongoing SPI transfer, rather than starting a new transfer. This
298 //               reduces access latency and increases bus throughput.
299 //
300 //               Specifically, the next access must be in the same direction
301 //               (read/write), access the same memory window (chip select 0/1),
302 //               and follow sequentially the address of the last transfer. If
303 //               any of these are false, the new access will first deassert the
304 //               chip select, then begin a new transfer.
305 //
306 //               If COOLDOWN is 0, the address alignment configured by PAGEBREAK
307 //               has been reached, or the total chip select assertion limit
308 //               MAX_SELECT has been reached, the cooldown period is skipped,
309 //               and the chip select will always be deasserted one half SCK
310 //               period after the transfer finishes.
311 #define QMI_M0_TIMING_COOLDOWN_RESET  _u(0x1)
312 #define QMI_M0_TIMING_COOLDOWN_BITS   _u(0xc0000000)
313 #define QMI_M0_TIMING_COOLDOWN_MSB    _u(31)
314 #define QMI_M0_TIMING_COOLDOWN_LSB    _u(30)
315 #define QMI_M0_TIMING_COOLDOWN_ACCESS "RW"
316 // -----------------------------------------------------------------------------
317 // Field       : QMI_M0_TIMING_PAGEBREAK
318 // Description : When page break is enabled, chip select will automatically
319 //               deassert when crossing certain power-of-2-aligned address
320 //               boundaries. The next access will always begin a new read/write
321 //               SPI burst, even if the address of the next access follows in
322 //               sequence with the last access before the page boundary.
323 //
324 //               Some flash and PSRAM devices forbid crossing page boundaries
325 //               with a single read/write transfer, or restrict the operating
326 //               frequency for transfers that do cross page a boundary. This
327 //               option allows the QMI to safely support those devices.
328 //
329 //               This field has no effect when COOLDOWN is disabled.
330 //               0x0 -> No page boundary is enforced
331 //               0x1 -> Break bursts crossing a 256-byte page boundary
332 //               0x2 -> Break bursts crossing a 1024-byte quad-page boundary
333 //               0x3 -> Break bursts crossing a 4096-byte sector boundary
334 #define QMI_M0_TIMING_PAGEBREAK_RESET  _u(0x0)
335 #define QMI_M0_TIMING_PAGEBREAK_BITS   _u(0x30000000)
336 #define QMI_M0_TIMING_PAGEBREAK_MSB    _u(29)
337 #define QMI_M0_TIMING_PAGEBREAK_LSB    _u(28)
338 #define QMI_M0_TIMING_PAGEBREAK_ACCESS "RW"
339 #define QMI_M0_TIMING_PAGEBREAK_VALUE_NONE _u(0x0)
340 #define QMI_M0_TIMING_PAGEBREAK_VALUE_256 _u(0x1)
341 #define QMI_M0_TIMING_PAGEBREAK_VALUE_1024 _u(0x2)
342 #define QMI_M0_TIMING_PAGEBREAK_VALUE_4096 _u(0x3)
343 // -----------------------------------------------------------------------------
344 // Field       : QMI_M0_TIMING_SELECT_SETUP
345 // Description : Add up to one additional system clock cycle of setup between
346 //               chip select assertion and the first rising edge of SCK.
347 //
348 //               The default setup time is one half SCK period, which is usually
349 //               sufficient except for very high SCK frequencies with some flash
350 //               devices.
351 #define QMI_M0_TIMING_SELECT_SETUP_RESET  _u(0x0)
352 #define QMI_M0_TIMING_SELECT_SETUP_BITS   _u(0x02000000)
353 #define QMI_M0_TIMING_SELECT_SETUP_MSB    _u(25)
354 #define QMI_M0_TIMING_SELECT_SETUP_LSB    _u(25)
355 #define QMI_M0_TIMING_SELECT_SETUP_ACCESS "RW"
356 // -----------------------------------------------------------------------------
357 // Field       : QMI_M0_TIMING_SELECT_HOLD
358 // Description : Add up to three additional system clock cycles of active hold
359 //               between the last falling edge of SCK and the deassertion of
360 //               this window's chip select.
361 //
362 //               The default hold time is one system clock cycle. Note that
363 //               flash datasheets usually give chip select active hold time from
364 //               the last *rising* edge of SCK, and so even zero hold from the
365 //               last falling edge would be safe.
366 //
367 //               Note that this is a minimum hold time guaranteed by the QMI:
368 //               the actual chip select active hold may be slightly longer for
369 //               read transfers with low clock divisors and/or high sample
370 //               delays. Specifically, if the point two cycles after the last RX
371 //               data sample is later than the last SCK falling edge, then the
372 //               hold time is measured from *this* point.
373 //
374 //               Note also that, in case the final SCK pulse is masked to save
375 //               energy (true for non-DTR reads when COOLDOWN is disabled or
376 //               PAGE_BREAK is reached), all of QMI's timing logic behaves as
377 //               though the clock pulse were still present. The SELECT_HOLD time
378 //               is applied from the point where the last SCK falling edge would
379 //               be if the clock pulse were not masked.
380 #define QMI_M0_TIMING_SELECT_HOLD_RESET  _u(0x0)
381 #define QMI_M0_TIMING_SELECT_HOLD_BITS   _u(0x01800000)
382 #define QMI_M0_TIMING_SELECT_HOLD_MSB    _u(24)
383 #define QMI_M0_TIMING_SELECT_HOLD_LSB    _u(23)
384 #define QMI_M0_TIMING_SELECT_HOLD_ACCESS "RW"
385 // -----------------------------------------------------------------------------
386 // Field       : QMI_M0_TIMING_MAX_SELECT
387 // Description : Enforce a maximum assertion duration for this window's chip
388 //               select, in units of 64 system clock cycles. If 0, the QMI is
389 //               permitted to keep the chip select asserted indefinitely when
390 //               servicing sequential memory accesses (see COOLDOWN).
391 //
392 //               This feature is required to meet timing constraints of PSRAM
393 //               devices, which specify a maximum chip select assertion so they
394 //               can perform DRAM refresh cycles. See also MIN_DESELECT, which
395 //               can enforce a minimum deselect time.
396 //
397 //               If a memory access is in progress at the time MAX_SELECT is
398 //               reached, the QMI will wait for the access to complete before
399 //               deasserting the chip select. This additional time must be
400 //               accounted for to calculate a safe MAX_SELECT value. In the
401 //               worst case, this may be a fully-formed serial transfer,
402 //               including command prefix and address, with a data payload as
403 //               large as one cache line.
404 #define QMI_M0_TIMING_MAX_SELECT_RESET  _u(0x00)
405 #define QMI_M0_TIMING_MAX_SELECT_BITS   _u(0x007e0000)
406 #define QMI_M0_TIMING_MAX_SELECT_MSB    _u(22)
407 #define QMI_M0_TIMING_MAX_SELECT_LSB    _u(17)
408 #define QMI_M0_TIMING_MAX_SELECT_ACCESS "RW"
409 // -----------------------------------------------------------------------------
410 // Field       : QMI_M0_TIMING_MIN_DESELECT
411 // Description : After this window's chip select is deasserted, it remains
412 //               deasserted for half an SCK cycle (rounded up to an integer
413 //               number of system clock cycles), plus MIN_DESELECT additional
414 //               system clock cycles, before the QMI reasserts either chip
415 //               select pin.
416 //
417 //               Nonzero values may be required for PSRAM devices which enforce
418 //               a longer minimum CS deselect time, so that they can perform
419 //               internal DRAM refresh cycles whilst deselected.
420 #define QMI_M0_TIMING_MIN_DESELECT_RESET  _u(0x00)
421 #define QMI_M0_TIMING_MIN_DESELECT_BITS   _u(0x0001f000)
422 #define QMI_M0_TIMING_MIN_DESELECT_MSB    _u(16)
423 #define QMI_M0_TIMING_MIN_DESELECT_LSB    _u(12)
424 #define QMI_M0_TIMING_MIN_DESELECT_ACCESS "RW"
425 // -----------------------------------------------------------------------------
426 // Field       : QMI_M0_TIMING_RXDELAY
427 // Description : Delay the read data sample timing, in units of one half of a
428 //               system clock cycle. (Not necessarily half of an SCK cycle.) An
429 //               RXDELAY of 0 means the sample is captured at the SDI input
430 //               registers simultaneously with the rising edge of SCK launched
431 //               from the SCK output register.
432 //
433 //               At higher SCK frequencies, RXDELAY may need to be increased to
434 //               account for the round trip delay of the pads, and the clock-
435 //               to-Q delay of the QSPI memory device.
436 #define QMI_M0_TIMING_RXDELAY_RESET  _u(0x0)
437 #define QMI_M0_TIMING_RXDELAY_BITS   _u(0x00000700)
438 #define QMI_M0_TIMING_RXDELAY_MSB    _u(10)
439 #define QMI_M0_TIMING_RXDELAY_LSB    _u(8)
440 #define QMI_M0_TIMING_RXDELAY_ACCESS "RW"
441 // -----------------------------------------------------------------------------
442 // Field       : QMI_M0_TIMING_CLKDIV
443 // Description : Clock divisor. Odd and even divisors are supported. Defines the
444 //               SCK clock period in units of 1 system clock cycle. Divisors
445 //               1..255 are encoded directly, and a divisor of 256 is encoded
446 //               with a value of CLKDIV=0.
447 //
448 //               The clock divisor can be changed on-the-fly, even when the QMI
449 //               is currently accessing memory in this address window. All other
450 //               parameters must only be changed when the QMI is idle.
451 //
452 //               If software is increasing CLKDIV in anticipation of an increase
453 //               in the system clock frequency, a dummy access to either memory
454 //               window (and appropriate processor barriers/fences) must be
455 //               inserted after the Mx_TIMING write to ensure the SCK divisor
456 //               change is in effect _before_ the system clock is changed.
457 #define QMI_M0_TIMING_CLKDIV_RESET  _u(0x04)
458 #define QMI_M0_TIMING_CLKDIV_BITS   _u(0x000000ff)
459 #define QMI_M0_TIMING_CLKDIV_MSB    _u(7)
460 #define QMI_M0_TIMING_CLKDIV_LSB    _u(0)
461 #define QMI_M0_TIMING_CLKDIV_ACCESS "RW"
462 // =============================================================================
463 // Register    : QMI_M0_RFMT
464 // Description : Read transfer format configuration for memory address window 0.
465 //
466 //               Configure the bus width of each transfer phase individually,
467 //               and configure the length or presence of the command prefix,
468 //               command suffix and dummy/turnaround transfer phases. Only
469 //               24-bit addresses are supported.
470 //
471 //               The reset value of the M0_RFMT register is configured to
472 //               support a basic 03h serial read transfer with no additional
473 //               configuration.
474 #define QMI_M0_RFMT_OFFSET _u(0x00000010)
475 #define QMI_M0_RFMT_BITS   _u(0x1007d3ff)
476 #define QMI_M0_RFMT_RESET  _u(0x00001000)
477 // -----------------------------------------------------------------------------
478 // Field       : QMI_M0_RFMT_DTR
479 // Description : Enable double transfer rate (DTR) for read commands: address,
480 //               suffix and read data phases are active on both edges of SCK.
481 //               SDO data is launched centre-aligned on each SCK edge, and SDI
482 //               data is captured on the SCK edge that follows its launch.
483 //
484 //               DTR is implemented by halving the clock rate; SCK has a period
485 //               of 2 x CLK_DIV throughout the transfer. The prefix and dummy
486 //               phases are still single transfer rate.
487 //
488 //               If the suffix is quad-width, it must be 0 or 8 bits in length,
489 //               to ensure an even number of SCK edges.
490 #define QMI_M0_RFMT_DTR_RESET  _u(0x0)
491 #define QMI_M0_RFMT_DTR_BITS   _u(0x10000000)
492 #define QMI_M0_RFMT_DTR_MSB    _u(28)
493 #define QMI_M0_RFMT_DTR_LSB    _u(28)
494 #define QMI_M0_RFMT_DTR_ACCESS "RW"
495 // -----------------------------------------------------------------------------
496 // Field       : QMI_M0_RFMT_DUMMY_LEN
497 // Description : Length of dummy phase between command suffix and data phase, in
498 //               units of 4 bits. (i.e. 1 cycle for quad width, 2 for dual, 4
499 //               for single)
500 //               0x0 -> No dummy phase
501 //               0x1 -> 4 dummy bits
502 //               0x2 -> 8 dummy bits
503 //               0x3 -> 12 dummy bits
504 //               0x4 -> 16 dummy bits
505 //               0x5 -> 20 dummy bits
506 //               0x6 -> 24 dummy bits
507 //               0x7 -> 28 dummy bits
508 #define QMI_M0_RFMT_DUMMY_LEN_RESET  _u(0x0)
509 #define QMI_M0_RFMT_DUMMY_LEN_BITS   _u(0x00070000)
510 #define QMI_M0_RFMT_DUMMY_LEN_MSB    _u(18)
511 #define QMI_M0_RFMT_DUMMY_LEN_LSB    _u(16)
512 #define QMI_M0_RFMT_DUMMY_LEN_ACCESS "RW"
513 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_NONE _u(0x0)
514 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_4 _u(0x1)
515 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_8 _u(0x2)
516 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_12 _u(0x3)
517 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_16 _u(0x4)
518 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_20 _u(0x5)
519 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_24 _u(0x6)
520 #define QMI_M0_RFMT_DUMMY_LEN_VALUE_28 _u(0x7)
521 // -----------------------------------------------------------------------------
522 // Field       : QMI_M0_RFMT_SUFFIX_LEN
523 // Description : Length of post-address command suffix, in units of 4 bits.
524 //               (i.e. 1 cycle for quad width, 2 for dual, 4 for single)
525 //
526 //               Only values of 0 and 8 bits are supported.
527 //               0x0 -> No suffix
528 //               0x2 -> 8-bit suffix
529 #define QMI_M0_RFMT_SUFFIX_LEN_RESET  _u(0x0)
530 #define QMI_M0_RFMT_SUFFIX_LEN_BITS   _u(0x0000c000)
531 #define QMI_M0_RFMT_SUFFIX_LEN_MSB    _u(15)
532 #define QMI_M0_RFMT_SUFFIX_LEN_LSB    _u(14)
533 #define QMI_M0_RFMT_SUFFIX_LEN_ACCESS "RW"
534 #define QMI_M0_RFMT_SUFFIX_LEN_VALUE_NONE _u(0x0)
535 #define QMI_M0_RFMT_SUFFIX_LEN_VALUE_8 _u(0x2)
536 // -----------------------------------------------------------------------------
537 // Field       : QMI_M0_RFMT_PREFIX_LEN
538 // Description : Length of command prefix, in units of 8 bits. (i.e. 2 cycles
539 //               for quad width, 4 for dual, 8 for single)
540 //               0x0 -> No prefix
541 //               0x1 -> 8-bit prefix
542 #define QMI_M0_RFMT_PREFIX_LEN_RESET  _u(0x1)
543 #define QMI_M0_RFMT_PREFIX_LEN_BITS   _u(0x00001000)
544 #define QMI_M0_RFMT_PREFIX_LEN_MSB    _u(12)
545 #define QMI_M0_RFMT_PREFIX_LEN_LSB    _u(12)
546 #define QMI_M0_RFMT_PREFIX_LEN_ACCESS "RW"
547 #define QMI_M0_RFMT_PREFIX_LEN_VALUE_NONE _u(0x0)
548 #define QMI_M0_RFMT_PREFIX_LEN_VALUE_8 _u(0x1)
549 // -----------------------------------------------------------------------------
550 // Field       : QMI_M0_RFMT_DATA_WIDTH
551 // Description : The width used for the data transfer
552 //               0x0 -> Single width
553 //               0x1 -> Dual width
554 //               0x2 -> Quad width
555 #define QMI_M0_RFMT_DATA_WIDTH_RESET  _u(0x0)
556 #define QMI_M0_RFMT_DATA_WIDTH_BITS   _u(0x00000300)
557 #define QMI_M0_RFMT_DATA_WIDTH_MSB    _u(9)
558 #define QMI_M0_RFMT_DATA_WIDTH_LSB    _u(8)
559 #define QMI_M0_RFMT_DATA_WIDTH_ACCESS "RW"
560 #define QMI_M0_RFMT_DATA_WIDTH_VALUE_S _u(0x0)
561 #define QMI_M0_RFMT_DATA_WIDTH_VALUE_D _u(0x1)
562 #define QMI_M0_RFMT_DATA_WIDTH_VALUE_Q _u(0x2)
563 // -----------------------------------------------------------------------------
564 // Field       : QMI_M0_RFMT_DUMMY_WIDTH
565 // Description : The width used for the dummy phase, if any.
566 //
567 //               If width is single, SD0/MOSI is held asserted low during the
568 //               dummy phase, and SD1...SD3 are tristated. If width is
569 //               dual/quad, all IOs are tristated during the dummy phase.
570 //               0x0 -> Single width
571 //               0x1 -> Dual width
572 //               0x2 -> Quad width
573 #define QMI_M0_RFMT_DUMMY_WIDTH_RESET  _u(0x0)
574 #define QMI_M0_RFMT_DUMMY_WIDTH_BITS   _u(0x000000c0)
575 #define QMI_M0_RFMT_DUMMY_WIDTH_MSB    _u(7)
576 #define QMI_M0_RFMT_DUMMY_WIDTH_LSB    _u(6)
577 #define QMI_M0_RFMT_DUMMY_WIDTH_ACCESS "RW"
578 #define QMI_M0_RFMT_DUMMY_WIDTH_VALUE_S _u(0x0)
579 #define QMI_M0_RFMT_DUMMY_WIDTH_VALUE_D _u(0x1)
580 #define QMI_M0_RFMT_DUMMY_WIDTH_VALUE_Q _u(0x2)
581 // -----------------------------------------------------------------------------
582 // Field       : QMI_M0_RFMT_SUFFIX_WIDTH
583 // Description : The width used for the post-address command suffix, if any
584 //               0x0 -> Single width
585 //               0x1 -> Dual width
586 //               0x2 -> Quad width
587 #define QMI_M0_RFMT_SUFFIX_WIDTH_RESET  _u(0x0)
588 #define QMI_M0_RFMT_SUFFIX_WIDTH_BITS   _u(0x00000030)
589 #define QMI_M0_RFMT_SUFFIX_WIDTH_MSB    _u(5)
590 #define QMI_M0_RFMT_SUFFIX_WIDTH_LSB    _u(4)
591 #define QMI_M0_RFMT_SUFFIX_WIDTH_ACCESS "RW"
592 #define QMI_M0_RFMT_SUFFIX_WIDTH_VALUE_S _u(0x0)
593 #define QMI_M0_RFMT_SUFFIX_WIDTH_VALUE_D _u(0x1)
594 #define QMI_M0_RFMT_SUFFIX_WIDTH_VALUE_Q _u(0x2)
595 // -----------------------------------------------------------------------------
596 // Field       : QMI_M0_RFMT_ADDR_WIDTH
597 // Description : The transfer width used for the address. The address phase
598 //               always transfers 24 bits in total.
599 //               0x0 -> Single width
600 //               0x1 -> Dual width
601 //               0x2 -> Quad width
602 #define QMI_M0_RFMT_ADDR_WIDTH_RESET  _u(0x0)
603 #define QMI_M0_RFMT_ADDR_WIDTH_BITS   _u(0x0000000c)
604 #define QMI_M0_RFMT_ADDR_WIDTH_MSB    _u(3)
605 #define QMI_M0_RFMT_ADDR_WIDTH_LSB    _u(2)
606 #define QMI_M0_RFMT_ADDR_WIDTH_ACCESS "RW"
607 #define QMI_M0_RFMT_ADDR_WIDTH_VALUE_S _u(0x0)
608 #define QMI_M0_RFMT_ADDR_WIDTH_VALUE_D _u(0x1)
609 #define QMI_M0_RFMT_ADDR_WIDTH_VALUE_Q _u(0x2)
610 // -----------------------------------------------------------------------------
611 // Field       : QMI_M0_RFMT_PREFIX_WIDTH
612 // Description : The transfer width used for the command prefix, if any
613 //               0x0 -> Single width
614 //               0x1 -> Dual width
615 //               0x2 -> Quad width
616 #define QMI_M0_RFMT_PREFIX_WIDTH_RESET  _u(0x0)
617 #define QMI_M0_RFMT_PREFIX_WIDTH_BITS   _u(0x00000003)
618 #define QMI_M0_RFMT_PREFIX_WIDTH_MSB    _u(1)
619 #define QMI_M0_RFMT_PREFIX_WIDTH_LSB    _u(0)
620 #define QMI_M0_RFMT_PREFIX_WIDTH_ACCESS "RW"
621 #define QMI_M0_RFMT_PREFIX_WIDTH_VALUE_S _u(0x0)
622 #define QMI_M0_RFMT_PREFIX_WIDTH_VALUE_D _u(0x1)
623 #define QMI_M0_RFMT_PREFIX_WIDTH_VALUE_Q _u(0x2)
624 // =============================================================================
625 // Register    : QMI_M0_RCMD
626 // Description : Command constants used for reads from memory address window 0.
627 //
628 //               The reset value of the M0_RCMD register is configured to
629 //               support a basic 03h serial read transfer with no additional
630 //               configuration.
631 #define QMI_M0_RCMD_OFFSET _u(0x00000014)
632 #define QMI_M0_RCMD_BITS   _u(0x0000ffff)
633 #define QMI_M0_RCMD_RESET  _u(0x0000a003)
634 // -----------------------------------------------------------------------------
635 // Field       : QMI_M0_RCMD_SUFFIX
636 // Description : The command suffix bits following the address, if
637 //               Mx_RFMT_SUFFIX_LEN is nonzero.
638 #define QMI_M0_RCMD_SUFFIX_RESET  _u(0xa0)
639 #define QMI_M0_RCMD_SUFFIX_BITS   _u(0x0000ff00)
640 #define QMI_M0_RCMD_SUFFIX_MSB    _u(15)
641 #define QMI_M0_RCMD_SUFFIX_LSB    _u(8)
642 #define QMI_M0_RCMD_SUFFIX_ACCESS "RW"
643 // -----------------------------------------------------------------------------
644 // Field       : QMI_M0_RCMD_PREFIX
645 // Description : The command prefix bits to prepend on each new transfer, if
646 //               Mx_RFMT_PREFIX_LEN is nonzero.
647 #define QMI_M0_RCMD_PREFIX_RESET  _u(0x03)
648 #define QMI_M0_RCMD_PREFIX_BITS   _u(0x000000ff)
649 #define QMI_M0_RCMD_PREFIX_MSB    _u(7)
650 #define QMI_M0_RCMD_PREFIX_LSB    _u(0)
651 #define QMI_M0_RCMD_PREFIX_ACCESS "RW"
652 // =============================================================================
653 // Register    : QMI_M0_WFMT
654 // Description : Write transfer format configuration for memory address window
655 //               0.
656 //
657 //               Configure the bus width of each transfer phase individually,
658 //               and configure the length or presence of the command prefix,
659 //               command suffix and dummy/turnaround transfer phases. Only
660 //               24-bit addresses are supported.
661 //
662 //               The reset value of the M0_WFMT register is configured to
663 //               support a basic 02h serial write transfer. However, writes to
664 //               this window must first be enabled via the XIP_CTRL_WRITABLE_M0
665 //               bit, as XIP memory is read-only by default.
666 #define QMI_M0_WFMT_OFFSET _u(0x00000018)
667 #define QMI_M0_WFMT_BITS   _u(0x1007d3ff)
668 #define QMI_M0_WFMT_RESET  _u(0x00001000)
669 // -----------------------------------------------------------------------------
670 // Field       : QMI_M0_WFMT_DTR
671 // Description : Enable double transfer rate (DTR) for write commands: address,
672 //               suffix and write data phases are active on both edges of SCK.
673 //               SDO data is launched centre-aligned on each SCK edge, and SDI
674 //               data is captured on the SCK edge that follows its launch.
675 //
676 //               DTR is implemented by halving the clock rate; SCK has a period
677 //               of 2 x CLK_DIV throughout the transfer. The prefix and dummy
678 //               phases are still single transfer rate.
679 //
680 //               If the suffix is quad-width, it must be 0 or 8 bits in length,
681 //               to ensure an even number of SCK edges.
682 #define QMI_M0_WFMT_DTR_RESET  _u(0x0)
683 #define QMI_M0_WFMT_DTR_BITS   _u(0x10000000)
684 #define QMI_M0_WFMT_DTR_MSB    _u(28)
685 #define QMI_M0_WFMT_DTR_LSB    _u(28)
686 #define QMI_M0_WFMT_DTR_ACCESS "RW"
687 // -----------------------------------------------------------------------------
688 // Field       : QMI_M0_WFMT_DUMMY_LEN
689 // Description : Length of dummy phase between command suffix and data phase, in
690 //               units of 4 bits. (i.e. 1 cycle for quad width, 2 for dual, 4
691 //               for single)
692 //               0x0 -> No dummy phase
693 //               0x1 -> 4 dummy bits
694 //               0x2 -> 8 dummy bits
695 //               0x3 -> 12 dummy bits
696 //               0x4 -> 16 dummy bits
697 //               0x5 -> 20 dummy bits
698 //               0x6 -> 24 dummy bits
699 //               0x7 -> 28 dummy bits
700 #define QMI_M0_WFMT_DUMMY_LEN_RESET  _u(0x0)
701 #define QMI_M0_WFMT_DUMMY_LEN_BITS   _u(0x00070000)
702 #define QMI_M0_WFMT_DUMMY_LEN_MSB    _u(18)
703 #define QMI_M0_WFMT_DUMMY_LEN_LSB    _u(16)
704 #define QMI_M0_WFMT_DUMMY_LEN_ACCESS "RW"
705 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_NONE _u(0x0)
706 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_4 _u(0x1)
707 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_8 _u(0x2)
708 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_12 _u(0x3)
709 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_16 _u(0x4)
710 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_20 _u(0x5)
711 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_24 _u(0x6)
712 #define QMI_M0_WFMT_DUMMY_LEN_VALUE_28 _u(0x7)
713 // -----------------------------------------------------------------------------
714 // Field       : QMI_M0_WFMT_SUFFIX_LEN
715 // Description : Length of post-address command suffix, in units of 4 bits.
716 //               (i.e. 1 cycle for quad width, 2 for dual, 4 for single)
717 //
718 //               Only values of 0 and 8 bits are supported.
719 //               0x0 -> No suffix
720 //               0x2 -> 8-bit suffix
721 #define QMI_M0_WFMT_SUFFIX_LEN_RESET  _u(0x0)
722 #define QMI_M0_WFMT_SUFFIX_LEN_BITS   _u(0x0000c000)
723 #define QMI_M0_WFMT_SUFFIX_LEN_MSB    _u(15)
724 #define QMI_M0_WFMT_SUFFIX_LEN_LSB    _u(14)
725 #define QMI_M0_WFMT_SUFFIX_LEN_ACCESS "RW"
726 #define QMI_M0_WFMT_SUFFIX_LEN_VALUE_NONE _u(0x0)
727 #define QMI_M0_WFMT_SUFFIX_LEN_VALUE_8 _u(0x2)
728 // -----------------------------------------------------------------------------
729 // Field       : QMI_M0_WFMT_PREFIX_LEN
730 // Description : Length of command prefix, in units of 8 bits. (i.e. 2 cycles
731 //               for quad width, 4 for dual, 8 for single)
732 //               0x0 -> No prefix
733 //               0x1 -> 8-bit prefix
734 #define QMI_M0_WFMT_PREFIX_LEN_RESET  _u(0x1)
735 #define QMI_M0_WFMT_PREFIX_LEN_BITS   _u(0x00001000)
736 #define QMI_M0_WFMT_PREFIX_LEN_MSB    _u(12)
737 #define QMI_M0_WFMT_PREFIX_LEN_LSB    _u(12)
738 #define QMI_M0_WFMT_PREFIX_LEN_ACCESS "RW"
739 #define QMI_M0_WFMT_PREFIX_LEN_VALUE_NONE _u(0x0)
740 #define QMI_M0_WFMT_PREFIX_LEN_VALUE_8 _u(0x1)
741 // -----------------------------------------------------------------------------
742 // Field       : QMI_M0_WFMT_DATA_WIDTH
743 // Description : The width used for the data transfer
744 //               0x0 -> Single width
745 //               0x1 -> Dual width
746 //               0x2 -> Quad width
747 #define QMI_M0_WFMT_DATA_WIDTH_RESET  _u(0x0)
748 #define QMI_M0_WFMT_DATA_WIDTH_BITS   _u(0x00000300)
749 #define QMI_M0_WFMT_DATA_WIDTH_MSB    _u(9)
750 #define QMI_M0_WFMT_DATA_WIDTH_LSB    _u(8)
751 #define QMI_M0_WFMT_DATA_WIDTH_ACCESS "RW"
752 #define QMI_M0_WFMT_DATA_WIDTH_VALUE_S _u(0x0)
753 #define QMI_M0_WFMT_DATA_WIDTH_VALUE_D _u(0x1)
754 #define QMI_M0_WFMT_DATA_WIDTH_VALUE_Q _u(0x2)
755 // -----------------------------------------------------------------------------
756 // Field       : QMI_M0_WFMT_DUMMY_WIDTH
757 // Description : The width used for the dummy phase, if any.
758 //
759 //               If width is single, SD0/MOSI is held asserted low during the
760 //               dummy phase, and SD1...SD3 are tristated. If width is
761 //               dual/quad, all IOs are tristated during the dummy phase.
762 //               0x0 -> Single width
763 //               0x1 -> Dual width
764 //               0x2 -> Quad width
765 #define QMI_M0_WFMT_DUMMY_WIDTH_RESET  _u(0x0)
766 #define QMI_M0_WFMT_DUMMY_WIDTH_BITS   _u(0x000000c0)
767 #define QMI_M0_WFMT_DUMMY_WIDTH_MSB    _u(7)
768 #define QMI_M0_WFMT_DUMMY_WIDTH_LSB    _u(6)
769 #define QMI_M0_WFMT_DUMMY_WIDTH_ACCESS "RW"
770 #define QMI_M0_WFMT_DUMMY_WIDTH_VALUE_S _u(0x0)
771 #define QMI_M0_WFMT_DUMMY_WIDTH_VALUE_D _u(0x1)
772 #define QMI_M0_WFMT_DUMMY_WIDTH_VALUE_Q _u(0x2)
773 // -----------------------------------------------------------------------------
774 // Field       : QMI_M0_WFMT_SUFFIX_WIDTH
775 // Description : The width used for the post-address command suffix, if any
776 //               0x0 -> Single width
777 //               0x1 -> Dual width
778 //               0x2 -> Quad width
779 #define QMI_M0_WFMT_SUFFIX_WIDTH_RESET  _u(0x0)
780 #define QMI_M0_WFMT_SUFFIX_WIDTH_BITS   _u(0x00000030)
781 #define QMI_M0_WFMT_SUFFIX_WIDTH_MSB    _u(5)
782 #define QMI_M0_WFMT_SUFFIX_WIDTH_LSB    _u(4)
783 #define QMI_M0_WFMT_SUFFIX_WIDTH_ACCESS "RW"
784 #define QMI_M0_WFMT_SUFFIX_WIDTH_VALUE_S _u(0x0)
785 #define QMI_M0_WFMT_SUFFIX_WIDTH_VALUE_D _u(0x1)
786 #define QMI_M0_WFMT_SUFFIX_WIDTH_VALUE_Q _u(0x2)
787 // -----------------------------------------------------------------------------
788 // Field       : QMI_M0_WFMT_ADDR_WIDTH
789 // Description : The transfer width used for the address. The address phase
790 //               always transfers 24 bits in total.
791 //               0x0 -> Single width
792 //               0x1 -> Dual width
793 //               0x2 -> Quad width
794 #define QMI_M0_WFMT_ADDR_WIDTH_RESET  _u(0x0)
795 #define QMI_M0_WFMT_ADDR_WIDTH_BITS   _u(0x0000000c)
796 #define QMI_M0_WFMT_ADDR_WIDTH_MSB    _u(3)
797 #define QMI_M0_WFMT_ADDR_WIDTH_LSB    _u(2)
798 #define QMI_M0_WFMT_ADDR_WIDTH_ACCESS "RW"
799 #define QMI_M0_WFMT_ADDR_WIDTH_VALUE_S _u(0x0)
800 #define QMI_M0_WFMT_ADDR_WIDTH_VALUE_D _u(0x1)
801 #define QMI_M0_WFMT_ADDR_WIDTH_VALUE_Q _u(0x2)
802 // -----------------------------------------------------------------------------
803 // Field       : QMI_M0_WFMT_PREFIX_WIDTH
804 // Description : The transfer width used for the command prefix, if any
805 //               0x0 -> Single width
806 //               0x1 -> Dual width
807 //               0x2 -> Quad width
808 #define QMI_M0_WFMT_PREFIX_WIDTH_RESET  _u(0x0)
809 #define QMI_M0_WFMT_PREFIX_WIDTH_BITS   _u(0x00000003)
810 #define QMI_M0_WFMT_PREFIX_WIDTH_MSB    _u(1)
811 #define QMI_M0_WFMT_PREFIX_WIDTH_LSB    _u(0)
812 #define QMI_M0_WFMT_PREFIX_WIDTH_ACCESS "RW"
813 #define QMI_M0_WFMT_PREFIX_WIDTH_VALUE_S _u(0x0)
814 #define QMI_M0_WFMT_PREFIX_WIDTH_VALUE_D _u(0x1)
815 #define QMI_M0_WFMT_PREFIX_WIDTH_VALUE_Q _u(0x2)
816 // =============================================================================
817 // Register    : QMI_M0_WCMD
818 // Description : Command constants used for writes to memory address window 0.
819 //
820 //               The reset value of the M0_WCMD register is configured to
821 //               support a basic 02h serial write transfer with no additional
822 //               configuration.
823 #define QMI_M0_WCMD_OFFSET _u(0x0000001c)
824 #define QMI_M0_WCMD_BITS   _u(0x0000ffff)
825 #define QMI_M0_WCMD_RESET  _u(0x0000a002)
826 // -----------------------------------------------------------------------------
827 // Field       : QMI_M0_WCMD_SUFFIX
828 // Description : The command suffix bits following the address, if
829 //               Mx_WFMT_SUFFIX_LEN is nonzero.
830 #define QMI_M0_WCMD_SUFFIX_RESET  _u(0xa0)
831 #define QMI_M0_WCMD_SUFFIX_BITS   _u(0x0000ff00)
832 #define QMI_M0_WCMD_SUFFIX_MSB    _u(15)
833 #define QMI_M0_WCMD_SUFFIX_LSB    _u(8)
834 #define QMI_M0_WCMD_SUFFIX_ACCESS "RW"
835 // -----------------------------------------------------------------------------
836 // Field       : QMI_M0_WCMD_PREFIX
837 // Description : The command prefix bits to prepend on each new transfer, if
838 //               Mx_WFMT_PREFIX_LEN is nonzero.
839 #define QMI_M0_WCMD_PREFIX_RESET  _u(0x02)
840 #define QMI_M0_WCMD_PREFIX_BITS   _u(0x000000ff)
841 #define QMI_M0_WCMD_PREFIX_MSB    _u(7)
842 #define QMI_M0_WCMD_PREFIX_LSB    _u(0)
843 #define QMI_M0_WCMD_PREFIX_ACCESS "RW"
844 // =============================================================================
845 // Register    : QMI_M1_TIMING
846 // Description : Timing configuration register for memory address window 1.
847 #define QMI_M1_TIMING_OFFSET _u(0x00000020)
848 #define QMI_M1_TIMING_BITS   _u(0xf3fff7ff)
849 #define QMI_M1_TIMING_RESET  _u(0x40000004)
850 // -----------------------------------------------------------------------------
851 // Field       : QMI_M1_TIMING_COOLDOWN
852 // Description : Chip select cooldown period. When a memory transfer finishes,
853 //               the chip select remains asserted for 64 x COOLDOWN system clock
854 //               cycles, plus half an SCK clock period (rounded up for odd SCK
855 //               divisors). After this cooldown expires, the chip select is
856 //               always deasserted to save power.
857 //
858 //               If the next memory access arrives within the cooldown period,
859 //               the QMI may be able to append more SCK cycles to the currently
860 //               ongoing SPI transfer, rather than starting a new transfer. This
861 //               reduces access latency and increases bus throughput.
862 //
863 //               Specifically, the next access must be in the same direction
864 //               (read/write), access the same memory window (chip select 0/1),
865 //               and follow sequentially the address of the last transfer. If
866 //               any of these are false, the new access will first deassert the
867 //               chip select, then begin a new transfer.
868 //
869 //               If COOLDOWN is 0, the address alignment configured by PAGEBREAK
870 //               has been reached, or the total chip select assertion limit
871 //               MAX_SELECT has been reached, the cooldown period is skipped,
872 //               and the chip select will always be deasserted one half SCK
873 //               period after the transfer finishes.
874 #define QMI_M1_TIMING_COOLDOWN_RESET  _u(0x1)
875 #define QMI_M1_TIMING_COOLDOWN_BITS   _u(0xc0000000)
876 #define QMI_M1_TIMING_COOLDOWN_MSB    _u(31)
877 #define QMI_M1_TIMING_COOLDOWN_LSB    _u(30)
878 #define QMI_M1_TIMING_COOLDOWN_ACCESS "RW"
879 // -----------------------------------------------------------------------------
880 // Field       : QMI_M1_TIMING_PAGEBREAK
881 // Description : When page break is enabled, chip select will automatically
882 //               deassert when crossing certain power-of-2-aligned address
883 //               boundaries. The next access will always begin a new read/write
884 //               SPI burst, even if the address of the next access follows in
885 //               sequence with the last access before the page boundary.
886 //
887 //               Some flash and PSRAM devices forbid crossing page boundaries
888 //               with a single read/write transfer, or restrict the operating
889 //               frequency for transfers that do cross page a boundary. This
890 //               option allows the QMI to safely support those devices.
891 //
892 //               This field has no effect when COOLDOWN is disabled.
893 //               0x0 -> No page boundary is enforced
894 //               0x1 -> Break bursts crossing a 256-byte page boundary
895 //               0x2 -> Break bursts crossing a 1024-byte quad-page boundary
896 //               0x3 -> Break bursts crossing a 4096-byte sector boundary
897 #define QMI_M1_TIMING_PAGEBREAK_RESET  _u(0x0)
898 #define QMI_M1_TIMING_PAGEBREAK_BITS   _u(0x30000000)
899 #define QMI_M1_TIMING_PAGEBREAK_MSB    _u(29)
900 #define QMI_M1_TIMING_PAGEBREAK_LSB    _u(28)
901 #define QMI_M1_TIMING_PAGEBREAK_ACCESS "RW"
902 #define QMI_M1_TIMING_PAGEBREAK_VALUE_NONE _u(0x0)
903 #define QMI_M1_TIMING_PAGEBREAK_VALUE_256 _u(0x1)
904 #define QMI_M1_TIMING_PAGEBREAK_VALUE_1024 _u(0x2)
905 #define QMI_M1_TIMING_PAGEBREAK_VALUE_4096 _u(0x3)
906 // -----------------------------------------------------------------------------
907 // Field       : QMI_M1_TIMING_SELECT_SETUP
908 // Description : Add up to one additional system clock cycle of setup between
909 //               chip select assertion and the first rising edge of SCK.
910 //
911 //               The default setup time is one half SCK period, which is usually
912 //               sufficient except for very high SCK frequencies with some flash
913 //               devices.
914 #define QMI_M1_TIMING_SELECT_SETUP_RESET  _u(0x0)
915 #define QMI_M1_TIMING_SELECT_SETUP_BITS   _u(0x02000000)
916 #define QMI_M1_TIMING_SELECT_SETUP_MSB    _u(25)
917 #define QMI_M1_TIMING_SELECT_SETUP_LSB    _u(25)
918 #define QMI_M1_TIMING_SELECT_SETUP_ACCESS "RW"
919 // -----------------------------------------------------------------------------
920 // Field       : QMI_M1_TIMING_SELECT_HOLD
921 // Description : Add up to three additional system clock cycles of active hold
922 //               between the last falling edge of SCK and the deassertion of
923 //               this window's chip select.
924 //
925 //               The default hold time is one system clock cycle. Note that
926 //               flash datasheets usually give chip select active hold time from
927 //               the last *rising* edge of SCK, and so even zero hold from the
928 //               last falling edge would be safe.
929 //
930 //               Note that this is a minimum hold time guaranteed by the QMI:
931 //               the actual chip select active hold may be slightly longer for
932 //               read transfers with low clock divisors and/or high sample
933 //               delays. Specifically, if the point two cycles after the last RX
934 //               data sample is later than the last SCK falling edge, then the
935 //               hold time is measured from *this* point.
936 //
937 //               Note also that, in case the final SCK pulse is masked to save
938 //               energy (true for non-DTR reads when COOLDOWN is disabled or
939 //               PAGE_BREAK is reached), all of QMI's timing logic behaves as
940 //               though the clock pulse were still present. The SELECT_HOLD time
941 //               is applied from the point where the last SCK falling edge would
942 //               be if the clock pulse were not masked.
943 #define QMI_M1_TIMING_SELECT_HOLD_RESET  _u(0x0)
944 #define QMI_M1_TIMING_SELECT_HOLD_BITS   _u(0x01800000)
945 #define QMI_M1_TIMING_SELECT_HOLD_MSB    _u(24)
946 #define QMI_M1_TIMING_SELECT_HOLD_LSB    _u(23)
947 #define QMI_M1_TIMING_SELECT_HOLD_ACCESS "RW"
948 // -----------------------------------------------------------------------------
949 // Field       : QMI_M1_TIMING_MAX_SELECT
950 // Description : Enforce a maximum assertion duration for this window's chip
951 //               select, in units of 64 system clock cycles. If 0, the QMI is
952 //               permitted to keep the chip select asserted indefinitely when
953 //               servicing sequential memory accesses (see COOLDOWN).
954 //
955 //               This feature is required to meet timing constraints of PSRAM
956 //               devices, which specify a maximum chip select assertion so they
957 //               can perform DRAM refresh cycles. See also MIN_DESELECT, which
958 //               can enforce a minimum deselect time.
959 //
960 //               If a memory access is in progress at the time MAX_SELECT is
961 //               reached, the QMI will wait for the access to complete before
962 //               deasserting the chip select. This additional time must be
963 //               accounted for to calculate a safe MAX_SELECT value. In the
964 //               worst case, this may be a fully-formed serial transfer,
965 //               including command prefix and address, with a data payload as
966 //               large as one cache line.
967 #define QMI_M1_TIMING_MAX_SELECT_RESET  _u(0x00)
968 #define QMI_M1_TIMING_MAX_SELECT_BITS   _u(0x007e0000)
969 #define QMI_M1_TIMING_MAX_SELECT_MSB    _u(22)
970 #define QMI_M1_TIMING_MAX_SELECT_LSB    _u(17)
971 #define QMI_M1_TIMING_MAX_SELECT_ACCESS "RW"
972 // -----------------------------------------------------------------------------
973 // Field       : QMI_M1_TIMING_MIN_DESELECT
974 // Description : After this window's chip select is deasserted, it remains
975 //               deasserted for half an SCK cycle (rounded up to an integer
976 //               number of system clock cycles), plus MIN_DESELECT additional
977 //               system clock cycles, before the QMI reasserts either chip
978 //               select pin.
979 //
980 //               Nonzero values may be required for PSRAM devices which enforce
981 //               a longer minimum CS deselect time, so that they can perform
982 //               internal DRAM refresh cycles whilst deselected.
983 #define QMI_M1_TIMING_MIN_DESELECT_RESET  _u(0x00)
984 #define QMI_M1_TIMING_MIN_DESELECT_BITS   _u(0x0001f000)
985 #define QMI_M1_TIMING_MIN_DESELECT_MSB    _u(16)
986 #define QMI_M1_TIMING_MIN_DESELECT_LSB    _u(12)
987 #define QMI_M1_TIMING_MIN_DESELECT_ACCESS "RW"
988 // -----------------------------------------------------------------------------
989 // Field       : QMI_M1_TIMING_RXDELAY
990 // Description : Delay the read data sample timing, in units of one half of a
991 //               system clock cycle. (Not necessarily half of an SCK cycle.) An
992 //               RXDELAY of 0 means the sample is captured at the SDI input
993 //               registers simultaneously with the rising edge of SCK launched
994 //               from the SCK output register.
995 //
996 //               At higher SCK frequencies, RXDELAY may need to be increased to
997 //               account for the round trip delay of the pads, and the clock-
998 //               to-Q delay of the QSPI memory device.
999 #define QMI_M1_TIMING_RXDELAY_RESET  _u(0x0)
1000 #define QMI_M1_TIMING_RXDELAY_BITS   _u(0x00000700)
1001 #define QMI_M1_TIMING_RXDELAY_MSB    _u(10)
1002 #define QMI_M1_TIMING_RXDELAY_LSB    _u(8)
1003 #define QMI_M1_TIMING_RXDELAY_ACCESS "RW"
1004 // -----------------------------------------------------------------------------
1005 // Field       : QMI_M1_TIMING_CLKDIV
1006 // Description : Clock divisor. Odd and even divisors are supported. Defines the
1007 //               SCK clock period in units of 1 system clock cycle. Divisors
1008 //               1..255 are encoded directly, and a divisor of 256 is encoded
1009 //               with a value of CLKDIV=0.
1010 //
1011 //               The clock divisor can be changed on-the-fly, even when the QMI
1012 //               is currently accessing memory in this address window. All other
1013 //               parameters must only be changed when the QMI is idle.
1014 //
1015 //               If software is increasing CLKDIV in anticipation of an increase
1016 //               in the system clock frequency, a dummy access to either memory
1017 //               window (and appropriate processor barriers/fences) must be
1018 //               inserted after the Mx_TIMING write to ensure the SCK divisor
1019 //               change is in effect _before_ the system clock is changed.
1020 #define QMI_M1_TIMING_CLKDIV_RESET  _u(0x04)
1021 #define QMI_M1_TIMING_CLKDIV_BITS   _u(0x000000ff)
1022 #define QMI_M1_TIMING_CLKDIV_MSB    _u(7)
1023 #define QMI_M1_TIMING_CLKDIV_LSB    _u(0)
1024 #define QMI_M1_TIMING_CLKDIV_ACCESS "RW"
1025 // =============================================================================
1026 // Register    : QMI_M1_RFMT
1027 // Description : Read transfer format configuration for memory address window 1.
1028 //
1029 //               Configure the bus width of each transfer phase individually,
1030 //               and configure the length or presence of the command prefix,
1031 //               command suffix and dummy/turnaround transfer phases. Only
1032 //               24-bit addresses are supported.
1033 //
1034 //               The reset value of the M1_RFMT register is configured to
1035 //               support a basic 03h serial read transfer with no additional
1036 //               configuration.
1037 #define QMI_M1_RFMT_OFFSET _u(0x00000024)
1038 #define QMI_M1_RFMT_BITS   _u(0x1007d3ff)
1039 #define QMI_M1_RFMT_RESET  _u(0x00001000)
1040 // -----------------------------------------------------------------------------
1041 // Field       : QMI_M1_RFMT_DTR
1042 // Description : Enable double transfer rate (DTR) for read commands: address,
1043 //               suffix and read data phases are active on both edges of SCK.
1044 //               SDO data is launched centre-aligned on each SCK edge, and SDI
1045 //               data is captured on the SCK edge that follows its launch.
1046 //
1047 //               DTR is implemented by halving the clock rate; SCK has a period
1048 //               of 2 x CLK_DIV throughout the transfer. The prefix and dummy
1049 //               phases are still single transfer rate.
1050 //
1051 //               If the suffix is quad-width, it must be 0 or 8 bits in length,
1052 //               to ensure an even number of SCK edges.
1053 #define QMI_M1_RFMT_DTR_RESET  _u(0x0)
1054 #define QMI_M1_RFMT_DTR_BITS   _u(0x10000000)
1055 #define QMI_M1_RFMT_DTR_MSB    _u(28)
1056 #define QMI_M1_RFMT_DTR_LSB    _u(28)
1057 #define QMI_M1_RFMT_DTR_ACCESS "RW"
1058 // -----------------------------------------------------------------------------
1059 // Field       : QMI_M1_RFMT_DUMMY_LEN
1060 // Description : Length of dummy phase between command suffix and data phase, in
1061 //               units of 4 bits. (i.e. 1 cycle for quad width, 2 for dual, 4
1062 //               for single)
1063 //               0x0 -> No dummy phase
1064 //               0x1 -> 4 dummy bits
1065 //               0x2 -> 8 dummy bits
1066 //               0x3 -> 12 dummy bits
1067 //               0x4 -> 16 dummy bits
1068 //               0x5 -> 20 dummy bits
1069 //               0x6 -> 24 dummy bits
1070 //               0x7 -> 28 dummy bits
1071 #define QMI_M1_RFMT_DUMMY_LEN_RESET  _u(0x0)
1072 #define QMI_M1_RFMT_DUMMY_LEN_BITS   _u(0x00070000)
1073 #define QMI_M1_RFMT_DUMMY_LEN_MSB    _u(18)
1074 #define QMI_M1_RFMT_DUMMY_LEN_LSB    _u(16)
1075 #define QMI_M1_RFMT_DUMMY_LEN_ACCESS "RW"
1076 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_NONE _u(0x0)
1077 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_4 _u(0x1)
1078 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_8 _u(0x2)
1079 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_12 _u(0x3)
1080 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_16 _u(0x4)
1081 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_20 _u(0x5)
1082 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_24 _u(0x6)
1083 #define QMI_M1_RFMT_DUMMY_LEN_VALUE_28 _u(0x7)
1084 // -----------------------------------------------------------------------------
1085 // Field       : QMI_M1_RFMT_SUFFIX_LEN
1086 // Description : Length of post-address command suffix, in units of 4 bits.
1087 //               (i.e. 1 cycle for quad width, 2 for dual, 4 for single)
1088 //
1089 //               Only values of 0 and 8 bits are supported.
1090 //               0x0 -> No suffix
1091 //               0x2 -> 8-bit suffix
1092 #define QMI_M1_RFMT_SUFFIX_LEN_RESET  _u(0x0)
1093 #define QMI_M1_RFMT_SUFFIX_LEN_BITS   _u(0x0000c000)
1094 #define QMI_M1_RFMT_SUFFIX_LEN_MSB    _u(15)
1095 #define QMI_M1_RFMT_SUFFIX_LEN_LSB    _u(14)
1096 #define QMI_M1_RFMT_SUFFIX_LEN_ACCESS "RW"
1097 #define QMI_M1_RFMT_SUFFIX_LEN_VALUE_NONE _u(0x0)
1098 #define QMI_M1_RFMT_SUFFIX_LEN_VALUE_8 _u(0x2)
1099 // -----------------------------------------------------------------------------
1100 // Field       : QMI_M1_RFMT_PREFIX_LEN
1101 // Description : Length of command prefix, in units of 8 bits. (i.e. 2 cycles
1102 //               for quad width, 4 for dual, 8 for single)
1103 //               0x0 -> No prefix
1104 //               0x1 -> 8-bit prefix
1105 #define QMI_M1_RFMT_PREFIX_LEN_RESET  _u(0x1)
1106 #define QMI_M1_RFMT_PREFIX_LEN_BITS   _u(0x00001000)
1107 #define QMI_M1_RFMT_PREFIX_LEN_MSB    _u(12)
1108 #define QMI_M1_RFMT_PREFIX_LEN_LSB    _u(12)
1109 #define QMI_M1_RFMT_PREFIX_LEN_ACCESS "RW"
1110 #define QMI_M1_RFMT_PREFIX_LEN_VALUE_NONE _u(0x0)
1111 #define QMI_M1_RFMT_PREFIX_LEN_VALUE_8 _u(0x1)
1112 // -----------------------------------------------------------------------------
1113 // Field       : QMI_M1_RFMT_DATA_WIDTH
1114 // Description : The width used for the data transfer
1115 //               0x0 -> Single width
1116 //               0x1 -> Dual width
1117 //               0x2 -> Quad width
1118 #define QMI_M1_RFMT_DATA_WIDTH_RESET  _u(0x0)
1119 #define QMI_M1_RFMT_DATA_WIDTH_BITS   _u(0x00000300)
1120 #define QMI_M1_RFMT_DATA_WIDTH_MSB    _u(9)
1121 #define QMI_M1_RFMT_DATA_WIDTH_LSB    _u(8)
1122 #define QMI_M1_RFMT_DATA_WIDTH_ACCESS "RW"
1123 #define QMI_M1_RFMT_DATA_WIDTH_VALUE_S _u(0x0)
1124 #define QMI_M1_RFMT_DATA_WIDTH_VALUE_D _u(0x1)
1125 #define QMI_M1_RFMT_DATA_WIDTH_VALUE_Q _u(0x2)
1126 // -----------------------------------------------------------------------------
1127 // Field       : QMI_M1_RFMT_DUMMY_WIDTH
1128 // Description : The width used for the dummy phase, if any.
1129 //
1130 //               If width is single, SD0/MOSI is held asserted low during the
1131 //               dummy phase, and SD1...SD3 are tristated. If width is
1132 //               dual/quad, all IOs are tristated during the dummy phase.
1133 //               0x0 -> Single width
1134 //               0x1 -> Dual width
1135 //               0x2 -> Quad width
1136 #define QMI_M1_RFMT_DUMMY_WIDTH_RESET  _u(0x0)
1137 #define QMI_M1_RFMT_DUMMY_WIDTH_BITS   _u(0x000000c0)
1138 #define QMI_M1_RFMT_DUMMY_WIDTH_MSB    _u(7)
1139 #define QMI_M1_RFMT_DUMMY_WIDTH_LSB    _u(6)
1140 #define QMI_M1_RFMT_DUMMY_WIDTH_ACCESS "RW"
1141 #define QMI_M1_RFMT_DUMMY_WIDTH_VALUE_S _u(0x0)
1142 #define QMI_M1_RFMT_DUMMY_WIDTH_VALUE_D _u(0x1)
1143 #define QMI_M1_RFMT_DUMMY_WIDTH_VALUE_Q _u(0x2)
1144 // -----------------------------------------------------------------------------
1145 // Field       : QMI_M1_RFMT_SUFFIX_WIDTH
1146 // Description : The width used for the post-address command suffix, if any
1147 //               0x0 -> Single width
1148 //               0x1 -> Dual width
1149 //               0x2 -> Quad width
1150 #define QMI_M1_RFMT_SUFFIX_WIDTH_RESET  _u(0x0)
1151 #define QMI_M1_RFMT_SUFFIX_WIDTH_BITS   _u(0x00000030)
1152 #define QMI_M1_RFMT_SUFFIX_WIDTH_MSB    _u(5)
1153 #define QMI_M1_RFMT_SUFFIX_WIDTH_LSB    _u(4)
1154 #define QMI_M1_RFMT_SUFFIX_WIDTH_ACCESS "RW"
1155 #define QMI_M1_RFMT_SUFFIX_WIDTH_VALUE_S _u(0x0)
1156 #define QMI_M1_RFMT_SUFFIX_WIDTH_VALUE_D _u(0x1)
1157 #define QMI_M1_RFMT_SUFFIX_WIDTH_VALUE_Q _u(0x2)
1158 // -----------------------------------------------------------------------------
1159 // Field       : QMI_M1_RFMT_ADDR_WIDTH
1160 // Description : The transfer width used for the address. The address phase
1161 //               always transfers 24 bits in total.
1162 //               0x0 -> Single width
1163 //               0x1 -> Dual width
1164 //               0x2 -> Quad width
1165 #define QMI_M1_RFMT_ADDR_WIDTH_RESET  _u(0x0)
1166 #define QMI_M1_RFMT_ADDR_WIDTH_BITS   _u(0x0000000c)
1167 #define QMI_M1_RFMT_ADDR_WIDTH_MSB    _u(3)
1168 #define QMI_M1_RFMT_ADDR_WIDTH_LSB    _u(2)
1169 #define QMI_M1_RFMT_ADDR_WIDTH_ACCESS "RW"
1170 #define QMI_M1_RFMT_ADDR_WIDTH_VALUE_S _u(0x0)
1171 #define QMI_M1_RFMT_ADDR_WIDTH_VALUE_D _u(0x1)
1172 #define QMI_M1_RFMT_ADDR_WIDTH_VALUE_Q _u(0x2)
1173 // -----------------------------------------------------------------------------
1174 // Field       : QMI_M1_RFMT_PREFIX_WIDTH
1175 // Description : The transfer width used for the command prefix, if any
1176 //               0x0 -> Single width
1177 //               0x1 -> Dual width
1178 //               0x2 -> Quad width
1179 #define QMI_M1_RFMT_PREFIX_WIDTH_RESET  _u(0x0)
1180 #define QMI_M1_RFMT_PREFIX_WIDTH_BITS   _u(0x00000003)
1181 #define QMI_M1_RFMT_PREFIX_WIDTH_MSB    _u(1)
1182 #define QMI_M1_RFMT_PREFIX_WIDTH_LSB    _u(0)
1183 #define QMI_M1_RFMT_PREFIX_WIDTH_ACCESS "RW"
1184 #define QMI_M1_RFMT_PREFIX_WIDTH_VALUE_S _u(0x0)
1185 #define QMI_M1_RFMT_PREFIX_WIDTH_VALUE_D _u(0x1)
1186 #define QMI_M1_RFMT_PREFIX_WIDTH_VALUE_Q _u(0x2)
1187 // =============================================================================
1188 // Register    : QMI_M1_RCMD
1189 // Description : Command constants used for reads from memory address window 1.
1190 //
1191 //               The reset value of the M1_RCMD register is configured to
1192 //               support a basic 03h serial read transfer with no additional
1193 //               configuration.
1194 #define QMI_M1_RCMD_OFFSET _u(0x00000028)
1195 #define QMI_M1_RCMD_BITS   _u(0x0000ffff)
1196 #define QMI_M1_RCMD_RESET  _u(0x0000a003)
1197 // -----------------------------------------------------------------------------
1198 // Field       : QMI_M1_RCMD_SUFFIX
1199 // Description : The command suffix bits following the address, if
1200 //               Mx_RFMT_SUFFIX_LEN is nonzero.
1201 #define QMI_M1_RCMD_SUFFIX_RESET  _u(0xa0)
1202 #define QMI_M1_RCMD_SUFFIX_BITS   _u(0x0000ff00)
1203 #define QMI_M1_RCMD_SUFFIX_MSB    _u(15)
1204 #define QMI_M1_RCMD_SUFFIX_LSB    _u(8)
1205 #define QMI_M1_RCMD_SUFFIX_ACCESS "RW"
1206 // -----------------------------------------------------------------------------
1207 // Field       : QMI_M1_RCMD_PREFIX
1208 // Description : The command prefix bits to prepend on each new transfer, if
1209 //               Mx_RFMT_PREFIX_LEN is nonzero.
1210 #define QMI_M1_RCMD_PREFIX_RESET  _u(0x03)
1211 #define QMI_M1_RCMD_PREFIX_BITS   _u(0x000000ff)
1212 #define QMI_M1_RCMD_PREFIX_MSB    _u(7)
1213 #define QMI_M1_RCMD_PREFIX_LSB    _u(0)
1214 #define QMI_M1_RCMD_PREFIX_ACCESS "RW"
1215 // =============================================================================
1216 // Register    : QMI_M1_WFMT
1217 // Description : Write transfer format configuration for memory address window
1218 //               1.
1219 //
1220 //               Configure the bus width of each transfer phase individually,
1221 //               and configure the length or presence of the command prefix,
1222 //               command suffix and dummy/turnaround transfer phases. Only
1223 //               24-bit addresses are supported.
1224 //
1225 //               The reset value of the M1_WFMT register is configured to
1226 //               support a basic 02h serial write transfer. However, writes to
1227 //               this window must first be enabled via the XIP_CTRL_WRITABLE_M1
1228 //               bit, as XIP memory is read-only by default.
1229 #define QMI_M1_WFMT_OFFSET _u(0x0000002c)
1230 #define QMI_M1_WFMT_BITS   _u(0x1007d3ff)
1231 #define QMI_M1_WFMT_RESET  _u(0x00001000)
1232 // -----------------------------------------------------------------------------
1233 // Field       : QMI_M1_WFMT_DTR
1234 // Description : Enable double transfer rate (DTR) for write commands: address,
1235 //               suffix and write data phases are active on both edges of SCK.
1236 //               SDO data is launched centre-aligned on each SCK edge, and SDI
1237 //               data is captured on the SCK edge that follows its launch.
1238 //
1239 //               DTR is implemented by halving the clock rate; SCK has a period
1240 //               of 2 x CLK_DIV throughout the transfer. The prefix and dummy
1241 //               phases are still single transfer rate.
1242 //
1243 //               If the suffix is quad-width, it must be 0 or 8 bits in length,
1244 //               to ensure an even number of SCK edges.
1245 #define QMI_M1_WFMT_DTR_RESET  _u(0x0)
1246 #define QMI_M1_WFMT_DTR_BITS   _u(0x10000000)
1247 #define QMI_M1_WFMT_DTR_MSB    _u(28)
1248 #define QMI_M1_WFMT_DTR_LSB    _u(28)
1249 #define QMI_M1_WFMT_DTR_ACCESS "RW"
1250 // -----------------------------------------------------------------------------
1251 // Field       : QMI_M1_WFMT_DUMMY_LEN
1252 // Description : Length of dummy phase between command suffix and data phase, in
1253 //               units of 4 bits. (i.e. 1 cycle for quad width, 2 for dual, 4
1254 //               for single)
1255 //               0x0 -> No dummy phase
1256 //               0x1 -> 4 dummy bits
1257 //               0x2 -> 8 dummy bits
1258 //               0x3 -> 12 dummy bits
1259 //               0x4 -> 16 dummy bits
1260 //               0x5 -> 20 dummy bits
1261 //               0x6 -> 24 dummy bits
1262 //               0x7 -> 28 dummy bits
1263 #define QMI_M1_WFMT_DUMMY_LEN_RESET  _u(0x0)
1264 #define QMI_M1_WFMT_DUMMY_LEN_BITS   _u(0x00070000)
1265 #define QMI_M1_WFMT_DUMMY_LEN_MSB    _u(18)
1266 #define QMI_M1_WFMT_DUMMY_LEN_LSB    _u(16)
1267 #define QMI_M1_WFMT_DUMMY_LEN_ACCESS "RW"
1268 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_NONE _u(0x0)
1269 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_4 _u(0x1)
1270 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_8 _u(0x2)
1271 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_12 _u(0x3)
1272 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_16 _u(0x4)
1273 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_20 _u(0x5)
1274 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_24 _u(0x6)
1275 #define QMI_M1_WFMT_DUMMY_LEN_VALUE_28 _u(0x7)
1276 // -----------------------------------------------------------------------------
1277 // Field       : QMI_M1_WFMT_SUFFIX_LEN
1278 // Description : Length of post-address command suffix, in units of 4 bits.
1279 //               (i.e. 1 cycle for quad width, 2 for dual, 4 for single)
1280 //
1281 //               Only values of 0 and 8 bits are supported.
1282 //               0x0 -> No suffix
1283 //               0x2 -> 8-bit suffix
1284 #define QMI_M1_WFMT_SUFFIX_LEN_RESET  _u(0x0)
1285 #define QMI_M1_WFMT_SUFFIX_LEN_BITS   _u(0x0000c000)
1286 #define QMI_M1_WFMT_SUFFIX_LEN_MSB    _u(15)
1287 #define QMI_M1_WFMT_SUFFIX_LEN_LSB    _u(14)
1288 #define QMI_M1_WFMT_SUFFIX_LEN_ACCESS "RW"
1289 #define QMI_M1_WFMT_SUFFIX_LEN_VALUE_NONE _u(0x0)
1290 #define QMI_M1_WFMT_SUFFIX_LEN_VALUE_8 _u(0x2)
1291 // -----------------------------------------------------------------------------
1292 // Field       : QMI_M1_WFMT_PREFIX_LEN
1293 // Description : Length of command prefix, in units of 8 bits. (i.e. 2 cycles
1294 //               for quad width, 4 for dual, 8 for single)
1295 //               0x0 -> No prefix
1296 //               0x1 -> 8-bit prefix
1297 #define QMI_M1_WFMT_PREFIX_LEN_RESET  _u(0x1)
1298 #define QMI_M1_WFMT_PREFIX_LEN_BITS   _u(0x00001000)
1299 #define QMI_M1_WFMT_PREFIX_LEN_MSB    _u(12)
1300 #define QMI_M1_WFMT_PREFIX_LEN_LSB    _u(12)
1301 #define QMI_M1_WFMT_PREFIX_LEN_ACCESS "RW"
1302 #define QMI_M1_WFMT_PREFIX_LEN_VALUE_NONE _u(0x0)
1303 #define QMI_M1_WFMT_PREFIX_LEN_VALUE_8 _u(0x1)
1304 // -----------------------------------------------------------------------------
1305 // Field       : QMI_M1_WFMT_DATA_WIDTH
1306 // Description : The width used for the data transfer
1307 //               0x0 -> Single width
1308 //               0x1 -> Dual width
1309 //               0x2 -> Quad width
1310 #define QMI_M1_WFMT_DATA_WIDTH_RESET  _u(0x0)
1311 #define QMI_M1_WFMT_DATA_WIDTH_BITS   _u(0x00000300)
1312 #define QMI_M1_WFMT_DATA_WIDTH_MSB    _u(9)
1313 #define QMI_M1_WFMT_DATA_WIDTH_LSB    _u(8)
1314 #define QMI_M1_WFMT_DATA_WIDTH_ACCESS "RW"
1315 #define QMI_M1_WFMT_DATA_WIDTH_VALUE_S _u(0x0)
1316 #define QMI_M1_WFMT_DATA_WIDTH_VALUE_D _u(0x1)
1317 #define QMI_M1_WFMT_DATA_WIDTH_VALUE_Q _u(0x2)
1318 // -----------------------------------------------------------------------------
1319 // Field       : QMI_M1_WFMT_DUMMY_WIDTH
1320 // Description : The width used for the dummy phase, if any.
1321 //
1322 //               If width is single, SD0/MOSI is held asserted low during the
1323 //               dummy phase, and SD1...SD3 are tristated. If width is
1324 //               dual/quad, all IOs are tristated during the dummy phase.
1325 //               0x0 -> Single width
1326 //               0x1 -> Dual width
1327 //               0x2 -> Quad width
1328 #define QMI_M1_WFMT_DUMMY_WIDTH_RESET  _u(0x0)
1329 #define QMI_M1_WFMT_DUMMY_WIDTH_BITS   _u(0x000000c0)
1330 #define QMI_M1_WFMT_DUMMY_WIDTH_MSB    _u(7)
1331 #define QMI_M1_WFMT_DUMMY_WIDTH_LSB    _u(6)
1332 #define QMI_M1_WFMT_DUMMY_WIDTH_ACCESS "RW"
1333 #define QMI_M1_WFMT_DUMMY_WIDTH_VALUE_S _u(0x0)
1334 #define QMI_M1_WFMT_DUMMY_WIDTH_VALUE_D _u(0x1)
1335 #define QMI_M1_WFMT_DUMMY_WIDTH_VALUE_Q _u(0x2)
1336 // -----------------------------------------------------------------------------
1337 // Field       : QMI_M1_WFMT_SUFFIX_WIDTH
1338 // Description : The width used for the post-address command suffix, if any
1339 //               0x0 -> Single width
1340 //               0x1 -> Dual width
1341 //               0x2 -> Quad width
1342 #define QMI_M1_WFMT_SUFFIX_WIDTH_RESET  _u(0x0)
1343 #define QMI_M1_WFMT_SUFFIX_WIDTH_BITS   _u(0x00000030)
1344 #define QMI_M1_WFMT_SUFFIX_WIDTH_MSB    _u(5)
1345 #define QMI_M1_WFMT_SUFFIX_WIDTH_LSB    _u(4)
1346 #define QMI_M1_WFMT_SUFFIX_WIDTH_ACCESS "RW"
1347 #define QMI_M1_WFMT_SUFFIX_WIDTH_VALUE_S _u(0x0)
1348 #define QMI_M1_WFMT_SUFFIX_WIDTH_VALUE_D _u(0x1)
1349 #define QMI_M1_WFMT_SUFFIX_WIDTH_VALUE_Q _u(0x2)
1350 // -----------------------------------------------------------------------------
1351 // Field       : QMI_M1_WFMT_ADDR_WIDTH
1352 // Description : The transfer width used for the address. The address phase
1353 //               always transfers 24 bits in total.
1354 //               0x0 -> Single width
1355 //               0x1 -> Dual width
1356 //               0x2 -> Quad width
1357 #define QMI_M1_WFMT_ADDR_WIDTH_RESET  _u(0x0)
1358 #define QMI_M1_WFMT_ADDR_WIDTH_BITS   _u(0x0000000c)
1359 #define QMI_M1_WFMT_ADDR_WIDTH_MSB    _u(3)
1360 #define QMI_M1_WFMT_ADDR_WIDTH_LSB    _u(2)
1361 #define QMI_M1_WFMT_ADDR_WIDTH_ACCESS "RW"
1362 #define QMI_M1_WFMT_ADDR_WIDTH_VALUE_S _u(0x0)
1363 #define QMI_M1_WFMT_ADDR_WIDTH_VALUE_D _u(0x1)
1364 #define QMI_M1_WFMT_ADDR_WIDTH_VALUE_Q _u(0x2)
1365 // -----------------------------------------------------------------------------
1366 // Field       : QMI_M1_WFMT_PREFIX_WIDTH
1367 // Description : The transfer width used for the command prefix, if any
1368 //               0x0 -> Single width
1369 //               0x1 -> Dual width
1370 //               0x2 -> Quad width
1371 #define QMI_M1_WFMT_PREFIX_WIDTH_RESET  _u(0x0)
1372 #define QMI_M1_WFMT_PREFIX_WIDTH_BITS   _u(0x00000003)
1373 #define QMI_M1_WFMT_PREFIX_WIDTH_MSB    _u(1)
1374 #define QMI_M1_WFMT_PREFIX_WIDTH_LSB    _u(0)
1375 #define QMI_M1_WFMT_PREFIX_WIDTH_ACCESS "RW"
1376 #define QMI_M1_WFMT_PREFIX_WIDTH_VALUE_S _u(0x0)
1377 #define QMI_M1_WFMT_PREFIX_WIDTH_VALUE_D _u(0x1)
1378 #define QMI_M1_WFMT_PREFIX_WIDTH_VALUE_Q _u(0x2)
1379 // =============================================================================
1380 // Register    : QMI_M1_WCMD
1381 // Description : Command constants used for writes to memory address window 1.
1382 //
1383 //               The reset value of the M1_WCMD register is configured to
1384 //               support a basic 02h serial write transfer with no additional
1385 //               configuration.
1386 #define QMI_M1_WCMD_OFFSET _u(0x00000030)
1387 #define QMI_M1_WCMD_BITS   _u(0x0000ffff)
1388 #define QMI_M1_WCMD_RESET  _u(0x0000a002)
1389 // -----------------------------------------------------------------------------
1390 // Field       : QMI_M1_WCMD_SUFFIX
1391 // Description : The command suffix bits following the address, if
1392 //               Mx_WFMT_SUFFIX_LEN is nonzero.
1393 #define QMI_M1_WCMD_SUFFIX_RESET  _u(0xa0)
1394 #define QMI_M1_WCMD_SUFFIX_BITS   _u(0x0000ff00)
1395 #define QMI_M1_WCMD_SUFFIX_MSB    _u(15)
1396 #define QMI_M1_WCMD_SUFFIX_LSB    _u(8)
1397 #define QMI_M1_WCMD_SUFFIX_ACCESS "RW"
1398 // -----------------------------------------------------------------------------
1399 // Field       : QMI_M1_WCMD_PREFIX
1400 // Description : The command prefix bits to prepend on each new transfer, if
1401 //               Mx_WFMT_PREFIX_LEN is nonzero.
1402 #define QMI_M1_WCMD_PREFIX_RESET  _u(0x02)
1403 #define QMI_M1_WCMD_PREFIX_BITS   _u(0x000000ff)
1404 #define QMI_M1_WCMD_PREFIX_MSB    _u(7)
1405 #define QMI_M1_WCMD_PREFIX_LSB    _u(0)
1406 #define QMI_M1_WCMD_PREFIX_ACCESS "RW"
1407 // =============================================================================
1408 // Register    : QMI_ATRANS0
1409 // Description : Configure address translation for XIP virtual addresses
1410 //               0x000000 through 0x3fffff (a 4 MiB window starting at +0 MiB).
1411 //
1412 //               Address translation allows a program image to be executed in
1413 //               place at multiple physical flash addresses (for example, a
1414 //               double-buffered flash image for over-the-air updates), without
1415 //               the overhead of position-independent code.
1416 //
1417 //               At reset, the address translation registers are initialised to
1418 //               an identity mapping, so that they can be ignored if address
1419 //               translation is not required.
1420 //
1421 //               Note that the XIP cache is fully virtually addressed, so a
1422 //               cache flush is required after changing the address translation.
1423 #define QMI_ATRANS0_OFFSET _u(0x00000034)
1424 #define QMI_ATRANS0_BITS   _u(0x07ff0fff)
1425 #define QMI_ATRANS0_RESET  _u(0x04000000)
1426 // -----------------------------------------------------------------------------
1427 // Field       : QMI_ATRANS0_SIZE
1428 // Description : Translation aperture size for this virtual address range, in
1429 //               units of 4 kiB (one flash sector).
1430 //
1431 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1432 //               greater than SIZE return a bus error, and do not cause a QSPI
1433 //               access.
1434 #define QMI_ATRANS0_SIZE_RESET  _u(0x400)
1435 #define QMI_ATRANS0_SIZE_BITS   _u(0x07ff0000)
1436 #define QMI_ATRANS0_SIZE_MSB    _u(26)
1437 #define QMI_ATRANS0_SIZE_LSB    _u(16)
1438 #define QMI_ATRANS0_SIZE_ACCESS "RW"
1439 // -----------------------------------------------------------------------------
1440 // Field       : QMI_ATRANS0_BASE
1441 // Description : Physical address base for this virtual address range, in units
1442 //               of 4 kiB (one flash sector).
1443 //
1444 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1445 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1446 //               (the upper 12 bits) to form the physical address. Translation
1447 //               wraps on a 16 MiB boundary.
1448 #define QMI_ATRANS0_BASE_RESET  _u(0x000)
1449 #define QMI_ATRANS0_BASE_BITS   _u(0x00000fff)
1450 #define QMI_ATRANS0_BASE_MSB    _u(11)
1451 #define QMI_ATRANS0_BASE_LSB    _u(0)
1452 #define QMI_ATRANS0_BASE_ACCESS "RW"
1453 // =============================================================================
1454 // Register    : QMI_ATRANS1
1455 // Description : Configure address translation for XIP virtual addresses
1456 //               0x400000 through 0x7fffff (a 4 MiB window starting at +4 MiB).
1457 //
1458 //               Address translation allows a program image to be executed in
1459 //               place at multiple physical flash addresses (for example, a
1460 //               double-buffered flash image for over-the-air updates), without
1461 //               the overhead of position-independent code.
1462 //
1463 //               At reset, the address translation registers are initialised to
1464 //               an identity mapping, so that they can be ignored if address
1465 //               translation is not required.
1466 //
1467 //               Note that the XIP cache is fully virtually addressed, so a
1468 //               cache flush is required after changing the address translation.
1469 #define QMI_ATRANS1_OFFSET _u(0x00000038)
1470 #define QMI_ATRANS1_BITS   _u(0x07ff0fff)
1471 #define QMI_ATRANS1_RESET  _u(0x04000400)
1472 // -----------------------------------------------------------------------------
1473 // Field       : QMI_ATRANS1_SIZE
1474 // Description : Translation aperture size for this virtual address range, in
1475 //               units of 4 kiB (one flash sector).
1476 //
1477 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1478 //               greater than SIZE return a bus error, and do not cause a QSPI
1479 //               access.
1480 #define QMI_ATRANS1_SIZE_RESET  _u(0x400)
1481 #define QMI_ATRANS1_SIZE_BITS   _u(0x07ff0000)
1482 #define QMI_ATRANS1_SIZE_MSB    _u(26)
1483 #define QMI_ATRANS1_SIZE_LSB    _u(16)
1484 #define QMI_ATRANS1_SIZE_ACCESS "RW"
1485 // -----------------------------------------------------------------------------
1486 // Field       : QMI_ATRANS1_BASE
1487 // Description : Physical address base for this virtual address range, in units
1488 //               of 4 kiB (one flash sector).
1489 //
1490 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1491 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1492 //               (the upper 12 bits) to form the physical address. Translation
1493 //               wraps on a 16 MiB boundary.
1494 #define QMI_ATRANS1_BASE_RESET  _u(0x400)
1495 #define QMI_ATRANS1_BASE_BITS   _u(0x00000fff)
1496 #define QMI_ATRANS1_BASE_MSB    _u(11)
1497 #define QMI_ATRANS1_BASE_LSB    _u(0)
1498 #define QMI_ATRANS1_BASE_ACCESS "RW"
1499 // =============================================================================
1500 // Register    : QMI_ATRANS2
1501 // Description : Configure address translation for XIP virtual addresses
1502 //               0x800000 through 0xbfffff (a 4 MiB window starting at +8 MiB).
1503 //
1504 //               Address translation allows a program image to be executed in
1505 //               place at multiple physical flash addresses (for example, a
1506 //               double-buffered flash image for over-the-air updates), without
1507 //               the overhead of position-independent code.
1508 //
1509 //               At reset, the address translation registers are initialised to
1510 //               an identity mapping, so that they can be ignored if address
1511 //               translation is not required.
1512 //
1513 //               Note that the XIP cache is fully virtually addressed, so a
1514 //               cache flush is required after changing the address translation.
1515 #define QMI_ATRANS2_OFFSET _u(0x0000003c)
1516 #define QMI_ATRANS2_BITS   _u(0x07ff0fff)
1517 #define QMI_ATRANS2_RESET  _u(0x04000800)
1518 // -----------------------------------------------------------------------------
1519 // Field       : QMI_ATRANS2_SIZE
1520 // Description : Translation aperture size for this virtual address range, in
1521 //               units of 4 kiB (one flash sector).
1522 //
1523 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1524 //               greater than SIZE return a bus error, and do not cause a QSPI
1525 //               access.
1526 #define QMI_ATRANS2_SIZE_RESET  _u(0x400)
1527 #define QMI_ATRANS2_SIZE_BITS   _u(0x07ff0000)
1528 #define QMI_ATRANS2_SIZE_MSB    _u(26)
1529 #define QMI_ATRANS2_SIZE_LSB    _u(16)
1530 #define QMI_ATRANS2_SIZE_ACCESS "RW"
1531 // -----------------------------------------------------------------------------
1532 // Field       : QMI_ATRANS2_BASE
1533 // Description : Physical address base for this virtual address range, in units
1534 //               of 4 kiB (one flash sector).
1535 //
1536 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1537 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1538 //               (the upper 12 bits) to form the physical address. Translation
1539 //               wraps on a 16 MiB boundary.
1540 #define QMI_ATRANS2_BASE_RESET  _u(0x800)
1541 #define QMI_ATRANS2_BASE_BITS   _u(0x00000fff)
1542 #define QMI_ATRANS2_BASE_MSB    _u(11)
1543 #define QMI_ATRANS2_BASE_LSB    _u(0)
1544 #define QMI_ATRANS2_BASE_ACCESS "RW"
1545 // =============================================================================
1546 // Register    : QMI_ATRANS3
1547 // Description : Configure address translation for XIP virtual addresses
1548 //               0xc00000 through 0xffffff (a 4 MiB window starting at +12 MiB).
1549 //
1550 //               Address translation allows a program image to be executed in
1551 //               place at multiple physical flash addresses (for example, a
1552 //               double-buffered flash image for over-the-air updates), without
1553 //               the overhead of position-independent code.
1554 //
1555 //               At reset, the address translation registers are initialised to
1556 //               an identity mapping, so that they can be ignored if address
1557 //               translation is not required.
1558 //
1559 //               Note that the XIP cache is fully virtually addressed, so a
1560 //               cache flush is required after changing the address translation.
1561 #define QMI_ATRANS3_OFFSET _u(0x00000040)
1562 #define QMI_ATRANS3_BITS   _u(0x07ff0fff)
1563 #define QMI_ATRANS3_RESET  _u(0x04000c00)
1564 // -----------------------------------------------------------------------------
1565 // Field       : QMI_ATRANS3_SIZE
1566 // Description : Translation aperture size for this virtual address range, in
1567 //               units of 4 kiB (one flash sector).
1568 //
1569 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1570 //               greater than SIZE return a bus error, and do not cause a QSPI
1571 //               access.
1572 #define QMI_ATRANS3_SIZE_RESET  _u(0x400)
1573 #define QMI_ATRANS3_SIZE_BITS   _u(0x07ff0000)
1574 #define QMI_ATRANS3_SIZE_MSB    _u(26)
1575 #define QMI_ATRANS3_SIZE_LSB    _u(16)
1576 #define QMI_ATRANS3_SIZE_ACCESS "RW"
1577 // -----------------------------------------------------------------------------
1578 // Field       : QMI_ATRANS3_BASE
1579 // Description : Physical address base for this virtual address range, in units
1580 //               of 4 kiB (one flash sector).
1581 //
1582 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1583 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1584 //               (the upper 12 bits) to form the physical address. Translation
1585 //               wraps on a 16 MiB boundary.
1586 #define QMI_ATRANS3_BASE_RESET  _u(0xc00)
1587 #define QMI_ATRANS3_BASE_BITS   _u(0x00000fff)
1588 #define QMI_ATRANS3_BASE_MSB    _u(11)
1589 #define QMI_ATRANS3_BASE_LSB    _u(0)
1590 #define QMI_ATRANS3_BASE_ACCESS "RW"
1591 // =============================================================================
1592 // Register    : QMI_ATRANS4
1593 // Description : Configure address translation for XIP virtual addresses
1594 //               0x1000000 through 0x13fffff (a 4 MiB window starting at +16
1595 //               MiB).
1596 //
1597 //               Address translation allows a program image to be executed in
1598 //               place at multiple physical flash addresses (for example, a
1599 //               double-buffered flash image for over-the-air updates), without
1600 //               the overhead of position-independent code.
1601 //
1602 //               At reset, the address translation registers are initialised to
1603 //               an identity mapping, so that they can be ignored if address
1604 //               translation is not required.
1605 //
1606 //               Note that the XIP cache is fully virtually addressed, so a
1607 //               cache flush is required after changing the address translation.
1608 #define QMI_ATRANS4_OFFSET _u(0x00000044)
1609 #define QMI_ATRANS4_BITS   _u(0x07ff0fff)
1610 #define QMI_ATRANS4_RESET  _u(0x04000000)
1611 // -----------------------------------------------------------------------------
1612 // Field       : QMI_ATRANS4_SIZE
1613 // Description : Translation aperture size for this virtual address range, in
1614 //               units of 4 kiB (one flash sector).
1615 //
1616 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1617 //               greater than SIZE return a bus error, and do not cause a QSPI
1618 //               access.
1619 #define QMI_ATRANS4_SIZE_RESET  _u(0x400)
1620 #define QMI_ATRANS4_SIZE_BITS   _u(0x07ff0000)
1621 #define QMI_ATRANS4_SIZE_MSB    _u(26)
1622 #define QMI_ATRANS4_SIZE_LSB    _u(16)
1623 #define QMI_ATRANS4_SIZE_ACCESS "RW"
1624 // -----------------------------------------------------------------------------
1625 // Field       : QMI_ATRANS4_BASE
1626 // Description : Physical address base for this virtual address range, in units
1627 //               of 4 kiB (one flash sector).
1628 //
1629 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1630 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1631 //               (the upper 12 bits) to form the physical address. Translation
1632 //               wraps on a 16 MiB boundary.
1633 #define QMI_ATRANS4_BASE_RESET  _u(0x000)
1634 #define QMI_ATRANS4_BASE_BITS   _u(0x00000fff)
1635 #define QMI_ATRANS4_BASE_MSB    _u(11)
1636 #define QMI_ATRANS4_BASE_LSB    _u(0)
1637 #define QMI_ATRANS4_BASE_ACCESS "RW"
1638 // =============================================================================
1639 // Register    : QMI_ATRANS5
1640 // Description : Configure address translation for XIP virtual addresses
1641 //               0x1400000 through 0x17fffff (a 4 MiB window starting at +20
1642 //               MiB).
1643 //
1644 //               Address translation allows a program image to be executed in
1645 //               place at multiple physical flash addresses (for example, a
1646 //               double-buffered flash image for over-the-air updates), without
1647 //               the overhead of position-independent code.
1648 //
1649 //               At reset, the address translation registers are initialised to
1650 //               an identity mapping, so that they can be ignored if address
1651 //               translation is not required.
1652 //
1653 //               Note that the XIP cache is fully virtually addressed, so a
1654 //               cache flush is required after changing the address translation.
1655 #define QMI_ATRANS5_OFFSET _u(0x00000048)
1656 #define QMI_ATRANS5_BITS   _u(0x07ff0fff)
1657 #define QMI_ATRANS5_RESET  _u(0x04000400)
1658 // -----------------------------------------------------------------------------
1659 // Field       : QMI_ATRANS5_SIZE
1660 // Description : Translation aperture size for this virtual address range, in
1661 //               units of 4 kiB (one flash sector).
1662 //
1663 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1664 //               greater than SIZE return a bus error, and do not cause a QSPI
1665 //               access.
1666 #define QMI_ATRANS5_SIZE_RESET  _u(0x400)
1667 #define QMI_ATRANS5_SIZE_BITS   _u(0x07ff0000)
1668 #define QMI_ATRANS5_SIZE_MSB    _u(26)
1669 #define QMI_ATRANS5_SIZE_LSB    _u(16)
1670 #define QMI_ATRANS5_SIZE_ACCESS "RW"
1671 // -----------------------------------------------------------------------------
1672 // Field       : QMI_ATRANS5_BASE
1673 // Description : Physical address base for this virtual address range, in units
1674 //               of 4 kiB (one flash sector).
1675 //
1676 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1677 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1678 //               (the upper 12 bits) to form the physical address. Translation
1679 //               wraps on a 16 MiB boundary.
1680 #define QMI_ATRANS5_BASE_RESET  _u(0x400)
1681 #define QMI_ATRANS5_BASE_BITS   _u(0x00000fff)
1682 #define QMI_ATRANS5_BASE_MSB    _u(11)
1683 #define QMI_ATRANS5_BASE_LSB    _u(0)
1684 #define QMI_ATRANS5_BASE_ACCESS "RW"
1685 // =============================================================================
1686 // Register    : QMI_ATRANS6
1687 // Description : Configure address translation for XIP virtual addresses
1688 //               0x1800000 through 0x1bfffff (a 4 MiB window starting at +24
1689 //               MiB).
1690 //
1691 //               Address translation allows a program image to be executed in
1692 //               place at multiple physical flash addresses (for example, a
1693 //               double-buffered flash image for over-the-air updates), without
1694 //               the overhead of position-independent code.
1695 //
1696 //               At reset, the address translation registers are initialised to
1697 //               an identity mapping, so that they can be ignored if address
1698 //               translation is not required.
1699 //
1700 //               Note that the XIP cache is fully virtually addressed, so a
1701 //               cache flush is required after changing the address translation.
1702 #define QMI_ATRANS6_OFFSET _u(0x0000004c)
1703 #define QMI_ATRANS6_BITS   _u(0x07ff0fff)
1704 #define QMI_ATRANS6_RESET  _u(0x04000800)
1705 // -----------------------------------------------------------------------------
1706 // Field       : QMI_ATRANS6_SIZE
1707 // Description : Translation aperture size for this virtual address range, in
1708 //               units of 4 kiB (one flash sector).
1709 //
1710 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1711 //               greater than SIZE return a bus error, and do not cause a QSPI
1712 //               access.
1713 #define QMI_ATRANS6_SIZE_RESET  _u(0x400)
1714 #define QMI_ATRANS6_SIZE_BITS   _u(0x07ff0000)
1715 #define QMI_ATRANS6_SIZE_MSB    _u(26)
1716 #define QMI_ATRANS6_SIZE_LSB    _u(16)
1717 #define QMI_ATRANS6_SIZE_ACCESS "RW"
1718 // -----------------------------------------------------------------------------
1719 // Field       : QMI_ATRANS6_BASE
1720 // Description : Physical address base for this virtual address range, in units
1721 //               of 4 kiB (one flash sector).
1722 //
1723 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1724 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1725 //               (the upper 12 bits) to form the physical address. Translation
1726 //               wraps on a 16 MiB boundary.
1727 #define QMI_ATRANS6_BASE_RESET  _u(0x800)
1728 #define QMI_ATRANS6_BASE_BITS   _u(0x00000fff)
1729 #define QMI_ATRANS6_BASE_MSB    _u(11)
1730 #define QMI_ATRANS6_BASE_LSB    _u(0)
1731 #define QMI_ATRANS6_BASE_ACCESS "RW"
1732 // =============================================================================
1733 // Register    : QMI_ATRANS7
1734 // Description : Configure address translation for XIP virtual addresses
1735 //               0x1c00000 through 0x1ffffff (a 4 MiB window starting at +28
1736 //               MiB).
1737 //
1738 //               Address translation allows a program image to be executed in
1739 //               place at multiple physical flash addresses (for example, a
1740 //               double-buffered flash image for over-the-air updates), without
1741 //               the overhead of position-independent code.
1742 //
1743 //               At reset, the address translation registers are initialised to
1744 //               an identity mapping, so that they can be ignored if address
1745 //               translation is not required.
1746 //
1747 //               Note that the XIP cache is fully virtually addressed, so a
1748 //               cache flush is required after changing the address translation.
1749 #define QMI_ATRANS7_OFFSET _u(0x00000050)
1750 #define QMI_ATRANS7_BITS   _u(0x07ff0fff)
1751 #define QMI_ATRANS7_RESET  _u(0x04000c00)
1752 // -----------------------------------------------------------------------------
1753 // Field       : QMI_ATRANS7_SIZE
1754 // Description : Translation aperture size for this virtual address range, in
1755 //               units of 4 kiB (one flash sector).
1756 //
1757 //               Bits 21:12 of the virtual address are compared to SIZE. Offsets
1758 //               greater than SIZE return a bus error, and do not cause a QSPI
1759 //               access.
1760 #define QMI_ATRANS7_SIZE_RESET  _u(0x400)
1761 #define QMI_ATRANS7_SIZE_BITS   _u(0x07ff0000)
1762 #define QMI_ATRANS7_SIZE_MSB    _u(26)
1763 #define QMI_ATRANS7_SIZE_LSB    _u(16)
1764 #define QMI_ATRANS7_SIZE_ACCESS "RW"
1765 // -----------------------------------------------------------------------------
1766 // Field       : QMI_ATRANS7_BASE
1767 // Description : Physical address base for this virtual address range, in units
1768 //               of 4 kiB (one flash sector).
1769 //
1770 //               Taking a 24-bit virtual address, firstly bits 23:22 (the two
1771 //               MSBs) are masked to zero, and then BASE is added to bits 23:12
1772 //               (the upper 12 bits) to form the physical address. Translation
1773 //               wraps on a 16 MiB boundary.
1774 #define QMI_ATRANS7_BASE_RESET  _u(0xc00)
1775 #define QMI_ATRANS7_BASE_BITS   _u(0x00000fff)
1776 #define QMI_ATRANS7_BASE_MSB    _u(11)
1777 #define QMI_ATRANS7_BASE_LSB    _u(0)
1778 #define QMI_ATRANS7_BASE_ACCESS "RW"
1779 // =============================================================================
1780 #endif // _HARDWARE_REGS_QMI_H
1781 
1782