tree:
https://github.com/frank-w/BPI-R2-4.14 5.9-r64
head: cd8fe04edbda6f089442fcbdedad421a55e44b21
commit: ce71ea546d2c5bcd9d79dc19dc5a94d5d55b55de [11/14] net: dsa: mt7530: Add the support
of MT7531 switch
config: arc-randconfig-r002-20200818 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout ce71ea546d2c5bcd9d79dc19dc5a94d5d55b55de
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/net/dsa/mt7530.c:1976:1: warning: no previous prototype
for 'mt7531_sgmii_link_up_force' [-Wmissing-prototypes]
1976 |
mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/dsa/mt7530.c:2081:6: warning: no previous prototype
for 'mt7531_sgmii_restart_an' [-Wmissing-prototypes]
2081 | void
mt7531_sgmii_restart_an(struct dsa_switch *ds, int port)
| ^~~~~~~~~~~~~~~~~~~~~~~
#
https://github.com/frank-w/BPI-R2-4.14/commit/ce71ea546d2c5bcd9d79dc19dc5...
git remote add frank-w-bpi-r2-4.14
https://github.com/frank-w/BPI-R2-4.14
git fetch --no-tags frank-w-bpi-r2-4.14 5.9-r64
git checkout ce71ea546d2c5bcd9d79dc19dc5a94d5d55b55de
vim +/mt7531_sgmii_link_up_force +1976 drivers/net/dsa/mt7530.c
1974
1975 void
1976 mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
1977 unsigned int mode, phy_interface_t interface,
1978 int speed, int duplex)
1979 {
1980 struct mt7530_priv *priv = ds->priv;
1981 unsigned int val;
1982
1983 /* For adjusting speed and duplex of SGMII force mode. */
1984 if (interface != PHY_INTERFACE_MODE_SGMII ||
1985 phylink_autoneg_inband(mode))
1986 return;
1987
1988 /* SGMII force mode setting */
1989 val = mt7530_read(priv, MT7531_SGMII_MODE(port));
1990 val &= ~MT7531_SGMII_IF_MODE_MASK;
1991
1992 switch (speed) {
1993 case SPEED_10:
1994 val |= MT7531_SGMII_FORCE_SPEED_10;
1995 break;
1996 case SPEED_100:
1997 val |= MT7531_SGMII_FORCE_SPEED_100;
1998 break;
1999 case SPEED_1000:
2000 val |= MT7531_SGMII_FORCE_SPEED_1000;
2001 break;
2002 }
2003
2004 /* MT7531 SGMII 1G force mode can only work in full duplex mode,
2005 * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
2006 */
2007 if ((speed == SPEED_10 || speed == SPEED_100) &&
2008 duplex != DUPLEX_FULL)
2009 val |= MT7531_SGMII_FORCE_HALF_DUPLEX;
2010
2011 mt7530_write(priv, MT7531_SGMII_MODE(port), val);
2012 }
2013
2014 static bool mt753x_is_mac_port(u32 port)
2015 {
2016 return (port == 5 || port == 6);
2017 }
2018
2019 static int mt7531_sgmii_setup_mode_force(struct mt7530_priv *priv, u32 port,
2020 phy_interface_t interface)
2021 {
2022 u32 val;
2023
2024 if (!mt753x_is_mac_port(port))
2025 return -EINVAL;
2026
2027 mt7530_set(priv, MT7531_QPHY_PWR_STATE_CTRL(port),
2028 MT7531_SGMII_PHYA_PWD);
2029
2030 val = mt7530_read(priv, MT7531_PHYA_CTRL_SIGNAL3(port));
2031 val &= ~MT7531_RG_TPHY_SPEED_MASK;
2032 /* Setup 2.5 times faster clock for 2.5Gbps data speeds with 10B/8B
2033 * encoding.
2034 */
2035 val |= (interface == PHY_INTERFACE_MODE_2500BASEX) ?
2036 MT7531_RG_TPHY_SPEED_3_125G : MT7531_RG_TPHY_SPEED_1_25G;
2037 mt7530_write(priv, MT7531_PHYA_CTRL_SIGNAL3(port), val);
2038
2039 mt7530_clear(priv, MT7531_PCS_CONTROL_1(port), MT7531_SGMII_AN_ENABLE);
2040
2041 /* MT7531 SGMII 1G and 2.5G force mode can only work in full duplex
2042 * mode, no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
2043 */
2044 mt7530_rmw(priv, MT7531_SGMII_MODE(port),
2045 MT7531_SGMII_IF_MODE_MASK | MT7531_SGMII_REMOTE_FAULT_DIS,
2046 MT7531_SGMII_FORCE_SPEED_1000);
2047
2048 mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), 0);
2049
2050 return 0;
2051 }
2052
2053 static int mt7531_sgmii_setup_mode_an(struct mt7530_priv *priv, int port,
2054 phy_interface_t interface)
2055 {
2056 if (!mt753x_is_mac_port(port))
2057 return -EINVAL;
2058
2059 mt7530_set(priv, MT7531_QPHY_PWR_STATE_CTRL(port),
2060 MT7531_SGMII_PHYA_PWD);
2061
2062 mt7530_rmw(priv, MT7531_PHYA_CTRL_SIGNAL3(port),
2063 MT7531_RG_TPHY_SPEED_MASK, MT7531_RG_TPHY_SPEED_1_25G);
2064
2065 mt7530_set(priv, MT7531_SGMII_MODE(port),
2066 MT7531_SGMII_REMOTE_FAULT_DIS |
2067 MT7531_SGMII_SPEED_DUPLEX_AN);
2068
2069 mt7530_rmw(priv, MT7531_PCS_SPEED_ABILITY(port),
2070 MT7531_SGMII_TX_CONFIG_MASK, 1);
2071
2072 mt7530_set(priv, MT7531_PCS_CONTROL_1(port), MT7531_SGMII_AN_ENABLE);
2073
2074 mt7530_set(priv, MT7531_PCS_CONTROL_1(port), MT7531_SGMII_AN_RESTART);
2075
2076 mt7530_write(priv, MT7531_QPHY_PWR_STATE_CTRL(port), 0);
2077
2078 return 0;
2079 }
2080
2081 void mt7531_sgmii_restart_an(struct dsa_switch *ds, int port)
2082 {
2083 struct mt7530_priv *priv = ds->priv;
2084 u32 val;
2085
2086 /* Only restart AN when AN is enabled */
2087 val = mt7530_read(priv, MT7531_PCS_CONTROL_1(port));
2088 if (val & MT7531_SGMII_AN_ENABLE) {
2089 val |= MT7531_SGMII_AN_RESTART;
2090 mt7530_write(priv, MT7531_PCS_CONTROL_1(port), val);
2091 }
2092 }
2093
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org