Lines Matching defs:slave
68 struct cpsw_slave *slave; \
75 slave = cpsw->slaves; \
77 (func)(slave++, ##arg); \
462 static void _cpsw_adjust_link(struct cpsw_slave *slave,
465 struct phy_device *phy = slave->phy;
473 slave_port = cpsw_get_slave_port(slave->slave_num);
496 if (mac_control != slave->mac_control)
497 cpsw_sl_ctl_set(slave->mac_sl, mac_control);
506 priv->shp_cfg_speed != slave->phy->speed &&
516 cpsw_sl_wait_for_idle(slave->mac_sl, 100);
518 cpsw_sl_ctl_reset(slave->mac_sl);
521 if (mac_control != slave->mac_control)
524 slave->mac_control = mac_control;
549 struct cpsw_priv *priv, struct cpsw_slave *slave,
556 slave_write(slave, slave->port_vlan, CPSW1_PORT_VLAN);
558 slave_write(slave, slave->port_vlan, CPSW2_PORT_VLAN);
559 cpsw_ale_add_vlan(cpsw->ale, slave->port_vlan, port_mask,
562 ALE_PORT_HOST, ALE_VLAN, slave->port_vlan, 0);
565 ALE_SECURE, slave->port_vlan);
570 static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
576 cpsw_sl_reset(slave->mac_sl, 100);
577 cpsw_sl_ctl_reset(slave->mac_sl);
580 cpsw_sl_reg_write(slave->mac_sl, CPSW_SL_RX_PRI_MAP,
585 slave_write(slave, TX_PRIORITY_MAPPING, CPSW1_TX_PRI_MAP);
589 slave_write(slave,
596 slave_write(slave, TX_PRIORITY_MAPPING, CPSW2_TX_PRI_MAP);
600 slave_write(slave,
607 cpsw_sl_reg_write(slave->mac_sl, CPSW_SL_RX_MAXLEN,
609 cpsw_set_slave_mac(slave, priv);
611 slave->mac_control = 0; /* no link yet */
613 slave_port = cpsw_get_slave_port(slave->slave_num);
616 cpsw_add_dual_emac_def_ale_entries(priv, slave, slave_port);
621 if (slave->data->phy_node) {
622 phy = of_phy_connect(priv->ndev, slave->data->phy_node,
623 &cpsw_adjust_link, 0, slave->data->phy_if);
625 dev_err(priv->dev, "phy \"%pOF\" not found on slave %d\n",
626 slave->data->phy_node,
627 slave->slave_num);
631 phy = phy_connect(priv->ndev, slave->data->phy_id,
632 &cpsw_adjust_link, slave->data->phy_if);
635 "phy \"%s\" not found on slave %d, err %ld\n",
636 slave->data->phy_id, slave->slave_num,
642 slave->phy = phy;
644 phy_attached_info(slave->phy);
646 phy_start(slave->phy);
649 if (!IS_ERR(slave->data->ifphy))
650 phy_set_mode_ext(slave->data->ifphy, PHY_MODE_ETHERNET,
651 slave->data->phy_if);
653 cpsw_phy_sel(cpsw->dev, slave->phy->interface,
654 slave->slave_num);
719 static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_common *cpsw)
723 slave_port = cpsw_get_slave_port(slave->slave_num);
725 if (!slave->phy)
727 phy_stop(slave->phy);
728 phy_disconnect(slave->phy);
729 slave->phy = NULL;
732 cpsw_sl_reset(slave->mac_sl, 100);
733 cpsw_sl_ctl_reset(slave->mac_sl);
794 /* Initialize host and slave ports */
1315 /* This is no slave child node, continue */
1316 if (!of_node_name_eq(slave_node, "slave"))
1335 "slave[%d] using phy-handle=\"%pOF\"\n",
1354 dev_err(&pdev->dev, "Invalid slave[%d] phy_id property\n", i);
1371 "No slave[%d] phy_id, phy-handle, or fixed-link property\n",
1377 dev_err(&pdev->dev, "Missing or malformed slave[%d] phy-mode property\n",
1397 dev_err(&pdev->dev, "Using %d as Reserved VLAN for %d slave\n",
1429 if (!of_node_name_eq(slave_node, "slave"))
1686 cpsw_err(priv, probe, "error probe slave 2 emac interface\n");