diff mbox series

[v2,net,1/2] net: stmmac: add new mode parameter for fix_mac_speed

Message ID 20230727152503.2199550-2-shenwei.wang@nxp.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series update stmmac fix_mac_speed | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 1369 this patch: 56
netdev/cc_maintainers warning 2 maintainers not CCed: linux-arm-msm@vger.kernel.org linux-sunxi@lists.linux.dev
netdev/build_clang fail Errors and warnings before: 1365 this patch: 29
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 1392 this patch: 56
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 80 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Shenwei Wang July 27, 2023, 3:25 p.m. UTC
A mode parameter has been added to the callback function of fix_mac_speed
to indicate the physical layer type.

The mode can be one the following:
	MLO_AN_PHY	- Conventional PHY
	MLO_AN_FIXED	- Fixed-link mode
	MLO_AN_INBAND	- In-band protocol

Also use short version of 'uint' to replace the 'unsigned int' in the
function definitions.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c         | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c     | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c       | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c          | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c     | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c       | 2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c    | 2 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c       | 2 +-
 include/linux/stmmac.h                                  | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

Comments

kernel test robot July 28, 2023, 4:01 p.m. UTC | #1
Hi Shenwei,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenwei-Wang/net-stmmac-add-new-mode-parameter-for-fix_mac_speed/20230727-232922
base:   net/main
patch link:    https://lore.kernel.org/r/20230727152503.2199550-2-shenwei.wang%40nxp.com
patch subject: [PATCH v2 net 1/2] net: stmmac: add new mode parameter for fix_mac_speed
config: x86_64-randconfig-x004-20230728 (https://download.01.org/0day-ci/archive/20230728/202307282338.veVKQvK3-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230728/202307282338.veVKQvK3-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307282338.veVKQvK3-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c:359:22: error: incompatible function pointer types assigning to 'void (*)(void *, uint, uint)' (aka 'void (*)(void *, unsigned int, unsigned int)') from 'void (void *, unsigned int)' [-Wincompatible-function-pointer-types]
           data->fix_mac_speed = tegra_eqos_fix_speed;
                               ^ ~~~~~~~~~~~~~~~~~~~~
   1 error generated.
--
>> drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c:108:28: error: incompatible function pointer types assigning to 'void (*)(void *, uint, uint)' (aka 'void (*)(void *, unsigned int, unsigned int)') from 'void (*const)(void *, unsigned int)' [-Wincompatible-function-pointer-types]
                           plat_dat->fix_mac_speed = dwmac->data->fix_mac_speed;
                                                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 error generated.


vim +359 drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

e6ea2d16fc615e Thierry Reding 2017-03-10  267  
a884915f4cef94 Jisheng Zhang  2020-11-09  268  static int tegra_eqos_probe(struct platform_device *pdev,
e6ea2d16fc615e Thierry Reding 2017-03-10  269  			    struct plat_stmmacenet_data *data,
e6ea2d16fc615e Thierry Reding 2017-03-10  270  			    struct stmmac_resources *res)
e6ea2d16fc615e Thierry Reding 2017-03-10  271  {
1d4605e0aff9ff Ajay Gupta     2019-12-15  272  	struct device *dev = &pdev->dev;
e6ea2d16fc615e Thierry Reding 2017-03-10  273  	struct tegra_eqos *eqos;
e6ea2d16fc615e Thierry Reding 2017-03-10  274  	int err;
e6ea2d16fc615e Thierry Reding 2017-03-10  275  
e6ea2d16fc615e Thierry Reding 2017-03-10  276  	eqos = devm_kzalloc(&pdev->dev, sizeof(*eqos), GFP_KERNEL);
a884915f4cef94 Jisheng Zhang  2020-11-09  277  	if (!eqos)
a884915f4cef94 Jisheng Zhang  2020-11-09  278  		return -ENOMEM;
e6ea2d16fc615e Thierry Reding 2017-03-10  279  
e6ea2d16fc615e Thierry Reding 2017-03-10  280  	eqos->dev = &pdev->dev;
e6ea2d16fc615e Thierry Reding 2017-03-10  281  	eqos->regs = res->addr;
e6ea2d16fc615e Thierry Reding 2017-03-10  282  
1d4605e0aff9ff Ajay Gupta     2019-12-15  283  	if (!is_of_node(dev->fwnode))
1d4605e0aff9ff Ajay Gupta     2019-12-15  284  		goto bypass_clk_reset_gpio;
1d4605e0aff9ff Ajay Gupta     2019-12-15  285  
e6ea2d16fc615e Thierry Reding 2017-03-10  286  	eqos->clk_master = devm_clk_get(&pdev->dev, "master_bus");
e6ea2d16fc615e Thierry Reding 2017-03-10  287  	if (IS_ERR(eqos->clk_master)) {
e6ea2d16fc615e Thierry Reding 2017-03-10  288  		err = PTR_ERR(eqos->clk_master);
e6ea2d16fc615e Thierry Reding 2017-03-10  289  		goto error;
e6ea2d16fc615e Thierry Reding 2017-03-10  290  	}
e6ea2d16fc615e Thierry Reding 2017-03-10  291  
e6ea2d16fc615e Thierry Reding 2017-03-10  292  	err = clk_prepare_enable(eqos->clk_master);
e6ea2d16fc615e Thierry Reding 2017-03-10  293  	if (err < 0)
e6ea2d16fc615e Thierry Reding 2017-03-10  294  		goto error;
e6ea2d16fc615e Thierry Reding 2017-03-10  295  
e6ea2d16fc615e Thierry Reding 2017-03-10  296  	eqos->clk_slave = devm_clk_get(&pdev->dev, "slave_bus");
e6ea2d16fc615e Thierry Reding 2017-03-10  297  	if (IS_ERR(eqos->clk_slave)) {
e6ea2d16fc615e Thierry Reding 2017-03-10  298  		err = PTR_ERR(eqos->clk_slave);
e6ea2d16fc615e Thierry Reding 2017-03-10  299  		goto disable_master;
e6ea2d16fc615e Thierry Reding 2017-03-10  300  	}
e6ea2d16fc615e Thierry Reding 2017-03-10  301  
e6ea2d16fc615e Thierry Reding 2017-03-10  302  	data->stmmac_clk = eqos->clk_slave;
e6ea2d16fc615e Thierry Reding 2017-03-10  303  
e6ea2d16fc615e Thierry Reding 2017-03-10  304  	err = clk_prepare_enable(eqos->clk_slave);
e6ea2d16fc615e Thierry Reding 2017-03-10  305  	if (err < 0)
e6ea2d16fc615e Thierry Reding 2017-03-10  306  		goto disable_master;
e6ea2d16fc615e Thierry Reding 2017-03-10  307  
e6ea2d16fc615e Thierry Reding 2017-03-10  308  	eqos->clk_rx = devm_clk_get(&pdev->dev, "rx");
e6ea2d16fc615e Thierry Reding 2017-03-10  309  	if (IS_ERR(eqos->clk_rx)) {
e6ea2d16fc615e Thierry Reding 2017-03-10  310  		err = PTR_ERR(eqos->clk_rx);
e6ea2d16fc615e Thierry Reding 2017-03-10  311  		goto disable_slave;
e6ea2d16fc615e Thierry Reding 2017-03-10  312  	}
e6ea2d16fc615e Thierry Reding 2017-03-10  313  
e6ea2d16fc615e Thierry Reding 2017-03-10  314  	err = clk_prepare_enable(eqos->clk_rx);
e6ea2d16fc615e Thierry Reding 2017-03-10  315  	if (err < 0)
e6ea2d16fc615e Thierry Reding 2017-03-10  316  		goto disable_slave;
e6ea2d16fc615e Thierry Reding 2017-03-10  317  
e6ea2d16fc615e Thierry Reding 2017-03-10  318  	eqos->clk_tx = devm_clk_get(&pdev->dev, "tx");
e6ea2d16fc615e Thierry Reding 2017-03-10  319  	if (IS_ERR(eqos->clk_tx)) {
e6ea2d16fc615e Thierry Reding 2017-03-10  320  		err = PTR_ERR(eqos->clk_tx);
e6ea2d16fc615e Thierry Reding 2017-03-10  321  		goto disable_rx;
e6ea2d16fc615e Thierry Reding 2017-03-10  322  	}
e6ea2d16fc615e Thierry Reding 2017-03-10  323  
e6ea2d16fc615e Thierry Reding 2017-03-10  324  	err = clk_prepare_enable(eqos->clk_tx);
e6ea2d16fc615e Thierry Reding 2017-03-10  325  	if (err < 0)
e6ea2d16fc615e Thierry Reding 2017-03-10  326  		goto disable_rx;
e6ea2d16fc615e Thierry Reding 2017-03-10  327  
e6ea2d16fc615e Thierry Reding 2017-03-10  328  	eqos->reset = devm_gpiod_get(&pdev->dev, "phy-reset", GPIOD_OUT_HIGH);
e6ea2d16fc615e Thierry Reding 2017-03-10  329  	if (IS_ERR(eqos->reset)) {
e6ea2d16fc615e Thierry Reding 2017-03-10  330  		err = PTR_ERR(eqos->reset);
e6ea2d16fc615e Thierry Reding 2017-03-10  331  		goto disable_tx;
e6ea2d16fc615e Thierry Reding 2017-03-10  332  	}
e6ea2d16fc615e Thierry Reding 2017-03-10  333  
e6ea2d16fc615e Thierry Reding 2017-03-10  334  	usleep_range(2000, 4000);
e6ea2d16fc615e Thierry Reding 2017-03-10  335  	gpiod_set_value(eqos->reset, 0);
e6ea2d16fc615e Thierry Reding 2017-03-10  336  
1a981c0586c038 Thierry Reding 2019-07-26  337  	/* MDIO bus was already reset just above */
1a981c0586c038 Thierry Reding 2019-07-26  338  	data->mdio_bus_data->needs_reset = false;
1a981c0586c038 Thierry Reding 2019-07-26  339  
e6ea2d16fc615e Thierry Reding 2017-03-10  340  	eqos->rst = devm_reset_control_get(&pdev->dev, "eqos");
e6ea2d16fc615e Thierry Reding 2017-03-10  341  	if (IS_ERR(eqos->rst)) {
e6ea2d16fc615e Thierry Reding 2017-03-10  342  		err = PTR_ERR(eqos->rst);
e6ea2d16fc615e Thierry Reding 2017-03-10  343  		goto reset_phy;
e6ea2d16fc615e Thierry Reding 2017-03-10  344  	}
e6ea2d16fc615e Thierry Reding 2017-03-10  345  
e6ea2d16fc615e Thierry Reding 2017-03-10  346  	err = reset_control_assert(eqos->rst);
e6ea2d16fc615e Thierry Reding 2017-03-10  347  	if (err < 0)
e6ea2d16fc615e Thierry Reding 2017-03-10  348  		goto reset_phy;
e6ea2d16fc615e Thierry Reding 2017-03-10  349  
e6ea2d16fc615e Thierry Reding 2017-03-10  350  	usleep_range(2000, 4000);
e6ea2d16fc615e Thierry Reding 2017-03-10  351  
e6ea2d16fc615e Thierry Reding 2017-03-10  352  	err = reset_control_deassert(eqos->rst);
e6ea2d16fc615e Thierry Reding 2017-03-10  353  	if (err < 0)
e6ea2d16fc615e Thierry Reding 2017-03-10  354  		goto reset_phy;
e6ea2d16fc615e Thierry Reding 2017-03-10  355  
e6ea2d16fc615e Thierry Reding 2017-03-10  356  	usleep_range(2000, 4000);
e6ea2d16fc615e Thierry Reding 2017-03-10  357  
1d4605e0aff9ff Ajay Gupta     2019-12-15  358  bypass_clk_reset_gpio:
e6ea2d16fc615e Thierry Reding 2017-03-10 @359  	data->fix_mac_speed = tegra_eqos_fix_speed;
e6ea2d16fc615e Thierry Reding 2017-03-10  360  	data->init = tegra_eqos_init;
e6ea2d16fc615e Thierry Reding 2017-03-10  361  	data->bsp_priv = eqos;
029c1c2059e9c4 Jon Hunter     2022-07-06  362  	data->sph_disable = 1;
e6ea2d16fc615e Thierry Reding 2017-03-10  363  
e6ea2d16fc615e Thierry Reding 2017-03-10  364  	err = tegra_eqos_init(pdev, eqos);
e6ea2d16fc615e Thierry Reding 2017-03-10  365  	if (err < 0)
e6ea2d16fc615e Thierry Reding 2017-03-10  366  		goto reset;
e6ea2d16fc615e Thierry Reding 2017-03-10  367  
a884915f4cef94 Jisheng Zhang  2020-11-09  368  	return 0;
e6ea2d16fc615e Thierry Reding 2017-03-10  369  reset:
e6ea2d16fc615e Thierry Reding 2017-03-10  370  	reset_control_assert(eqos->rst);
e6ea2d16fc615e Thierry Reding 2017-03-10  371  reset_phy:
e6ea2d16fc615e Thierry Reding 2017-03-10  372  	gpiod_set_value(eqos->reset, 1);
e6ea2d16fc615e Thierry Reding 2017-03-10  373  disable_tx:
e6ea2d16fc615e Thierry Reding 2017-03-10  374  	clk_disable_unprepare(eqos->clk_tx);
e6ea2d16fc615e Thierry Reding 2017-03-10  375  disable_rx:
e6ea2d16fc615e Thierry Reding 2017-03-10  376  	clk_disable_unprepare(eqos->clk_rx);
e6ea2d16fc615e Thierry Reding 2017-03-10  377  disable_slave:
e6ea2d16fc615e Thierry Reding 2017-03-10  378  	clk_disable_unprepare(eqos->clk_slave);
e6ea2d16fc615e Thierry Reding 2017-03-10  379  disable_master:
e6ea2d16fc615e Thierry Reding 2017-03-10  380  	clk_disable_unprepare(eqos->clk_master);
e6ea2d16fc615e Thierry Reding 2017-03-10  381  error:
a884915f4cef94 Jisheng Zhang  2020-11-09  382  	return err;
e6ea2d16fc615e Thierry Reding 2017-03-10  383  }
e6ea2d16fc615e Thierry Reding 2017-03-10  384
kernel test robot July 28, 2023, 10:14 p.m. UTC | #2
Hi Shenwei,

kernel test robot noticed the following build errors:

[auto build test ERROR on net/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenwei-Wang/net-stmmac-add-new-mode-parameter-for-fix_mac_speed/20230727-232922
base:   net/main
patch link:    https://lore.kernel.org/r/20230727152503.2199550-2-shenwei.wang%40nxp.com
patch subject: [PATCH v2 net 1/2] net: stmmac: add new mode parameter for fix_mac_speed
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230729/202307290635.TOWvHdhK-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230729/202307290635.TOWvHdhK-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307290635.TOWvHdhK-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c: In function 'starfive_dwmac_probe':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c:132:41: error: assignment to 'void (*)(void *, uint,  uint)' {aka 'void (*)(void *, unsigned int,  unsigned int)'} from incompatible pointer type 'void (*)(void *, unsigned int)' [-Werror=incompatible-pointer-types]
     132 |                 plat_dat->fix_mac_speed = starfive_dwmac_fix_mac_speed;
         |                                         ^
   cc1: some warnings being treated as errors
--
   drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c: In function 'sti_dwmac_probe':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c:296:33: error: assignment to 'void (*)(void *, uint,  uint)' {aka 'void (*)(void *, unsigned int,  unsigned int)'} from incompatible pointer type 'void (*)(void *, unsigned int)' [-Werror=incompatible-pointer-types]
     296 |         plat_dat->fix_mac_speed = data->fix_retime_src;
         |                                 ^
   cc1: some warnings being treated as errors
--
   drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c: In function 'tegra_eqos_probe':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c:359:29: error: assignment to 'void (*)(void *, uint,  uint)' {aka 'void (*)(void *, unsigned int,  unsigned int)'} from incompatible pointer type 'void (*)(void *, unsigned int)' [-Werror=incompatible-pointer-types]
     359 |         data->fix_mac_speed = tegra_eqos_fix_speed;
         |                             ^
   cc1: some warnings being treated as errors
--
   drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c: In function 'intel_eth_plat_probe':
>> drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c:108:49: error: assignment to 'void (*)(void *, uint,  uint)' {aka 'void (*)(void *, unsigned int,  unsigned int)'} from incompatible pointer type 'void (*)(void *, unsigned int)' [-Werror=incompatible-pointer-types]
     108 |                         plat_dat->fix_mac_speed = dwmac->data->fix_mac_speed;
         |                                                 ^
   cc1: some warnings being treated as errors


vim +132 drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c

b4a5afa51ceeca Samin Guo 2023-04-17   92  
4bd3bb7b452690 Samin Guo 2023-04-17   93  static int starfive_dwmac_probe(struct platform_device *pdev)
4bd3bb7b452690 Samin Guo 2023-04-17   94  {
4bd3bb7b452690 Samin Guo 2023-04-17   95  	struct plat_stmmacenet_data *plat_dat;
4bd3bb7b452690 Samin Guo 2023-04-17   96  	struct stmmac_resources stmmac_res;
4bd3bb7b452690 Samin Guo 2023-04-17   97  	struct starfive_dwmac *dwmac;
4bd3bb7b452690 Samin Guo 2023-04-17   98  	struct clk *clk_gtx;
4bd3bb7b452690 Samin Guo 2023-04-17   99  	int err;
4bd3bb7b452690 Samin Guo 2023-04-17  100  
4bd3bb7b452690 Samin Guo 2023-04-17  101  	err = stmmac_get_platform_resources(pdev, &stmmac_res);
4bd3bb7b452690 Samin Guo 2023-04-17  102  	if (err)
4bd3bb7b452690 Samin Guo 2023-04-17  103  		return dev_err_probe(&pdev->dev, err,
4bd3bb7b452690 Samin Guo 2023-04-17  104  				     "failed to get resources\n");
4bd3bb7b452690 Samin Guo 2023-04-17  105  
4bd3bb7b452690 Samin Guo 2023-04-17  106  	plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
4bd3bb7b452690 Samin Guo 2023-04-17  107  	if (IS_ERR(plat_dat))
4bd3bb7b452690 Samin Guo 2023-04-17  108  		return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat),
4bd3bb7b452690 Samin Guo 2023-04-17  109  				     "dt configuration failed\n");
4bd3bb7b452690 Samin Guo 2023-04-17  110  
4bd3bb7b452690 Samin Guo 2023-04-17  111  	dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
4bd3bb7b452690 Samin Guo 2023-04-17  112  	if (!dwmac)
4bd3bb7b452690 Samin Guo 2023-04-17  113  		return -ENOMEM;
4bd3bb7b452690 Samin Guo 2023-04-17  114  
4bd3bb7b452690 Samin Guo 2023-04-17  115  	dwmac->clk_tx = devm_clk_get_enabled(&pdev->dev, "tx");
4bd3bb7b452690 Samin Guo 2023-04-17  116  	if (IS_ERR(dwmac->clk_tx))
4bd3bb7b452690 Samin Guo 2023-04-17  117  		return dev_err_probe(&pdev->dev, PTR_ERR(dwmac->clk_tx),
4bd3bb7b452690 Samin Guo 2023-04-17  118  				     "error getting tx clock\n");
4bd3bb7b452690 Samin Guo 2023-04-17  119  
4bd3bb7b452690 Samin Guo 2023-04-17  120  	clk_gtx = devm_clk_get_enabled(&pdev->dev, "gtx");
4bd3bb7b452690 Samin Guo 2023-04-17  121  	if (IS_ERR(clk_gtx))
4bd3bb7b452690 Samin Guo 2023-04-17  122  		return dev_err_probe(&pdev->dev, PTR_ERR(clk_gtx),
4bd3bb7b452690 Samin Guo 2023-04-17  123  				     "error getting gtx clock\n");
4bd3bb7b452690 Samin Guo 2023-04-17  124  
4bd3bb7b452690 Samin Guo 2023-04-17  125  	/* Generally, the rgmii_tx clock is provided by the internal clock,
4bd3bb7b452690 Samin Guo 2023-04-17  126  	 * which needs to match the corresponding clock frequency according
4bd3bb7b452690 Samin Guo 2023-04-17  127  	 * to different speeds. If the rgmii_tx clock is provided by the
4bd3bb7b452690 Samin Guo 2023-04-17  128  	 * external rgmii_rxin, there is no need to configure the clock
4bd3bb7b452690 Samin Guo 2023-04-17  129  	 * internally, because rgmii_rxin will be adaptively adjusted.
4bd3bb7b452690 Samin Guo 2023-04-17  130  	 */
4bd3bb7b452690 Samin Guo 2023-04-17  131  	if (!device_property_read_bool(&pdev->dev, "starfive,tx-use-rgmii-clk"))
4bd3bb7b452690 Samin Guo 2023-04-17 @132  		plat_dat->fix_mac_speed = starfive_dwmac_fix_mac_speed;
4bd3bb7b452690 Samin Guo 2023-04-17  133  
4bd3bb7b452690 Samin Guo 2023-04-17  134  	dwmac->dev = &pdev->dev;
4bd3bb7b452690 Samin Guo 2023-04-17  135  	plat_dat->bsp_priv = dwmac;
4bd3bb7b452690 Samin Guo 2023-04-17  136  	plat_dat->dma_cfg->dche = true;
4bd3bb7b452690 Samin Guo 2023-04-17  137  
b4a5afa51ceeca Samin Guo 2023-04-17  138  	err = starfive_dwmac_set_mode(plat_dat);
b4a5afa51ceeca Samin Guo 2023-04-17  139  	if (err)
b4a5afa51ceeca Samin Guo 2023-04-17  140  		return err;
b4a5afa51ceeca Samin Guo 2023-04-17  141  
4bd3bb7b452690 Samin Guo 2023-04-17  142  	err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
4bd3bb7b452690 Samin Guo 2023-04-17  143  	if (err) {
4bd3bb7b452690 Samin Guo 2023-04-17  144  		stmmac_remove_config_dt(pdev, plat_dat);
4bd3bb7b452690 Samin Guo 2023-04-17  145  		return err;
4bd3bb7b452690 Samin Guo 2023-04-17  146  	}
4bd3bb7b452690 Samin Guo 2023-04-17  147  
4bd3bb7b452690 Samin Guo 2023-04-17  148  	return 0;
4bd3bb7b452690 Samin Guo 2023-04-17  149  }
4bd3bb7b452690 Samin Guo 2023-04-17  150
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index b9378a63f0e8..53ee5a42c071 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -178,7 +178,7 @@  static void imx_dwmac_exit(struct platform_device *pdev, void *priv)
 	/* nothing to do now */
 }
 
