emacps: Export proper values to xparameters.h file when PCS/PMA core is configured with 1000BASE-X

This patch fixes the issue exporting proper
values to the xparameters.h file when the PCS/PMA core is configured
in 1000BASE-X mode.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
This commit is contained in:
Kedareswara rao Appana 2014-10-29 15:58:14 +05:30 committed by Suneel Garapati
parent e562b6a397
commit c338c3c054
2 changed files with 29 additions and 9 deletions

View file

@ -42,6 +42,9 @@
# should export to the xparameters.h file.
# 2.1 bss 09/08/14 Fixed CR#820349 to export phy address in xparameters.h
# when GMII to RGMII converter is present in hw.
# 2.2 adk 29/10/14 Fixed CR#827686 when PCS/PMA core is configured with
# 1000BASE-X mode export proper values to the xparameters.h
# file.
#
##############################################################################
@ -138,16 +141,27 @@ proc generate_sgmii_params {drv_handle file_name} {
foreach ip $ips {
set ipname [get_property NAME $ip]
set periph [get_property IP_NAME $ip]
if { [string compare -nocase $periph "ps7_ethernet"] == 0} {
if { [string compare -nocase $periph "gig_ethernet_pcs_pma"] == 0} {
set PhyStandard [get_property CONFIG.Standard $ip]
}
if { [string compare -nocase $ipname "ps7_ethernet_0"] == 0} {
set phya [is_gige_pcs_pma_ip_present $ip]
if { $phya == 0} {
close $file_handle
return 0
}
puts $file_handle "/* Definitions related to PCS PMA PL IP*/"
puts $file_handle "\#define XPAR_GIGE_PCS_PMA_CORE_PRESENT 1"
puts $file_handle "\#define XPAR_PCSPMA_SGMII_PHYADDR $phya"
puts $file_handle "\n/******************************************************************/\n"
if { $PhyStandard == "1000BASEX" } {
puts $file_handle "/* Definitions related to PCS PMA PL IP*/"
puts $file_handle "\#define XPAR_GIGE_PCS_PMA_1000BASEX_CORE_PRESENT 1"
puts $file_handle "\#define XPAR_PCSPMA_1000BASEX_PHYADDR $phya"
puts $file_handle "\n/******************************************************************/\n"
} else {
puts $file_handle "/* Definitions related to PCS PMA PL IP*/"
puts $file_handle "\#define XPAR_GIGE_PCS_PMA_SGMII_CORE_PRESENT 1"
puts $file_handle "\#define XPAR_PCSPMA_SGMII_PHYADDR $phya"
puts $file_handle "\n/******************************************************************/\n"
}
}
}
close $file_handle
@ -159,25 +173,27 @@ proc is_gige_pcs_pma_ip_present {slave} {
set ipconv 0
set ips [get_cells "*"]
set enetipinstance_name [get_property NAME $slave]
set enetipinstance_name [get_property IP_NAME $slave]
foreach ip $ips {
set convipname [get_property NAME $ip]
set periph [get_property IP_NAME $ip]
if { [string compare -nocase $periph "gig_ethernet_pcs_pma"] == 0} {
set sgmii_param [get_property CONFIG.c_is_sgmii $ip]
if {$sgmii_param == true} {
set PhyStandarrd [get_property CONFIG.Standard $ip]
if {$sgmii_param == true || $PhyStandarrd == "1000BASEX"} {
set ipconv $ip
}
break
}
}
if { $ipconv != 0 } {
set port_value [get_pins -of_objects [get_nets -of_objects [get_pins -of_objects $ipconv gmii_txd]]]
if { $port_value != 0 } {
set tmp [string first "ENET0" $port_value]
if { $tmp >= 0 } {
if { [string compare -nocase $enetipinstance_name "ps7_ethernet_0"] == 0} {
if { [string compare -nocase $enetipinstance_name "ps7_ethernet"] == 0} {
set phyaddr [::hsm::utils::get_param_value $ipconv C_PHYADDR]
set phy_addr [::hsm::utils::convert_binary_to_decimal $phyaddr]
if {[llength $phy_addr] == 0} {
@ -187,9 +203,10 @@ proc is_gige_pcs_pma_ip_present {slave} {
} else {
set tmp0 [string first "ENET1" $port_value]
if { $tmp0 >= 0 } {
if { [string compare -nocase $enetipinstance_name "ps7_ethernet_1"] == 0} {
if { [string compare -nocase $enetipinstance_name "ps7_ethernet"] == 0} {
set phyaddr [::hsm::utils::get_param_value $ipconv C_PHYADDR]
set phy_addr [::hsm::utils::convert_binary_to_decimal $phyaddr]
puts [format "phy_addr %s phyaddr %s" $phy_addr $phyaddr]
if {[llength $phy_addr] == 0} {
set phy_addr 0
}

View file

@ -296,6 +296,9 @@
* 2.1 bss 09/08/14 Modified driver tcl to fix CR#820349 to export phy
* address in xparameters.h when GMII to RGMII converter
* is present in hw.
* 2.2 adk 29/10/14 Fixed CR#827686 when PCS/PMA core is configured with
* 1000BASE-X mode export proper values to the xparameters.h
* file. Changes are made in the driver tcl file.
* </pre>
*
****************************************************************************/