generic: ar8216: do a software reset for switch during hw_init
This applies to ar8216 and ar8236. QCA's newer U-boot will enable the switch mdio master for FE switches which makes phy inaccessible from CPU mdio. (e.g. on TP-Link TL-WR941N v7 Chinese version which uses QCA9558+AR8236.) For these devices PHY probing is broken and mdio device probing is a must. We also need to disable switch mdio master in driver for later PHY initialization. Do a soft reset during hw_init so that mdio master can be disabled and expose PHYs to CPU mdio for later PHY accessing. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
This commit is contained in:
		 Chuanhong Guo
					Chuanhong Guo
				
			
				
					committed by
					
						 Petr Štetiar
						Petr Štetiar
					
				
			
			
				
	
			
			
			 Petr Štetiar
						Petr Štetiar
					
				
			
						parent
						
							d6366ce366
						
					
				
				
					commit
					c8c2ef1d49
				
			| @@ -705,6 +705,9 @@ ar8216_hw_init(struct ar8xxx_priv *priv) | |||||||
| 	if (priv->initialized) | 	if (priv->initialized) | ||||||
| 		return 0; | 		return 0; | ||||||
|  |  | ||||||
|  | 	ar8xxx_write(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET); | ||||||
|  | 	ar8xxx_reg_wait(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET, 0, 1000); | ||||||
|  |  | ||||||
| 	ar8xxx_phy_init(priv); | 	ar8xxx_phy_init(priv); | ||||||
|  |  | ||||||
| 	priv->initialized = true; | 	priv->initialized = true; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user