Lines Matching +full:cpsw +full:- +full:switch
1 // SPDX-License-Identifier: GPL-2.0
3 * Texas Instruments Ethernet Switch media-access-controller (MAC) submodule/
122 .device_id = "cpsw",
193 if (sl->regs[reg] == CPSW_SL_REG_NOTUSED) { in cpsw_sl_reg_read()
194 dev_err(sl->dev, "cpsw_sl: not sup r reg: %04X\n", in cpsw_sl_reg_read()
195 sl->regs[reg]); in cpsw_sl_reg_read()
199 val = readl(sl->sl_base + sl->regs[reg]); in cpsw_sl_reg_read()
200 dev_dbg(sl->dev, "cpsw_sl: reg: %04X r 0x%08X\n", sl->regs[reg], val); in cpsw_sl_reg_read()
206 if (sl->regs[reg] == CPSW_SL_REG_NOTUSED) { in cpsw_sl_reg_write()
207 dev_err(sl->dev, "cpsw_sl: not sup w reg: %04X\n", in cpsw_sl_reg_write()
208 sl->regs[reg]); in cpsw_sl_reg_write()
212 dev_dbg(sl->dev, "cpsw_sl: reg: %04X w 0x%08X\n", sl->regs[reg], val); in cpsw_sl_reg_write()
213 writel(val, sl->sl_base + sl->regs[reg]); in cpsw_sl_reg_write()
223 while (id->device_id) { in cpsw_sl_match_id()
224 if (strcmp(device_id, id->device_id) == 0) in cpsw_sl_match_id()
239 return ERR_PTR(-ENOMEM); in cpsw_sl_get()
240 sl->dev = dev; in cpsw_sl_get()
241 sl->sl_base = sl_base; in cpsw_sl_get()
245 dev_err(sl->dev, "cpsw_sl: dev_id %s not found.\n", device_id); in cpsw_sl_get()
246 return ERR_PTR(-EINVAL); in cpsw_sl_get()
248 sl->regs = sl_dev_id->regs; in cpsw_sl_get()
249 sl->control_features = sl_dev_id->control_features; in cpsw_sl_get()
250 sl->idle_mask = sl_dev_id->idle_mask; in cpsw_sl_get()
251 sl->sl_base += sl_dev_id->regs_offset; in cpsw_sl_get()
271 dev_err(sl->dev, "cpsw_sl failed to soft-reset.\n"); in cpsw_sl_reset()
278 if (ctl_funcs & ~sl->control_features) { in cpsw_sl_ctl_set()
279 dev_err(sl->dev, "cpsw_sl: unsupported func 0x%08X\n", in cpsw_sl_ctl_set()
280 ctl_funcs & (~sl->control_features)); in cpsw_sl_ctl_set()
281 return -EINVAL; in cpsw_sl_ctl_set()
295 if (ctl_funcs & ~sl->control_features) { in cpsw_sl_ctl_clr()
296 dev_err(sl->dev, "cpsw_sl: unsupported func 0x%08X\n", in cpsw_sl_ctl_clr()
297 ctl_funcs & (~sl->control_features)); in cpsw_sl_ctl_clr()
298 return -EINVAL; in cpsw_sl_ctl_clr()
320 sl->idle_mask) && time_after(timeout, jiffies)); in cpsw_sl_wait_for_idle()
322 if (!(cpsw_sl_reg_read(sl, CPSW_SL_MACSTATUS) & sl->idle_mask)) { in cpsw_sl_wait_for_idle()
323 dev_err(sl->dev, "cpsw_sl failed to soft-reset.\n"); in cpsw_sl_wait_for_idle()
324 return -ETIMEDOUT; in cpsw_sl_wait_for_idle()