~funderscore blog cgit wiki get in touch
aboutsummaryrefslogtreecommitdiff
blob: 77af0e3f8353c8fd846d342d74ded4f2f1eadf7b (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
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2020 Marvell International Ltd.
 */

#ifndef __CVMX_SATA_DEFS_H__
#define __CVMX_SATA_DEFS_H__

#define CVMX_SATA_UCTL_CTL	   (0x000118006C000000ull)
#define CVMX_SATA_UCTL_SHIM_CFG	   (0x000118006C0000E8ull)
#define CVMX_SATA_UCTL_BIST_STATUS (0x000118006C000008ull)

#define CVMX_SATA_UAHC_GBL_PI	    (0x00016C000000000Cull)
#define CVMX_SATA_UAHC_GBL_TIMER1MS (0x00016C00000000E0ull)
#define CVMX_SATA_UAHC_GBL_CAP	    (0x00016C0000000000ull)

#define CVMX_SATA_UAHC_PX_CMD(offset)  (0x00016C0000000118ull + ((offset) & 1) * 128)
#define CVMX_SATA_UAHC_PX_SCTL(offset) (0x00016C000000012Cull + ((offset) & 1) * 128)
#define CVMX_SATA_UAHC_PX_SERR(offset) (0x00016C0000000130ull + ((offset) & 1) * 128)
#define CVMX_SATA_UAHC_PX_IS(offset)   (0x00016C0000000110ull + ((offset) & 1) * 128)
#define CVMX_SATA_UAHC_PX_SSTS(offset) (0x00016C0000000128ull + ((offset) & 1) * 128)
#define CVMX_SATA_UAHC_PX_TFD(offset)  (0x00016C0000000120ull + ((offset) & 1) * 128)

/**
 * cvmx_sata_uctl_ctl
 *
 * This register controls clocks, resets, power, and BIST for the SATA.
 *
 * Accessible always.
 *
 * Reset by IOI reset.
 */
union cvmx_sata_uctl_ctl {
	u64 u64;
	struct cvmx_sata_uctl_ctl_s {
		u64 clear_bist : 1;
		u64 start_bist : 1;
		u64 reserved_31_61 : 31;
		u64 a_clk_en : 1;
		u64 a_clk_byp_sel : 1;
		u64 a_clkdiv_rst : 1;
		u64 reserved_27_27 : 1;
		u64 a_clkdiv_sel : 3;
		u64 reserved_5_23 : 19;
		u64 csclk_en : 1;
		u64 reserved_2_3 : 2;
		u64 sata_uahc_rst : 1;
		u64 sata_uctl_rst : 1;
	} s;
	struct cvmx_sata_uctl_ctl_s cn70xx;
	struct cvmx_sata_uctl_ctl_s cn70xxp1;
	struct cvmx_sata_uctl_ctl_s cn73xx;
};

typedef union cvmx_sata_uctl_ctl cvmx_sata_uctl_ctl_t;

/**
 * cvmx_sata_uctl_bist_status
 *
 * Results from BIST runs of SATA's memories.
 * Wait for NDONE==0, then look at defect indication.
 *
 * Accessible always.
 *
 * Reset by IOI reset.
 */
union cvmx_sata_uctl_bist_status {
	u64 u64;
	struct cvmx_sata_uctl_bist_status_s {
		u64 reserved_42_63 : 22;
		u64 uctl_xm_r_bist_ndone : 1;
		u64 uctl_xm_w_bist_ndone : 1;
		u64 reserved_36_39 : 4;
		u64 uahc_p0_rxram_bist_ndone : 1;
		u64 uahc_p1_rxram_bist_ndone : 1;
		u64 uahc_p0_txram_bist_ndone : 1;
		u64 uahc_p1_txram_bist_ndone : 1;
		u64 reserved_10_31 : 22;
		u64 uctl_xm_r_bist_status : 1;
		u64 uctl_xm_w_bist_status : 1;
		u64 reserved_4_7 : 4;
		u64 uahc_p0_rxram_bist_status : 1;
		u64 uahc_p1_rxram_bist_status : 1;
		u64 uahc_p0_txram_bist_status : 1;
		u64 uahc_p1_txram_bist_status : 1;
	} s;
	struct cvmx_sata_uctl_bist_status_s cn70xx;
	struct cvmx_sata_uctl_bist_status_s cn70xxp1;
	struct cvmx_sata_uctl_bist_status_s cn73xx;
};

typedef union cvmx_sata_uctl_bist_status cvmx_sata_uctl_bist_status_t;

/**
 * cvmx_sata_uctl_shim_cfg
 *
 * This register allows configuration of various shim (UCTL) features.
 *
 * Fields XS_NCB_OOB_* are captured when there are no outstanding OOB errors indicated in INTSTAT
 * and a new OOB error arrives.
 *
 * Fields XS_BAD_DMA_* are captured when there are no outstanding DMA errors indicated in INTSTAT
 * and a new DMA error arrives.
 *
 * Accessible only when SATA_UCTL_CTL[A_CLK_EN].
 *
 * Reset by IOI reset or SATA_UCTL_CTL[SATA_UCTL_RST].
 */
union cvmx_sata_uctl_shim_cfg {
	u64 u64;
	struct cvmx_sata_uctl_shim_cfg_s {
		u64 xs_ncb_oob_wrn : 1;
		u64 reserved_60_62 : 3;
		u64 xs_ncb_oob_osrc : 12;
		u64 xm_bad_dma_wrn : 1;
		u64 reserved_44_46 : 3;
		u64 xm_bad_dma_type : 4;
		u64 reserved_14_39 : 26;
		u64 dma_read_cmd : 2;
		u64 reserved_11_11 : 1;
		u64 dma_write_cmd : 1;
		u64 dma_endian_mode : 2;
		u64 reserved_2_7 : 6;
		u64 csr_endian_mode : 2;
	} s;
	struct cvmx_sata_uctl_shim_cfg_cn70xx {
		u64 xs_ncb_oob_wrn : 1;
		u64 reserved_57_62 : 6;
		u64 xs_ncb_oob_osrc : 9;
		u64 xm_bad_dma_wrn : 1;
		u64 reserved_44_46 : 3;
		u64 xm_bad_dma_type : 4;
		u64 reserved_13_39 : 27;
		u64 dma_read_cmd : 1;
		u64 reserved_10_11 : 2;
		u64 dma_endian_mode : 2;
		u64 reserved_2_7 : 6;
		u64 csr_endian_mode : 2;
	} cn70xx;
	struct cvmx_sata_uctl_shim_cfg_cn70xx cn70xxp1;
	struct cvmx_sata_uctl_shim_cfg_s cn73xx;
};

typedef union cvmx_sata_uctl_shim_cfg cvmx_sata_uctl_shim_cfg_t;

/**
 * cvmx_sata_uahc_gbl_cap
 *
 * See AHCI specification v1.3 section 3.1
 *
 */
union cvmx_sata_uahc_gbl_cap {
	u32 u32;
	struct cvmx_sata_uahc_gbl_cap_s {
		u32 s64a : 1;
		u32 sncq : 1;
		u32 ssntf : 1;
		u32 smps : 1;
		u32 sss : 1;
		u32 salp : 1;
		u32 sal : 1;
		u32 sclo : 1;
		u32 iss : 4;
		u32 snzo : 1;
		u32 sam : 1;
		u32 spm : 1;
		u32 fbss : 1;
		u32 pmd : 1;
		u32 ssc : 1;
		u32 psc : 1;
		u32 ncs : 5;
		u32 cccs : 1;
		u32 ems : 1;
		u32 sxs : 1;
		u32 np : 5;
	} s;
	struct cvmx_sata_uahc_gbl_cap_s cn70xx;
	struct cvmx_sata_uahc_gbl_cap_s cn70xxp1;
	struct cvmx_sata_uahc_gbl_cap_s cn73xx;
};

typedef union cvmx_sata_uahc_gbl_cap cvmx_sata_uahc_gbl_cap_t;

/**
 * cvmx_sata_uahc_p#_sctl
 */
union cvmx_sata_uahc_px_sctl {
	u32 u32;
	struct cvmx_sata_uahc_px_sctl_s {
		u32 reserved_10_31 : 22;
		u32 ipm : 2;
		u32 reserved_6_7 : 2;
		u32 spd : 2;
		u32 reserved_3_3 : 1;
		u32 det : 3;
	} s;
	struct cvmx_sata_uahc_px_sctl_s cn70xx;
	struct cvmx_sata_uahc_px_sctl_s cn70xxp1;
	struct cvmx_sata_uahc_px_sctl_s cn73xx;
};

typedef union cvmx_sata_uahc_px_sctl cvmx_sata_uahc_px_sctl_t;

/**
 * cvmx_sata_uahc_p#_cmd
 */
union cvmx_sata_uahc_px_cmd {
	u32 u32;
	struct cvmx_sata_uahc_px_cmd_s {
		u32 icc : 4;
		u32 asp : 1;
		u32 alpe : 1;
		u32 dlae : 1;
		u32 atapi : 1;
		u32 apste : 1;
		u32 fbscp : 1;
		u32 esp : 1;
		u32 cpd : 1;
		u32 mpsp : 1;
		u32 hpcp : 1;
		u32 pma : 1;
		u32 cps : 1;
		u32 cr : 1;
		u32 fr : 1;
		u32 mpss : 1;
		u32 ccs : 5;
		u32 reserved_5_7 : 3;
		u32 fre : 1;
		u32 clo : 1;
		u32 pod : 1;
		u32 sud : 1;
		u32 st : 1;
	} s;
	struct cvmx_sata_uahc_px_cmd_s cn70xx;
	struct cvmx_sata_uahc_px_cmd_s cn70xxp1;
	struct cvmx_sata_uahc_px_cmd_s cn73xx;
};

typedef union cvmx_sata_uahc_px_cmd cvmx_sata_uahc_px_cmd_t;

/**
 * cvmx_sata_uahc_gbl_pi
 *
 * See AHCI specification v1.3 section 3.1.
 *
 */
union cvmx_sata_uahc_gbl_pi {
	u32 u32;
	struct cvmx_sata_uahc_gbl_pi_s {
		u32 reserved_2_31 : 30;
		u32 pi : 2;
	} s;
	struct cvmx_sata_uahc_gbl_pi_s cn70xx;
	struct cvmx_sata_uahc_gbl_pi_s cn70xxp1;
	struct cvmx_sata_uahc_gbl_pi_s cn73xx;
};

typedef union cvmx_sata_uahc_gbl_pi cvmx_sata_uahc_gbl_pi_t;

/**
 * cvmx_sata_uahc_p#_ssts
 */
union cvmx_sata_uahc_px_ssts {
	u32 u32;
	struct cvmx_sata_uahc_px_ssts_s {
		u32 reserved_12_31 : 20;
		u32 ipm : 4;
		u32 spd : 4;
		u32 det : 4;
	} s;
	struct cvmx_sata_uahc_px_ssts_s cn70xx;
	struct cvmx_sata_uahc_px_ssts_s cn70xxp1;
	struct cvmx_sata_uahc_px_ssts_s cn73xx;
};

typedef union cvmx_sata_uahc_px_ssts cvmx_sata_uahc_px_ssts_t;

/**
 * cvmx_sata_uahc_p#_tfd
 */
union cvmx_sata_uahc_px_tfd {
	u32 u32;
	struct cvmx_sata_uahc_px_tfd_s {
		u32 reserved_16_31 : 16;
		u32 tferr : 8;
		u32 sts : 8;
	} s;
	struct cvmx_sata_uahc_px_tfd_s cn70xx;
	struct cvmx_sata_uahc_px_tfd_s cn70xxp1;
	struct cvmx_sata_uahc_px_tfd_s cn73xx;
};

typedef union cvmx_sata_uahc_px_tfd cvmx_sata_uahc_px_tfd_t;

/**
 * cvmx_sata_uahc_gbl_timer1ms
 */
union cvmx_sata_uahc_gbl_timer1ms {
	u32 u32;
	struct cvmx_sata_uahc_gbl_timer1ms_s {
		u32 reserved_20_31 : 12;
		u32 timv : 20;
	} s;
	struct cvmx_sata_uahc_gbl_timer1ms_s cn70xx;
	struct cvmx_sata_uahc_gbl_timer1ms_s cn70xxp1;
	struct cvmx_sata_uahc_gbl_timer1ms_s cn73xx;
};

typedef union cvmx_sata_uahc_gbl_timer1ms cvmx_sata_uahc_gbl_timer1ms_t;

#endif