diff options
author | Chuanhong Guo <gch981213@gmail.com> | 2018-07-24 21:23:04 +0800 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-07-30 10:43:35 +0200 |
commit | f43e8f90049fbbf7961854660c09e88fb7555ef2 (patch) | |
tree | 451d424887370e7c3c5e10f4d3ec5a4ef89abf33 /target/linux/ath79/files/drivers/net/ethernet/atheros | |
parent | 85189e4c0051a9ca2fd61e9e9d88663b8012b197 (diff) | |
download | upstream-f43e8f90049fbbf7961854660c09e88fb7555ef2.tar.gz upstream-f43e8f90049fbbf7961854660c09e88fb7555ef2.tar.bz2 upstream-f43e8f90049fbbf7961854660c09e88fb7555ef2.zip |
ath79: ag71xx: Explicitly register mdio bus after ag71xx_hw_init() for ar7240
mdio bus isn't a standalone device on ar7240. (and maybe older SoCs?)
Use simple-mfd for ar7241 and later SoCs to get mdio1 ready before gmac0
For ar7240 and older chips, manually create platform device after
ag71xx_hw_init() in ag71xx_probe()to get mdio0 ready between
ag71xx_hw_init() and ag71xx_phy_connect().
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Diffstat (limited to 'target/linux/ath79/files/drivers/net/ethernet/atheros')
-rw-r--r-- | target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index e741bdfa7b..3a25904d56 100644 --- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -14,6 +14,7 @@ #include <linux/sizes.h> #include <linux/of_net.h> #include <linux/of_address.h> +#include <linux/of_platform.h> #include "ag71xx.h" #define AG71XX_DEFAULT_MSG_ENABLE \ @@ -1273,6 +1274,7 @@ static const char *ag71xx_get_phy_if_mode_name(phy_interface_t mode) static int ag71xx_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; + struct device_node *mdio_node; struct net_device *dev; struct resource *res; struct ag71xx *ag; @@ -1439,6 +1441,12 @@ static int ag71xx_probe(struct platform_device *pdev) ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, 0); ag71xx_hw_init(ag); + if(!of_device_is_compatible(np, "simple-mfd")) { + mdio_node = of_get_child_by_name(np, "mdio-bus"); + if(!IS_ERR(mdio_node)) + of_platform_device_create(mdio_node, NULL, NULL); + } + err = ag71xx_phy_connect(ag); if (err) goto err_free; |