-static void imx_dwmac_fix_speed(void *priv, unsigned int speed)
+static void imx_dwmac_fix_speed(void *priv, uint speed, uint mode)
 {
 	struct plat_stmmacenet_data *plat_dat;
 	struct imx_priv_data *dwmac = priv;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
index e39406df8516..8070352844e3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
@@ -257,7 +257,7 @@  static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
 	return PTR_ERR_OR_ZERO(gmac->qsgmii_csr);
 }
 
-static void ipq806x_gmac_fix_mac_speed(void *priv, unsigned int speed)
+static void ipq806x_gmac_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct ipq806x_gmac *gmac = priv;
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
index 7aa5e6bc04eb..612551c09ad9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
@@ -22,7 +22,7 @@  struct meson_dwmac {
 	void __iomem	*reg;
 };
 
-static void meson6_dwmac_fix_mac_speed(void *priv, unsigned int speed)
+static void meson6_dwmac_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct meson_dwmac *dwmac = priv;
 	unsigned int val;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 735525ba8b93..c32549d2fc5a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -631,7 +631,7 @@  static int ethqos_configure(struct qcom_ethqos *ethqos)
 	return ethqos->configure_func(ethqos);
 }
 
-static void ethqos_fix_mac_speed(void *priv, unsigned int speed)
+static void ethqos_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct qcom_ethqos *ethqos = priv;
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index d81591b470a2..2fb24c7e1b44 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1785,7 +1785,7 @@  static void rk_gmac_powerdown(struct rk_priv_data *gmac)
 	gmac_clk_enable(gmac, false);
 }
 
