tree:
https://github.com/frank-w/BPI-R2-4.14 5.15-rtl8367dsa
head: e9ec03c13f235a810e08f9797a0e826b994a8743
commit: 135bbd3ba8140624beeff45f30dc314c30a9be6f [40/44] net: dsa: rtl8367: add chip
detection
config: s390-randconfig-r022-20211114 (attached as .config)
compiler: s390-linux-gcc (GCC) 11.2.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
#
https://github.com/frank-w/BPI-R2-4.14/commit/135bbd3ba8140624beeff45f30d...
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.15-rtl8367dsa
git checkout 135bbd3ba8140624beeff45f30dc314c30a9be6f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=s390
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 >>):
In file included from drivers/net/dsa/rtl8367s_mdio.c:23:
drivers/net/dsa/rtl8367s_mdio.h:393:15: warning: no previous prototype for
'rtk_vlan_reset' [-Wmissing-prototypes]
393 | rtk_api_ret_t rtk_vlan_reset(void) {return 0;}
| ^~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:396:15: warning: no previous prototype for
'rtk_vlan_init' [-Wmissing-prototypes]
396 | rtk_api_ret_t rtk_vlan_init(void) {return 0;}
| ^~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:419:15: warning: no previous prototype for
'rtk_vlan_set' [-Wmissing-prototypes]
419 | rtk_api_ret_t rtk_vlan_set(rtk_vlan_t vid, rtk_vlan_cfg_t *pVlanCfg) {return
0;}
| ^~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:444:15: warning: no previous prototype for
'rtk_vlan_portPvid_set' [-Wmissing-prototypes]
444 | rtk_api_ret_t rtk_vlan_portPvid_set(rtk_port_t port, rtk_vlan_t pvid, rtk_pri_t
priority) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:480:15: warning: no previous prototype for
'rtk_port_macForceLinkExt_set' [-Wmissing-prototypes]
480 | rtk_api_ret_t rtk_port_macForceLinkExt_set(rtk_port_t port, rtk_mode_ext_t
mode, rtk_port_mac_ability_t *pPortability) {return 0;};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:502:15: warning: no previous prototype for
'rtk_port_phyEnableAll_set' [-Wmissing-prototypes]
502 | rtk_api_ret_t rtk_port_phyEnableAll_set(rtk_enable_t enable) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:524:15: warning: no previous prototype for
'rtk_port_rgmiiDelayExt_set' [-Wmissing-prototypes]
524 | rtk_api_ret_t rtk_port_rgmiiDelayExt_set(rtk_port_t port, rtk_data_t txDelay,
rtk_data_t rxDelay) {return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.h:544:15: warning: no previous prototype for
'rtk_port_sgmiiNway_set' [-Wmissing-prototypes]
544 | rtk_api_ret_t rtk_port_sgmiiNway_set(rtk_port_t port, rtk_enable_t state)
{return 0;}
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:49:14: warning: no previous prototype for
'mii_mgr_read' [-Wmissing-prototypes]
49 | unsigned int mii_mgr_read(unsigned int phy_addr,unsigned int
phy_register,unsigned int *read_data)
| ^~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:62:14: warning: no previous prototype for
'mii_mgr_write' [-Wmissing-prototypes]
62 | unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int
phy_register,unsigned int write_data)
| ^~~~~~~~~~~~~
> drivers/net/dsa/rtl8367s_mdio.c:79:11: warning: no previous
prototype for 'smi_read' [-Wmissing-prototypes]
79 | rtk_int32
smi_read(rtk_uint32 mAddrs, rtk_uint32 *rData)
| ^~~~~~~~
> drivers/net/dsa/rtl8367s_mdio.c:108:11: warning: no previous
prototype for 'smi_write' [-Wmissing-prototypes]
108 | rtk_int32
smi_write(rtk_uint32 mAddrs, rtk_uint32 rData)
| ^~~~~~~~~
> drivers/net/dsa/rtl8367s_mdio.c:155:7: warning: no previous
prototype for 'rtl8367c_setAsicReg' [-Wmissing-prototypes]
155 | ret_t
rtl8367c_setAsicReg(rtk_uint32 reg, rtk_uint32 value)
| ^~~~~~~~~~~~~~~~~~~
> drivers/net/dsa/rtl8367s_mdio.c:180:7: warning: no previous
prototype for 'rtl8367c_getAsicReg' [-Wmissing-prototypes]
180 | ret_t
rtl8367c_getAsicReg(rtk_uint32 reg, rtk_uint32 *pValue)
| ^~~~~~~~~~~~~~~~~~~
> drivers/net/dsa/rtl8367s_mdio.c:210:15: warning: no previous
prototype for 'rtk_switch_probe' [-Wmissing-prototypes]
210 |
rtk_api_ret_t rtk_switch_probe(switch_chip_t *pSwitchChip)
| ^~~~~~~~~~~~~~~~
> drivers/net/dsa/rtl8367s_mdio.c:258:15: warning: no previous
prototype for 'rtk_switch_init' [-Wmissing-prototypes]
258 |
rtk_api_ret_t rtk_switch_init(void)
| ^~~~~~~~~~~~~~~
drivers/net/dsa/rtl8367s_mdio.c:412:6: warning: no previous prototype for
'init_gsw' [-Wmissing-prototypes]
412 | void init_gsw(void)
| ^~~~~~~~
vim +/smi_read +79 drivers/net/dsa/rtl8367s_mdio.c
77
78 //MDC_MDIO_OPERATION is defined in phy code via makefile
79 rtk_int32 smi_read(rtk_uint32 mAddrs, rtk_uint32 *rData)
80 {
81 if(mAddrs > 0xFFFF)
82 return RT_ERR_INPUT;
83
84 if(rData == NULL)
85 return RT_ERR_NULL_POINTER;
86
87 /* Lock (empty function in phy driver) */
88 //rtlglue_drvMutexLock();
89
90 /* Write address control code to register 31 */
91 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL0_REG,
MDC_MDIO_ADDR_OP);
92
93 /* Write address to register 23 */
94 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_ADDRESS_REG,
mAddrs);
95
96 /* Write read control code to register 21 */
97 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL1_REG,
MDC_MDIO_READ_OP);
98
99 /* Read data from register 25 */
100 MDC_MDIO_READ(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_DATA_READ_REG,
rData);
101
102 /* Unlock (empty function in phy driver) */
103 //rtlglue_drvMutexUnlock();
104
105 return RT_ERR_OK;
106 }
107
108 rtk_int32 smi_write(rtk_uint32 mAddrs, rtk_uint32 rData)
109 {
110 if(mAddrs > 0xFFFF)
111 return RT_ERR_INPUT;
112
113 if(rData > 0xFFFF)
114 return RT_ERR_INPUT;
115
116 /* Lock (empty function in phy driver) */
117 //rtlglue_drvMutexLock();
118
119 /* Write address control code to register 31 */
120 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL0_REG,
MDC_MDIO_ADDR_OP);
121
122 /* Write address to register 23 */
123 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_ADDRESS_REG,
mAddrs);
124
125 /* Write data to register 24 */
126 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_DATA_WRITE_REG,
rData);
127
128 /* Write data control code to register 21 */
129 MDC_MDIO_WRITE(MDC_MDIO_PREAMBLE_LEN, MDC_MDIO_PHY_ID, MDC_MDIO_CTRL1_REG,
MDC_MDIO_WRITE_OP);
130
131 /* Unlock (empty function in phy driver) */
132 //rtlglue_drvMutexUnlock();
133
134 return RT_ERR_OK;
135
136 }
137
138
139
140 /* Function Name:
141 * rtl8367c_setAsicReg
142 * Description:
143 * Set content of asic register
144 * Input:
145 * reg - register's address
146 * value - Value setting to register
147 * Output:
148 * None
149 * Return:
150 * RT_ERR_OK - Success
151 * RT_ERR_SMI - SMI access error
152 * Note:
153 * The value will be set to ASIC mapping address only and it is always return
RT_ERR_OK while setting un-mapping address registers
154 */
155 ret_t rtl8367c_setAsicReg(rtk_uint32 reg, rtk_uint32 value)
156 {
157 ret_t retVal;
158
159 retVal = smi_write(reg, value);
160 if(retVal != RT_ERR_OK)
161 return RT_ERR_SMI;
162
163 return RT_ERR_OK;
164 }
165 /* Function Name:
166 * rtl8367c_getAsicReg
167 * Description:
168 * Get content of asic register
169 * Input:
170 * reg - register's address
171 * value - Value setting to register
172 * Output:
173 * None
174 * Return:
175 * RT_ERR_OK - Success
176 * RT_ERR_SMI - SMI access error
177 * Note:
178 * Value 0x0000 will be returned for ASIC un-mapping address
179 */
180 ret_t rtl8367c_getAsicReg(rtk_uint32 reg, rtk_uint32 *pValue)
181 {
182
183 rtk_uint32 regData;
184 ret_t retVal;
185
186 retVal = smi_read(reg, ®Data);
187 if(retVal != RT_ERR_OK)
188 return RT_ERR_SMI;
189
190 *pValue = regData;
191
192 return RT_ERR_OK;
193 }
194
195
196 /* Function Name:
197 * rtk_switch_probe
198 * Description:
199 * Probe switch
200 * Input:
201 * None
202 * Output:
203 * None
204 * Return:
205 * RT_ERR_OK - Switch probed
206 * RT_ERR_FAILED - Switch Unprobed.
207 * Note:
208 *
209 */
210 rtk_api_ret_t rtk_switch_probe(switch_chip_t *pSwitchChip)
211 {
212 rtk_uint32 retVal;
213 rtk_uint32 data, regValue;
214
215 if((retVal = rtl8367c_setAsicReg(0x13C2, 0x0249)) != RT_ERR_OK)
216 return retVal;
217
218 if((retVal = rtl8367c_getAsicReg(0x1300, &data)) != RT_ERR_OK)
219 return retVal;
220
221 if((retVal = rtl8367c_getAsicReg(0x1301, ®Value)) != RT_ERR_OK)
222 return retVal;
223
224 if((retVal = rtl8367c_setAsicReg(0x13C2, 0x0000)) != RT_ERR_OK)
225 return retVal;
226
227 printk(KERN_ALERT "DEBUG: Passed %s %d chip:
0x%x\n",__FUNCTION__,__LINE__,data); //0x6367 on r64 v0.1
228
229 switch (data)
230 {
231 case 0x0276:
232 case 0x0597:
233 case 0x6367:
234 *pSwitchChip = CHIP_RTL8367C;
235 break;
236 case 0x0652:
237 case 0x6368:
238 *pSwitchChip = CHIP_RTL8370B;
239 break;
240 case 0x0801:
241 case 0x6511:
242 if( (regValue & 0x00F0) == 0x0080)
243 {
244 *pSwitchChip = CHIP_RTL8363SC_VB;
245 }
246 else
247 {
248 *pSwitchChip = CHIP_RTL8364B;
249 }
250 break;
251 default:
252 return RT_ERR_FAILED;
253 }
254
255 return RT_ERR_OK;
256 }
257
258 rtk_api_ret_t rtk_switch_init(void)
259 {
260 rtk_uint32 retVal;
261 //rtl8367c_rma_t rmaCfg;
262 switch_chip_t switchChip;
263
264 /* probe switch */
265 if ((retVal = rtk_switch_probe(&switchChip)) != RT_ERR_OK)
266 return retVal;
267
268 //some more missing here...
269
270 return 0;
271 }
272
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org