Lines Matching +full:vsc9953 +full:- +full:switch
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
2 /* Distributed Switch Architecture VSC9953 driver
10 #include <linux/mdio/mdio-mscc-miim.h>
13 #include <linux/pcs-lynx.h>
600 /* Layer-3 Information */
606 /* Layer-4 Information */
812 /* soft-reset the switch core */ in vsc9953_reset()
818 dev_err(ocelot->dev, "timeout: switch core reset\n"); in vsc9953_reset()
822 /* initialize switch mem ~40us */ in vsc9953_reset()
830 dev_err(ocelot->dev, "timeout: switch sram init\n"); in vsc9953_reset()
834 /* enable switch core */ in vsc9953_reset()
842 * Bit 8-0: Value to be multiplied with unit
882 struct device *dev = ocelot->dev; in vsc9953_mdio_bus_alloc()
887 felix->pcs = devm_kcalloc(dev, felix->info->num_ports, in vsc9953_mdio_bus_alloc()
890 if (!felix->pcs) { in vsc9953_mdio_bus_alloc()
892 return -ENOMEM; in vsc9953_mdio_bus_alloc()
895 rc = mscc_miim_setup(dev, &bus, "VSC9953 internal MDIO bus", in vsc9953_mdio_bus_alloc()
896 ocelot->targets[GCB], in vsc9953_mdio_bus_alloc()
897 ocelot->map[GCB][GCB_MIIM_MII_STATUS & REG_MASK], in vsc9953_mdio_bus_alloc()
911 felix->imdio = bus; in vsc9953_mdio_bus_alloc()
913 for (port = 0; port < felix->info->num_ports; port++) { in vsc9953_mdio_bus_alloc()
914 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9953_mdio_bus_alloc()
918 if (dsa_is_unused_port(felix->ds, port)) in vsc9953_mdio_bus_alloc()
921 if (ocelot_port->phy_mode == PHY_INTERFACE_MODE_INTERNAL) in vsc9953_mdio_bus_alloc()
924 phylink_pcs = lynx_pcs_create_mdiodev(felix->imdio, addr); in vsc9953_mdio_bus_alloc()
928 felix->pcs[port] = phylink_pcs; in vsc9953_mdio_bus_alloc()
941 for (port = 0; port < ocelot->num_phys_ports; port++) { in vsc9953_mdio_bus_free()
942 struct phylink_pcs *phylink_pcs = felix->pcs[port]; in vsc9953_mdio_bus_free()
982 err = -ENOMEM; in seville_probe()
983 dev_err(&pdev->dev, "Failed to allocate driver memory\n"); in seville_probe()
989 ocelot = &felix->ocelot; in seville_probe()
990 ocelot->dev = &pdev->dev; in seville_probe()
991 ocelot->num_flooding_pgids = 1; in seville_probe()
992 felix->info = &seville_info_vsc9953; in seville_probe()
996 err = -EINVAL; in seville_probe()
997 dev_err(&pdev->dev, "Invalid resource\n"); in seville_probe()
1000 felix->switch_base = res->start; in seville_probe()
1004 err = -ENOMEM; in seville_probe()
1005 dev_err(&pdev->dev, "Failed to allocate DSA switch\n"); in seville_probe()
1009 ds->dev = &pdev->dev; in seville_probe()
1010 ds->num_ports = felix->info->num_ports; in seville_probe()
1011 ds->ops = &felix_switch_ops; in seville_probe()
1012 ds->priv = ocelot; in seville_probe()
1013 felix->ds = ds; in seville_probe()
1014 felix->tag_proto = DSA_TAG_PROTO_SEVILLE; in seville_probe()
1018 dev_err(&pdev->dev, "Failed to register DSA switch: %d\n", err); in seville_probe()
1039 dsa_unregister_switch(felix->ds); in seville_remove()
1041 kfree(felix->ds); in seville_remove()
1052 dsa_switch_shutdown(felix->ds); in seville_shutdown()
1058 { .compatible = "mscc,vsc9953-switch" },
1074 MODULE_DESCRIPTION("Seville Switch driver");