Skip to content

Commit

Permalink
Update the sdfec parameters
Browse files Browse the repository at this point in the history
Add the compatible string based on the ip version and also
remove the paramter sdfec-op-mode.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
  • Loading branch information
Venkatesh Yadav Abbarapu committed May 11, 2018
1 parent 2d1b375 commit cdc5afc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions sdfec/data/sdfec.mdd
Expand Up @@ -20,6 +20,7 @@ BEGIN driver sdfec
OPTION supported_os_types = (DTS);
OPTION driver_state = ACTIVE;
OPTION NAME = sdfec;
PARAMETER name = dev_type, default = "sd-fec", type = string;
DTGPARAM name = compatible, type = stringlist, default = "xlnx,fec-engine";

END driver
19 changes: 12 additions & 7 deletions sdfec/data/sdfec.tcl
Expand Up @@ -20,21 +20,16 @@ proc generate {drv_handle} {
break
}
}
set compatible [get_ipdetails $drv_handle]
set_drv_prop $drv_handle compatible "$compatible" stringlist
set ldpc_decode [get_property CONFIG.LDPC_Decode [get_cells -hier $drv_handle]]
set ldpc_encode [get_property CONFIG.LDPC_Encode [get_cells -hier $drv_handle]]
set turbo_decode [get_property CONFIG.Turbo_Decode [get_cells -hier $drv_handle]]
if {[string match -nocase $turbo_decode "true"]} {
set sdfec_code "turbo"
set sdfec_op_mode "decode"
} else {
set sdfec_code "ldpc"
if {[string match -nocase $ldpc_encode "true"]} {
set sdfec_op_mode "encode"
} else {
set sdfec_op_mode "decode"
}
}
set_drv_property $drv_handle xlnx,sdfec-op-mode $sdfec_op_mode string
set_drv_property $drv_handle xlnx,sdfec-code $sdfec_code string
set sdfec_dout_words [get_property CONFIG.C_S_DOUT_WORDS_MODE [get_cells -hier $drv_handle]]
set sdfec_dout_width [get_property CONFIG.DOUT_Lanes [get_cells -hier $drv_handle]]
Expand All @@ -45,3 +40,13 @@ proc generate {drv_handle} {
set_drv_property $drv_handle xlnx,sdfec-din-words $sdfec_din_words int
set_drv_property $drv_handle xlnx,sdfec-din-width $sdfec_din_width int
}

proc get_ipdetails {drv_handle} {
set slave [get_cells -hier ${drv_handle}]
set vlnv [split [get_property VLNV $slave] ":"]
set name [lindex $vlnv 2]
set ver [lindex $vlnv 3]
set comp_prop "xlnx,${name}-${ver}"
regsub -all {_} $comp_prop {-} comp_prop
return $comp_prop
}

0 comments on commit cdc5afc

Please sign in to comment.