Permalink
Browse files

b53 switch support patch update for kernels 4.5+

  • Loading branch information...
1 parent 9be8dd2 commit 94194dc06529529015bfd04767865bbd04d29d9b @zador-blood-stained zador-blood-stained committed Apr 23, 2016
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
-# Linux/arm 4.5.1 Kernel Configuration
+# Linux/arm 4.5.2 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
@@ -1919,6 +1919,8 @@ CONFIG_SYNOPSYS_DWC_ETH_QOS=m
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
CONFIG_PHYLIB=y
+CONFIG_SWCONFIG=y
+CONFIG_SWCONFIG_LEDS=y
#
# MII PHY device drivers
@@ -1953,6 +1955,12 @@ CONFIG_MDIO_SUN4I=y
# CONFIG_MDIO_BUS_MUX_GPIO is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
# CONFIG_MDIO_BCM_UNIMAC is not set
+CONFIG_B53=y
+CONFIG_B53_SPI_DRIVER=y
+CONFIG_B53_PHY_DRIVER=y
+CONFIG_B53_MMAP_DRIVER=y
+CONFIG_B53_SRAB_DRIVER=y
+CONFIG_B53_PHY_FIXUP=y
# CONFIG_MICREL_KS8995MA is not set
# CONFIG_PLIP is not set
CONFIG_PPP=m
@@ -36,7 +36,7 @@ new mode 100755
index 501ea76..79cd3b6
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
-@@ -17,6 +18,8 @@ obj-$(CONFIG_BCM87XX_PHY) += bcm87xx.o
+@@ -17,6 +17,8 @@ obj-$(CONFIG_BCM87XX_PHY) += bcm87xx.o
obj-$(CONFIG_ICPLUS_PHY) += icplus.o
obj-$(CONFIG_REALTEK_PHY) += realtek.o
obj-$(CONFIG_LSI_ET1011C_PHY) += et1011c.o
@@ -1572,7 +1572,7 @@ new file mode 100755
index 0000000..3c25f0e
--- /dev/null
+++ b/drivers/net/phy/b53/b53_mdio.c
-@@ -0,0 +1,425 @@
+@@ -0,0 +1,396 @@
+/*
+ * B53 register access through MII registers
+ *
@@ -1832,11 +1832,11 @@ index 0000000..3c25f0e
+ int ret;
+
+ /* allow the generic phy driver to take over */
-+ if (phydev->addr != B53_PSEUDO_PHY && phydev->addr != 0)
++ if (phydev->mdio.addr != B53_PSEUDO_PHY && phydev->mdio.addr != 0)
+ return -ENODEV;
+
+ dev.current_page = 0xff;
-+ dev.priv = phydev->bus;
++ dev.priv = phydev->mdio.bus;
+ dev.ops = &b53_mdio_ops;
+ dev.pdata = NULL;
+ mutex_init(&dev.reg_mutex);
@@ -1860,7 +1860,7 @@ index 0000000..3c25f0e
+ struct b53_device *dev;
+ int ret;
+
-+ dev = b53_switch_alloc(&phydev->dev, &b53_mdio_ops, phydev->bus);
++ dev = b53_switch_alloc(&phydev->mdio.dev, &b53_mdio_ops, phydev->mdio.bus);
+ if (!dev)
+ return -ENOMEM;
+
@@ -1916,81 +1916,52 @@ index 0000000..3c25f0e
+ return 0;
+}
+
-+/* BCM5325, BCM539x */
-+static struct phy_driver b53_phy_driver_id1 = {
-+ .phy_id = 0x0143bc00,
++static struct phy_driver b53_phy_drivers[] = {
++ { /* BCM5325, BCM539x */
+ .name = "Broadcom B53 (1)",
++ .phy_id = 0x0143bc00,
+ .phy_id_mask = 0x1ffffc00,
+ .features = 0,
+ .probe = b53_phy_probe,
+ .remove = b53_phy_remove,
+ .config_aneg = b53_phy_config_aneg,
+ .config_init = b53_phy_config_init,
+ .read_status = b53_phy_read_status,
-+ .driver = {
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+/* BCM53125, BCM53128 */
-+static struct phy_driver b53_phy_driver_id2 = {
-+ .phy_id = 0x03625c00,
++ },
++ { /* BCM53125, BCM53128 */
+ .name = "Broadcom B53 (2)",
++ .phy_id = 0x03625c00,
+ .phy_id_mask = 0x1ffffc00,
+ .features = 0,
+ .probe = b53_phy_probe,
+ .remove = b53_phy_remove,
+ .config_aneg = b53_phy_config_aneg,
+ .config_init = b53_phy_config_init,
+ .read_status = b53_phy_read_status,
-+ .driver = {
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+/* BCM5365 */
-+static struct phy_driver b53_phy_driver_id3 = {
-+ .phy_id = 0x00406000,
++ },
++ { /* BCM5365 */
+ .name = "Broadcom B53 (3)",
++ .phy_id = 0x00406000,
+ .phy_id_mask = 0x1ffffc00,
+ .features = 0,
+ .probe = b53_phy_probe,
+ .remove = b53_phy_remove,
+ .config_aneg = b53_phy_config_aneg,
+ .config_init = b53_phy_config_init,
+ .read_status = b53_phy_read_status,
-+ .driver = {
-+ .owner = THIS_MODULE,
-+ },
++ }
+};
+
+int __init b53_phy_driver_register(void)
+{
-+ int ret;
-+
-+ ret = phy_driver_register(&b53_phy_driver_id1);
-+ if (ret)
-+ return ret;
-+
-+ ret = phy_driver_register(&b53_phy_driver_id2);
-+ if (ret)
-+ goto err1;
-+
-+ ret = phy_driver_register(&b53_phy_driver_id3);
-+ if (!ret)
-+ return 0;
-+
-+ phy_driver_unregister(&b53_phy_driver_id2);
-+err1:
-+ phy_driver_unregister(&b53_phy_driver_id1);
-+ return ret;
++ return phy_drivers_register(b53_phy_drivers,
++ ARRAY_SIZE(b53_phy_drivers), THIS_MODULE);
+}
+
+void __exit b53_phy_driver_unregister(void)
+{
-+ phy_driver_unregister(&b53_phy_driver_id3);
-+ phy_driver_unregister(&b53_phy_driver_id2);
-+ phy_driver_unregister(&b53_phy_driver_id1);
++ phy_drivers_unregister(b53_phy_drivers,
++ ARRAY_SIZE(b53_phy_drivers));
+}
+
+module_init(b53_phy_driver_register);
@@ -2046,7 +2017,7 @@ index 0000000..ab1895e
+ return -EINVAL;
+
+ if (dev->pdata && dev->pdata->big_endian)
-+ *val = readw_be(regs + (page << 8) + reg);
++ *val = be16_to_cpu(readw(regs + (page << 8) + reg));
+ else
+ *val = readw(regs + (page << 8) + reg);
+
@@ -2061,7 +2032,7 @@ index 0000000..ab1895e
+ return -EINVAL;
+
+ if (dev->pdata && dev->pdata->big_endian)
-+ *val = readl_be(regs + (page << 8) + reg);
++ *val = be16_to_cpu(readl(regs + (page << 8) + reg));
+ else
+ *val = readl(regs + (page << 8) + reg);
+
@@ -2127,7 +2098,7 @@ index 0000000..ab1895e
+ return -EINVAL;
+
+ if (dev->pdata && dev->pdata->big_endian)
-+ writew_be(value, regs + (page << 8) + reg);
++ writew(cpu_to_be16((value)), regs + (page << 8) + reg);
+ else
+ writew(value, regs + (page << 8) + reg);
+
@@ -2143,7 +2114,7 @@ index 0000000..ab1895e
+ return -EINVAL;
+
+ if (dev->pdata && dev->pdata->big_endian)
-+ writel_be(value, regs + (page << 8) + reg);
++ writel(cpu_to_be32((value)), regs + (page << 8) + reg);
+ else
+ writel(value, regs + (page << 8) + reg);
+
@@ -2282,9 +2253,9 @@ index 0000000..72d1373
+static int b53_phy_fixup(struct phy_device *dev)
+{
+ u32 phy_id;
-+ struct mii_bus *bus = dev->bus;
++ struct mii_bus *bus = dev->mdio.bus;
+
-+ if (dev->addr != B53_PSEUDO_PHY)
++ if (dev->mdio.addr != B53_PSEUDO_PHY)
+ return 0;
+
+ /* read the first port's id */
Oops, something went wrong.

0 comments on commit 94194dc

Please sign in to comment.