ramips: mt7620: remove useless GMAC nodes
These nodes are used for configuring a GMAC interface and for defining external PHYs to be accessed with MDIO. None of this is possible on MT7620N, only MT7620A, so remove them from all MT7620N DTS. When the mdio-bus node is missing, the driver returns -NODEV which causes the internal switch to not initialize. Replace that return so that everything works without the DTS node. Also, an extra kernel message to indicate for all error conditions that mdio-bus is disabled. Fixes:d482356322("ramips: mt7620n: add mdio node and disable port4 by default") Fixes:aa5014dd1a("ramips: mt7620n: enable port 4 as EPHY by default") Signed-off-by: Michael Pratt <mcpratt@pm.me>
This commit is contained in:
		 Michael Pratt
					Michael Pratt
				
			
				
					committed by
					
						 Chuanhong Guo
						Chuanhong Guo
					
				
			
			
				
	
			
			
			 Chuanhong Guo
						Chuanhong Guo
					
				
			
						parent
						
							953bfe2eb3
						
					
				
				
					commit
					a2acdf9607
				
			| @@ -322,20 +322,6 @@ | |||||||
| 		reset-names = "fe", "esw"; | 		reset-names = "fe", "esw"; | ||||||
|  |  | ||||||
| 		mediatek,switch = <&gsw>; | 		mediatek,switch = <&gsw>; | ||||||
|  |  | ||||||
| 		mdio-bus { |  | ||||||
| 			#address-cells = <1>; |  | ||||||
| 			#size-cells = <0>; |  | ||||||
|  |  | ||||||
| 			status = "disabled"; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		port@4 { |  | ||||||
| 			compatible = "mediatek,mt7620a-gsw-port", "mediatek,eth-port"; |  | ||||||
| 			reg = <4>; |  | ||||||
|  |  | ||||||
| 			status = "disabled"; |  | ||||||
| 		}; |  | ||||||
| 	}; | 	}; | ||||||
|  |  | ||||||
| 	gsw: gsw@10110000 { | 	gsw: gsw@10110000 { | ||||||
|   | |||||||
| @@ -133,12 +133,6 @@ | |||||||
| 	status = "okay"; | 	status = "okay"; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| ðernet { |  | ||||||
| 	port@4 { |  | ||||||
| 		status = "okay"; |  | ||||||
| 	}; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| &state_default { | &state_default { | ||||||
| 	default { | 	default { | ||||||
| 		groups = "spi refclk", "i2c", "ephy", "wled"; | 		groups = "spi refclk", "i2c", "ephy", "wled"; | ||||||
|   | |||||||
| @@ -136,12 +136,6 @@ | |||||||
| 	status = "okay"; | 	status = "okay"; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| ðernet { |  | ||||||
| 	port@4 { |  | ||||||
| 		status = "okay"; |  | ||||||
| 	}; |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| &state_default { | &state_default { | ||||||
| 	default { | 	default { | ||||||
| 		groups = "spi refclk", "i2c", "ephy", "wled"; | 		groups = "spi refclk", "i2c", "ephy", "wled"; | ||||||
|   | |||||||
| @@ -232,7 +232,8 @@ int fe_mdio_init(struct fe_priv *priv) | |||||||
| 	mii_np = of_get_child_by_name(priv->dev->of_node, "mdio-bus"); | 	mii_np = of_get_child_by_name(priv->dev->of_node, "mdio-bus"); | ||||||
| 	if (!mii_np) { | 	if (!mii_np) { | ||||||
| 		dev_err(priv->dev, "no %s child node found", "mdio-bus"); | 		dev_err(priv->dev, "no %s child node found", "mdio-bus"); | ||||||
| 		return -ENODEV; | 		err = 0; | ||||||
|  | 		goto err_no_bus; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (!of_device_is_available(mii_np)) { | 	if (!of_device_is_available(mii_np)) { | ||||||
| @@ -264,6 +265,8 @@ err_free_bus: | |||||||
| 	kfree(priv->mii_bus); | 	kfree(priv->mii_bus); | ||||||
| err_put_node: | err_put_node: | ||||||
| 	of_node_put(mii_np); | 	of_node_put(mii_np); | ||||||
|  | err_no_bus: | ||||||
|  | 	dev_err(priv->dev, "%s disabled", "mdio-bus"); | ||||||
| 	priv->mii_bus = NULL; | 	priv->mii_bus = NULL; | ||||||
| 	return err; | 	return err; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user