Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable BCM54616S MII isolate mode #303

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/igb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Patch
pushd ./igb-$(IGB_DRIVER_VERSION)
patch -p1 < ../patch/0001-add-support-for-BCM54616-phy-for-intel-igb-driver.patch
patch -p1 < ../patch/0002-force-disable-mii-isolate-mode-for-bcm54616.patch

# Build the package
pushd src
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
Force disable MII isolate mode
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add description in your patch.

Ingrasys S9100 platform set the PHY address to 00h puts the device into isolate mode during and after reset. So we must write 0 to bit 10 of the MII Control register to return normal operation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add detail in my patch. Thx


From: wadelnn <wadelnn@users.noreply.github.com>
---
src/e1000_82575.c | 3 +++
src/e1000_phy.c | 13 +++++++++++++
src/e1000_phy.h | 1 +
3 files changed, 17 insertions(+)

diff --git a/src/e1000_82575.c b/src/e1000_82575.c
index 049ab7b..97e7025 100644
--- a/src/e1000_82575.c
+++ b/src/e1000_82575.c
@@ -1592,6 +1592,9 @@ static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw)
case I210_I_PHY_ID:
ret_val = e1000_copper_link_setup_m88_gen2(hw);
break;
+ case BCM54616_E_PHY_ID:
+ e1000_disable_mii_isolate_bcm54616(hw);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ret_val = e1000_disable_mii_isolate_bcm54616(hw);

+ break;
default:
ret_val = e1000_copper_link_setup_m88(hw);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not convinced that this patch does not affect other nic that also use 54616 phy since in previous code, they will call e1000_copper_link_setup_m88. Now, they will only call your function.

Copy link
Contributor Author

@wadelnn wadelnn Feb 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am searching for open source patch for BCM54616S in IGB. There is not found to call this m88 function. Most of patch just return 0 or break like this. M88 register addresses and behaviors are not match with BCM54616S. Why would we need to call the m88 function?

break;
diff --git a/src/e1000_phy.c b/src/e1000_phy.c
index 5172691..c9c8660 100644
--- a/src/e1000_phy.c
+++ b/src/e1000_phy.c
@@ -1367,6 +1367,19 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw)
return ret_val;
}

+s32 e1000_disable_mii_isolate_bcm54616(struct e1000_hw *hw)
+{
+ struct e1000_phy_info *phy = &hw->phy;
+ s32 ret_val;
+ u16 phy_data;
+
+ ret_val = phy->ops.read_reg(hw, PHY_CONTROL, &phy_data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ret_val != 0, need to return retval

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. thx

+ phy_data &=~(MII_CR_ISOLATE);
+ ret_val = phy->ops.write_reg(hw, PHY_CONTROL, phy_data);
+
+ return 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return ret_val

+}
+
/**
* e1000_phy_setup_autoneg - Configure PHY for auto-negotiation
* @hw: pointer to the HW structure
diff --git a/src/e1000_phy.h b/src/e1000_phy.h
index a109c91..d72ae62 100644
--- a/src/e1000_phy.h
+++ b/src/e1000_phy.h
@@ -43,6 +43,7 @@ s32 e1000_check_reset_block_generic(struct e1000_hw *hw);
s32 e1000_copper_link_setup_igp(struct e1000_hw *hw);
s32 e1000_copper_link_setup_m88(struct e1000_hw *hw);
s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw *hw);
+s32 e1000_disable_mii_isolate_bcm54616(struct e1000_hw *hw);
s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw);
s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw);
s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw);
--
2.1.4