1 /***********************license start***************
2 * Copyright (c) 2003-2012 Cavium Inc. (support@cavium.com). All rights
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * * Neither the name of Cavium Inc. nor the names of
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written
23 * This Software, including technical data, may be subject to U.S. export control
24 * laws, including the U.S. Export Administration Act and its associated
25 * regulations, and may be subject to export or import regulations in other
28 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
30 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
37 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38 ***********************license end**************************************/
44 * Configuration and status register (CSR) type definitions for
47 * This file is auto generated. Do not edit.
52 #ifndef __CVMX_PCM_DEFS_H__
53 #define __CVMX_PCM_DEFS_H__
55 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
56 static inline uint64_t CVMX_PCM_CLKX_CFG(unsigned long offset)
59 (OCTEON_IS_MODEL(OCTEON_CN30XX) && ((offset <= 1))) ||
60 (OCTEON_IS_MODEL(OCTEON_CN31XX) && ((offset <= 1))) ||
61 (OCTEON_IS_MODEL(OCTEON_CN50XX) && ((offset <= 1))) ||
62 (OCTEON_IS_MODEL(OCTEON_CN61XX) && ((offset <= 1))) ||
63 (OCTEON_IS_MODEL(OCTEON_CNF71XX) && ((offset <= 1)))))
64 cvmx_warn("CVMX_PCM_CLKX_CFG(%lu) is invalid on this chip\n", offset);
65 return CVMX_ADD_IO_SEG(0x0001070000010000ull) + ((offset) & 1) * 16384;
68 #define CVMX_PCM_CLKX_CFG(offset) (CVMX_ADD_IO_SEG(0x0001070000010000ull) + ((offset) & 1) * 16384)
70 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
71 static inline uint64_t CVMX_PCM_CLKX_DBG(unsigned long offset)
74 (OCTEON_IS_MODEL(OCTEON_CN30XX) && ((offset <= 1))) ||
75 (OCTEON_IS_MODEL(OCTEON_CN31XX) && ((offset <= 1))) ||
76 (OCTEON_IS_MODEL(OCTEON_CN50XX) && ((offset <= 1))) ||
77 (OCTEON_IS_MODEL(OCTEON_CN61XX) && ((offset <= 1))) ||
78 (OCTEON_IS_MODEL(OCTEON_CNF71XX) && ((offset <= 1)))))
79 cvmx_warn("CVMX_PCM_CLKX_DBG(%lu) is invalid on this chip\n", offset);
80 return CVMX_ADD_IO_SEG(0x0001070000010038ull) + ((offset) & 1) * 16384;
83 #define CVMX_PCM_CLKX_DBG(offset) (CVMX_ADD_IO_SEG(0x0001070000010038ull) + ((offset) & 1) * 16384)
85 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
86 static inline uint64_t CVMX_PCM_CLKX_GEN(unsigned long offset)
89 (OCTEON_IS_MODEL(OCTEON_CN30XX) && ((offset <= 1))) ||
90 (OCTEON_IS_MODEL(OCTEON_CN31XX) && ((offset <= 1))) ||
91 (OCTEON_IS_MODEL(OCTEON_CN50XX) && ((offset <= 1))) ||
92 (OCTEON_IS_MODEL(OCTEON_CN61XX) && ((offset <= 1))) ||
93 (OCTEON_IS_MODEL(OCTEON_CNF71XX) && ((offset <= 1)))))
94 cvmx_warn("CVMX_PCM_CLKX_GEN(%lu) is invalid on this chip\n", offset);
95 return CVMX_ADD_IO_SEG(0x0001070000010008ull) + ((offset) & 1) * 16384;
98 #define CVMX_PCM_CLKX_GEN(offset) (CVMX_ADD_IO_SEG(0x0001070000010008ull) + ((offset) & 1) * 16384)
104 union cvmx_pcm_clkx_cfg {
106 struct cvmx_pcm_clkx_cfg_s {
107 #ifdef __BIG_ENDIAN_BITFIELD
108 uint64_t fsyncgood : 1; /**< FSYNC status | NS
109 If 1, the last frame had a correctly positioned
111 If 0, none/extra fsync pulse seen on most recent
113 NOTE: this is intended for startup. the FSYNCEXTRA
114 and FSYNCMISSING interrupts are intended for
115 detecting loss of sync during normal operation. */
116 uint64_t reserved_48_62 : 15;
117 uint64_t fsyncsamp : 16; /**< Number of ECLKs from internal BCLK edge to | NS
119 NOTE: used to sync to the start of a frame and to
120 check for FSYNC errors. */
121 uint64_t reserved_26_31 : 6;
122 uint64_t fsynclen : 5; /**< Number of 1/2 BCLKs FSYNC is asserted for | NS
123 NOTE: only used when GEN==1 */
124 uint64_t fsyncloc : 5; /**< FSYNC location, in 1/2 BCLKS before timeslot 0, | NS
126 NOTE: also used to detect framing errors and
127 therefore must have a correct value even if GEN==0 */
128 uint64_t numslots : 10; /**< Number of 8-bit slots in a frame | NS
129 NOTE: this, along with EXTRABIT and Fbclk
130 determines FSYNC frequency when GEN == 1
131 NOTE: also used to detect framing errors and
132 therefore must have a correct value even if GEN==0 */
133 uint64_t extrabit : 1; /**< If 0, no frame bit | NS
134 If 1, add one extra bit time for frame bit
135 NOTE: if GEN == 1, then FSYNC will be delayed one
137 NOTE: also used to detect framing errors and
138 therefore must have a correct value even if GEN==0
139 NOTE: the extra bit comes from the LSB/MSB of the
140 first byte of the frame in the transmit memory
141 region. LSB vs MSB is determined from the setting
142 of PCMn_TDM_CFG[LSBFIRST]. */
143 uint64_t bitlen : 2; /**< Number of BCLKs in a bit time. | NS
147 3 : operation undefined */
148 uint64_t bclkpol : 1; /**< If 0, BCLK rise edge is start of bit time | NS
149 If 1, BCLK fall edge is start of bit time
150 NOTE: also used to detect framing errors and
151 therefore must have a correct value even if GEN==0 */
152 uint64_t fsyncpol : 1; /**< If 0, FSYNC idles low, asserts high | NS
153 If 1, FSYNC idles high, asserts low
154 NOTE: also used to detect framing errors and
155 therefore must have a correct value even if GEN==0 */
156 uint64_t ena : 1; /**< If 0, Clock receiving logic is doing nothing | NS
157 1, Clock receiving logic is looking for sync */
160 uint64_t fsyncpol : 1;
161 uint64_t bclkpol : 1;
163 uint64_t extrabit : 1;
164 uint64_t numslots : 10;
165 uint64_t fsyncloc : 5;
166 uint64_t fsynclen : 5;
167 uint64_t reserved_26_31 : 6;
168 uint64_t fsyncsamp : 16;
169 uint64_t reserved_48_62 : 15;
170 uint64_t fsyncgood : 1;
173 struct cvmx_pcm_clkx_cfg_s cn30xx;
174 struct cvmx_pcm_clkx_cfg_s cn31xx;
175 struct cvmx_pcm_clkx_cfg_s cn50xx;
176 struct cvmx_pcm_clkx_cfg_s cn61xx;
177 struct cvmx_pcm_clkx_cfg_s cnf71xx;
179 typedef union cvmx_pcm_clkx_cfg cvmx_pcm_clkx_cfg_t;
184 union cvmx_pcm_clkx_dbg {
186 struct cvmx_pcm_clkx_dbg_s {
187 #ifdef __BIG_ENDIAN_BITFIELD
188 uint64_t debuginfo : 64; /**< Miscellaneous debug information | NS */
190 uint64_t debuginfo : 64;
193 struct cvmx_pcm_clkx_dbg_s cn30xx;
194 struct cvmx_pcm_clkx_dbg_s cn31xx;
195 struct cvmx_pcm_clkx_dbg_s cn50xx;
196 struct cvmx_pcm_clkx_dbg_s cn61xx;
197 struct cvmx_pcm_clkx_dbg_s cnf71xx;
199 typedef union cvmx_pcm_clkx_dbg cvmx_pcm_clkx_dbg_t;
204 union cvmx_pcm_clkx_gen {
206 struct cvmx_pcm_clkx_gen_s {
207 #ifdef __BIG_ENDIAN_BITFIELD
208 uint64_t deltasamp : 16; /**< Signed number of ECLKs to move sampled BCLK edge | NS
209 NOTE: the complete number of ECLKs to move is:
210 NUMSAMP + 2 + 1 + DELTASAMP
211 NUMSAMP to compensate for sampling delay
212 + 2 to compensate for dual-rank synchronizer
214 + DELTASAMP to CMA/debugging */
215 uint64_t numsamp : 16; /**< Number of ECLK samples to detect BCLK change when | NS
217 uint64_t n : 32; /**< Determines BCLK frequency when generating clock | NS
218 NOTE: Fbclk = Feclk * N / 2^32
219 N = (Fbclk / Feclk) * 2^32
220 NOTE: writing N == 0 stops the clock generator, and
221 causes bclk and fsync to be RECEIVED */
224 uint64_t numsamp : 16;
225 uint64_t deltasamp : 16;
228 struct cvmx_pcm_clkx_gen_s cn30xx;
229 struct cvmx_pcm_clkx_gen_s cn31xx;
230 struct cvmx_pcm_clkx_gen_s cn50xx;
231 struct cvmx_pcm_clkx_gen_s cn61xx;
232 struct cvmx_pcm_clkx_gen_s cnf71xx;
234 typedef union cvmx_pcm_clkx_gen cvmx_pcm_clkx_gen_t;