Lines Matching +full:am65 +full:- +full:cpts
1 // SPDX-License-Identifier: GPL-2.0
2 /* Texas Instruments K3 AM65 Ethernet Switch SubSystem Driver ethtool ops
4 * Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
13 #include "am65-cpsw-nuss.h"
15 #include "am65-cpts.h"
33 * struct am65_cpsw_regdump_hdr - regdump record header
45 * struct am65_cpsw_regdump_item - regdump module description
64 .hdr.len = (end + 4 - start) * 2 + \
375 "p0-rx-ptype-rrobin",
383 ret = pm_runtime_resume_and_get(common->dev); in am65_cpsw_ethtool_op_begin()
385 dev_err(common->dev, "ethtool begin failed %d\n", ret); in am65_cpsw_ethtool_op_begin()
395 ret = pm_runtime_put(common->dev); in am65_cpsw_ethtool_op_complete()
396 if (ret < 0 && ret != -EBUSY) in am65_cpsw_ethtool_op_complete()
397 dev_err(common->dev, "ethtool complete failed %d\n", ret); in am65_cpsw_ethtool_op_complete()
405 strscpy(info->driver, dev_driver_string(common->dev), in am65_cpsw_get_drvinfo()
406 sizeof(info->driver)); in am65_cpsw_get_drvinfo()
407 strscpy(info->bus_info, dev_name(common->dev), sizeof(info->bus_info)); in am65_cpsw_get_drvinfo()
414 return priv->msg_enable; in am65_cpsw_get_msglevel()
421 priv->msg_enable = value; in am65_cpsw_set_msglevel()
429 ch->max_rx = AM65_CPSW_MAX_RX_QUEUES; in am65_cpsw_get_channels()
430 ch->max_tx = AM65_CPSW_MAX_TX_QUEUES; in am65_cpsw_get_channels()
431 ch->rx_count = AM65_CPSW_MAX_RX_QUEUES; in am65_cpsw_get_channels()
432 ch->tx_count = common->tx_ch_num; in am65_cpsw_get_channels()
440 if (!chs->rx_count || !chs->tx_count) in am65_cpsw_set_channels()
441 return -EINVAL; in am65_cpsw_set_channels()
446 if (common->usage_count) in am65_cpsw_set_channels()
447 return -EBUSY; in am65_cpsw_set_channels()
451 return am65_cpsw_nuss_update_tx_chns(common, chs->tx_count); in am65_cpsw_set_channels()
463 ering->tx_pending = common->tx_chns[0].descs_num; in am65_cpsw_get_ringparam()
464 ering->rx_pending = common->rx_chns.descs_num; in am65_cpsw_get_ringparam()
472 phylink_ethtool_get_pauseparam(salve->phylink, pause); in am65_cpsw_get_pauseparam()
480 return phylink_ethtool_set_pauseparam(salve->phylink, pause); in am65_cpsw_set_pauseparam()
488 phylink_ethtool_get_wol(salve->phylink, wol); in am65_cpsw_get_wol()
496 return phylink_ethtool_set_wol(salve->phylink, wol); in am65_cpsw_set_wol()
504 return phylink_ethtool_ksettings_get(salve->phylink, ecmd); in am65_cpsw_get_link_ksettings()
513 return phylink_ethtool_ksettings_set(salve->phylink, ecmd); in am65_cpsw_set_link_ksettings()
520 return phylink_ethtool_get_eee(salve->phylink, edata); in am65_cpsw_get_eee()
527 return phylink_ethtool_set_eee(salve->phylink, edata); in am65_cpsw_set_eee()
534 return phylink_ethtool_nway_reset(salve->phylink); in am65_cpsw_nway_reset()
542 ale_entries = cpsw_ale_get_num_entries(common->ale); in am65_cpsw_get_regs_len()
564 regs->version = AM65_CPSW_REGDUMP_VER; in am65_cpsw_get_regs()
565 ale_entries = cpsw_ale_get_num_entries(common->ale); in am65_cpsw_get_regs()
577 cpsw_ale_dump(common->ale, ®[pos]); in am65_cpsw_get_regs()
587 reg[pos++] = readl_relaxed(common->ss_base + j); in am65_cpsw_get_regs()
602 return -EOPNOTSUPP; in am65_cpsw_get_sset_count()
655 *data++ = readl_relaxed(host_p->stat_base + in am65_cpsw_get_ethtool_stats()
661 *data++ = readl_relaxed(port->stat_base + in am65_cpsw_get_ethtool_stats()
673 info->so_timestamping = in am65_cpsw_get_ethtool_ts_info()
680 info->phc_index = am65_cpts_phc_index(common->cpts); in am65_cpsw_get_ethtool_ts_info()
681 info->tx_types = BIT(HWTSTAMP_TX_OFF) | BIT(HWTSTAMP_TX_ON); in am65_cpsw_get_ethtool_ts_info()
682 info->rx_filters = BIT(HWTSTAMP_FILTER_NONE) | BIT(HWTSTAMP_FILTER_ALL); in am65_cpsw_get_ethtool_ts_info()
691 if (common->pf_p0_rx_ptype_rrobin) in am65_cpsw_get_ethtool_priv_flags()
704 if (common->usage_count) in am65_cpsw_set_ethtool_priv_flags()
705 return -EBUSY; in am65_cpsw_set_ethtool_priv_flags()
707 if (common->est_enabled && rrobin) { in am65_cpsw_set_ethtool_priv_flags()
709 "p0-rx-ptype-rrobin flag conflicts with QOS\n"); in am65_cpsw_set_ethtool_priv_flags()
710 return -EINVAL; in am65_cpsw_set_ethtool_priv_flags()
713 common->pf_p0_rx_ptype_rrobin = rrobin; in am65_cpsw_set_ethtool_priv_flags()