1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2018-2022 Marvell International Ltd.
5 * Configuration and status register (CSR) type definitions for
9 #ifndef __CVMX_XCV_DEFS_H__
10 #define __CVMX_XCV_DEFS_H__
12 #define CVMX_XCV_BATCH_CRD_RET (0x00011800DB000100ull)
13 #define CVMX_XCV_COMP_CTL (0x00011800DB000020ull)
14 #define CVMX_XCV_CTL (0x00011800DB000030ull)
15 #define CVMX_XCV_DLL_CTL (0x00011800DB000010ull)
16 #define CVMX_XCV_ECO (0x00011800DB000200ull)
17 #define CVMX_XCV_INBND_STATUS (0x00011800DB000080ull)
18 #define CVMX_XCV_INT (0x00011800DB000040ull)
19 #define CVMX_XCV_RESET (0x00011800DB000000ull)
22 * cvmx_xcv_batch_crd_ret
24 union cvmx_xcv_batch_crd_ret {
26 struct cvmx_xcv_batch_crd_ret_s {
27 u64 reserved_1_63 : 63;
30 struct cvmx_xcv_batch_crd_ret_s cn73xx;
33 typedef union cvmx_xcv_batch_crd_ret cvmx_xcv_batch_crd_ret_t;
38 * This register controls programmable compensation.
41 union cvmx_xcv_comp_ctl {
43 struct cvmx_xcv_comp_ctl_s {
45 u64 reserved_61_62 : 2;
47 u64 reserved_53_55 : 3;
49 u64 reserved_45_47 : 3;
51 u64 reserved_37_39 : 3;
53 u64 reserved_31_31 : 1;
56 u64 reserved_28_28 : 1;
58 u64 reserved_1_26 : 26;
61 struct cvmx_xcv_comp_ctl_s cn73xx;
64 typedef union cvmx_xcv_comp_ctl cvmx_xcv_comp_ctl_t;
69 * This register contains the status control bits.
74 struct cvmx_xcv_ctl_s {
75 u64 reserved_4_63 : 60;
80 struct cvmx_xcv_ctl_s cn73xx;
83 typedef union cvmx_xcv_ctl cvmx_xcv_ctl_t;
88 * The RGMII timing specification requires that devices transmit clock and
89 * data synchronously. The specification requires external sources (namely
90 * the PC board trace routes) to introduce the appropriate 1.5 to 2.0 ns of
93 * To eliminate the need for the PC board delays, the RGMII interface has optional
94 * on-board DLLs for both transmit and receive. For correct operation, at most one
95 * of the transmitter, board, or receiver involved in an RGMII link should
96 * introduce delay. By default/reset, the RGMII receivers delay the received clock,
97 * and the RGMII transmitters do not delay the transmitted clock. Whether this
98 * default works as-is with a given link partner depends on the behavior of the
99 * link partner and the PC board.
101 * These are the possible modes of RGMII receive operation:
103 * * XCV_DLL_CTL[CLKRX_BYP] = 0 (reset value) - The RGMII
104 * receive interface introduces clock delay using its internal DLL.
105 * This mode is appropriate if neither the remote
106 * transmitter nor the PC board delays the clock.
108 * * XCV_DLL_CTL[CLKRX_BYP] = 1, [CLKRX_SET] = 0x0 - The
109 * RGMII receive interface introduces no clock delay. This mode
110 * is appropriate if either the remote transmitter or the PC board
113 * These are the possible modes of RGMII transmit operation:
115 * * XCV_DLL_CTL[CLKTX_BYP] = 1, [CLKTX_SET] = 0x0 (reset value) -
116 * The RGMII transmit interface introduces no clock
117 * delay. This mode is appropriate is either the remote receiver
118 * or the PC board delays the clock.
120 * * XCV_DLL_CTL[CLKTX_BYP] = 0 - The RGMII transmit
121 * interface introduces clock delay using its internal DLL.
122 * This mode is appropriate if neither the remote receiver
123 * nor the PC board delays the clock.
125 union cvmx_xcv_dll_ctl {
127 struct cvmx_xcv_dll_ctl_s {
128 u64 reserved_32_63 : 32;
135 u64 reserved_2_7 : 6;
138 struct cvmx_xcv_dll_ctl_s cn73xx;
141 typedef union cvmx_xcv_dll_ctl cvmx_xcv_dll_ctl_t;
148 struct cvmx_xcv_eco_s {
149 u64 reserved_16_63 : 48;
152 struct cvmx_xcv_eco_s cn73xx;
155 typedef union cvmx_xcv_eco cvmx_xcv_eco_t;
158 * cvmx_xcv_inbnd_status
160 * This register contains RGMII in-band status.
163 union cvmx_xcv_inbnd_status {
165 struct cvmx_xcv_inbnd_status_s {
166 u64 reserved_4_63 : 60;
171 struct cvmx_xcv_inbnd_status_s cn73xx;
174 typedef union cvmx_xcv_inbnd_status cvmx_xcv_inbnd_status_t;
179 * This register controls interrupts.
184 struct cvmx_xcv_int_s {
185 u64 reserved_7_63 : 57;
190 u64 reserved_2_2 : 1;
194 struct cvmx_xcv_int_s cn73xx;
197 typedef union cvmx_xcv_int cvmx_xcv_int_t;
202 * This register controls reset.
205 union cvmx_xcv_reset {
207 struct cvmx_xcv_reset_s {
209 u64 reserved_16_62 : 47;
211 u64 reserved_12_14 : 3;
213 u64 reserved_8_10 : 3;
215 u64 reserved_4_6 : 3;
216 u64 tx_pkt_rst_n : 1;
217 u64 tx_dat_rst_n : 1;
218 u64 rx_pkt_rst_n : 1;
219 u64 rx_dat_rst_n : 1;
221 struct cvmx_xcv_reset_s cn73xx;
224 typedef union cvmx_xcv_reset cvmx_xcv_reset_t;