Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x393_sata
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
x393_sata
Commits
927f8201
Commit
927f8201
authored
Jan 16, 2016
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
continue on sequencer code
parent
82906512
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
4 deletions
+43
-4
ahci_ctrl_stat.v
ahci/ahci_ctrl_stat.v
+4
-2
ahci_fsm.v
ahci/ahci_fsm.v
+1
-0
ahci_top.v
ahci/ahci_top.v
+4
-0
ahci_fsm_sequence.py
helpers/ahci_fsm_sequence.py
+34
-2
No files found.
ahci/ahci_ctrl_stat.v
View file @
927f8201
...
...
@@ -124,7 +124,9 @@ module ahci_ctrl_stat #(
input
ssts_det_ndnp
,
// no device detected, phy communication not established
input
ssts_det_dnp
,
// device detected, but phy communication not established
input
ssts_det_dp
,
// device detected, phy communication established
input
ssts_det_offline
,
// device detected, phy communication established
input
ssts_det_offline
,
// device offline
output
[
3
:
0
]
ssts_det
,
// current value of PxSSTS.DET
// SCR2:SControl (written by software only)
output
reg
[
3
:
0
]
sctl_ipm
,
// Interface power management transitions allowed
output
reg
[
3
:
0
]
sctl_spd
,
// Interface maximal speed
...
...
@@ -254,7 +256,7 @@ module ahci_ctrl_stat #(
assign
update_pending
=
|
regs_changed
;
assign
pcmd_fre
=
|
(
HBA_PORT__PxCMD__FRE__MASK
&
PxCMD_r
)
;
assign
serr_diag_X
=
|
(
HBA_PORT__PxSERR__DIAG__X__MASK
&
PxSERR_r
)
;
assign
ssts_det
=
PxSSTS_r
[
3
:
0
]
;
localparam
PxIE_MASK
=
HBA_PORT__PxIE__TFEE__MASK
|
// 'h40000000;
HBA_PORT__PxIE__IFE__MASK
|
// 'h8000000;
...
...
ahci/ahci_fsm.v
View file @
927f8201
...
...
@@ -132,6 +132,7 @@ module ahci_fsm
output
ssts_det_dnp
,
// device detected, but phy communication not established
output
ssts_det_dp
,
// device detected, phy communication established
output
ssts_det_offline
,
// device detected, phy communication established
input
[
3
:
0
]
ssts_det
,
// current value of PxSSTS.DET
// SCR2:SControl (written by software only)
input
[
3
:
0
]
sctl_ipm
,
// Interface power management transitions allowed
...
...
ahci/ahci_top.v
View file @
927f8201
...
...
@@ -387,6 +387,8 @@ module ahci_top#(
wire
ssts_det_dnp
;
// device detected, but phy communication not established
wire
ssts_det_dp
;
// device detected, phy communication established
wire
ssts_det_offline
;
// device detected, phy communication established
wire
[
3
:
0
]
ssts_det
;
// current value of PxSSTS.DET
// SCR2:SControl (written by software only)
wire
[
3
:
0
]
sctl_ipm
;
// Interface power management transitions allowed
wire
[
3
:
0
]
sctl_spd
;
// Interface maximal speed
...
...
@@ -484,6 +486,7 @@ module ahci_top#(
.
ssts_det_dnp
(
ssts_det_dnp
)
,
// output
.
ssts_det_dp
(
ssts_det_dp
)
,
// output
.
ssts_det_offline
(
ssts_det_offline
)
,
// output
.
ssts_det
(
ssts_det
)
,
// input[3:0]
.
sctl_ipm
(
sctl_ipm
)
,
// input[3:0]
.
sctl_spd
(
sctl_spd
)
,
// input[3:0]
.
sctl_det
(
sctl_det
)
,
// input[3:0]
...
...
@@ -699,6 +702,7 @@ module ahci_top#(
.
ssts_det_dnp
(
ssts_det_dnp
)
,
// input
.
ssts_det_dp
(
ssts_det_dp
)
,
// input
.
ssts_det_offline
(
ssts_det_offline
)
,
// input
.
ssts_det
(
ssts_det
)
,
// output[3:0]
.
sctl_ipm
(
sctl_ipm
)
,
// output[3:0] reg
.
sctl_spd
(
sctl_spd
)
,
// output[3:0] reg
.
sctl_det
(
sctl_det
)
,
// output[3:0] reg
...
...
helpers/ahci_fsm_sequence.py
View file @
927f8201
...
...
@@ -97,12 +97,44 @@ sequence = [{LBL:'POR', ADR: 0x0, ACT: NOP},
{
ACT
:
'XFER_CNTR_CLEAR'
},
# clear_xfer_cntr
{
LBL
:
'P:Idle'
,
ACT
:
'PCMD_CR_SET'
},
# pcmd_cr_set
{
IF
:
'PXSSTS_DET_NE_3'
,
GOTO
:
'P:NotRunning'
},
# 1. ssts_det!=3, // device detected, phy communication not established
{
IF
:
'PXCI0_NOT_CMDTOISSUE'
,
GOTO
:
'P:FetchCmd'
},
# 2. pxci0 && !pCmdToIssue was pIssueSlot==32, -> p:SelectCmd
{
IF
:
'PCTI_CTBAR_XCZ'
,
GOTO
:
'CFIS:SyncEscape'
},
# 3. pCmdToIssue && ch_r && xfer_cntr_zero
{
IF
:
'FIS_DATA'
,
GOTO
:
'DR:Entry'
},
# 4. fis_first_vld && (fis_type == 'h46)
{
IF
:
'FIS'
,
GOTO
:
'NDR:Entry'
},
# 5. fis_first_vld # already assumed && ((fis_type != 'h46)
{
IF
:
'PCTI_XCZ'
,
GOTO
:
'CFIS:Xmit'
},
# 6. pCmdToIssue && xfer_cntr_zero
{
GOTO
:
'P:Idle'
},
#10. (#7-#9 PM, not implemented)
#P:SelectCmd not implemented, using single slot
{
LBL
:
'P:FetchCmd'
,
ACT
:
'FETCH_CMD'
},
# fetch_cmd (other actions included in ahci_fis_transmit)
{
IF
:
'CTBAA_CTBAP'
,
ACT
:
'CFIS:PrefetchACMD'
},
#1. ch_a && ch_p # Note ch_p may be ignored or transition may be ignored
{
IF
:
'CTBAP'
,
ACT
:
'CFIS:PrefetchPRD'
},
#2. ch_p # Note ch_p may be ignored or transition may be ignored
# PxTFD.STS.BSY must be set before issuing a command (or now if predicted)
{
LBL
:
'P:StartComm'
,
ACT
:
'SET_STS_7F'
},
# frcv_set_sts_7f
{
ACT
:
'SET_UPDATE_SIG'
},
# #frcv_set_update_sig
{
ACT
:
'XMIT_COMRESET'
},
# Now does it on reset. See if it is possible to transmit COMRESET w/o reset
{
IF
:
'PXSSTS_DET_EQ_1'
,
GOTO
:
'P:StartComm'
},
{
GOTO
:
'P:NotRunning'
},
#P:PowerOn, P;PwerOff,P:PhyListening - not implemented
#FB:* - Not implemented
#PM:* - Not implemented
{
LBL
:
'NDR:Entry'
,
ACT
:
'NOP'
},
{
IF
:
'FIS_ERR'
,
GOTO
:
'ERR:Non-fatal'
},
# 1. fis_ok
{
IF
:
'FIS_FERR'
,
GOTO
:
'ERR:Fatal'
},
# 2. fis_ferr
{
GOTO
:
'NDR:Accept'
},
# 3.
]
"""
input fis_ok, // FIS done, checksum OK reset by starting a new get FIS
input fis_err, // FIS done, checksum ERROR reset by starting a new get FIS
input fis_ferr, // FIS done, fatal error - FIS too long
input fetch_cmd, // Enter p:FetchCmd, fetch command header (from the register memory, prefetch command FIS)
// wait for either fetch_cmd_busy == 0 or pCmdToIssue ==1 after fetch_cmd
input fis_first_vld, // fis_first contains valid FIS header, reset by 'get_*'
input [7:0] fis_type, // FIS type (low byte in the first FIS DWORD), valid with 'fis_first_vld'
pcmd_cr_set, // command list run set
clear_xfer_cntr
pcmd_cr_reset
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment