Lines Matching defs:slave
139 static void am65_cpsw_port_set_sl_mac(struct am65_cpsw_port *slave,
146 writel(mac_hi, slave->port_base + AM65_CPSW_PORTN_REG_SA_H);
147 writel(mac_lo, slave->port_base + AM65_CPSW_PORTN_REG_SA_L);
152 cpsw_sl_reset(port->slave.mac_sl, 100);
542 phylink_stop(port->slave.phylink);
546 phylink_disconnect_phy(port->slave.phylink);
579 cpsw_sl_ctl_set(port->slave.mac_sl, CPSW_SL_CTL_CMD_IDLE);
580 cpsw_sl_wait_for_idle(port->slave.mac_sl, 100);
581 cpsw_sl_ctl_reset(port->slave.mac_sl);
584 cpsw_sl_reg_write(port->slave.mac_sl, CPSW_SL_SOFT_RESET, 1);
586 reg = cpsw_sl_reg_read(port->slave.mac_sl, CPSW_SL_SOFT_RESET);
629 ret = phylink_of_phy_connect(port->slave.phylink, port->slave.phy_node, 0);
636 phylink_start(port->slave.phylink);
1386 return phylink_mii_ioctl(port->slave.phylink, req, cmd);
1470 phy = port->slave.serdes_phy;
1488 port->slave.serdes_phy = phy;
1504 struct am65_cpsw_slave_data *slave = container_of(config, struct am65_cpsw_slave_data,
1506 struct am65_cpsw_port *port = container_of(slave, struct am65_cpsw_port, slave);
1513 cpsw_sl_ctl_set(port->slave.mac_sl, CPSW_SL_CTL_EXT_EN);
1515 cpsw_sl_ctl_clr(port->slave.mac_sl, CPSW_SL_CTL_EXT_EN);
1519 cpsw_sl_ctl_set(port->slave.mac_sl,
1522 cpsw_sl_ctl_clr(port->slave.mac_sl,
1534 struct am65_cpsw_slave_data *slave = container_of(config, struct am65_cpsw_slave_data,
1536 struct am65_cpsw_port *port = container_of(slave, struct am65_cpsw_port, slave);
1545 cpsw_sl_ctl_set(port->slave.mac_sl, CPSW_SL_CTL_CMD_IDLE);
1547 tmo = cpsw_sl_wait_for_idle(port->slave.mac_sl, 100);
1549 cpsw_sl_reg_read(port->slave.mac_sl, CPSW_SL_MACSTATUS), tmo);
1558 cpsw_sl_ctl_clr(port->slave.mac_sl, mac_control);
1568 struct am65_cpsw_slave_data *slave = container_of(config, struct am65_cpsw_slave_data,
1570 struct am65_cpsw_port *port = container_of(slave, struct am65_cpsw_port, slave);
1576 cpsw_sl_ctl_clr(port->slave.mac_sl, CPSW_SL_CTL_CMD_IDLE);
1596 cpsw_sl_ctl_set(port->slave.mac_sl, mac_control);
1621 cpsw_sl_reset(port->slave.mac_sl, 100);
1622 cpsw_sl_ctl_reset(port->slave.mac_sl);
1936 int slave, u8 *mac_addr)
2018 /* it is not a slave port node, continue */
2050 port->slave.mac_sl = cpsw_sl_get("am65", dev, port->port_base);
2051 if (IS_ERR(port->slave.mac_sl)) {
2052 ret = PTR_ERR(port->slave.mac_sl);
2062 port->slave.ifphy = devm_of_phy_get(dev, port_np, NULL);
2063 if (IS_ERR(port->slave.ifphy)) {
2064 ret = PTR_ERR(port->slave.ifphy);
2075 port->slave.mac_only =
2079 port->slave.phy_node = port_np;
2080 ret = of_get_phy_mode(port_np, &port->slave.phy_if);
2087 ret = phy_set_mode_ext(port->slave.ifphy, PHY_MODE_ETHERNET, port->slave.phy_if);
2091 ret = of_get_mac_address(port_np, port->slave.mac_addr);
2095 port->slave.mac_addr);
2096 if (!is_valid_ether_addr(port->slave.mac_addr)) {
2097 eth_random_addr(port->slave.mac_addr);
2132 if (port->slave.phylink)
2133 phylink_destroy(port->slave.phylink);
2157 dev_err(dev, "error allocating slave net_device %u\n",
2167 eth_hw_addr_set(port->ndev, port->slave.mac_addr);
2183 port->slave.phylink_config.dev = &port->ndev->dev;
2184 port->slave.phylink_config.type = PHYLINK_NETDEV;
2185 port->slave.phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 |
2187 port->slave.phylink_config.mac_managed_pm = true; /* MAC does PM */
2189 switch (port->slave.phy_if) {
2194 phy_interface_set_rgmii(port->slave.phylink_config.supported_interfaces);
2199 port->slave.phylink_config.supported_interfaces);
2205 if (common->pdata.extra_modes & BIT(port->slave.phy_if)) {
2206 __set_bit(port->slave.phy_if,
2207 port->slave.phylink_config.supported_interfaces);
2219 phylink = phylink_create(&port->slave.phylink_config,
2220 of_node_to_fwnode(port->slave.phy_node),
2221 port->slave.phy_if,
2226 port->slave.phylink = phylink;
2467 struct am65_cpsw_slave_data *slave = &port->slave;
2471 writel(slave->port_vlan, port->port_base + AM65_CPSW_PORT_VLAN_REG_OFFSET);
2473 if (slave->mac_only)
2483 HOST_PORT_NUM, ALE_SECURE, slave->port_vlan);
2485 port_mask, ALE_VLAN, slave->port_vlan, ALE_MCAST_FWD_2);
2490 struct am65_cpsw_slave_data *slave = &port->slave;
2499 slave->port_vlan);
2504 port_mask, ALE_VLAN, slave->port_vlan,
2507 writel(slave->port_vlan, port->port_base + AM65_CPSW_PORT_VLAN_REG_OFFSET);
2552 struct am65_cpsw_slave_data *slave;
2557 slave = am65_ndev_to_slave(sl_ndev);
2559 slave->port_vlan = cpsw->default_vlan;
2561 slave->port_vlan = 0;
2579 struct am65_cpsw_slave_data *slave;
2586 slave = am65_ndev_to_slave(sl_ndev);
2587 slave->port_vlan = cpsw->default_vlan;
2606 port->slave.port_vlan = 0;
2745 dev_err(dev, "error registering slave net device%i %d\n",