summaryrefslogtreecommitdiff
path: root/bsps/include/dev/grlib/memscrub.h
blob: 6f79a58059a68a69f4fd609eac894b2fbfdf8115 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
/* SPDX-License-Identifier: BSD-2-Clause */

/**
 * @file
 *
 * @ingroup RTEMSDeviceGRLIB
 *
 * @brief This header file defines the MEMSCRUB register block interface.
 */

/*
 * Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * This file is part of the RTEMS quality process and was automatically
 * generated.  If you find something that needs to be fixed or
 * worded better please post a report or patch to an RTEMS mailing list
 * or raise a bug report:
 *
 * https://www.rtems.org/bugs.html
 *
 * For information on updating and regenerating please refer to the How-To
 * section in the Software Requirements Engineering chapter of the
 * RTEMS Software Engineering manual.  The manual is provided as a part of
 * a release.  For development sources please refer to the online
 * documentation at:
 *
 * https://docs.rtems.org
 */

/* Generated from spec:/dev/grlib/if/memscrub-header */

#ifndef _DEV_GRLIB_MEMSCRUB_H
#define _DEV_GRLIB_MEMSCRUB_H

#ifdef __cplusplus
extern "C" {
#endif

/* Generated from spec:/dev/grlib/if/memscrub */

/**
 * @defgroup DevGrlibIfMemscrub MEMSCRUB
 *
 * @ingroup RTEMSDeviceGRLIB
 *
 * @brief This group contains the MEMSCRUB interfaces.
 *
 * @{
 */

/**
 * @defgroup DevGrlibIfMemscrubAHBS AHBS
 *
 * @brief AHB Status register
 *
 * @{
 */

#define MEMSCRUB_AHBS_CECNT_SHIFT 22
#define MEMSCRUB_AHBS_CECNT_MASK 0xffc00000U
#define MEMSCRUB_AHBS_CECNT_GET( _reg ) \
  ( ( ( _reg ) >> 22 ) & 0x3ffU )
#define MEMSCRUB_AHBS_CECNT( _val ) ( ( _val ) << 22 )

#define MEMSCRUB_AHBS_UECNT_SHIFT 14
#define MEMSCRUB_AHBS_UECNT_MASK 0x3fc000U
#define MEMSCRUB_AHBS_UECNT_GET( _reg ) \
  ( ( ( _reg ) >> 14 ) & 0xffU )
#define MEMSCRUB_AHBS_UECNT( _val ) ( ( _val ) << 14 )

#define MEMSCRUB_AHBS_DONE 0x2000U

#define MEMSCRUB_AHBS_SEC 0x800U

#define MEMSCRUB_AHBS_SBC 0x400U

#define MEMSCRUB_AHBS_CE 0x200U

#define MEMSCRUB_AHBS_NE 0x100U

#define MEMSCRUB_AHBS_HWRITE 0x80U

#define MEMSCRUB_AHBS_HMASTER_SHIFT 3
#define MEMSCRUB_AHBS_HMASTER_MASK 0x78U
#define MEMSCRUB_AHBS_HMASTER_GET( _reg ) \
  ( ( ( _reg ) >> 3 ) & 0xfU )
#define MEMSCRUB_AHBS_HMASTER( _val ) ( ( _val ) << 3 )

#define MEMSCRUB_AHBS_HSIZE_SHIFT 0
#define MEMSCRUB_AHBS_HSIZE_MASK 0x7U
#define MEMSCRUB_AHBS_HSIZE_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0x7U )
#define MEMSCRUB_AHBS_HSIZE( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubAHBFAR AHBFAR
 *
 * @brief AHB Failing Address Register
 *
 * @{
 */

#define MEMSCRUB_AHBFAR_AHB_FAILING_ADDRESS_SHIFT 0
#define MEMSCRUB_AHBFAR_AHB_FAILING_ADDRESS_MASK 0xffffffffU
#define MEMSCRUB_AHBFAR_AHB_FAILING_ADDRESS_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define MEMSCRUB_AHBFAR_AHB_FAILING_ADDRESS( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubAHBERC AHBERC
 *
 * @brief AHB Error configuration register
 *
 * @{
 */

#define MEMSCRUB_AHBERC_CECNTT_SHIFT 22
#define MEMSCRUB_AHBERC_CECNTT_MASK 0xffc00000U
#define MEMSCRUB_AHBERC_CECNTT_GET( _reg ) \
  ( ( ( _reg ) >> 22 ) & 0x3ffU )
#define MEMSCRUB_AHBERC_CECNTT( _val ) ( ( _val ) << 22 )

#define MEMSCRUB_AHBERC_UECNTT_SHIFT 14
#define MEMSCRUB_AHBERC_UECNTT_MASK 0x3fc000U
#define MEMSCRUB_AHBERC_UECNTT_GET( _reg ) \
  ( ( ( _reg ) >> 14 ) & 0xffU )
#define MEMSCRUB_AHBERC_UECNTT( _val ) ( ( _val ) << 14 )

#define MEMSCRUB_AHBERC_CECTE 0x2U

#define MEMSCRUB_AHBERC_UECTE 0x1U

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubSTAT STAT
 *
 * @brief Status register
 *
 * @{
 */

#define MEMSCRUB_STAT_RUNCOUNT_SHIFT 22
#define MEMSCRUB_STAT_RUNCOUNT_MASK 0xffc00000U
#define MEMSCRUB_STAT_RUNCOUNT_GET( _reg ) \
  ( ( ( _reg ) >> 22 ) & 0x3ffU )
#define MEMSCRUB_STAT_RUNCOUNT( _val ) ( ( _val ) << 22 )

#define MEMSCRUB_STAT_BLKCOUNT_SHIFT 14
#define MEMSCRUB_STAT_BLKCOUNT_MASK 0x3fc000U
#define MEMSCRUB_STAT_BLKCOUNT_GET( _reg ) \
  ( ( ( _reg ) >> 14 ) & 0xffU )
#define MEMSCRUB_STAT_BLKCOUNT( _val ) ( ( _val ) << 14 )

#define MEMSCRUB_STAT_DONE 0x2000U

#define MEMSCRUB_STAT_BURSTLEN_SHIFT 1
#define MEMSCRUB_STAT_BURSTLEN_MASK 0x1eU
#define MEMSCRUB_STAT_BURSTLEN_GET( _reg ) \
  ( ( ( _reg ) >> 1 ) & 0xfU )
#define MEMSCRUB_STAT_BURSTLEN( _val ) ( ( _val ) << 1 )

#define MEMSCRUB_STAT_ACTIVE 0x1U

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubCONFIG CONFIG
 *
 * @brief Configuration register
 *
 * @{
 */

#define MEMSCRUB_CONFIG_DELAY_SHIFT 8
#define MEMSCRUB_CONFIG_DELAY_MASK 0xff00U
#define MEMSCRUB_CONFIG_DELAY_GET( _reg ) \
  ( ( ( _reg ) >> 8 ) & 0xffU )
#define MEMSCRUB_CONFIG_DELAY( _val ) ( ( _val ) << 8 )

#define MEMSCRUB_CONFIG_IRQD 0x80U

#define MEMSCRUB_CONFIG_SERA 0x20U

#define MEMSCRUB_CONFIG_LOOP 0x10U

#define MEMSCRUB_CONFIG_MODE_SHIFT 2
#define MEMSCRUB_CONFIG_MODE_MASK 0xcU
#define MEMSCRUB_CONFIG_MODE_GET( _reg ) \
  ( ( ( _reg ) >> 2 ) & 0x3U )
#define MEMSCRUB_CONFIG_MODE( _val ) ( ( _val ) << 2 )

#define MEMSCRUB_CONFIG_ES 0x2U

#define MEMSCRUB_CONFIG_SCEN 0x1U

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubRANGEL RANGEL
 *
 * @brief Range low address register
 *
 * @{
 */

#define MEMSCRUB_RANGEL_RLADDR_SHIFT 0
#define MEMSCRUB_RANGEL_RLADDR_MASK 0xffffffffU
#define MEMSCRUB_RANGEL_RLADDR_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define MEMSCRUB_RANGEL_RLADDR( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubRANGEH RANGEH
 *
 * @brief Range high address register
 *
 * @{
 */

#define MEMSCRUB_RANGEH_RHADDR_SHIFT 0
#define MEMSCRUB_RANGEH_RHADDR_MASK 0xffffffffU
#define MEMSCRUB_RANGEH_RHADDR_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define MEMSCRUB_RANGEH_RHADDR( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubPOS POS
 *
 * @brief Position register
 *
 * @{
 */

#define MEMSCRUB_POS_POSITION_SHIFT 0
#define MEMSCRUB_POS_POSITION_MASK 0xffffffffU
#define MEMSCRUB_POS_POSITION_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define MEMSCRUB_POS_POSITION( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubETHRES ETHRES
 *
 * @brief Error threshold register
 *
 * @{
 */

#define MEMSCRUB_ETHRES_RECT_SHIFT 22
#define MEMSCRUB_ETHRES_RECT_MASK 0xffc00000U
#define MEMSCRUB_ETHRES_RECT_GET( _reg ) \
  ( ( ( _reg ) >> 22 ) & 0x3ffU )
#define MEMSCRUB_ETHRES_RECT( _val ) ( ( _val ) << 22 )

#define MEMSCRUB_ETHRES_BECT_SHIFT 14
#define MEMSCRUB_ETHRES_BECT_MASK 0x3fc000U
#define MEMSCRUB_ETHRES_BECT_GET( _reg ) \
  ( ( ( _reg ) >> 14 ) & 0xffU )
#define MEMSCRUB_ETHRES_BECT( _val ) ( ( _val ) << 14 )

#define MEMSCRUB_ETHRES_RECTE 0x2U

#define MEMSCRUB_ETHRES_BECTE 0x1U

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubINIT INIT
 *
 * @brief Initialisation data register
 *
 * @{
 */

#define MEMSCRUB_INIT_DATA_SHIFT 0
#define MEMSCRUB_INIT_DATA_MASK 0xffffffffU
#define MEMSCRUB_INIT_DATA_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define MEMSCRUB_INIT_DATA( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubRANGEL2 RANGEL2
 *
 * @brief Second range low address register
 *
 * @{
 */

#define MEMSCRUB_RANGEL2_RLADDR_SHIFT 0
#define MEMSCRUB_RANGEL2_RLADDR_MASK 0xffffffffU
#define MEMSCRUB_RANGEL2_RLADDR_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define MEMSCRUB_RANGEL2_RLADDR( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @defgroup DevGrlibIfMemscrubRANGEH2 RANGEH2
 *
 * @brief Second range high address register
 *
 * @{
 */

#define MEMSCRUB_RANGEH2_RHADDR_SHIFT 0
#define MEMSCRUB_RANGEH2_RHADDR_MASK 0xffffffffU
#define MEMSCRUB_RANGEH2_RHADDR_GET( _reg ) \
  ( ( ( _reg ) >> 0 ) & 0xffffffffU )
#define MEMSCRUB_RANGEH2_RHADDR( _val ) ( ( _val ) << 0 )

/** @} */

/**
 * @brief This structure defines the MEMSCRUB register block memory map.
 */
typedef struct {
  /**
   * @brief See @ref DevGrlibIfMemscrubAHBS.
   */
  uint32_t ahbs;

  /**
   * @brief See @ref DevGrlibIfMemscrubAHBFAR.
   */
  uint32_t ahbfar;

  /**
   * @brief See @ref DevGrlibIfMemscrubAHBERC.
   */
  uint32_t ahberc;

  uint32_t reserved_c_10;

  /**
   * @brief See @ref DevGrlibIfMemscrubSTAT.
   */
  uint32_t stat;

  /**
   * @brief See @ref DevGrlibIfMemscrubCONFIG.
   */
  uint32_t config;

  /**
   * @brief See @ref DevGrlibIfMemscrubRANGEL.
   */
  uint32_t rangel;

  /**
   * @brief See @ref DevGrlibIfMemscrubRANGEH.
   */
  uint32_t rangeh;

  /**
   * @brief See @ref DevGrlibIfMemscrubPOS.
   */
  uint32_t pos;

  /**
   * @brief See @ref DevGrlibIfMemscrubETHRES.
   */
  uint32_t ethres;

  /**
   * @brief See @ref DevGrlibIfMemscrubINIT.
   */
  uint32_t init;

  /**
   * @brief See @ref DevGrlibIfMemscrubRANGEL2.
   */
  uint32_t rangel2;

  /**
   * @brief See @ref DevGrlibIfMemscrubRANGEH2.
   */
  uint32_t rangeh2;
} memscrub;

/** @} */

#ifdef __cplusplus
}
#endif

#endif /* _DEV_GRLIB_MEMSCRUB_H */