aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorTobias Schramm <tobleminer@gmail.com>2019-12-03 22:30:00 +0100
committerDavid Bauer <mail@david-bauer.net>2020-01-12 14:12:50 +0100
commit8f9cd1af0f9c325a902dbd0e79e12015372e6bb0 (patch)
tree7cdca66b835e81862b53a0cb079fb7880b2b1a6f /target
parent35ba9304c60665724803ae142ba971947973012c (diff)
downloadupstream-8f9cd1af0f9c325a902dbd0e79e12015372e6bb0.tar.gz
upstream-8f9cd1af0f9c325a902dbd0e79e12015372e6bb0.tar.bz2
upstream-8f9cd1af0f9c325a902dbd0e79e12015372e6bb0.zip
swconfig: fix Broadcom b53 support
This commit fixes a bug in the main swconfig patch where a function needed by the b53 driver is not exported. Additionally it adds OF support to the b53_mdio driver for devicetree- based probing Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c32
-rw-r--r--target/linux/generic/files/drivers/net/phy/swconfig.c1
2 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
index 6de8623612..5675232bef 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
@@ -370,6 +370,26 @@ static int b53_phy_read_status(struct phy_device *phydev)
return 0;
}
+static const struct of_device_id b53_of_match_1[] = {
+ { .compatible = "brcm,bcm5325" },
+ { .compatible = "brcm,bcm5395" },
+ { .compatible = "brcm,bcm5397" },
+ { .compatible = "brcm,bcm5398" },
+ { /* sentinel */ },
+};
+
+static const struct of_device_id b53_of_match_2[] = {
+ { .compatible = "brcm,bcm53115" },
+ { .compatible = "brcm,bcm53125" },
+ { .compatible = "brcm,bcm53128" },
+ { /* sentinel */ },
+};
+
+static const struct of_device_id b53_of_match_3[] = {
+ { .compatible = "brcm,bcm5365" },
+ { /* sentinel */ },
+};
+
/* BCM5325, BCM539x */
static struct phy_driver b53_phy_driver_id1 = {
.phy_id = 0x0143bc00,
@@ -381,6 +401,10 @@ static struct phy_driver b53_phy_driver_id1 = {
.config_aneg = b53_phy_config_aneg,
.config_init = b53_phy_config_init,
.read_status = b53_phy_read_status,
+ .mdiodrv.driver = {
+ .name = "bcm539x",
+ .of_match_table = b53_of_match_1,
+ },
};
/* BCM53125, BCM53128 */
@@ -394,6 +418,10 @@ static struct phy_driver b53_phy_driver_id2 = {
.config_aneg = b53_phy_config_aneg,
.config_init = b53_phy_config_init,
.read_status = b53_phy_read_status,
+ .mdiodrv.driver = {
+ .name = "bcm531xx",
+ .of_match_table = b53_of_match_2,
+ },
};
/* BCM5365 */
@@ -407,6 +435,10 @@ static struct phy_driver b53_phy_driver_id3 = {
.config_aneg = b53_phy_config_aneg,
.config_init = b53_phy_config_init,
.read_status = b53_phy_read_status,
+ .mdiodrv.driver = {
+ .name = "bcm5365",
+ .of_match_table = b53_of_match_3,
+ },
};
int __init b53_phy_driver_register(void)
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index 20d6c693da..abf1a4504b 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -1256,6 +1256,7 @@ switch_generic_set_link(struct switch_dev *dev, int port,
return 0;
}
+EXPORT_SYMBOL_GPL(switch_generic_set_link);
static int __init
swconfig_init(void)