Skip to contentSkip to conversation

stmmac: intel: change all EHL/TGL to auto detect phy addr

PATCH Applied Wong Vee Khee 5 participants 5 messages Nov 6, 2020 – Jan 17, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stmmac: intel: change all EHL/TGL to auto detect phy addr

From: Voon Weifeng <[email protected]>

Set all EHL/TGL phy_addr to -1 so that the driver will automatically detect it at run-time by probing all the possible 32 addresses.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +1 -5
index b6e5e3e36b63..7c1353f37247 100644
@@ -236,6 +236,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
 	int ret;
 	int i;
 
+	plat->phy_addr = -1;
 	plat->clk_csr = 5;
 	plat->has_gmac = 0;
 	plat->has_gmac4 = 1;
@@ -345,7 +346,6 @@ static int ehl_sgmii_data(struct pci_dev *pdev,
 			  struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_addr = 0;
 	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 
 	plat->serdes_powerup = intel_serdes_powerup;
@@ -362,7 +362,6 @@ static int ehl_rgmii_data(struct pci_dev *pdev,
 			  struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_addr = 0;
 	plat->phy_interface = PHY_INTERFACE_MODE_RGMII;
 
 	return ehl_common_data(pdev, plat);
@@ -376,7 +375,6 @@ static int ehl_pse0_common_data(struct pci_dev *pdev,
 				struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 2;
-	plat->phy_addr = 1;
 	return ehl_common_data(pdev, plat);
 }
 
@@ -408,7 +406,6 @@ static int ehl_pse1_common_data(struct pci_dev *pdev,
 				struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 3;
-	plat->phy_addr = 1;
 	return ehl_common_data(pdev, plat);
 }
 
@@ -450,7 +447,6 @@ static int tgl_sgmii_data(struct pci_dev *pdev,
 			  struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_addr = 0;
 	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 	plat->serdes_powerup = intel_serdes_powerup;
 	plat->serdes_powerdown = intel_serdes_powerdown;
Signature · 1 line
2.17.0
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 9 lines · On Fri, 6 Nov 2020 17:43:41 +0800 you wrote:

From: Voon Weifeng <[email protected]>

Set all EHL/TGL phy_addr to -1 so that the driver will automatically detect it at run-time by probing all the possible 32 addresses.

[...]

Here is the summary with links:
- [net-next,1/1] stmmac: intel: change all EHL/TGL to auto detect phy addr

    https://git.kernel.org/netdev/net-next/c/bff6f1db91e3

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

#2 lore raw
In reply to Wong Vee Khee
Quoted 57 lines · Wong Vee Khee

From: Voon Weifeng <[email protected]>

Set all EHL/TGL phy_addr to -1 so that the driver will automatically detect it at run-time by probing all the possible 32 addresses.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +1 -4
index b6e5e3e36b63..7c1353f37247 100644
@@ -236,6 +236,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
 	int ret;
 	int i;
 
+	plat->phy_addr = -1;
 	plat->clk_csr = 5;
 	plat->has_gmac = 0;
 	plat->has_gmac4 = 1;
@@ -345,7 +346,6 @@ static int ehl_sgmii_data(struct pci_dev *pdev,
 			  struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_addr = 0;
 	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 
 	plat->serdes_powerup = intel_serdes_powerup;
@@ -362,7 +362,6 @@ static int ehl_rgmii_data(struct pci_dev *pdev,
 			  struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_addr = 0;
 	plat->phy_interface = PHY_INTERFACE_MODE_RGMII;
 
 	return ehl_common_data(pdev, plat);
@@ -376,7 +375,6 @@ static int ehl_pse0_common_data(struct pci_dev *pdev,
 				struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 2;
-	plat->phy_addr = 1;
 	return ehl_common_data(pdev, plat);
 }
 
@@ -408,7 +406,6 @@ static int ehl_pse1_common_data(struct pci_dev *pdev,
 				struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 3;
-	plat->phy_addr = 1;
 	return ehl_common_data(pdev, plat);
 }
 

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c static int tgl_sgmii_data(struct pci_dev *pdev, · line 452

Quoted 7 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +0 -1
@@ -450,7 +447,6 @@ static int tgl_sgmii_data(struct pci_dev *pdev,
 			  struct plat_stmmacenet_data *plat)
 {
 	plat->bus_id = 1;
-	plat->phy_addr = 0;
 	plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
 	plat->serdes_powerup = intel_serdes_powerup;
 	plat->serdes_powerdown = intel_serdes_powerdown;

This fixes PHY detection on one of our EHL-based boards. Can this also be applied to stable 5.10?

Thanks,
Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
maintainer
#3 lore raw
Quoted 11 lines · On Sat, 16 Jan 2021 10:12:21 +0100 Jan Kiszka wrote:
Quoted 7 lines · Wong Vee Khee

From: Voon Weifeng <[email protected]>

Set all EHL/TGL phy_addr to -1 so that the driver will automatically detect it at run-time by probing all the possible 32 addresses.

This fixes PHY detection on one of our EHL-based boards. Can this also be applied to stable 5.10?

Sure.

Greg, we'd like to request a backport of the following commit to 5.10.

commit bff6f1db91e330d7fba56f815cdbc412c75fe163

Author: Voon Weifeng <[email protected]>
Date:   Fri Nov 6 17:43:41 2020 +0800

stmmac: intel: change all EHL/TGL to auto detect phy addr

Set all EHL/TGL phy_addr to -1 so that the driver will automatically detect it at run-time by probing all the possible 32 addresses.

It's relatively small, and Jan reports it makes his boards detect the PHY. The change went in via -next and into Linus's tree during the 5.11 merge window.

#4 lore raw
Quoted 32 lines · Jakub Kicinski
Quoted 11 lines · On Sat, 16 Jan 2021 10:12:21 +0100 Jan Kiszka wrote:
Quoted 7 lines · Wong Vee Khee

From: Voon Weifeng <[email protected]>

Set all EHL/TGL phy_addr to -1 so that the driver will automatically detect it at run-time by probing all the possible 32 addresses.

This fixes PHY detection on one of our EHL-based boards. Can this also be applied to stable 5.10?

Sure.

Greg, we'd like to request a backport of the following commit to 5.10.

commit bff6f1db91e330d7fba56f815cdbc412c75fe163

Author: Voon Weifeng <[email protected]>
Date:   Fri Nov 6 17:43:41 2020 +0800

stmmac: intel: change all EHL/TGL to auto detect phy addr

Set all EHL/TGL phy_addr to -1 so that the driver will automatically detect it at run-time by probing all the possible 32 addresses.

Quoted 3 lines

It's relatively small, and Jan reports it makes his boards detect the PHY. The change went in via -next and into Linus's tree during the 5.11 merge window.

Now queued up, thanks.

greg k-h