30 // parameter READ_REG_LATENCY = 2, // 0 if reg_rdata is available with reg_re/reg_addr, 2 with re/regen 31 parameter ADDRESS_BITS =
10 // number of memory address bits - now fixed. Low half - RO/RW/RWC,RW1 (2-cycle write), 2-nd just RW (single-cycle) 33 input mrst,
// @posedge mclk, generated by phy 34 input mclk,
// for command/status 35 input was_hba_rst,
// last reset was hba reset (not counting system reset) 36 input was_port_rst,
// last reset was port reset(not counting system reset) 38 // notification from axi_ahci_regs that software has written data to register 40 input [
31:
0]
soft_write_data,
// register data written (after applying wstb and type (RO, RW, RWC, RW1) 42 // input soft_arst, // reset SATA PHY not relying on SATA clock 43 // R/W access to AXI/AHCI registers, shared with ahci_fis_receive and ahci_fis_transmit modules 46 // output [3:0] regs_wstb, Needed? 47 // output [1:0] regs_re, // [0] - re, [1] - regen 49 // input [31:0] regs_dout, 50 // update register inputs (will write to register memory current value of the corresponding register) 55 input update_gis,
// these following individual may be unneeded - just use universal update_all 63 /// output reg st01_pending, // software turned PxCMD.ST from 0 to 1 64 /// output reg st10_pending, // software turned PxCMD.ST from 1 to 0 65 /// input st_pending_reset,// reset both st01_pending and st10_pending 68 // input pcmd_clear_icc, // clear PxCMD.ICC field (generated here) 69 input pcmd_esp,
// external SATA port (just forward value) 70 output pcmd_cr,
// command list run - current 73 input pcmd_fr,
// ahci_fis_receive:get_fis_busy - change to HAB set/reset (set, do, reset) 76 output pcmd_clo,
//RW1, causes ahci_fis_receive:clear_bsy_drq, that in turn resets this bit 80 input pfsm_started,
// H: FSM done, P: FSM started (enable sensing pcmd_st_cleared) 81 output reg pcmd_st_cleared,
// ST bit cleared by software; TODO: check not in H:Init (5.3.2.10) 86 input sirq_IF,
// RWC: Interface Fatal Error Status (sect. 6.1.2) 87 input sirq_INF,
// RWC: Interface Non-Fatal Error Status (sect. 6.1.2) 90 input sirq_PC,
// RO: Port Connect Change Status 91 input sirq_DP,
// RWC: Descriptor Processed with "I" bit on 93 input sirq_SDB,
// RWC: Set Device Bits Interrupt - Set Device bits FIS with 'I' bit set 94 input sirq_DS,
// RWC: DMA Setup FIS Interrupt - DMA Setup FIS received with 'I' bit set 95 input sirq_PS,
// RWC: PIO Setup FIS Interrupt - PIO Setup FIS received with 'I' bit set 96 input sirq_DHR,
// RWC: D2H Register FIS Interrupt - D2H Register FIS received with 'I' bit set 97 // SCR1:SError (only inputs that are not available in sirq_* ones 100 input serr_DT,
// RWC: Transport state transition error 102 input serr_DH,
// RWC: Handshake Error (i.e. Device got CRC error) 103 input serr_DC,
// RWC: CRC error in Link layer 105 input serr_DW,
// RWC: COMMWAKE signal was detected 108 // sirq_IF || // sirq_INF 109 input serr_EE,
// RWC: Internal error (such as elastic buffer overflow or primitive mis-alignment) 110 input serr_EP,
// RWC: Protocol Error - a violation of SATA protocol detected 111 input serr_EC,
// RWC: Persistent Communication or Data Integrity Error 112 input serr_ET,
// RWC: Transient Data Integrity Error (error not recovered by the interface) 113 input serr_EM,
// RWC: Communication between the device and host was lost but re-established 114 input serr_EI,
// RWC: Recovered Data integrity Error 119 input ssts_ipm_dnp,
// device not present or communication not established 125 input ssts_spd_dnp,
// device not present or communication not established 130 input ssts_det_ndnp,
// no device detected, phy communication not established 131 input ssts_det_dnp,
// device detected, but phy communication not established 132 input ssts_det_dp,
// device detected, phy communication established 134 output [
3:
0]
ssts_det,
// current value of PxSSTS.DET 136 // SCR2:SControl (written by software only) 137 output reg [
3:
0]
sctl_ipm,
// Interface power management transitions allowed 138 output reg [
3:
0]
sctl_spd,
// Interface maximal speed 139 output reg [
3:
0]
sctl_det,
// Device detection initialization requested 147 output unsolicited_en,
// enable processing of cominit_got and PxERR.DIAG.W interrupts from 148 // this bit is reset at reset, set when PxSSTS.DET==3 or PxSCTL.DET==4 155 localparam PCI_Header__ID__DID__ADDR =
'h60;
156 localparam PCI_Header__ID__DID__MASK =
'hffff0000;
157 localparam PCI_Header__ID__DID__DFLT =
'h10000;
159 localparam PCI_Header__ID__VID__ADDR =
'h60;
160 localparam PCI_Header__ID__VID__MASK =
'hffff;
161 localparam PCI_Header__ID__VID__DFLT =
'hfffe;
162 // RW: HBA Interrupt Disable 163 localparam PCI_Header__CMD__ID__ADDR =
'h61;
164 localparam PCI_Header__CMD__ID__MASK =
'h400;
165 localparam PCI_Header__CMD__ID__DFLT =
'h0;
166 // RO: Fast Back-to-Back Enable 167 localparam PCI_Header__CMD__FBE__ADDR =
'h61;
168 localparam PCI_Header__CMD__FBE__MASK =
'h200;
169 localparam PCI_Header__CMD__FBE__DFLT =
'h0;
171 localparam PCI_Header__CMD__SEE__ADDR =
'h61;
172 localparam PCI_Header__CMD__SEE__MASK =
'h100;
173 localparam PCI_Header__CMD__SEE__DFLT =
'h0;
175 localparam PCI_Header__CMD__WCC__ADDR =
'h61;
176 localparam PCI_Header__CMD__WCC__MASK =
'h80;
177 localparam PCI_Header__CMD__WCC__DFLT =
'h0;
178 // RO: Parity Error Response Enable 179 localparam PCI_Header__CMD__PEE__ADDR =
'h61;
180 localparam PCI_Header__CMD__PEE__MASK =
'h40;
181 localparam PCI_Header__CMD__PEE__DFLT =
'h0;
183 localparam PCI_Header__CMD__VGA__ADDR =
'h61;
184 localparam PCI_Header__CMD__VGA__MASK =
'h20;
185 localparam PCI_Header__CMD__VGA__DFLT =
'h0;
187 localparam PCI_Header__CMD__MWIE__ADDR =
'h61;
188 localparam PCI_Header__CMD__MWIE__MASK =
'h10;
189 localparam PCI_Header__CMD__MWIE__DFLT =
'h0;
191 localparam PCI_Header__CMD__SCE__ADDR =
'h61;
192 localparam PCI_Header__CMD__SCE__MASK =
'h8;
193 localparam PCI_Header__CMD__SCE__DFLT =
'h0;
194 // RW: Bus Master Enable (0 - stops any DMA) 195 localparam PCI_Header__CMD__BME__ADDR =
'h61;
196 localparam PCI_Header__CMD__BME__MASK =
'h4;
197 localparam PCI_Header__CMD__BME__DFLT =
'h0;
198 // RW: Memory Space enable (here - always?) 199 localparam PCI_Header__CMD__MSE__ADDR =
'h61;
200 localparam PCI_Header__CMD__MSE__MASK =
'h2;
201 localparam PCI_Header__CMD__MSE__DFLT =
'h0;
202 // RO: Enable IO space access (only for legacy IDE) 203 localparam PCI_Header__CMD__IOSE__ADDR =
'h61;
204 localparam PCI_Header__CMD__IOSE__MASK =
'h1;
205 localparam PCI_Header__CMD__IOSE__DFLT =
'h0;
206 // RWC: Detected Parity Error 207 localparam PCI_Header__STS__DPE__ADDR =
'h61;
208 localparam PCI_Header__STS__DPE__MASK =
'h80000000;
209 localparam PCI_Header__STS__DPE__DFLT =
'h0;
210 // RWC: Signaled System Error (HBA SERR) 211 localparam PCI_Header__STS__SSE__ADDR =
'h61;
212 localparam PCI_Header__STS__SSE__MASK =
'h40000000;
213 localparam PCI_Header__STS__SSE__DFLT =
'h0;
214 // RWC: Received Master Abort 215 localparam PCI_Header__STS__RMA__ADDR =
'h61;
216 localparam PCI_Header__STS__RMA__MASK =
'h20000000;
217 localparam PCI_Header__STS__RMA__DFLT =
'h0;
218 // RWC: Received Target Abort 219 localparam PCI_Header__STS__RTA__ADDR =
'h61;
220 localparam PCI_Header__STS__RTA__MASK =
'h10000000;
221 localparam PCI_Header__STS__RTA__DFLT =
'h0;
222 // RWC: Signaled Target Abort 223 localparam PCI_Header__STS__STA__ADDR =
'h61;
224 localparam PCI_Header__STS__STA__MASK =
'h8000000;
225 localparam PCI_Header__STS__STA__DFLT =
'h0;
226 // RO: PCI DEVSEL Timing 227 localparam PCI_Header__STS__DEVT__ADDR =
'h61;
228 localparam PCI_Header__STS__DEVT__MASK =
'h6000000;
229 localparam PCI_Header__STS__DEVT__DFLT =
'h0;
230 // RWC: Master Data Parity Error Detected 231 localparam PCI_Header__STS__DPD__ADDR =
'h61;
232 localparam PCI_Header__STS__DPD__MASK =
'h1000000;
233 localparam PCI_Header__STS__DPD__DFLT =
'h0;
234 // RO: Fast Back-To-Back Capable 235 localparam PCI_Header__STS__FBC__ADDR =
'h61;
236 localparam PCI_Header__STS__FBC__MASK =
'h800000;
237 localparam PCI_Header__STS__FBC__DFLT =
'h0;
238 // RO: 66 MHz Capable 239 localparam PCI_Header__STS__C66__ADDR =
'h61;
240 localparam PCI_Header__STS__C66__MASK =
'h200000;
241 localparam PCI_Header__STS__C66__DFLT =
'h0;
242 // RO: Capabilities List (PCI power management mandatory) 243 localparam PCI_Header__STS__CL__ADDR =
'h61;
244 localparam PCI_Header__STS__CL__MASK =
'h100000;
245 localparam PCI_Header__STS__CL__DFLT =
'h100000;
246 // RO: Interrupt Status (1 - asserted) 247 localparam PCI_Header__STS__IS__ADDR =
'h61;
248 localparam PCI_Header__STS__IS__MASK =
'h80000;
249 localparam PCI_Header__STS__IS__DFLT =
'h0;
250 // RO: HBA Revision ID 251 localparam PCI_Header__RID__RID__ADDR =
'h62;
252 localparam PCI_Header__RID__RID__MASK =
'hff;
253 localparam PCI_Header__RID__RID__DFLT =
'h2;
254 // RO: Base Class Code: 1 - Mass Storage Device 255 localparam PCI_Header__CC__BCC__ADDR =
'h62;
256 localparam PCI_Header__CC__BCC__MASK =
'hff000000;
257 localparam PCI_Header__CC__BCC__DFLT =
'h1000000;
258 // RO: Sub Class Code: 0x06 - SATA Device 259 localparam PCI_Header__CC__SCC__ADDR =
'h62;
260 localparam PCI_Header__CC__SCC__MASK =
'hff0000;
261 localparam PCI_Header__CC__SCC__DFLT =
'h60000;
262 // RO: Programming Interface: 1 - AHCI HBA major rev 1 263 localparam PCI_Header__CC__PI__ADDR =
'h62;
264 localparam PCI_Header__CC__PI__MASK =
'hff0000;
265 localparam PCI_Header__CC__PI__DFLT =
'h10000;
266 // RW: Cache Line Size 267 localparam PCI_Header__CLS__CLS__ADDR =
'h63;
268 localparam PCI_Header__CLS__CLS__MASK =
'hff;
269 localparam PCI_Header__CLS__CLS__DFLT =
'h0;
270 // RW: Master Latency Timer 271 localparam PCI_Header__MLT__MLT__ADDR =
'h63;
272 localparam PCI_Header__MLT__MLT__MASK =
'hff00;
273 localparam PCI_Header__MLT__MLT__DFLT =
'h0;
274 // RO: Multi-Function Device 275 localparam PCI_Header__HTYPE__MFDT__ADDR =
'h63;
276 localparam PCI_Header__HTYPE__MFDT__MASK =
'h8000;
277 localparam PCI_Header__HTYPE__MFDT__DFLT =
'h0;
278 // RO: Header Layout 0 - HBA uses a target device layout 279 localparam PCI_Header__HTYPE__HL__ADDR =
'h63;
280 localparam PCI_Header__HTYPE__HL__MASK =
'h7f00;
281 localparam PCI_Header__HTYPE__HL__DFLT =
'h0;
282 // RO: AHCI Base Address high bits, normally RW, but here RO to get to MAXIGP1 space 283 localparam PCI_Header__ABAR__BA__ADDR =
'h69;
284 localparam PCI_Header__ABAR__BA__MASK =
'hfffffff0;
285 localparam PCI_Header__ABAR__BA__DFLT =
'h80000000;
286 // RO: Prefetchable (this is not) 287 localparam PCI_Header__ABAR__PF__ADDR =
'h69;
288 localparam PCI_Header__ABAR__PF__MASK =
'h8;
289 localparam PCI_Header__ABAR__PF__DFLT =
'h0;
290 // RO: Type (0 - any 32-bit address, here it is hard-mapped 291 localparam PCI_Header__ABAR__TP__ADDR =
'h69;
292 localparam PCI_Header__ABAR__TP__MASK =
'h6;
293 localparam PCI_Header__ABAR__TP__DFLT =
'h0;
294 // RO: Resource Type Indicator: 0 - memory address 295 localparam PCI_Header__ABAR__RTE__ADDR =
'h69;
296 localparam PCI_Header__ABAR__RTE__MASK =
'h1;
297 localparam PCI_Header__ABAR__RTE__DFLT =
'h0;
299 localparam PCI_Header__SS__SSID__ADDR =
'h6b;
300 localparam PCI_Header__SS__SSID__MASK =
'hffff0000;
301 localparam PCI_Header__SS__SSID__DFLT =
'h10000;
302 // RO: SubSystem Vendor ID 303 localparam PCI_Header__SS__SSVID__ADDR =
'h6b;
304 localparam PCI_Header__SS__SSVID__MASK =
'hffff;
305 localparam PCI_Header__SS__SSVID__DFLT =
'hfffe;
306 // RO: ROM Base Address 307 localparam PCI_Header__EROM__RBA__ADDR =
'h6c;
308 localparam PCI_Header__EROM__RBA__MASK =
'hffffffff;
309 localparam PCI_Header__EROM__RBA__DFLT =
'h0;
310 // RO: Capabilities pointer 311 localparam PCI_Header__CAP__CAP__ADDR =
'h6d;
312 localparam PCI_Header__CAP__CAP__MASK =
'hff;
313 localparam PCI_Header__CAP__CAP__DFLT =
'h40;
315 localparam PCI_Header__INTR__IPIN__ADDR =
'h6f;
316 localparam PCI_Header__INTR__IPIN__MASK =
'hff00;
317 localparam PCI_Header__INTR__IPIN__DFLT =
'h100;
318 // RW: Interrupt Line 319 localparam PCI_Header__INTR__ILINE__ADDR =
'h6f;
320 localparam PCI_Header__INTR__ILINE__MASK =
'hff;
321 localparam PCI_Header__INTR__ILINE__DFLT =
'h0;
323 localparam PCI_Header__MGNT__MGNT__ADDR =
'h6f;
324 localparam PCI_Header__MGNT__MGNT__MASK =
'hff0000;
325 localparam PCI_Header__MGNT__MGNT__DFLT =
'h0;
326 // RO: Maximal Latency 327 localparam PCI_Header__MLAT__MLAT__ADDR =
'h6f;
328 localparam PCI_Header__MLAT__MLAT__MASK =
'hff000000;
329 localparam PCI_Header__MLAT__MLAT__DFLT =
'h0;
330 // RO: Next Capability pointer 331 localparam PMCAP__PID__NEXT__ADDR =
'h70;
332 localparam PMCAP__PID__NEXT__MASK =
'hff00;
333 localparam PMCAP__PID__NEXT__DFLT =
'h0;
334 // RO: This is PCI Power Management Capability 335 localparam PMCAP__PID__CID__ADDR =
'h70;
336 localparam PMCAP__PID__CID__MASK =
'hff;
337 localparam PMCAP__PID__CID__DFLT =
'h1;
338 // RO: PME_SUPPORT bits:'b01000 339 localparam PMCAP__PC__PSUP__ADDR =
'h70;
340 localparam PMCAP__PC__PSUP__MASK =
'hf8000000;
341 localparam PMCAP__PC__PSUP__DFLT =
'h40000000;
342 // RO: D2 Support - no 343 localparam PMCAP__PC__D2S__ADDR =
'h70;
344 localparam PMCAP__PC__D2S__MASK =
'h4000000;
345 localparam PMCAP__PC__D2S__DFLT =
'h0;
346 // RO: D1 Support - no 347 localparam PMCAP__PC__D1S__ADDR =
'h70;
348 localparam PMCAP__PC__D1S__MASK =
'h2000000;
349 localparam PMCAP__PC__D1S__DFLT =
'h0;
350 // RO: Maximal D3cold current 351 localparam PMCAP__PC__AUXC__ADDR =
'h70;
352 localparam PMCAP__PC__AUXC__MASK =
'h1c00000;
353 localparam PMCAP__PC__AUXC__DFLT =
'h0;
354 // RO: Device-specific initialization required 355 localparam PMCAP__PC__DSI__ADDR =
'h70;
356 localparam PMCAP__PC__DSI__MASK =
'h200000;
357 localparam PMCAP__PC__DSI__DFLT =
'h0;
358 // RO: PCI clock required to generate PME 359 localparam PMCAP__PC__PMEC__ADDR =
'h70;
360 localparam PMCAP__PC__PMEC__MASK =
'h80000;
361 localparam PMCAP__PC__PMEC__DFLT =
'h0;
362 // RO: Revision of Power Management Specification support version 363 localparam PMCAP__PC__VS__ADDR =
'h70;
364 localparam PMCAP__PC__VS__MASK =
'h70000;
365 localparam PMCAP__PC__VS__DFLT =
'h0;
366 // RWC: PME Status, set by hardware when HBA generates PME 367 localparam PMCAP__PMCS__PMES__ADDR =
'h71;
368 localparam PMCAP__PMCS__PMES__MASK =
'h8000;
369 localparam PMCAP__PMCS__PMES__DFLT =
'h0;
371 localparam PMCAP__PMCS__PMEE__ADDR =
'h71;
372 localparam PMCAP__PMCS__PMEE__MASK =
'h100;
373 localparam PMCAP__PMCS__PMEE__DFLT =
'h0;
375 localparam PMCAP__PMCS__PS__ADDR =
'h71;
376 localparam PMCAP__PMCS__PS__MASK =
'h3;
377 localparam PMCAP__PMCS__PS__DFLT =
'h0;
378 // RO: Supports 64-bit Addressing - no 379 localparam GHC__CAP__S64A__ADDR =
'h0;
380 localparam GHC__CAP__S64A__MASK =
'h80000000;
381 localparam GHC__CAP__S64A__DFLT =
'h0;
382 // RO: Supports Native Command Queuing - no 383 localparam GHC__CAP__SNCQ__ADDR =
'h0;
384 localparam GHC__CAP__SNCQ__MASK =
'h40000000;
385 localparam GHC__CAP__SNCQ__DFLT =
'h0;
386 // RO: Supports SNotification Register - no 387 localparam GHC__CAP__SSNTF__ADDR =
'h0;
388 localparam GHC__CAP__SSNTF__MASK =
'h20000000;
389 localparam GHC__CAP__SSNTF__DFLT =
'h0;
390 // RO: Supports Mechanical Presence Switch - no 391 localparam GHC__CAP__SMPS__ADDR =
'h0;
392 localparam GHC__CAP__SMPS__MASK =
'h10000000;
393 localparam GHC__CAP__SMPS__DFLT =
'h0;
394 // RO: Supports Staggered Spin-up - no 395 localparam GHC__CAP__SSS__ADDR =
'h0;
396 localparam GHC__CAP__SSS__MASK =
'h8000000;
397 localparam GHC__CAP__SSS__DFLT =
'h0;
398 // RO: Supports Aggressive Link Power Management - no 399 localparam GHC__CAP__SALP__ADDR =
'h0;
400 localparam GHC__CAP__SALP__MASK =
'h4000000;
401 localparam GHC__CAP__SALP__DFLT =
'h0;
402 // RO: Supports Activity LED - no 403 localparam GHC__CAP__SAL__ADDR =
'h0;
404 localparam GHC__CAP__SAL__MASK =
'h2000000;
405 localparam GHC__CAP__SAL__DFLT =
'h0;
406 // RO: Supports Command List Override - no (not capable of clearing BSY and DRQ bits, needs soft reset 407 localparam GHC__CAP__SCLO__ADDR =
'h0;
408 localparam GHC__CAP__SCLO__MASK =
'h1000000;
409 localparam GHC__CAP__SCLO__DFLT =
'h0;
410 // RO: Interface Maximal speed: 2 - Gen2, 3 - Gen3 411 localparam GHC__CAP__ISS__ADDR =
'h0;
412 localparam GHC__CAP__ISS__MASK =
'hf00000;
413 localparam GHC__CAP__ISS__DFLT =
'h200000;
414 // RO: AHCI only (0 - legacy too) 415 localparam GHC__CAP__SAM__ADDR =
'h0;
416 localparam GHC__CAP__SAM__MASK =
'h40000;
417 localparam GHC__CAP__SAM__DFLT =
'h40000;
418 // RO: Supports Port Multiplier - no 419 localparam GHC__CAP__SPM__ADDR =
'h0;
420 localparam GHC__CAP__SPM__MASK =
'h20000;
421 localparam GHC__CAP__SPM__DFLT =
'h0;
422 // RO: Supports FIS-based switching of the Port Multiplier - no 423 localparam GHC__CAP__FBSS__ADDR =
'h0;
424 localparam GHC__CAP__FBSS__MASK =
'h10000;
425 localparam GHC__CAP__FBSS__DFLT =
'h0;
426 // RO: PIO Multiple DRQ block - no 427 localparam GHC__CAP__PMD__ADDR =
'h0;
428 localparam GHC__CAP__PMD__MASK =
'h8000;
429 localparam GHC__CAP__PMD__DFLT =
'h0;
430 // RO: Slumber State Capable - no 431 localparam GHC__CAP__SSC__ADDR =
'h0;
432 localparam GHC__CAP__SSC__MASK =
'h4000;
433 localparam GHC__CAP__SSC__DFLT =
'h0;
434 // RO: Partial State Capable - no 435 localparam GHC__CAP__PSC__ADDR =
'h0;
436 localparam GHC__CAP__PSC__MASK =
'h2000;
437 localparam GHC__CAP__PSC__DFLT =
'h0;
438 // RO: Number of Command Slots, 0-based (0 means 1?) 439 localparam GHC__CAP__NSC__ADDR =
'h0;
440 localparam GHC__CAP__NSC__MASK =
'h1f00;
441 localparam GHC__CAP__NSC__DFLT =
'h0;
442 // RO: Command Completion Coalescing - no 443 localparam GHC__CAP__CCCS__ADDR =
'h0;
444 localparam GHC__CAP__CCCS__MASK =
'h80;
445 localparam GHC__CAP__CCCS__DFLT =
'h0;
446 // RO: Enclosure Management - no 447 localparam GHC__CAP__EMS__ADDR =
'h0;
448 localparam GHC__CAP__EMS__MASK =
'h40;
449 localparam GHC__CAP__EMS__DFLT =
'h0;
450 // RO: External SATA connector - yes 451 localparam GHC__CAP__SXS__ADDR =
'h0;
452 localparam GHC__CAP__SXS__MASK =
'h20;
453 localparam GHC__CAP__SXS__DFLT =
'h20;
454 // RO: Number of Ports, 0-based (0 means 1?) 455 localparam GHC__CAP__NP__ADDR =
'h0;
456 localparam GHC__CAP__NP__MASK =
'h1f;
457 localparam GHC__CAP__NP__DFLT =
'h0;
458 // RO: AHCI enable (0 - legacy) 459 localparam GHC__GHC__AE__ADDR =
'h1;
460 localparam GHC__GHC__AE__MASK =
'h80000000;
461 localparam GHC__GHC__AE__DFLT =
'h80000000;
462 // RO: MSI Revert to Single Message 463 localparam GHC__GHC__MRSM__ADDR =
'h1;
464 localparam GHC__GHC__MRSM__MASK =
'h4;
465 localparam GHC__GHC__MRSM__DFLT =
'h0;
466 // RW: Interrupt Enable (all ports) 467 localparam GHC__GHC__IE__ADDR =
'h1;
468 localparam GHC__GHC__IE__MASK =
'h2;
469 localparam GHC__GHC__IE__DFLT =
'h0;
470 // RW1: HBA reset (COMINIT, ...). Set by software, cleared by hardware, section 10.4.3 471 localparam GHC__GHC__HR__ADDR =
'h1;
472 localparam GHC__GHC__HR__MASK =
'h1;
473 localparam GHC__GHC__HR__DFLT =
'h0;
474 // RWC: Interrupt Pending Status (per port) 475 localparam GHC__IS__IPS__ADDR =
'h2;
476 localparam GHC__IS__IPS__MASK =
'hffffffff;
477 localparam GHC__IS__IPS__DFLT =
'h0;
478 // RO: Ports Implemented 479 localparam GHC__PI__PI__ADDR =
'h3;
480 localparam GHC__PI__PI__MASK =
'hffffffff;
481 localparam GHC__PI__PI__DFLT =
'h1;
482 // RO: AHCI Major Version 1. 483 localparam GHC__VS__MJR__ADDR =
'h4;
484 localparam GHC__VS__MJR__MASK =
'hffff0000;
485 localparam GHC__VS__MJR__DFLT =
'h10000;
486 // RO: AHCI Minor Version 3.1 487 localparam GHC__VS__MNR__ADDR =
'h4;
488 localparam GHC__VS__MNR__MASK =
'hffff;
489 localparam GHC__VS__MNR__DFLT =
'h301;
490 // RO: DevSleep Entrance from Slumber Only 491 localparam GHC__CAP2__DESO__ADDR =
'h9;
492 localparam GHC__CAP2__DESO__MASK =
'h20;
493 localparam GHC__CAP2__DESO__DFLT =
'h0;
494 // RO: Supports Aggressive Device Sleep Management 495 localparam GHC__CAP2__SADM__ADDR =
'h9;
496 localparam GHC__CAP2__SADM__MASK =
'h10;
497 localparam GHC__CAP2__SADM__DFLT =
'h0;
498 // RO: Supports Device Sleep 499 localparam GHC__CAP2__SDS__ADDR =
'h9;
500 localparam GHC__CAP2__SDS__MASK =
'h8;
501 localparam GHC__CAP2__SDS__DFLT =
'h0;
502 // RO: Automatic Partial to Slumber Transitions 503 localparam GHC__CAP2__APST__ADDR =
'h9;
504 localparam GHC__CAP2__APST__MASK =
'h4;
505 localparam GHC__CAP2__APST__DFLT =
'h0;
506 // RO: NVMHCI Present (section 10.15) 507 localparam GHC__CAP2__NVMP__ADDR =
'h9;
508 localparam GHC__CAP2__NVMP__MASK =
'h2;
509 localparam GHC__CAP2__NVMP__DFLT =
'h0;
510 // RO: BIOS/OS Handoff - not supported 511 localparam GHC__CAP2__BOH__ADDR =
'h9;
512 localparam GHC__CAP2__BOH__MASK =
'h1;
513 localparam GHC__CAP2__BOH__DFLT =
'h0;
514 // RW: Command List Base Address (1KB aligned) 515 localparam HBA_PORT__PxCLB__CLB__ADDR =
'h40;
516 localparam HBA_PORT__PxCLB__CLB__MASK =
'hfffffc00;
517 localparam HBA_PORT__PxCLB__CLB__DFLT =
'h80000800;
518 // RW: Command List Base Address (1KB aligned) 519 localparam HBA_PORT__PxFB__CLB__ADDR =
'h42;
520 localparam HBA_PORT__PxFB__CLB__MASK =
'hffffff00;
521 localparam HBA_PORT__PxFB__CLB__DFLT =
'h80000c00;
522 // RWC: Cold Port Detect Status 523 localparam HBA_PORT__PxIS__CPDS__ADDR =
'h44;
524 localparam HBA_PORT__PxIS__CPDS__MASK =
'h80000000;
525 localparam HBA_PORT__PxIS__CPDS__DFLT =
'h0;
526 // RWC: Task File Error Status 527 localparam HBA_PORT__PxIS__TFES__ADDR =
'h44;
528 localparam HBA_PORT__PxIS__TFES__MASK =
'h40000000;
529 localparam HBA_PORT__PxIS__TFES__DFLT =
'h0;
530 // RWC: Host Bus (PCI) Fatal error 531 localparam HBA_PORT__PxIS__HBFS__ADDR =
'h44;
532 localparam HBA_PORT__PxIS__HBFS__MASK =
'h20000000;
533 localparam HBA_PORT__PxIS__HBFS__DFLT =
'h0;
534 // RWC: ECC error R/W system memory 535 localparam HBA_PORT__PxIS__HBDS__ADDR =
'h44;
536 localparam HBA_PORT__PxIS__HBDS__MASK =
'h10000000;
537 localparam HBA_PORT__PxIS__HBDS__DFLT =
'h0;
538 // RWC: Interface Fatal Error Status (sect. 6.1.2) 539 localparam HBA_PORT__PxIS__IFS__ADDR =
'h44;
540 localparam HBA_PORT__PxIS__IFS__MASK =
'h8000000;
541 localparam HBA_PORT__PxIS__IFS__DFLT =
'h0;
542 // RWC: Interface Non-Fatal Error Status (sect. 6.1.2) 543 localparam HBA_PORT__PxIS__INFS__ADDR =
'h44;
544 localparam HBA_PORT__PxIS__INFS__MASK =
'h4000000;
545 localparam HBA_PORT__PxIS__INFS__DFLT =
'h0;
546 // RWC: Overflow Status 547 localparam HBA_PORT__PxIS__OFS__ADDR =
'h44;
548 localparam HBA_PORT__PxIS__OFS__MASK =
'h1000000;
549 localparam HBA_PORT__PxIS__OFS__DFLT =
'h0;
550 // RWC: Incorrect Port Multiplier Status 551 localparam HBA_PORT__PxIS__IPMS__ADDR =
'h44;
552 localparam HBA_PORT__PxIS__IPMS__MASK =
'h800000;
553 localparam HBA_PORT__PxIS__IPMS__DFLT =
'h0;
554 // RO: PhyRdy changed Status 555 localparam HBA_PORT__PxIS__PRCS__ADDR =
'h44;
556 localparam HBA_PORT__PxIS__PRCS__MASK =
'h400000;
557 localparam HBA_PORT__PxIS__PRCS__DFLT =
'h0;
558 // RWC: Device Mechanical Presence Status 559 localparam HBA_PORT__PxIS__DMPS__ADDR =
'h44;
560 localparam HBA_PORT__PxIS__DMPS__MASK =
'h80;
561 localparam HBA_PORT__PxIS__DMPS__DFLT =
'h0;
562 // RO: Port Connect Change Status 563 localparam HBA_PORT__PxIS__PCS__ADDR =
'h44;
564 localparam HBA_PORT__PxIS__PCS__MASK =
'h40;
565 localparam HBA_PORT__PxIS__PCS__DFLT =
'h0;
566 // RWC: Descriptor Processed 567 localparam HBA_PORT__PxIS__DPS__ADDR =
'h44;
568 localparam HBA_PORT__PxIS__DPS__MASK =
'h20;
569 localparam HBA_PORT__PxIS__DPS__DFLT =
'h0;
571 localparam HBA_PORT__PxIS__UFS__ADDR =
'h44;
572 localparam HBA_PORT__PxIS__UFS__MASK =
'h10;
573 localparam HBA_PORT__PxIS__UFS__DFLT =
'h0;
574 // RWC: Set Device Bits Interrupt - Set Device bits FIS with 'I' bit set 575 localparam HBA_PORT__PxIS__SDBS__ADDR =
'h44;
576 localparam HBA_PORT__PxIS__SDBS__MASK =
'h8;
577 localparam HBA_PORT__PxIS__SDBS__DFLT =
'h0;
578 // RWC: DMA Setup FIS Interrupt - DMA Setup FIS received with 'I' bit set 579 localparam HBA_PORT__PxIS__DSS__ADDR =
'h44;
580 localparam HBA_PORT__PxIS__DSS__MASK =
'h4;
581 localparam HBA_PORT__PxIS__DSS__DFLT =
'h0;
582 // RWC: PIO Setup FIS Interrupt - PIO Setup FIS received with 'I' bit set 583 localparam HBA_PORT__PxIS__PSS__ADDR =
'h44;
584 localparam HBA_PORT__PxIS__PSS__MASK =
'h2;
585 localparam HBA_PORT__PxIS__PSS__DFLT =
'h0;
586 // RWC: D2H Register FIS Interrupt - D2H Register FIS received with 'I' bit set 587 localparam HBA_PORT__PxIS__DHRS__ADDR =
'h44;
588 localparam HBA_PORT__PxIS__DHRS__MASK =
'h1;
589 localparam HBA_PORT__PxIS__DHRS__DFLT =
'h0;
590 // RW: Cold Port Detect Enable 591 localparam HBA_PORT__PxIE__CPDE__ADDR =
'h45;
592 localparam HBA_PORT__PxIE__CPDE__MASK =
'h80000000;
593 localparam HBA_PORT__PxIE__CPDE__DFLT =
'h0;
594 // RW: Task File Error Enable 595 localparam HBA_PORT__PxIE__TFEE__ADDR =
'h45;
596 localparam HBA_PORT__PxIE__TFEE__MASK =
'h40000000;
597 localparam HBA_PORT__PxIE__TFEE__DFLT =
'h0;
598 // RW: Host Bus (PCI) Fatal Error Enable 599 localparam HBA_PORT__PxIE__HBFE__ADDR =
'h45;
600 localparam HBA_PORT__PxIE__HBFE__MASK =
'h20000000;
601 localparam HBA_PORT__PxIE__HBFE__DFLT =
'h0;
602 // RW: ECC Error R/W System Memory Enable 603 localparam HBA_PORT__PxIE__HBDE__ADDR =
'h45;
604 localparam HBA_PORT__PxIE__HBDE__MASK =
'h10000000;
605 localparam HBA_PORT__PxIE__HBDE__DFLT =
'h0;
606 // RW: Interface Fatal Error Enable (sect. 6.1.2) 607 localparam HBA_PORT__PxIE__IFE__ADDR =
'h45;
608 localparam HBA_PORT__PxIE__IFE__MASK =
'h8000000;
609 localparam HBA_PORT__PxIE__IFE__DFLT =
'h0;
610 // RW: Interface Non-Fatal Error Enable (sect. 6.1.2) 611 localparam HBA_PORT__PxIE__INFE__ADDR =
'h45;
612 localparam HBA_PORT__PxIE__INFE__MASK =
'h4000000;
613 localparam HBA_PORT__PxIE__INFE__DFLT =
'h0;
614 // RW: Overflow Enable 615 localparam HBA_PORT__PxIE__OFE__ADDR =
'h45;
616 localparam HBA_PORT__PxIE__OFE__MASK =
'h1000000;
617 localparam HBA_PORT__PxIE__OFE__DFLT =
'h0;
618 // RW: Incorrect Port Multiplier Enable 619 localparam HBA_PORT__PxIE__IPME__ADDR =
'h45;
620 localparam HBA_PORT__PxIE__IPME__MASK =
'h800000;
621 localparam HBA_PORT__PxIE__IPME__DFLT =
'h0;
622 // RW: PhyRdy changed Enable 623 localparam HBA_PORT__PxIE__PRCE__ADDR =
'h45;
624 localparam HBA_PORT__PxIE__PRCE__MASK =
'h400000;
625 localparam HBA_PORT__PxIE__PRCE__DFLT =
'h0;
626 // RO: Device Mechanical Presence Interrupt Enable 627 localparam HBA_PORT__PxIE__DMPE__ADDR =
'h45;
628 localparam HBA_PORT__PxIE__DMPE__MASK =
'h80;
629 localparam HBA_PORT__PxIE__DMPE__DFLT =
'h0;
630 // RW: Port Connect Change Interrupt Enable 631 localparam HBA_PORT__PxIE__PCE__ADDR =
'h45;
632 localparam HBA_PORT__PxIE__PCE__MASK =
'h40;
633 localparam HBA_PORT__PxIE__PCE__DFLT =
'h0;
634 // RW: Descriptor Processed Interrupt Enable 635 localparam HBA_PORT__PxIE__DPE__ADDR =
'h45;
636 localparam HBA_PORT__PxIE__DPE__MASK =
'h20;
637 localparam HBA_PORT__PxIE__DPE__DFLT =
'h0;
639 localparam HBA_PORT__PxIE__UFE__ADDR =
'h45;
640 localparam HBA_PORT__PxIE__UFE__MASK =
'h10;
641 localparam HBA_PORT__PxIE__UFE__DFLT =
'h0;
642 // RW: Device Bits Interrupt Enable 643 localparam HBA_PORT__PxIE__SDBE__ADDR =
'h45;
644 localparam HBA_PORT__PxIE__SDBE__MASK =
'h8;
645 localparam HBA_PORT__PxIE__SDBE__DFLT =
'h0;
646 // RW: DMA Setup FIS Interrupt Enable 647 localparam HBA_PORT__PxIE__DSE__ADDR =
'h45;
648 localparam HBA_PORT__PxIE__DSE__MASK =
'h4;
649 localparam HBA_PORT__PxIE__DSE__DFLT =
'h0;
650 // RW: PIO Setup FIS Interrupt Enable 651 localparam HBA_PORT__PxIE__PSE__ADDR =
'h45;
652 localparam HBA_PORT__PxIE__PSE__MASK =
'h2;
653 localparam HBA_PORT__PxIE__PSE__DFLT =
'h0;
654 // RW: D2H Register FIS Interrupt Enable 655 localparam HBA_PORT__PxIE__DHRE__ADDR =
'h45;
656 localparam HBA_PORT__PxIE__DHRE__MASK =
'h1;
657 localparam HBA_PORT__PxIE__DHRE__DFLT =
'h0;
658 // RW: Interface Communication Control 659 localparam HBA_PORT__PxCMD__ICC__ADDR =
'h46;
660 localparam HBA_PORT__PxCMD__ICC__MASK =
'hf0000000;
661 localparam HBA_PORT__PxCMD__ICC__DFLT =
'h0;
662 // RO: Aggressive Slumber/Partial - not implemented 663 localparam HBA_PORT__PxCMD__ASP__ADDR =
'h46;
664 localparam HBA_PORT__PxCMD__ASP__MASK =
'h8000000;
665 localparam HBA_PORT__PxCMD__ASP__DFLT =
'h0;
666 // RO: Aggressive Link Power Management Enable - not implemented 667 localparam HBA_PORT__PxCMD__ALPE__ADDR =
'h46;
668 localparam HBA_PORT__PxCMD__ALPE__MASK =
'h4000000;
669 localparam HBA_PORT__PxCMD__ALPE__DFLT =
'h0;
670 // RW: Drive LED on ATAPI enable 671 localparam HBA_PORT__PxCMD__DLAE__ADDR =
'h46;
672 localparam HBA_PORT__PxCMD__DLAE__MASK =
'h2000000;
673 localparam HBA_PORT__PxCMD__DLAE__DFLT =
'h0;
674 // RW: Device is ATAPI (for activity LED) 675 localparam HBA_PORT__PxCMD__ATAPI__ADDR =
'h46;
676 localparam HBA_PORT__PxCMD__ATAPI__MASK =
'h1000000;
677 localparam HBA_PORT__PxCMD__ATAPI__DFLT =
'h0;
678 // RW: Automatic Partial to Slumber Transitions Enabled 679 localparam HBA_PORT__PxCMD__APSTE__ADDR =
'h46;
680 localparam HBA_PORT__PxCMD__APSTE__MASK =
'h800000;
681 localparam HBA_PORT__PxCMD__APSTE__DFLT =
'h0;
682 // RO: FIS-Based Switching Capable Port - not implemented 683 localparam HBA_PORT__PxCMD__FBSCP__ADDR =
'h46;
684 localparam HBA_PORT__PxCMD__FBSCP__MASK =
'h400000;
685 localparam HBA_PORT__PxCMD__FBSCP__DFLT =
'h0;
686 // RO: External SATA port 687 localparam HBA_PORT__PxCMD__ESP__ADDR =
'h46;
688 localparam HBA_PORT__PxCMD__ESP__MASK =
'h200000;
689 localparam HBA_PORT__PxCMD__ESP__DFLT =
'h200000;
690 // RO: Cold Presence Detection 691 localparam HBA_PORT__PxCMD__CPD__ADDR =
'h46;
692 localparam HBA_PORT__PxCMD__CPD__MASK =
'h100000;
693 localparam HBA_PORT__PxCMD__CPD__DFLT =
'h0;
694 // RO: Mechanical Presence Switch Attached to Port 695 localparam HBA_PORT__PxCMD__MPSP__ADDR =
'h46;
696 localparam HBA_PORT__PxCMD__MPSP__MASK =
'h80000;
697 localparam HBA_PORT__PxCMD__MPSP__DFLT =
'h0;
698 // RO: Hot Plug Capable Port 699 localparam HBA_PORT__PxCMD__HPCP__ADDR =
'h46;
700 localparam HBA_PORT__PxCMD__HPCP__MASK =
'h40000;
701 localparam HBA_PORT__PxCMD__HPCP__DFLT =
'h40000;
702 // RW: Port Multiplier Attached - not implemented (software should write this bit) 703 localparam HBA_PORT__PxCMD__PMA__ADDR =
'h46;
704 localparam HBA_PORT__PxCMD__PMA__MASK =
'h20000;
705 localparam HBA_PORT__PxCMD__PMA__DFLT =
'h0;
706 // RO: Cold Presence State 707 localparam HBA_PORT__PxCMD__CPS__ADDR =
'h46;
708 localparam HBA_PORT__PxCMD__CPS__MASK =
'h10000;
709 localparam HBA_PORT__PxCMD__CPS__DFLT =
'h0;
710 // RO: Command List Running (section 5.3.2) 711 localparam HBA_PORT__PxCMD__CR__ADDR =
'h46;
712 localparam HBA_PORT__PxCMD__CR__MASK =
'h8000;
713 localparam HBA_PORT__PxCMD__CR__DFLT =
'h0;
714 // RO: FIS Receive Running (section 10.3.2) 715 localparam HBA_PORT__PxCMD__FR__ADDR =
'h46;
716 localparam HBA_PORT__PxCMD__FR__MASK =
'h4000;
717 localparam HBA_PORT__PxCMD__FR__DFLT =
'h0;
718 // RO: Mechanical Presence Switch State 719 localparam HBA_PORT__PxCMD__MPSS__ADDR =
'h46;
720 localparam HBA_PORT__PxCMD__MPSS__MASK =
'h2000;
721 localparam HBA_PORT__PxCMD__MPSS__DFLT =
'h0;
722 // RO: Current Command Slot (when PxCMD.ST 1-> ) should be reset to 0, when 0->1 - highest priority is 0 723 localparam HBA_PORT__PxCMD__CCS__ADDR =
'h46;
724 localparam HBA_PORT__PxCMD__CCS__MASK =
'h1f00;
725 localparam HBA_PORT__PxCMD__CCS__DFLT =
'h0;
726 // RW: FIS Receive Enable (enable after FIS memory is set) 727 localparam HBA_PORT__PxCMD__FRE__ADDR =
'h46;
728 localparam HBA_PORT__PxCMD__FRE__MASK =
'h10;
729 localparam HBA_PORT__PxCMD__FRE__DFLT =
'h0;
730 // RW1: Command List Override 731 localparam HBA_PORT__PxCMD__CLO__ADDR =
'h46;
732 localparam HBA_PORT__PxCMD__CLO__MASK =
'h8;
733 localparam HBA_PORT__PxCMD__CLO__DFLT =
'h0;
734 // RO: Power On Device (RW with Cold Presence Detection) 735 localparam HBA_PORT__PxCMD__POD__ADDR =
'h46;
736 localparam HBA_PORT__PxCMD__POD__MASK =
'h4;
737 localparam HBA_PORT__PxCMD__POD__DFLT =
'h4;
738 // RO: Spin-Up Device (RW with Staggered Spin-Up Support) 739 localparam HBA_PORT__PxCMD__SUD__ADDR =
'h46;
740 localparam HBA_PORT__PxCMD__SUD__MASK =
'h2;
741 localparam HBA_PORT__PxCMD__SUD__DFLT =
'h2;
742 // RW: Start (HBA may process commands). See section 10.3.1 743 localparam HBA_PORT__PxCMD__ST__ADDR =
'h46;
744 localparam HBA_PORT__PxCMD__ST__MASK =
'h1;
745 localparam HBA_PORT__PxCMD__ST__DFLT =
'h0;
746 // RO: Latest Copy of Task File Error Register 747 localparam HBA_PORT__PxTFD__ERR__ADDR =
'h48;
748 localparam HBA_PORT__PxTFD__ERR__MASK =
'hff00;
749 localparam HBA_PORT__PxTFD__ERR__DFLT =
'h0;
750 // RO: Latest Copy of Task File Status Register: BSY 751 localparam HBA_PORT__PxTFD__STS__BSY__ADDR =
'h48;
752 localparam HBA_PORT__PxTFD__STS__BSY__MASK =
'h80;
753 localparam HBA_PORT__PxTFD__STS__BSY__DFLT =
'h0;
754 // RO: Latest Copy of Task File Status Register: command-specific bits 4..6 755 localparam HBA_PORT__PxTFD__STS__64__ADDR =
'h48;
756 localparam HBA_PORT__PxTFD__STS__64__MASK =
'h70;
757 localparam HBA_PORT__PxTFD__STS__64__DFLT =
'h0;
758 // RO: Latest Copy of Task File Status Register: DRQ 759 localparam HBA_PORT__PxTFD__STS__DRQ__ADDR =
'h48;
760 localparam HBA_PORT__PxTFD__STS__DRQ__MASK =
'h8;
761 localparam HBA_PORT__PxTFD__STS__DRQ__DFLT =
'h0;
762 // RO: Latest Copy of Task File Status Register: command-specific bits 1..2 763 localparam HBA_PORT__PxTFD__STS__12__ADDR =
'h48;
764 localparam HBA_PORT__PxTFD__STS__12__MASK =
'h6;
765 localparam HBA_PORT__PxTFD__STS__12__DFLT =
'h0;
766 // RO: Latest Copy of Task File Status Register: ERR 767 localparam HBA_PORT__PxTFD__STS__ERR__ADDR =
'h48;
768 localparam HBA_PORT__PxTFD__STS__ERR__MASK =
'h1;
769 localparam HBA_PORT__PxTFD__STS__ERR__DFLT =
'h0;
770 // RO: Data in the first D2H Register FIS 771 localparam HBA_PORT__PxSIG__SIG__ADDR =
'h49;
772 localparam HBA_PORT__PxSIG__SIG__MASK =
'hffffffff;
773 localparam HBA_PORT__PxSIG__SIG__DFLT =
'hffffffff;
774 // RO: Interface Power Management 775 localparam HBA_PORT__PxSSTS__IPM__ADDR =
'h4a;
776 localparam HBA_PORT__PxSSTS__IPM__MASK =
'hf00;
777 localparam HBA_PORT__PxSSTS__IPM__DFLT =
'h0;
778 // RO: Interface Speed 779 localparam HBA_PORT__PxSSTS__SPD__ADDR =
'h4a;
780 localparam HBA_PORT__PxSSTS__SPD__MASK =
'hf0;
781 localparam HBA_PORT__PxSSTS__SPD__DFLT =
'h0;
782 // RO: Device Detection (should be detected if COMINIT is received) 783 localparam HBA_PORT__PxSSTS__DET__ADDR =
'h4a;
784 localparam HBA_PORT__PxSSTS__DET__MASK =
'hf;
785 localparam HBA_PORT__PxSSTS__DET__DFLT =
'h0;
786 // RO: Port Multiplier Port - not used by AHCI 787 localparam HBA_PORT__PxSCTL__PMP__ADDR =
'h4b;
788 localparam HBA_PORT__PxSCTL__PMP__MASK =
'hf0000;
789 localparam HBA_PORT__PxSCTL__PMP__DFLT =
'h0;
790 // RO: Select Power Management - not used by AHCI 791 localparam HBA_PORT__PxSCTL__SPM__ADDR =
'h4b;
792 localparam HBA_PORT__PxSCTL__SPM__MASK =
'hf000;
793 localparam HBA_PORT__PxSCTL__SPM__DFLT =
'h0;
794 // RW: Interface Power Management Transitions Allowed 795 localparam HBA_PORT__PxSCTL__IPM__ADDR =
'h4b;
796 localparam HBA_PORT__PxSCTL__IPM__MASK =
'hf00;
797 localparam HBA_PORT__PxSCTL__IPM__DFLT =
'h0;
798 // RW: Interface Highest Speed 799 localparam HBA_PORT__PxSCTL__SPD__ADDR =
'h4b;
800 localparam HBA_PORT__PxSCTL__SPD__MASK =
'hf0;
801 localparam HBA_PORT__PxSCTL__SPD__DFLT =
'h0;
802 // RW: Device Detection Initialization 803 localparam HBA_PORT__PxSCTL__DET__ADDR =
'h4b;
804 localparam HBA_PORT__PxSCTL__DET__MASK =
'hf;
805 localparam HBA_PORT__PxSCTL__DET__DFLT =
'h0;
806 // RWC: Exchanged (set on COMINIT), reflected in PxIS.PCS 807 localparam HBA_PORT__PxSERR__DIAG__X__ADDR =
'h4c;
808 localparam HBA_PORT__PxSERR__DIAG__X__MASK =
'h4000000;
809 localparam HBA_PORT__PxSERR__DIAG__X__DFLT =
'h0;
811 localparam HBA_PORT__PxSERR__DIAG__F__ADDR =
'h4c;
812 localparam HBA_PORT__PxSERR__DIAG__F__MASK =
'h2000000;
813 localparam HBA_PORT__PxSERR__DIAG__F__DFLT =
'h0;
814 // RWC: Transport state transition error 815 localparam HBA_PORT__PxSERR__DIAG__T__ADDR =
'h4c;
816 localparam HBA_PORT__PxSERR__DIAG__T__MASK =
'h1000000;
817 localparam HBA_PORT__PxSERR__DIAG__T__DFLT =
'h0;
818 // RWC: Link sequence error 819 localparam HBA_PORT__PxSERR__DIAG__S__ADDR =
'h4c;
820 localparam HBA_PORT__PxSERR__DIAG__S__MASK =
'h800000;
821 localparam HBA_PORT__PxSERR__DIAG__S__DFLT =
'h0;
822 // RWC: Handshake Error (i.e. Device got CRC error) 823 localparam HBA_PORT__PxSERR__DIAG__H__ADDR =
'h4c;
824 localparam HBA_PORT__PxSERR__DIAG__H__MASK =
'h400000;
825 localparam HBA_PORT__PxSERR__DIAG__H__DFLT =
'h0;
826 // RWC: CRC error in Link layer 827 localparam HBA_PORT__PxSERR__DIAG__C__ADDR =
'h4c;
828 localparam HBA_PORT__PxSERR__DIAG__C__MASK =
'h200000;
829 localparam HBA_PORT__PxSERR__DIAG__C__DFLT =
'h0;
830 // RWC: Disparity Error - not used by AHCI 831 localparam HBA_PORT__PxSERR__DIAG__D__ADDR =
'h4c;
832 localparam HBA_PORT__PxSERR__DIAG__D__MASK =
'h100000;
833 localparam HBA_PORT__PxSERR__DIAG__D__DFLT =
'h0;
834 // RWC: 10B to 8B decode error 835 localparam HBA_PORT__PxSERR__DIAG__B__ADDR =
'h4c;
836 localparam HBA_PORT__PxSERR__DIAG__B__MASK =
'h80000;
837 localparam HBA_PORT__PxSERR__DIAG__B__DFLT =
'h0;
838 // RWC: COMMWAKE signal was detected 839 localparam HBA_PORT__PxSERR__DIAG__W__ADDR =
'h4c;
840 localparam HBA_PORT__PxSERR__DIAG__W__MASK =
'h40000;
841 localparam HBA_PORT__PxSERR__DIAG__W__DFLT =
'h0;
842 // RWC: PHY Internal Error 843 localparam HBA_PORT__PxSERR__DIAG__I__ADDR =
'h4c;
844 localparam HBA_PORT__PxSERR__DIAG__I__MASK =
'h20000;
845 localparam HBA_PORT__PxSERR__DIAG__I__DFLT =
'h0;
846 // RWC: PhyRdy changed. Reflected in PxIS.PRCS bit. 847 localparam HBA_PORT__PxSERR__DIAG__N__ADDR =
'h4c;
848 localparam HBA_PORT__PxSERR__DIAG__N__MASK =
'h10000;
849 localparam HBA_PORT__PxSERR__DIAG__N__DFLT =
'h0;
850 // RWC: Internal Error 851 localparam HBA_PORT__PxSERR__ERR__E__ADDR =
'h4c;
852 localparam HBA_PORT__PxSERR__ERR__E__MASK =
'h800;
853 localparam HBA_PORT__PxSERR__ERR__E__DFLT =
'h0;
854 // RWC: Protocol Error - a violation of SATA protocol detected 855 localparam HBA_PORT__PxSERR__ERR__P__ADDR =
'h4c;
856 localparam HBA_PORT__PxSERR__ERR__P__MASK =
'h400;
857 localparam HBA_PORT__PxSERR__ERR__P__DFLT =
'h0;
858 // RWC: Persistent Communication or Data Integrity Error 859 localparam HBA_PORT__PxSERR__ERR__C__ADDR =
'h4c;
860 localparam HBA_PORT__PxSERR__ERR__C__MASK =
'h200;
861 localparam HBA_PORT__PxSERR__ERR__C__DFLT =
'h0;
862 // RWC: Transient Data Integrity Error (error not recovered by the interface) 863 localparam HBA_PORT__PxSERR__ERR__T__ADDR =
'h4c;
864 localparam HBA_PORT__PxSERR__ERR__T__MASK =
'h100;
865 localparam HBA_PORT__PxSERR__ERR__T__DFLT =
'h0;
866 // RWC: Communication between the device and host was lost but re-established 867 localparam HBA_PORT__PxSERR__ERR__M__ADDR =
'h4c;
868 localparam HBA_PORT__PxSERR__ERR__M__MASK =
'h2;
869 localparam HBA_PORT__PxSERR__ERR__M__DFLT =
'h0;
870 // RWC: Recovered Data integrity Error 871 localparam HBA_PORT__PxSERR__ERR__I__ADDR =
'h4c;
872 localparam HBA_PORT__PxSERR__ERR__I__MASK =
'h1;
873 localparam HBA_PORT__PxSERR__ERR__I__DFLT =
'h0;
874 // RW1: Device Status: bit per Port, for TAG in native queued command 875 localparam HBA_PORT__PxSACT__DS__ADDR =
'h4d;
876 localparam HBA_PORT__PxSACT__DS__MASK =
'hffffffff;
877 localparam HBA_PORT__PxSACT__DS__DFLT =
'h0;
878 // RW1: Command Issued: bit per Port, only set when PxCMD.ST==1, also cleared by PxCMD.ST: 1->0 by soft 879 localparam HBA_PORT__PxCI__CI__ADDR =
'h4e;
880 localparam HBA_PORT__PxCI__CI__MASK =
'hffffffff;
881 localparam HBA_PORT__PxCI__CI__DFLT =
'h0;
882 // RWC: PM Notify (bit per PM port) 883 localparam HBA_PORT__PxSNTF__PMN__ADDR =
'h4f;
884 localparam HBA_PORT__PxSNTF__PMN__MASK =
'hffff;
885 localparam HBA_PORT__PxSNTF__PMN__DFLT =
'h0;
886 // RO: Device with Error 887 localparam HBA_PORT__PxFBS__DWE__ADDR =
'h50;
888 localparam HBA_PORT__PxFBS__DWE__MASK =
'hf0000;
889 localparam HBA_PORT__PxFBS__DWE__DFLT =
'h0;
890 // RO: Active Device Optimization 891 localparam HBA_PORT__PxFBS__ADO__ADDR =
'h50;
892 localparam HBA_PORT__PxFBS__ADO__MASK =
'hf000;
893 localparam HBA_PORT__PxFBS__ADO__DFLT =
'h0;
894 // RW: Device To Issue 895 localparam HBA_PORT__PxFBS__DEV__ADDR =
'h50;
896 localparam HBA_PORT__PxFBS__DEV__MASK =
'hf00;
897 localparam HBA_PORT__PxFBS__DEV__DFLT =
'h0;
898 // RO: Single Device Error 899 localparam HBA_PORT__PxFBS__SDE__ADDR =
'h50;
900 localparam HBA_PORT__PxFBS__SDE__MASK =
'h4;
901 localparam HBA_PORT__PxFBS__SDE__DFLT =
'h0;
902 // RW1: Device Error Clear 903 localparam HBA_PORT__PxFBS__DEC__ADDR =
'h50;
904 localparam HBA_PORT__PxFBS__DEC__MASK =
'h2;
905 localparam HBA_PORT__PxFBS__DEC__DFLT =
'h0;
907 localparam HBA_PORT__PxFBS__EN__ADDR =
'h50;
908 localparam HBA_PORT__PxFBS__EN__MASK =
'h1;
909 localparam HBA_PORT__PxFBS__EN__DFLT =
'h0;
910 // RO: DITO Multiplier 911 localparam HBA_PORT__PxDEVSLP__DM__ADDR =
'h51;
912 localparam HBA_PORT__PxDEVSLP__DM__MASK =
'h1e000000;
913 localparam HBA_PORT__PxDEVSLP__DM__DFLT =
'h0;
914 // RW: Device Sleep Idle Timeout (section 8.5.1.1.1) 915 localparam HBA_PORT__PxDEVSLP__DITO__ADDR =
'h51;
916 localparam HBA_PORT__PxDEVSLP__DITO__MASK =
'h1ff8000;
917 localparam HBA_PORT__PxDEVSLP__DITO__DFLT =
'h0;
918 // RW: Minimum Device Sleep Assertion Time 919 localparam HBA_PORT__PxDEVSLP__MDAT__ADDR =
'h51;
920 localparam HBA_PORT__PxDEVSLP__MDAT__MASK =
'h7c00;
921 localparam HBA_PORT__PxDEVSLP__MDAT__DFLT =
'h0;
922 // RW: Device Sleep Exit Timeout 923 localparam HBA_PORT__PxDEVSLP__DETO__ADDR =
'h51;
924 localparam HBA_PORT__PxDEVSLP__DETO__MASK =
'h3fc;
925 localparam HBA_PORT__PxDEVSLP__DETO__DFLT =
'h0;
926 // RO: Device Sleep Present 927 localparam HBA_PORT__PxDEVSLP__DSP__ADDR =
'h51;
928 localparam HBA_PORT__PxDEVSLP__DSP__MASK =
'h2;
929 localparam HBA_PORT__PxDEVSLP__DSP__DFLT =
'h0;
930 // RO: Aggressive Device Sleep Enable 931 localparam HBA_PORT__PxDEVSLP__ADSE__ADDR =
'h51;
932 localparam HBA_PORT__PxDEVSLP__ADSE__MASK =
'h1;
933 localparam HBA_PORT__PxDEVSLP__ADSE__DFLT =
'h0;
934 // RW: SAXIHP write channel cache mode 935 localparam HBA_PORT__AFI_CACHE__WR_CM__ADDR =
'h5c;
936 localparam HBA_PORT__AFI_CACHE__WR_CM__MASK =
'hf0;
937 localparam HBA_PORT__AFI_CACHE__WR_CM__DFLT =
'h30;
938 // RW: SAXIHP read channel cache mode 939 localparam HBA_PORT__AFI_CACHE__RD_CM__ADDR =
'h5c;
940 localparam HBA_PORT__AFI_CACHE__RD_CM__MASK =
'hf;
941 localparam HBA_PORT__AFI_CACHE__RD_CM__DFLT =
'h3;
942 // RW: Address/not data for programming AHCI state machine 943 localparam HBA_PORT__PGM_AHCI_SM__AnD__ADDR =
'h5d;
944 localparam HBA_PORT__PGM_AHCI_SM__AnD__MASK =
'h1000000;
945 localparam HBA_PORT__PGM_AHCI_SM__AnD__DFLT =
'h0;
946 // RW: Program address/data for programming AHCI state machine 947 localparam HBA_PORT__PGM_AHCI_SM__PGM_AD__ADDR =
'h5d;
948 localparam HBA_PORT__PGM_AHCI_SM__PGM_AD__MASK =
'h3ffff;
949 localparam HBA_PORT__PGM_AHCI_SM__PGM_AD__DFLT =
'h0;
950 // RW: 3-bit tag to add to the recorded timestamp 951 localparam HBA_PORT__PunchTime__TAG__ADDR =
'h5e;
952 localparam HBA_PORT__PunchTime__TAG__MASK =
'h7;
953 localparam HBA_PORT__PunchTime__TAG__DFLT =
'h0;
957 // wire swr_GHC__IE = soft_write_en && (soft_write_addr == GHC__GHC__IE__ADDR); 963 // wire swr_HBA_PORT__PxSSTS = soft_write_en && (soft_write_addr == HBA_PORT__PxSSTS__SPD__ADDR); 970 reg rst_hba;
// @SuppressThisWarning VEditor : Unused, maybe will be used later 971 reg rst_port;
// @SuppressThisWarning VEditor : Unused, maybe will be used later 975 reg set_ghc_is_r;
// active next cycle after one of individual non-masked bits in PxIS is set 976 reg cleared_ghc;
// active next cycle after ghc[1:0] is cleared 977 reg [
31:
0]
PxIE_r;
// some bits will be unused by PxIS_MASK 978 reg [
31:
0]
PxIS_r;
// some bits will be unused by PxIS_MASK 980 reg [
31:
0]
PxSERR_r;
// Assuming it is not needed for HBA, just for the software 983 reg [
1:
0]
GHC_r;
// only 2 bits are used here 986 reg cirq_PRC;
// clear PRC bit when clearing PxSERR.DIAG.N 987 reg cirq_PC;
// clear PC bit when clearing PxSERR.DIAG.X 988 wire [
31:
0]
cirq ={
32{
cirq_PRC}} &
HBA_PORT__PxIS__PRCS__MASK |
// 'h400000; 989 {
32{
cirq_PC}} &
HBA_PORT__PxIS__PCS__MASK;
// 'h40;;}; 992 wire [
31:
0]
sirq = {
32{
sirq_TFE}} &
HBA_PORT__PxIS__TFES__MASK |
// 'h40000000; 993 {
32{
sirq_IF }} &
HBA_PORT__PxIS__IFS__MASK |
// 'h8000000; 994 {
32{
sirq_INF}} &
HBA_PORT__PxIS__INFS__MASK |
// 'h4000000; 995 {
32{
sirq_OF }} &
HBA_PORT__PxIS__OFS__MASK |
// 'h1000000; 996 {
32{
sirq_PRC}} &
HBA_PORT__PxIS__PRCS__MASK |
// 'h400000; 998 {
32{
sirq_DP}} &
HBA_PORT__PxIS__DPS__MASK |
// 'h20; 999 {
32{
sirq_UF }} &
HBA_PORT__PxIS__UFS__MASK |
// 'h10; 1000 {
32{
sirq_SDB}} &
HBA_PORT__PxIS__SDBS__MASK |
// 'h8; 1001 {
32{
sirq_DS }} &
HBA_PORT__PxIS__DSS__MASK |
// 'h4; 1002 {
32{
sirq_PS }} &
HBA_PORT__PxIS__PSS__MASK |
// 'h2; 1003 {
32{
sirq_DHR}} &
HBA_PORT__PxIS__DHRS__MASK;
// 'h1; 1004 // See if sirq_PC should also be enabled by unsolicited_en. Or not? 1006 {
32{
sirq_UF }} &
HBA_PORT__PxSERR__DIAG__F__MASK |
// 'h2000000; 1007 {
32{
serr_DT }} &
HBA_PORT__PxSERR__DIAG__T__MASK |
// 'h1000000; 1008 {
32{
serr_DS }} &
HBA_PORT__PxSERR__DIAG__S__MASK |
// 'h800000; 1009 {
32{
serr_DH }} &
HBA_PORT__PxSERR__DIAG__H__MASK |
// 'h400000; 1010 {
32{
serr_DC }} &
HBA_PORT__PxSERR__DIAG__C__MASK |
// 'h200000; 1011 {
32{
serr_DB }} &
HBA_PORT__PxSERR__DIAG__B__MASK |
// 'h80000; 1013 {
32{
serr_DI }} &
HBA_PORT__PxSERR__DIAG__I__MASK |
// 'h20000; 1014 {
32{
sirq_PRC}} &
HBA_PORT__PxSERR__DIAG__N__MASK |
// 'h10000; 1015 // {32{sirq_IF | sirq_INF }} & HBA_PORT__PxSERR__ERR__E__MASK | // 'h800; 1016 {
32{
serr_EE}} &
HBA_PORT__PxSERR__ERR__E__MASK |
// 'h800; 1017 {
32{
serr_EP }} &
HBA_PORT__PxSERR__ERR__P__MASK |
// 'h400; 1019 {
32{
serr_EC }} &
HBA_PORT__PxSERR__ERR__C__MASK |
// 'h200; 1020 {
32{
serr_ET }} &
HBA_PORT__PxSERR__ERR__T__MASK |
// 'h100; 1021 {
32{
serr_EM }} &
HBA_PORT__PxSERR__ERR__M__MASK |
// 'h2; 1022 {
32{
serr_EI }} &
HBA_PORT__PxSERR__ERR__I__MASK;
// 'h0; 1038 ((
PxCMD_r &
HBA_PORT__PxCMD__ICC__MASK) ==
32'h10000000) &&
1039 ((
PxSSTS_r &
HBA_PORT__PxSSTS__IPM__MASK) ==
12'h100) ;
1040 // PxSSTS_r[11:8] HBA_PORT__PxSSTS__IPM__MASK ; 1041 // to update only HBA/async changed bits (not by the software) 1056 // wire [5:0] regs_changed={pxcmd_changed, serr_changed, ssts_changed, pxci_changed, sirq_changed,ghc_is_changed }; 1059 // wire [5:0] update; 1094 // assign cirq_PRC = swr_HBA_PORT__PxSERR && |(soft_write_data & HBA_PORT__PxSERR__DIAG__N__MASK); 1095 // assign cirq_PC = swr_HBA_PORT__PxSERR && |(soft_write_data & HBA_PORT__PxSERR__DIAG__X__MASK); 1098 localparam PxIE_MASK =
HBA_PORT__PxIE__TFEE__MASK |
// 'h40000000; 1099 HBA_PORT__PxIE__IFE__MASK |
// 'h8000000; 1100 HBA_PORT__PxIE__INFE__MASK |
// 'h4000000; 1101 HBA_PORT__PxIE__OFE__MASK |
// 'h1000000; 1102 HBA_PORT__PxIE__PRCE__MASK |
// 'h400000; 1103 HBA_PORT__PxIE__PCE__MASK |
// 'h40; 1104 HBA_PORT__PxIE__DPE__MASK |
// 'h20 1105 HBA_PORT__PxIE__UFE__MASK |
// 'h10; 1106 HBA_PORT__PxIE__SDBE__MASK |
// 'h8; 1107 HBA_PORT__PxIE__DSE__MASK |
// 'h4; 1108 HBA_PORT__PxIE__PSE__MASK |
// 'h2; 1109 HBA_PORT__PxIE__DHRE__MASK;
// 'h1; 1111 localparam PxIS_MASK =
HBA_PORT__PxIS__TFES__MASK |
// 'h40000000; 1112 HBA_PORT__PxIS__IFS__MASK |
// 'h8000000; 1113 HBA_PORT__PxIS__INFS__MASK |
// 'h4000000; 1114 HBA_PORT__PxIS__OFS__MASK |
// 'h1000000; 1115 HBA_PORT__PxIS__PRCS__MASK |
// 'h400000; 1116 HBA_PORT__PxIS__PCS__MASK |
// 'h40; 1117 HBA_PORT__PxIS__DPS__MASK |
// 'h20 1118 HBA_PORT__PxIS__UFS__MASK |
// 'h10; 1119 HBA_PORT__PxIS__SDBS__MASK |
// 'h8; 1120 HBA_PORT__PxIS__DSS__MASK |
// 'h4; 1121 HBA_PORT__PxIS__PSS__MASK |
// 'h2; 1122 HBA_PORT__PxIS__DHRS__MASK;
// 'h1; 1124 localparam PxSERR_MASK =
HBA_PORT__PxSERR__DIAG__X__MASK |
// 'h4000000; 1125 HBA_PORT__PxSERR__DIAG__F__MASK |
// 'h2000000; 1126 HBA_PORT__PxSERR__DIAG__T__MASK |
// 'h1000000; 1127 HBA_PORT__PxSERR__DIAG__S__MASK |
// 'h800000; 1128 HBA_PORT__PxSERR__DIAG__H__MASK |
// 'h400000; 1129 HBA_PORT__PxSERR__DIAG__C__MASK |
// 'h200000; 1130 HBA_PORT__PxSERR__DIAG__B__MASK |
// 'h80000; 1131 HBA_PORT__PxSERR__DIAG__W__MASK |
// 'h40000; 1132 HBA_PORT__PxSERR__DIAG__I__MASK |
// 'h20000; 1133 HBA_PORT__PxSERR__DIAG__N__MASK |
// 'h10000; 1134 HBA_PORT__PxSERR__ERR__E__MASK |
// 'h800; 1135 HBA_PORT__PxSERR__ERR__P__MASK |
// 'h400; 1136 HBA_PORT__PxSERR__ERR__C__MASK |
// 'h200; 1137 HBA_PORT__PxSERR__ERR__T__MASK |
// 'h100; 1138 HBA_PORT__PxSERR__ERR__M__MASK |
// 'h2; 1139 HBA_PORT__PxSERR__ERR__I__MASK;
// 'h0; 1141 localparam PxCMD_DFLT =
HBA_PORT__PxCMD__ICC__DFLT |
// 'h0; 1142 HBA_PORT__PxCMD__ASP__DFLT |
// 'h0; 1143 HBA_PORT__PxCMD__ALPE__DFLT |
// 'h0; 1144 HBA_PORT__PxCMD__DLAE__DFLT |
// 'h0; 1145 HBA_PORT__PxCMD__ATAPI__DFLT |
// 'h0; 1146 HBA_PORT__PxCMD__APSTE__DFLT |
// 'h0; 1147 HBA_PORT__PxCMD__FBSCP__DFLT |
// 'h0; 1148 HBA_PORT__PxCMD__ESP__DFLT |
// 'h200000; 1149 HBA_PORT__PxCMD__CPD__DFLT |
// 'h0; 1150 HBA_PORT__PxCMD__MPSP__DFLT |
// 'h0; 1151 HBA_PORT__PxCMD__HPCP__DFLT |
// 'h40000; 1152 HBA_PORT__PxCMD__PMA__DFLT |
// 'h0; 1153 HBA_PORT__PxCMD__CPS__DFLT |
// 'h0; 1154 HBA_PORT__PxCMD__CR__DFLT |
// 'h0; 1155 HBA_PORT__PxCMD__FR__DFLT |
// 'h0; 1156 HBA_PORT__PxCMD__MPSS__DFLT |
// 'h0; 1157 HBA_PORT__PxCMD__CCS__DFLT |
// 'h0; 1158 HBA_PORT__PxCMD__FRE__DFLT |
// 'h0; 1159 HBA_PORT__PxCMD__CLO__DFLT |
// 'h0; 1160 HBA_PORT__PxCMD__POD__DFLT |
// 'h4; 1161 HBA_PORT__PxCMD__SUD__DFLT |
// 'h2; 1162 HBA_PORT__PxCMD__ST__DFLT;
// 'h0; 1164 localparam PxCMD_MASK =
HBA_PORT__PxCMD__ICC__MASK |
// 'hf0000000; 1165 // HBA_PORT__PxCMD__ASP__MASK | // 'h8000000; 1166 // HBA_PORT__PxCMD__ALPE__MASK | // 'h4000000; 1167 // HBA_PORT__PxCMD__DLAE__MASK | // 'h2000000; 1168 // HBA_PORT__PxCMD__ATAPI__MASK | // 'h1000000; 1169 // HBA_PORT__PxCMD__APSTE__MASK | // 'h800000; 1170 // HBA_PORT__PxCMD__FBSCP__MASK | // 'h400000; 1171 HBA_PORT__PxCMD__ESP__MASK |
// 'h200000; 1172 // HBA_PORT__PxCMD__CPD__MASK | // 'h100000; 1173 // HBA_PORT__PxCMD__MPSP__MASK | // 'h80000; 1174 // HBA_PORT__PxCMD__HPCP__MASK | // 'h40000; 1175 // HBA_PORT__PxCMD__PMA__MASK | // 'h20000; 1176 // HBA_PORT__PxCMD__CPS__MASK | // 'h10000; 1177 HBA_PORT__PxCMD__CR__MASK |
// 'h8000; 1178 HBA_PORT__PxCMD__FR__MASK |
// 'h4000; 1179 // HBA_PORT__PxCMD__MPSS__MASK | // 'h2000; 1180 // HBA_PORT__PxCMD__CCS__MASK | // 'h1f00; 1181 HBA_PORT__PxCMD__FRE__MASK |
// 'h10; 1182 HBA_PORT__PxCMD__CLO__MASK |
// 'h8; 1183 // HBA_PORT__PxCMD__POD__MASK | // 'h4; 1184 // HBA_PORT__PxCMD__SUD__MASK | // 'h2; 1185 HBA_PORT__PxCMD__ST__MASK;
// 'h1; 1191 assign pcmd_clo =
PxCMD_r[
3];
// causes ahci_fis_receive:clear_bsy_drq, that in turn resets this bit 1194 always @(
posedge mclk)
begin 1196 else if (((
PxSSTS_r &
HBA_PORT__PxSSTS__DET__MASK) ==
3) ||
1201 always @(
posedge mclk)
begin 1205 always @(
posedge mclk)
begin // Here we do not have data written by soft, only the result (cleared). If bit is 0, it is 1206 // either cleared, or was 0. If it was 0, then IS bit was also 0, so clearing will not hurt. 1211 always @(
posedge mclk)
begin 1213 // else irq <= ghc_ie_r && ghc_is_r; 1218 // generate reset types 1219 always @ (
posedge mclk)
begin 1227 // GHC_IE register (just one bit) 1228 // always @(posedge mclk) begin 1229 // if (rst_por) ghc_ie_r <= 0; 1230 // else if (swr_GHC__IE) ghc_ie_r <= |(soft_write_data & GHC__GHC__IE__MASK); 1233 // swr_GHC__IS register (just one bit) 1234 always @(
posedge mclk)
begin 1240 // HBA_PORT__PxIE register 1241 always @(
posedge mclk)
begin 1245 // HBA_PORT__PxIS register 1246 always @(
posedge mclk)
begin 1251 // HBA_PORT__PxIE register 1252 always @(
posedge mclk)
begin 1254 // TODO: Not exactly clear - when ghc_is_r should be set after being RWC? After setting some not masked new individual interrupt? 1258 // GHC__GHC register 1259 always @(
posedge mclk)
begin 1268 // HBA_PORT__PxSSTS register - updated from the HOST only 1269 always @(
posedge mclk)
begin 1280 // HBA_PORT__PxSCTL register - updated by the software only 1281 always @ (
posedge mclk)
begin 1289 // HBA_PORT__PxSERR register 1290 always @(
posedge mclk)
begin 1295 // HBA_PORT__PxCI[0] register - cleared by HBA, set by software 1296 always @(
posedge mclk)
begin 1301 // HBA_PORT__PxCMD register - different behaviors of differtnt fields 1302 // use PxCMD_MASK to prevent generation of unneeded register bits 1304 always @(
posedge mclk)
begin 1308 (
pcmd_esp ?
HBA_PORT__PxCMD__ESP__MASK :
0) |
1310 (
pcmd_fr?
HBA_PORT__PxCMD__FR__MASK :
0 ) |
1311 (
HBA_PORT__PxCMD__FRE__MASK &
PxCMD_r) |
// no HBA control 1319 // else if (swr_HBA_PORT__PxCMD) pcmd_st_cleared <= |(HBA_PORT__PxCMD__ST__MASK & PxCMD_r & ~soft_write_data); 1325 // Update AXI registers with the current local data 1326 always @ (
posedge mclk)
begin 1334 //update_HBA_PORT__PxCI 1377 // updating registers if needed, 0 to 6 cycles, in priority sequence 1382 // detect software setting for PxCMD.ST 0->1 and 1->0 1384 if (mrst) st01_pending <= 0; 1385 else if (swr_HBA_PORT__PxCMD && (HBA_PORT__PxCMD__ST__MASK & soft_write_data & ~PxCMD_r)) st01_pending <= 1; 1386 if (st_pending_reset) st01_pending <= 0; 1388 if (mrst) st10_pending <= 0; 1389 else if (swr_HBA_PORT__PxCMD && (HBA_PORT__PxCMD__ST__MASK & ~soft_write_data & PxCMD_r)) st10_pending <= 1; 1390 if (st_pending_reset) st10_pending <= 0; 12761swr_HBA_PORT__PxISwire
12812update_HBA_PORT__PxCIwire
12816PxIE_MASKHBA_PORT__PxIE__TFEE__MASK | HBA_PORT__PxIE__IFE__MASK | HBA_PORT__PxIE__INFE__MASK | HBA_PORT__PxIE__OFE__MASK | HBA_PORT__PxIE__PRCE__MASK | HBA_PORT__PxIE__PCE__MASK | HBA_PORT__PxIE__DPE__MASK | HBA_PORT__PxIE__UFE__MASK | HBA_PORT__PxIE__SDBE__MASK | HBA_PORT__PxIE__DSE__MASK | HBA_PORT__PxIE__PSE__MASK | HBA_PORT__PxIE__DHRE__MASK
12817PxIS_MASKHBA_PORT__PxIS__TFES__MASK | HBA_PORT__PxIS__IFS__MASK | HBA_PORT__PxIS__INFS__MASK | HBA_PORT__PxIS__OFS__MASK | HBA_PORT__PxIS__PRCS__MASK | HBA_PORT__PxIS__PCS__MASK | HBA_PORT__PxIS__DPS__MASK | HBA_PORT__PxIS__UFS__MASK | HBA_PORT__PxIS__SDBS__MASK | HBA_PORT__PxIS__DSS__MASK | HBA_PORT__PxIS__PSS__MASK | HBA_PORT__PxIS__DHRS__MASK
[ADDRESS_BITS-1:0] 12681soft_write_addr
12810update_HBA_PORT__PxSERRwire
12760swr_HBA_PORT__PxCMDwire
12806update_nextwire[6:1]
[31:0] 12682soft_write_data
12803regs_changedwire[6:0]
12820PxCMD_MASKHBA_PORT__PxCMD__ICC__MASK | HBA_PORT__PxCMD__ESP__MASK | HBA_PORT__PxCMD__CR__MASK | HBA_PORT__PxCMD__FR__MASK | HBA_PORT__PxCMD__FRE__MASK | HBA_PORT__PxCMD__CLO__MASK | HBA_PORT__PxCMD__ST__MASK
12819PxCMD_DFLTHBA_PORT__PxCMD__ICC__DFLT | HBA_PORT__PxCMD__ASP__DFLT | HBA_PORT__PxCMD__ALPE__DFLT | HBA_PORT__PxCMD__DLAE__DFLT | HBA_PORT__PxCMD__ATAPI__DFLT | HBA_PORT__PxCMD__APSTE__DFLT | HBA_PORT__PxCMD__FBSCP__DFLT | HBA_PORT__PxCMD__ESP__DFLT | HBA_PORT__PxCMD__CPD__DFLT | HBA_PORT__PxCMD__MPSP__DFLT | HBA_PORT__PxCMD__HPCP__DFLT | HBA_PORT__PxCMD__PMA__DFLT | HBA_PORT__PxCMD__CPS__DFLT | HBA_PORT__PxCMD__CR__DFLT | HBA_PORT__PxCMD__FR__DFLT | HBA_PORT__PxCMD__MPSS__DFLT | HBA_PORT__PxCMD__CCS__DFLT | HBA_PORT__PxCMD__FRE__DFLT | HBA_PORT__PxCMD__CLO__DFLT | HBA_PORT__PxCMD__POD__DFLT | HBA_PORT__PxCMD__SUD__DFLT | HBA_PORT__PxCMD__ST__DFLT
12811update_HBA_PORT__PxCMDwire
12808update_HBA_PORT__PxISwire
12805update_firstwire[6:0]
reg 12752sctl_det_changed
12763swr_HBA_PORT__PxSCTLwire
12809update_HBA_PORT__PxSSTSwire
reg [ADDRESS_BITS-1:0] 12684regs_addr
12765swr_HBA_PORT__PxCIwire
12762swr_HBA_PORT__PxIEwire
12764swr_HBA_PORT__PxSERRwire
12818PxSERR_MASKHBA_PORT__PxSERR__DIAG__X__MASK | HBA_PORT__PxSERR__DIAG__F__MASK | HBA_PORT__PxSERR__DIAG__T__MASK | HBA_PORT__PxSERR__DIAG__S__MASK | HBA_PORT__PxSERR__DIAG__H__MASK | HBA_PORT__PxSERR__DIAG__C__MASK | HBA_PORT__PxSERR__DIAG__B__MASK | HBA_PORT__PxSERR__DIAG__W__MASK | HBA_PORT__PxSERR__DIAG__I__MASK | HBA_PORT__PxSERR__DIAG__N__MASK | HBA_PORT__PxSERR__ERR__E__MASK | HBA_PORT__PxSERR__ERR__P__MASK | HBA_PORT__PxSERR__ERR__C__MASK | HBA_PORT__PxSERR__ERR__T__MASK | HBA_PORT__PxSERR__ERR__M__MASK | HBA_PORT__PxSERR__ERR__I__MASK