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()
63 skb->dev->stats.rx_bytes += skb->len; in ocelot_xtr_irq_handler()
64 skb->dev->stats.rx_packets++; in ocelot_xtr_irq_handler()
89 { .compatible = "mscc,vsc7514-switch" },
124 for (port = 0; port < ocelot->num_phys_ports; port++) in mscc_ocelot_teardown_devlink_ports()
132 for (port = 0; port < ocelot->num_phys_ports; port++) { in mscc_ocelot_release_ports()
135 ocelot_port = ocelot->ports[port]; in mscc_ocelot_release_ports()
153 ocelot->ports = devm_kcalloc(ocelot->dev, ocelot->num_phys_ports, in mscc_ocelot_init_ports()
155 if (!ocelot->ports) in mscc_ocelot_init_ports()
156 return -ENOMEM; in mscc_ocelot_init_ports()
158 ocelot->devlink_ports = devm_kcalloc(ocelot->dev, in mscc_ocelot_init_ports()
159 ocelot->num_phys_ports, in mscc_ocelot_init_ports()
160 sizeof(*ocelot->devlink_ports), in mscc_ocelot_init_ports()
162 if (!ocelot->devlink_ports) in mscc_ocelot_init_ports()
163 return -ENOMEM; in mscc_ocelot_init_ports()
174 if (port < 0 || port >= ocelot->num_phys_ports) { in mscc_ocelot_init_ports()
175 dev_err(ocelot->dev, in mscc_ocelot_init_ports()
177 ocelot->num_phys_ports); in mscc_ocelot_init_ports()
209 for (port = 0; port < ocelot->num_phys_ports; port++) { in mscc_ocelot_init_ports()
227 for (port = 0; port < ocelot->num_phys_ports; port++) { in mscc_ocelot_init_ports()
236 struct device_node *np = pdev->dev.of_node; in mscc_ocelot_probe()
261 if (!np && !pdev->dev.platform_data) in mscc_ocelot_probe()
262 return -ENODEV; in mscc_ocelot_probe()
265 devlink_alloc(&ocelot_devlink_ops, sizeof(*ocelot), &pdev->dev); in mscc_ocelot_probe()
267 return -ENOMEM; in mscc_ocelot_probe()
270 ocelot->devlink = priv_to_devlink(ocelot); in mscc_ocelot_probe()
272 ocelot->dev = &pdev->dev; in mscc_ocelot_probe()
284 ocelot->targets[io_target[i].id] = NULL; in mscc_ocelot_probe()
291 ocelot->targets[io_target[i].id] = target; in mscc_ocelot_probe()
294 if (ocelot->targets[FDMA]) in mscc_ocelot_probe()
297 hsio = syscon_regmap_lookup_by_compatible("mscc,ocelot-hsio"); in mscc_ocelot_probe()
299 dev_err(&pdev->dev, "missing hsio syscon\n"); in mscc_ocelot_probe()
304 ocelot->targets[HSIO] = hsio; in mscc_ocelot_probe()
316 err = devm_request_threaded_irq(&pdev->dev, irq_xtr, NULL, in mscc_ocelot_probe()
323 if (irq_ptp_rdy > 0 && ocelot->targets[PTP]) { in mscc_ocelot_probe()
324 err = devm_request_threaded_irq(&pdev->dev, irq_ptp_rdy, NULL, in mscc_ocelot_probe()
332 ocelot->ptp = 1; in mscc_ocelot_probe()
335 ports = of_get_child_by_name(np, "ethernet-ports"); in mscc_ocelot_probe()
337 dev_err(ocelot->dev, "no ethernet-ports child node found\n"); in mscc_ocelot_probe()
338 err = -ENODEV; in mscc_ocelot_probe()
342 ocelot->num_phys_ports = of_get_child_count(ports); in mscc_ocelot_probe()
343 ocelot->num_flooding_pgids = 1; in mscc_ocelot_probe()
345 ocelot->vcap = vsc7514_vcap_props; in mscc_ocelot_probe()
347 ocelot->vcap_pol.base = VSC7514_VCAP_POLICER_BASE; in mscc_ocelot_probe()
348 ocelot->vcap_pol.max = VSC7514_VCAP_POLICER_MAX; in mscc_ocelot_probe()
350 ocelot->npi = -1; in mscc_ocelot_probe()
360 if (ocelot->fdma) in mscc_ocelot_probe()
367 if (ocelot->ptp) { in mscc_ocelot_probe()
370 dev_err(ocelot->dev, in mscc_ocelot_probe()
372 ocelot->ptp = 0; in mscc_ocelot_probe()
383 dev_info(&pdev->dev, "Ocelot switch probed\n"); in mscc_ocelot_probe()
403 if (ocelot->fdma) in mscc_ocelot_remove()
405 devlink_unregister(ocelot->devlink); in mscc_ocelot_remove()
414 devlink_free(ocelot->devlink); in mscc_ocelot_remove()
421 .name = "ocelot-switch",
428 MODULE_DESCRIPTION("Microsemi Ocelot switch driver");