mirror of
				https://github.com/Ysurac/openmptcprouter.git
				synced 2025-03-09 15:40:20 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			49 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 56d25c8e2465fb9dcac55ad754990b003b9213f8 Mon Sep 17 00:00:00 2001
 | |
| From: Phil Elwell <phil@raspberrypi.com>
 | |
| Date: Sat, 5 Nov 2022 11:46:08 +0000
 | |
| Subject: [PATCH 472/726] net: phy: BCM54210PE does not support PTP
 | |
| 
 | |
| BCM54213PE is an Ethernet PHY that supports PTP hardware timestamping.
 | |
| BCM54210PW ia another Ethernet PHY, but one without PTP support.
 | |
| Unfortunately the two PHYs return the same ID when queried, so some
 | |
| extra information is required to determine whether the PHY is PTP-
 | |
| capable.
 | |
| 
 | |
| There are two Raspberry Pi products that use these PHYs - Pi 4B and
 | |
| CM4 - and fortunately they use different PHY addresses, so use that as
 | |
| a differentiator. Choose to treat a PHY with the same ID but another
 | |
| address as a BCM54210PE, which seems more common.
 | |
| 
 | |
| See: https://github.com/raspberrypi/linux/issues/5104
 | |
| 
 | |
| Signed-off-by: Phil Elwell <phil@raspberrypi.com>
 | |
| ---
 | |
|  drivers/net/phy/bcm-phy-ptp.c | 12 ++++++++++++
 | |
|  1 file changed, 12 insertions(+)
 | |
| 
 | |
| diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c
 | |
| index ef00d6163061..30ee23e73a4b 100644
 | |
| --- a/drivers/net/phy/bcm-phy-ptp.c
 | |
| +++ b/drivers/net/phy/bcm-phy-ptp.c
 | |
| @@ -916,6 +916,18 @@ struct bcm_ptp_private *bcm_ptp_probe(struct phy_device *phydev)
 | |
|  	switch (BRCM_PHY_MODEL(phydev)) {
 | |
|  	case PHY_ID_BCM54210E:
 | |
|  		break;
 | |
| +#ifdef PHY_ID_BCM54213PE
 | |
| +	case PHY_ID_BCM54213PE:
 | |
| +		switch (phydev->mdio.addr) {
 | |
| +		case 0: // CM4 - this is a BCM54210PE which supports PTP
 | |
| +			break;
 | |
| +		case 1: //  4B - this is a BCM54213PE which doesn't
 | |
| +			return NULL;
 | |
| +		default: // Unknown - assume it's BCM54210PE
 | |
| +			break;
 | |
| +		}
 | |
| +		break;
 | |
| +#endif
 | |
|  	default:
 | |
|  		return NULL;
 | |
|  	}
 | |
| -- 
 | |
| 2.33.1
 | |
| 
 |