Lines Matching +full:pcie +full:- +full:ob
1 // SPDX-License-Identifier: (GPL-2.0 OR MIT)
19 #include <dt-bindings/phy/phy-ocelot-serdes.h>
29 /* Not used when in QSGMII or PCIe mode */
150 /* OB + DES + IB + SER CFG */ in serdes_init_s6g()
406 return -EOPNOTSUPP; in serdes_set_mode()
409 if (macro->idx != ocelot_serdes_muxes[i].idx || in serdes_set_mode()
415 macro->port != ocelot_serdes_muxes[i].port) in serdes_set_mode()
418 ret = regmap_update_bits(macro->ctrl->regs, HSIO_HW_CFG, in serdes_set_mode()
424 if (macro->idx <= SERDES1G_MAX) in serdes_set_mode()
425 return serdes_init_s1g(macro->ctrl->regs, macro->idx); in serdes_set_mode()
426 else if (macro->idx <= SERDES6G_MAX) in serdes_set_mode()
427 return serdes_init_s6g(macro->ctrl->regs, in serdes_set_mode()
428 macro->idx - (SERDES1G_MAX + 1), in serdes_set_mode()
431 /* PCIe not supported yet */ in serdes_set_mode()
432 return -EOPNOTSUPP; in serdes_set_mode()
435 return -EINVAL; in serdes_set_mode()
449 if (args->args_count != 2) in serdes_simple_xlate()
450 return ERR_PTR(-EINVAL); in serdes_simple_xlate()
452 port = args->args[0]; in serdes_simple_xlate()
453 idx = args->args[1]; in serdes_simple_xlate()
456 struct serdes_macro *macro = phy_get_drvdata(ctrl->phys[i]); in serdes_simple_xlate()
458 if (idx != macro->idx) in serdes_simple_xlate()
462 if (idx != SERDES6G(0) && macro->port >= 0) in serdes_simple_xlate()
463 return ERR_PTR(-EBUSY); in serdes_simple_xlate()
465 macro->port = port; in serdes_simple_xlate()
466 return ctrl->phys[i]; in serdes_simple_xlate()
469 return ERR_PTR(-ENODEV); in serdes_simple_xlate()
476 *phy = devm_phy_create(ctrl->dev, NULL, &serdes_ops); in serdes_phy_create()
480 macro = devm_kzalloc(ctrl->dev, sizeof(*macro), GFP_KERNEL); in serdes_phy_create()
482 return -ENOMEM; in serdes_phy_create()
484 macro->idx = idx; in serdes_phy_create()
485 macro->ctrl = ctrl; in serdes_phy_create()
486 macro->port = -1; in serdes_phy_create()
500 ctrl = devm_kzalloc(&pdev->dev, sizeof(*ctrl), GFP_KERNEL); in serdes_probe()
502 return -ENOMEM; in serdes_probe()
504 ctrl->dev = &pdev->dev; in serdes_probe()
505 ctrl->regs = syscon_node_to_regmap(pdev->dev.parent->of_node); in serdes_probe()
506 if (IS_ERR(ctrl->regs)) in serdes_probe()
507 return PTR_ERR(ctrl->regs); in serdes_probe()
510 ret = serdes_phy_create(ctrl, i, &ctrl->phys[i]); in serdes_probe()
515 dev_set_drvdata(&pdev->dev, ctrl); in serdes_probe()
517 provider = devm_of_phy_provider_register(ctrl->dev, in serdes_probe()
524 { .compatible = "mscc,vsc7514-serdes", },
532 .name = "mscc,ocelot-serdes",