From ffee1dde3c4cb2721c56c78e0360affec1c23d3f Mon Sep 17 00:00:00 2001 From: Zhao Qiang Date: Wed, 4 Sep 2013 10:11:27 +0800 Subject: SGMII:fix PHY addresses for QSGMII Riser Card working in SGMII mode Fix PHY addresses for QSGMII Riser Card working in SGMII mode on board P3041/P5020/P4080/P5040/B4860. QSGMII Riser Card can work in SGMII mode, but having the different PHY addresses. So the following steps should be done: 1. Confirm whether QSGMII Riser Card is used. 2. If yes, set the proper PHY address. Generally, the function is_qsgmii_riser_card() is for step 1, and set_sgmii_phy() for step 2. However, there are still some special situations, take P5040 and B4860 as examples, the PHY addresses need to be changed when serdes protocol is changed, so it is necessary to confirm the protocol before setting PHY addresses. Signed-off-by: Zhao Qiang --- include/fm_eth.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/fm_eth.h b/include/fm_eth.h index 90562dc9f06..114bb8cf25e 100644 --- a/include/fm_eth.h +++ b/include/fm_eth.h @@ -149,5 +149,9 @@ void fm_info_set_phy_address(enum fm_port port, int address); int fm_info_get_phy_address(enum fm_port port); void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus); void fm_disable_port(enum fm_port port); +void set_sgmii_phy(struct mii_dev *bus, enum fm_port base_port, + unsigned int port_num, int phy_base_addr); +int is_qsgmii_riser_card(struct mii_dev *bus, int phy_base_addr, + unsigned int port_num, unsigned regnum); #endif -- cgit v1.2.3