1 //*****************************************************************************
2 //
3 //  am_reg_jedec.h
4 //! @file am_reg_jedec.h
5 //!
6 //! @brief Register macros for the ARM JEDEC module
7 //
8 //*****************************************************************************
9 
10 //*****************************************************************************
11 //
12 // Copyright (c) 2023, Ambiq Micro, Inc.
13 // All rights reserved.
14 //
15 // Redistribution and use in source and binary forms, with or without
16 // modification, are permitted provided that the following conditions are met:
17 //
18 // 1. Redistributions of source code must retain the above copyright notice,
19 // this list of conditions and the following disclaimer.
20 //
21 // 2. Redistributions in binary form must reproduce the above copyright
22 // notice, this list of conditions and the following disclaimer in the
23 // documentation and/or other materials provided with the distribution.
24 //
25 // 3. Neither the name of the copyright holder nor the names of its
26 // contributors may be used to endorse or promote products derived from this
27 // software without specific prior written permission.
28 //
29 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
33 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
34 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
35 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
36 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
37 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39 // POSSIBILITY OF SUCH DAMAGE.
40 //
41 // This is part of revision release_sdk_4_4_0-3c5977e664 of the AmbiqSuite Development Package.
42 //
43 //*****************************************************************************
44 #ifndef AM_REG_JEDEC_H
45 #define AM_REG_JEDEC_H
46 
47 //*****************************************************************************
48 //
49 // JEDEC
50 // Instance finder. (1 instance(s) available)
51 //
52 //*****************************************************************************
53 #define AM_REG_JEDEC_NUM_MODULES                     1
54 #define AM_REG_JEDECn(n) \
55     (REG_JEDEC_BASEADDR + 0x00000000 * n)
56 
57 /* ========================================  Start of section using anonymous unions  ======================================== */
58 #if defined (__CC_ARM)
59   #pragma push
60   #pragma anon_unions
61 #elif defined (__ICCARM__)
62   #pragma language = extended
63 #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
64   #pragma clang diagnostic push
65   #pragma clang diagnostic ignored "-Wc11-extensions"
66   #pragma clang diagnostic ignored "-Wreserved-id-macro"
67   #pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
68   #pragma clang diagnostic ignored "-Wnested-anon-types"
69 #elif defined (__GNUC__)
70   /* anonymous unions are enabled by default */
71 #elif defined (__TMS470__)
72   /* anonymous unions are enabled by default */
73 #elif defined (__TASKING__)
74   #pragma warning 586
75 #elif defined (__CSMC__)
76   /* anonymous unions are enabled by default */
77 #else
78   #warning Not supported compiler type
79 #endif
80 
81 /**
82   \brief  Structure type to access the Apollo CM4 JEDEC registers.
83  */
84 typedef struct
85 {
86   uint32_t RESERVED0[52U];              /* 0xF00 - 0xFCF */
87 
88   union
89   {
90     __IM  uint32_t PID4;                /*!< 0xF0000FD0 (R/ )  PID4 Register */
91 
92     struct
93     {
94       __IM uint32_t JEPCONT     : 4;    /* [3..0] Contains the JEP Continuation bits. */
95     } PID4_b;
96   };
97 
98   union
99   {
100     __IM  uint32_t PID5;                /*!< 0xF0000FD4 (R/ )  PID5 Register */
101 
102     struct
103     {
104       __IM uint32_t VALUE       : 32;   /* [31..0] Contains the value of 0x00000000. */
105     } PID5_b;
106   };
107 
108   union
109   {
110     __IM  uint32_t PID6;                /*!< 0xF0000FD8 (R/ )  PID6 Register */
111 
112     struct
113     {
114       __IM uint32_t VALUE       : 32;   /* [31..0] Contains the value of 0x00000000. */
115     } PID6_b;
116   };
117 
118   union
119   {
120     __IM  uint32_t PID7;                /*!< 0xF0000FDC (R/ )  PID7 Register */
121 
122     struct
123     {
124       __IM uint32_t VALUE       : 32;   /* [31..0] Contains the value of 0x00000000. */
125     } PID7_b;
126   };
127 
128   union
129   {
130     __IM  uint32_t PID0;                /*!< 0xF0000FE0 (R/ )  PID0 Register */
131 
132     struct
133     {
134       __IM uint32_t PNL8        : 8;    /* [7..0] Contains the low 8 bits of the Ambiq Micro device part number. */
135     } PID0_b;
136   };
137 
138   union
139   {
140     __IM  uint32_t PID1;                /*!< 0xF0000FE4 (R/ )  PID1 Register */
141 
142     struct
143     {
144       __IM uint32_t PNH4        : 4;    /* [3..0] Contains the high 4 bits of the Ambiq Micro device part number. */
145       __IM uint32_t JEPIDL      : 4;    /* [7..4] Contains the low 4 bits of the Ambiq Micro JEDEC JEP-106 ID. The full JEPID is therefore 0x9B. */
146     } PID1_b;
147   };
148 
149   union
150   {
151     __IM  uint32_t PID2;                /*!< 0xF0000FE8 (R/ )  PID2 Register */
152 
153     struct
154     {
155       __IM uint32_t JEPIDH      : 4;    /* [3..0] Contains the high 3 bits of the Ambiq Micro JEPID. Note that bit3 of this field is hard-coded to 1. The full JEPID is therefore 0x9B. */
156       __IM uint32_t CHIPREVH4   : 4;    /* [7..4] Contains the high 4 bits of the Ambiq Micro CHIPREV (see also MCUCTRL.CHIPREV). Note that this field will change with each revision of the chip. */
157     } PID2_b;
158   };
159 
160   union
161   {
162     __IM  uint32_t PID3;                /*!< 0xF0000FEC (R/ )  PID3 Register */
163 
164     struct
165     {
166       __IM uint32_t ZERO        : 4;    /* [3..0] This field is hard-coded to 0x0. */
167       __IM uint32_t CHIPREVL4   : 4;    /* [7..0] Contains the low 4 bits of the Ambiq Micro CHIPREV (see also MCUCTRL.CHIPREV). Note that this field will change with each revision of the chip. */
168     } PID3_b;
169   };
170 
171   union
172   {
173     __IM  uint32_t CID0;                /*!< 0xF0000FF0 (R/ )  CID0 Register */
174 
175     struct
176     {
177       __IM uint32_t CID         : 8;    /* [7..0] Coresight ROM Table, CID0. */
178     } CID0_b;
179   };
180 
181   union
182   {
183     __IM  uint32_t CID1;                /*!< 0xF0000FF4 (R/ )  CID1 Register */
184 
185     struct
186     {
187       __IM uint32_t CID         : 8;    /* [7..0] Coresight ROM Table, CID1. */
188     } CID1_b;
189   };
190 
191   union
192   {
193     __IM  uint32_t CID2;                /*!< 0xF0000FF8 (R/ )  CID2 Register */
194 
195     struct
196     {
197       __IM uint32_t CID         : 8;    /* [7..0] Coresight ROM Table, CID2. */
198     } CID2_b;
199   };
200 
201   union
202   {
203     __IM  uint32_t CID3;                /*!< 0xF0000FFC (R/ )  CID3 Register */
204 
205     struct
206     {
207       __IM uint32_t CID         : 8;    /* [7..0] Coresight ROM Table, CID3. */
208     } CID3_b;
209   };
210 } JEDEC_Type;
211 
212 //*****************************************************************************
213 //
214 // JEDEC_PID4 - JEP Continuation Register
215 //
216 //*****************************************************************************
217 // Contains the JEP Continuation bits.
218 #define JEDEC_PID4_JEPCONT_Pos                0U
219 #define JEDEC_PID4_JEPCONT_Msk                (0x0000000FUL)
220 
221 //*****************************************************************************
222 //
223 // JEDEC_PID5 - JEP reserved Register
224 //
225 //*****************************************************************************
226 // Contains the value of 0x00000000.
227 #define JEDEC_PID5_VALUE_Pos                0U
228 #define JEDEC_PID5_VALUE_Msk                (0xFFFFFFFFUL)
229 
230 //*****************************************************************************
231 //
232 // JEDEC_PID6 - JEP reserved Register
233 //
234 //*****************************************************************************
235 // Contains the value of 0x00000000.
236 #define JEDEC_PID6_VALUE_Pos                0U
237 #define JEDEC_PID6_VALUE_Msk                (0xFFFFFFFFUL)
238 
239 //*****************************************************************************
240 //
241 // JEDEC_PID7 - JEP reserved Register
242 //
243 //*****************************************************************************
244 // Contains the value of 0x00000000.
245 #define JEDEC_PID7_VALUE_Pos                0U
246 #define JEDEC_PID7_VALUE_Msk                (0xFFFFFFFFUL)
247 
248 //*****************************************************************************
249 //
250 // JEDEC_PID0 - Ambiq Partnum low byte
251 //
252 //*****************************************************************************
253 // Contains the low 8 bits of the Ambiq Micro device part number.
254 #define JEDEC_PID0_PNL8_Pos                 0U
255 #define JEDEC_PID0_PNL8_Msk                 (0x000000FFUL)
256 
257 //*****************************************************************************
258 //
259 // JEDEC_PID1 - Ambiq part number high-nibble, JEPID low-nibble.
260 //
261 //*****************************************************************************
262 // Contains the low 4 bits of the Ambiq Micro JEDEC JEP-106 ID. The full JEPID
263 // is therefore 0x9B.
264 #define JEDEC_PID1_JEPIDL_Pos               4U
265 #define JEDEC_PID1_JEPIDL_Msk               (0x000000F0UL)
266 
267 // Contains the high 4 bits of the Ambiq Micro device part number.
268 #define JEDEC_PID1_PNH4_Pos                 0U
269 #define JEDEC_PID1_PNH4_Msk                 (0x0000000FUL)
270 
271 //*****************************************************************************
272 //
273 // JEDEC_PID2 - Ambiq chip revision low-nibble, JEPID high-nibble
274 //
275 //*****************************************************************************
276 // Contains the high 4 bits of the Ambiq Micro CHIPREV (see also
277 // MCUCTRL.CHIPREV). Note that this field will change with each revision of the
278 // chip.
279 #define JEDEC_PID2_CHIPREVH4_Pos            4U
280 #define JEDEC_PID2_CHIPREVH4_Msk            (0x000000F0UL)
281 
282 // Contains the high 3 bits of the Ambiq Micro JEPID. Note that bit3 of this
283 // field is hard-coded to 1. The full JEPID is therefore 0x9B.
284 #define JEDEC_PID2_JEPIDH_Pos               0U
285 #define JEDEC_PID2_JEPIDH_Msk               (0x0000000FUL)
286 
287 //*****************************************************************************
288 //
289 // JEDEC_PID3 - Ambiq chip revision high-nibble.
290 //
291 //*****************************************************************************
292 // Contains the low 4 bits of the Ambiq Micro CHIPREV (see also
293 // MCUCTRL.CHIPREV). Note that this field will change with each revision of the
294 // chip.
295 #define JEDEC_PID3_CHIPREVL4_Pos            4U
296 #define JEDEC_PID3_CHIPREVL4_Msk            (0x000000F0UL)
297 
298 // This field is hard-coded to 0x0.
299 #define JEDEC_PID3_ZERO_Pos                 0U
300 #define JEDEC_PID3_ZERO_Msk                 (0x0000000FUL)
301 
302 //*****************************************************************************
303 //
304 // JEDEC_CID0 - Coresight ROM Table.
305 //
306 //*****************************************************************************
307 // Coresight ROM Table, CID0.
308 #define JEDEC_CID0_CID_Pos                  0U
309 #define JEDEC_CID0_CID_Msk                  (0x000000FFUL)
310 
311 //*****************************************************************************
312 //
313 // JEDEC_CID1 - Coresight ROM Table.
314 //
315 //*****************************************************************************
316 // Coresight ROM Table, CID1.
317 #define JEDEC_CID1_CID_Pos                  0U
318 #define JEDEC_CID1_CID_Msk                  (0x000000FFUL)
319 
320 //*****************************************************************************
321 //
322 // JEDEC_CID2 - Coresight ROM Table.
323 //
324 //*****************************************************************************
325 // Coresight ROM Table, CID2.
326 #define JEDEC_CID2_CID_Pos                  0U
327 #define JEDEC_CID2_CID_Msk                  (0x000000FFUL)
328 
329 //*****************************************************************************
330 //
331 // JEDEC_CID3 - Coresight ROM Table.
332 //
333 //*****************************************************************************
334 // Coresight ROM Table, CID3.
335 #define JEDEC_CID3_CID_Pos                  0U
336 #define JEDEC_CID3_CID_Msk                  (0x000000FFUL)
337 
338 
339 
340 #define JEDEC_BASE  (0xF0000F00UL)                            /*!< JEDEC Base Address */
341 
342 #define JEDEC   ((JEDEC_Type       *)     JEDEC_BASE      )   /*!< JEDEC configuration struct */
343 
344 /* =========================================  End of section using anonymous unions  ========================================= */
345 #if defined (__CC_ARM)
346   #pragma pop
347 #elif defined (__ICCARM__)
348   /* leave anonymous unions enabled */
349 #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
350   #pragma clang diagnostic pop
351 #elif defined (__GNUC__)
352   /* anonymous unions are enabled by default */
353 #elif defined (__TMS470__)
354   /* anonymous unions are enabled by default */
355 #elif defined (__TASKING__)
356   #pragma warning restore
357 #elif defined (__CSMC__)
358   /* anonymous unions are enabled by default */
359 #endif
360 
361 
362 #endif // AM_REG_JEDEC_H
363 
364