Lines Matching +full:vsc7514 +full:- +full:switch
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
3 * Microsemi Ocelot Switch driver
33 ocelot->map = vsc7514_regmap; in ocelot_chip_init()
34 ocelot->num_mact_rows = 1024; in ocelot_chip_init()
35 ocelot->ops = ops; in ocelot_chip_init()
43 eth_random_addr(ocelot->base_mac); in ocelot_chip_init()
44 ocelot->base_mac[5] &= 0xf0; in ocelot_chip_init()
61 skb->dev->stats.rx_bytes += skb->len; in ocelot_xtr_irq_handler()
62 skb->dev->stats.rx_packets++; in ocelot_xtr_irq_handler()
85 { .compatible = "mscc,vsc7514-switch" },
120 for (port = 0; port < ocelot->num_phys_ports; port++) in mscc_ocelot_teardown_devlink_ports()
128 for (port = 0; port < ocelot->num_phys_ports; port++) { in mscc_ocelot_release_ports()
131 ocelot_port = ocelot->ports[port]; in mscc_ocelot_release_ports()
149 ocelot->ports = devm_kcalloc(ocelot->dev, ocelot->num_phys_ports, in mscc_ocelot_init_ports()
151 if (!ocelot->ports) in mscc_ocelot_init_ports()
152 return -ENOMEM; in mscc_ocelot_init_ports()
154 ocelot->devlink_ports = devm_kcalloc(ocelot->dev, in mscc_ocelot_init_ports()
155 ocelot->num_phys_ports, in mscc_ocelot_init_ports()
156 sizeof(*ocelot->devlink_ports), in mscc_ocelot_init_ports()
158 if (!ocelot->devlink_ports) in mscc_ocelot_init_ports()
159 return -ENOMEM; in mscc_ocelot_init_ports()
170 if (port < 0 || port >= ocelot->num_phys_ports) { in mscc_ocelot_init_ports()
171 dev_err(ocelot->dev, in mscc_ocelot_init_ports()
173 ocelot->num_phys_ports); in mscc_ocelot_init_ports()
205 for (port = 0; port < ocelot->num_phys_ports; port++) { in mscc_ocelot_init_ports()
223 for (port = 0; port < ocelot->num_phys_ports; port++) { in mscc_ocelot_init_ports()
232 struct device_node *np = pdev->dev.of_node; in mscc_ocelot_probe()
257 if (!np && !pdev->dev.platform_data) in mscc_ocelot_probe()
258 return -ENODEV; in mscc_ocelot_probe()
261 devlink_alloc(&ocelot_devlink_ops, sizeof(*ocelot), &pdev->dev); in mscc_ocelot_probe()
263 return -ENOMEM; in mscc_ocelot_probe()
266 ocelot->devlink = priv_to_devlink(ocelot); in mscc_ocelot_probe()
268 ocelot->dev = &pdev->dev; in mscc_ocelot_probe()
280 ocelot->targets[io_target[i].id] = NULL; in mscc_ocelot_probe()
287 ocelot->targets[io_target[i].id] = target; in mscc_ocelot_probe()
290 if (ocelot->targets[FDMA]) in mscc_ocelot_probe()
293 hsio = syscon_regmap_lookup_by_compatible("mscc,ocelot-hsio"); in mscc_ocelot_probe()
295 dev_err(&pdev->dev, "missing hsio syscon\n"); in mscc_ocelot_probe()
300 ocelot->targets[HSIO] = hsio; in mscc_ocelot_probe()
312 err = devm_request_threaded_irq(&pdev->dev, irq_xtr, NULL, in mscc_ocelot_probe()
319 if (irq_ptp_rdy > 0 && ocelot->targets[PTP]) { in mscc_ocelot_probe()
320 err = devm_request_threaded_irq(&pdev->dev, irq_ptp_rdy, NULL, in mscc_ocelot_probe()
328 ocelot->ptp = 1; in mscc_ocelot_probe()
331 ports = of_get_child_by_name(np, "ethernet-ports"); in mscc_ocelot_probe()
333 dev_err(ocelot->dev, "no ethernet-ports child node found\n"); in mscc_ocelot_probe()
334 err = -ENODEV; in mscc_ocelot_probe()
338 ocelot->num_phys_ports = of_get_child_count(ports); in mscc_ocelot_probe()
339 ocelot->num_flooding_pgids = 1; in mscc_ocelot_probe()
341 ocelot->vcap = vsc7514_vcap_props; in mscc_ocelot_probe()
343 ocelot->vcap_pol.base = VSC7514_VCAP_POLICER_BASE; in mscc_ocelot_probe()
344 ocelot->vcap_pol.max = VSC7514_VCAP_POLICER_MAX; in mscc_ocelot_probe()
346 ocelot->npi = -1; in mscc_ocelot_probe()
356 if (ocelot->fdma) in mscc_ocelot_probe()
363 if (ocelot->ptp) { in mscc_ocelot_probe()
366 dev_err(ocelot->dev, in mscc_ocelot_probe()
368 ocelot->ptp = 0; in mscc_ocelot_probe()
379 dev_info(&pdev->dev, "Ocelot switch probed\n"); in mscc_ocelot_probe()
399 if (ocelot->fdma) in mscc_ocelot_remove()
401 devlink_unregister(ocelot->devlink); in mscc_ocelot_remove()
410 devlink_free(ocelot->devlink); in mscc_ocelot_remove()
417 .name = "ocelot-switch",
424 MODULE_DESCRIPTION("Microsemi Ocelot switch driver");