-static void rk_fix_speed(void *priv, unsigned int speed)
+static void rk_fix_speed(void *priv, uint speed, uint mode)
 {
 	struct rk_priv_data *bsp_priv = priv;
 	struct device *dev = &bsp_priv->pdev->dev;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index 6267bcb60206..ef3be5a3e7b5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -61,7 +61,7 @@  struct socfpga_dwmac {
 	struct mdio_device *pcs_mdiodev;
 };
 
-static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
+static void socfpga_dwmac_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv;
 	void __iomem *splitter_base = dwmac->splitter_base;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
index 50963e91c347..4bbc9d6888f1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
@@ -72,7 +72,7 @@  static void sun7i_gmac_exit(struct platform_device *pdev, void *priv)
 		regulator_disable(gmac->regulator);
 }
 
-static void sun7i_fix_speed(void *priv, unsigned int speed)
+static void sun7i_fix_speed(void *priv, uint speed, uint mode)
 {
 	struct sunxi_priv_data *gmac = priv;
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
index acbb284be174..5c50cebe9a17 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
@@ -53,7 +53,7 @@  struct visconti_eth {
 	spinlock_t lock; /* lock to protect register update */
 };
 
-static void visconti_eth_fix_mac_speed(void *priv, unsigned int speed)
+static void visconti_eth_fix_mac_speed(void *priv, uint speed, uint mode)
 {
 	struct visconti_eth *dwmac = priv;
 	struct net_device *netdev = dev_get_drvdata(dwmac->dev);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e1f1c034d325..1c26d60886be 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1060,7 +1060,7 @@  static void stmmac_mac_link_up(struct phylink_config *config,
 	priv->speed = speed;
 
 	if (priv->plat->fix_mac_speed)
-		priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed);
+		priv->plat->fix_mac_speed(priv->plat->bsp_priv, speed, mode);
 
 	if (!duplex)
 		ctrl &= ~priv->hw->link.duplex;
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index ef67dba775d0..7d5e178574be 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -253,7 +253,7 @@  struct plat_stmmacenet_data {
 	u8 tx_sched_algorithm;
 	struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES];
 	struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES];
-	void (*fix_mac_speed)(void *priv, unsigned int speed);
+	void (*fix_mac_speed)(void *priv, uint speed, uint mode);
 	int (*fix_soc_reset)(void *priv, void __iomem *ioaddr);
 	int (*serdes_powerup)(struct net_device *ndev, void *priv);
 	void (*serdes_powerdown)(struct net_device *ndev, void *priv);