Lines Matching full:ocelot
13 #include <soc/mscc/ocelot.h>
14 #include <linux/dsa/ocelot.h>
879 static int vsc9959_gcb_soft_rst_status(struct ocelot *ocelot) in vsc9959_gcb_soft_rst_status() argument
883 ocelot_field_read(ocelot, GCB_SOFT_RST_SWC_RST, &val); in vsc9959_gcb_soft_rst_status()
888 static int vsc9959_sys_ram_init_status(struct ocelot *ocelot) in vsc9959_sys_ram_init_status() argument
890 return ocelot_read(ocelot, SYS_RAM_INIT); in vsc9959_sys_ram_init_status()
896 static int vsc9959_reset(struct ocelot *ocelot) in vsc9959_reset() argument
901 ocelot_field_write(ocelot, GCB_SOFT_RST_SWC_RST, 1); in vsc9959_reset()
903 err = readx_poll_timeout(vsc9959_gcb_soft_rst_status, ocelot, val, !val, in vsc9959_reset()
906 dev_err(ocelot->dev, "timeout: switch core reset\n"); in vsc9959_reset()
911 ocelot_write(ocelot, SYS_RAM_INIT_RAM_INIT, SYS_RAM_INIT); in vsc9959_reset()
912 err = readx_poll_timeout(vsc9959_sys_ram_init_status, ocelot, val, !val, in vsc9959_reset()
916 dev_err(ocelot->dev, "timeout: switch sram init\n"); in vsc9959_reset()
921 ocelot_field_write(ocelot, SYS_RESET_CFG_CORE_ENA, 1); in vsc9959_reset()
956 static int vsc9959_mdio_bus_alloc(struct ocelot *ocelot) in vsc9959_mdio_bus_alloc() argument
958 struct pci_dev *pdev = to_pci_dev(ocelot->dev); in vsc9959_mdio_bus_alloc()
959 struct felix *felix = ocelot_to_felix(ocelot); in vsc9959_mdio_bus_alloc()
961 struct device *dev = ocelot->dev; in vsc9959_mdio_bus_alloc()
1023 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_mdio_bus_alloc()
1044 static void vsc9959_mdio_bus_free(struct ocelot *ocelot) in vsc9959_mdio_bus_free() argument
1046 struct felix *felix = ocelot_to_felix(ocelot); in vsc9959_mdio_bus_free()
1049 for (port = 0; port < ocelot->num_phys_ports; port++) { in vsc9959_mdio_bus_free()
1144 static void vsc9959_port_qmaxsdu_set(struct ocelot *ocelot, int port, int tc, in vsc9959_port_qmaxsdu_set() argument
1149 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_0, in vsc9959_port_qmaxsdu_set()
1153 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_1, in vsc9959_port_qmaxsdu_set()
1157 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_2, in vsc9959_port_qmaxsdu_set()
1161 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_3, in vsc9959_port_qmaxsdu_set()
1165 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_4, in vsc9959_port_qmaxsdu_set()
1169 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_5, in vsc9959_port_qmaxsdu_set()
1173 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_6, in vsc9959_port_qmaxsdu_set()
1177 ocelot_write_rix(ocelot, max_sdu, QSYS_QMAXSDU_CFG_7, in vsc9959_port_qmaxsdu_set()
1183 static u32 vsc9959_port_qmaxsdu_get(struct ocelot *ocelot, int port, int tc) in vsc9959_port_qmaxsdu_get() argument
1186 case 0: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_0, port); in vsc9959_port_qmaxsdu_get()
1187 case 1: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_1, port); in vsc9959_port_qmaxsdu_get()
1188 case 2: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_2, port); in vsc9959_port_qmaxsdu_get()
1189 case 3: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_3, port); in vsc9959_port_qmaxsdu_get()
1190 case 4: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_4, port); in vsc9959_port_qmaxsdu_get()
1191 case 5: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_5, port); in vsc9959_port_qmaxsdu_get()
1192 case 6: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_6, port); in vsc9959_port_qmaxsdu_get()
1193 case 7: return ocelot_read_rix(ocelot, QSYS_QMAXSDU_CFG_7, port); in vsc9959_port_qmaxsdu_get()
1213 static void vsc9959_tas_guard_bands_update(struct ocelot *ocelot, int port) in vsc9959_tas_guard_bands_update() argument
1215 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_tas_guard_bands_update()
1216 struct ocelot_mm_state *mm = &ocelot->mm[port]; in vsc9959_tas_guard_bands_update()
1226 lockdep_assert_held(&ocelot->fwd_domain_lock); in vsc9959_tas_guard_bands_update()
1230 val = ocelot_read_rix(ocelot, QSYS_TAG_CONFIG, port); in vsc9959_tas_guard_bands_update()
1265 val = ocelot_read_rix(ocelot, QSYS_PREEMPTION_CFG, port); in vsc9959_tas_guard_bands_update()
1270 dev_dbg(ocelot->dev, in vsc9959_tas_guard_bands_update()
1292 dev_dbg(ocelot->dev, in vsc9959_tas_guard_bands_update()
1326 dev_info(ocelot->dev, in vsc9959_tas_guard_bands_update()
1335 vsc9959_port_qmaxsdu_set(ocelot, port, tc, max_sdu); in vsc9959_tas_guard_bands_update()
1338 ocelot_write_rix(ocelot, maxlen, QSYS_PORT_MAX_SDU, port); in vsc9959_tas_guard_bands_update()
1340 ocelot->ops->cut_through_fwd(ocelot); in vsc9959_tas_guard_bands_update()
1343 static void vsc9959_sched_speed_set(struct ocelot *ocelot, int port, in vsc9959_sched_speed_set() argument
1346 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_sched_speed_set()
1367 mutex_lock(&ocelot->fwd_domain_lock); in vsc9959_sched_speed_set()
1369 ocelot_rmw_rix(ocelot, in vsc9959_sched_speed_set()
1375 vsc9959_tas_guard_bands_update(ocelot, port); in vsc9959_sched_speed_set()
1377 mutex_unlock(&ocelot->fwd_domain_lock); in vsc9959_sched_speed_set()
1380 static void vsc9959_new_base_time(struct ocelot *ocelot, ktime_t base_time, in vsc9959_new_base_time() argument
1388 ocelot_ptp_gettime64(&ocelot->ptp_info, &ts); in vsc9959_new_base_time()
1402 static u32 vsc9959_tas_read_cfg_status(struct ocelot *ocelot) in vsc9959_tas_read_cfg_status() argument
1404 return ocelot_read(ocelot, QSYS_TAS_PARAM_CFG_CTRL); in vsc9959_tas_read_cfg_status()
1407 static void vsc9959_tas_gcl_set(struct ocelot *ocelot, const u32 gcl_ix, in vsc9959_tas_gcl_set() argument
1410 ocelot_write(ocelot, in vsc9959_tas_gcl_set()
1414 ocelot_write(ocelot, entry->interval, QSYS_GCL_CFG_REG_2); in vsc9959_tas_gcl_set()
1417 static int vsc9959_qos_port_tas_set(struct ocelot *ocelot, int port, in vsc9959_qos_port_tas_set() argument
1420 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_qos_port_tas_set()
1425 mutex_lock(&ocelot->fwd_domain_lock); in vsc9959_qos_port_tas_set()
1428 ocelot_port_mqprio(ocelot, port, &taprio->mqprio); in vsc9959_qos_port_tas_set()
1429 ocelot_rmw_rix(ocelot, 0, QSYS_TAG_CONFIG_ENABLE, in vsc9959_qos_port_tas_set()
1435 vsc9959_tas_guard_bands_update(ocelot, port); in vsc9959_qos_port_tas_set()
1437 mutex_unlock(&ocelot->fwd_domain_lock); in vsc9959_qos_port_tas_set()
1444 ret = ocelot_port_mqprio(ocelot, port, &taprio->mqprio); in vsc9959_qos_port_tas_set()
1468 ocelot_rmw(ocelot, QSYS_TAS_PARAM_CFG_CTRL_PORT_NUM(port) | in vsc9959_qos_port_tas_set()
1477 val = ocelot_read_rix(ocelot, QSYS_TAG_CONFIG, port); in vsc9959_qos_port_tas_set()
1479 val = ocelot_read(ocelot, QSYS_PARAM_STATUS_REG_8); in vsc9959_qos_port_tas_set()
1486 ocelot_rmw_rix(ocelot, in vsc9959_qos_port_tas_set()
1495 vsc9959_new_base_time(ocelot, taprio->base_time, in vsc9959_qos_port_tas_set()
1497 ocelot_write(ocelot, base_ts.tv_nsec, QSYS_PARAM_CFG_REG_1); in vsc9959_qos_port_tas_set()
1498 ocelot_write(ocelot, lower_32_bits(base_ts.tv_sec), QSYS_PARAM_CFG_REG_2); in vsc9959_qos_port_tas_set()
1500 ocelot_write(ocelot, in vsc9959_qos_port_tas_set()
1504 ocelot_write(ocelot, taprio->cycle_time, QSYS_PARAM_CFG_REG_4); in vsc9959_qos_port_tas_set()
1505 ocelot_write(ocelot, taprio->cycle_time_extension, QSYS_PARAM_CFG_REG_5); in vsc9959_qos_port_tas_set()
1508 vsc9959_tas_gcl_set(ocelot, i, &taprio->entries[i]); in vsc9959_qos_port_tas_set()
1510 ocelot_rmw(ocelot, QSYS_TAS_PARAM_CFG_CTRL_CONFIG_CHANGE, in vsc9959_qos_port_tas_set()
1514 ret = readx_poll_timeout(vsc9959_tas_read_cfg_status, ocelot, val, in vsc9959_qos_port_tas_set()
1521 vsc9959_tas_guard_bands_update(ocelot, port); in vsc9959_qos_port_tas_set()
1523 mutex_unlock(&ocelot->fwd_domain_lock); in vsc9959_qos_port_tas_set()
1529 ocelot_port_mqprio(ocelot, port, &taprio->mqprio); in vsc9959_qos_port_tas_set()
1531 mutex_unlock(&ocelot->fwd_domain_lock); in vsc9959_qos_port_tas_set()
1536 static void vsc9959_tas_clock_adjust(struct ocelot *ocelot) in vsc9959_tas_clock_adjust() argument
1544 mutex_lock(&ocelot->fwd_domain_lock); in vsc9959_tas_clock_adjust()
1546 for (port = 0; port < ocelot->num_phys_ports; port++) { in vsc9959_tas_clock_adjust()
1547 ocelot_port = ocelot->ports[port]; in vsc9959_tas_clock_adjust()
1552 ocelot_rmw(ocelot, in vsc9959_tas_clock_adjust()
1558 ocelot_rmw_rix(ocelot, 0, QSYS_TAG_CONFIG_ENABLE, in vsc9959_tas_clock_adjust()
1561 vsc9959_new_base_time(ocelot, taprio->base_time, in vsc9959_tas_clock_adjust()
1564 ocelot_write(ocelot, base_ts.tv_nsec, QSYS_PARAM_CFG_REG_1); in vsc9959_tas_clock_adjust()
1565 ocelot_write(ocelot, lower_32_bits(base_ts.tv_sec), in vsc9959_tas_clock_adjust()
1568 ocelot_rmw(ocelot, in vsc9959_tas_clock_adjust()
1573 ocelot_rmw(ocelot, QSYS_TAS_PARAM_CFG_CTRL_CONFIG_CHANGE, in vsc9959_tas_clock_adjust()
1578 ocelot_rmw_rix(ocelot, QSYS_TAG_CONFIG_ENABLE, in vsc9959_tas_clock_adjust()
1582 mutex_unlock(&ocelot->fwd_domain_lock); in vsc9959_tas_clock_adjust()
1588 struct ocelot *ocelot = ds->priv; in vsc9959_qos_port_cbs_set() local
1596 ocelot_write_gix(ocelot, QSYS_CIR_CFG_CIR_RATE(0) | in vsc9959_qos_port_cbs_set()
1600 ocelot_rmw_gix(ocelot, 0, QSYS_SE_CFG_SE_AVB_ENA, in vsc9959_qos_port_cbs_set()
1614 ocelot_write_gix(ocelot, in vsc9959_qos_port_cbs_set()
1620 ocelot_rmw_gix(ocelot, in vsc9959_qos_port_cbs_set()
1653 static int vsc9959_qos_port_mqprio(struct ocelot *ocelot, int port, in vsc9959_qos_port_mqprio() argument
1658 mutex_lock(&ocelot->fwd_domain_lock); in vsc9959_qos_port_mqprio()
1659 ret = ocelot_port_mqprio(ocelot, port, mqprio); in vsc9959_qos_port_mqprio()
1660 mutex_unlock(&ocelot->fwd_domain_lock); in vsc9959_qos_port_mqprio()
1669 struct ocelot *ocelot = ds->priv; in vsc9959_port_setup_tc() local
1675 return vsc9959_qos_port_tas_set(ocelot, port, type_data); in vsc9959_port_setup_tc()
1677 return vsc9959_qos_port_mqprio(ocelot, port, type_data); in vsc9959_port_setup_tc()
1796 static int vsc9959_mact_stream_set(struct ocelot *ocelot, in vsc9959_mact_stream_set() argument
1811 ret = ocelot_mact_lookup(ocelot, &dst_idx, mac, vid, &type); in vsc9959_mact_stream_set()
1825 ret = ocelot_mact_learn_streamdata(ocelot, dst_idx, mac, vid, type, in vsc9959_mact_stream_set()
1845 static int vsc9959_stream_table_add(struct ocelot *ocelot, in vsc9959_stream_table_add() argument
1858 ret = vsc9959_mact_stream_set(ocelot, stream_entry, extack); in vsc9959_stream_table_add()
1882 static void vsc9959_stream_table_del(struct ocelot *ocelot, in vsc9959_stream_table_del() argument
1886 vsc9959_mact_stream_set(ocelot, stream, NULL); in vsc9959_stream_table_del()
1892 static u32 vsc9959_sfi_access_status(struct ocelot *ocelot) in vsc9959_sfi_access_status() argument
1894 return ocelot_read(ocelot, ANA_TABLES_SFIDACCESS); in vsc9959_sfi_access_status()
1897 static int vsc9959_psfp_sfi_set(struct ocelot *ocelot, in vsc9959_psfp_sfi_set() argument
1906 ocelot_write(ocelot, ANA_TABLES_SFIDTIDX_SFID_INDEX(sfi->index), in vsc9959_psfp_sfi_set()
1910 ocelot_write(ocelot, val, ANA_TABLES_SFIDACCESS); in vsc9959_psfp_sfi_set()
1912 return readx_poll_timeout(vsc9959_sfi_access_status, ocelot, val, in vsc9959_psfp_sfi_set()
1921 ocelot_write(ocelot, in vsc9959_psfp_sfi_set()
1929 ocelot_write(ocelot, in vsc9959_psfp_sfi_set()
1936 return readx_poll_timeout(vsc9959_sfi_access_status, ocelot, val, in vsc9959_psfp_sfi_set()
1941 static int vsc9959_psfp_sfidmask_set(struct ocelot *ocelot, u32 sfid, int ports) in vsc9959_psfp_sfidmask_set() argument
1945 ocelot_rmw(ocelot, in vsc9959_psfp_sfidmask_set()
1950 ocelot_write(ocelot, in vsc9959_psfp_sfidmask_set()
1955 ocelot_rmw(ocelot, in vsc9959_psfp_sfidmask_set()
1960 return readx_poll_timeout(vsc9959_sfi_access_status, ocelot, val, in vsc9959_psfp_sfidmask_set()
1965 static int vsc9959_psfp_sfi_list_add(struct ocelot *ocelot, in vsc9959_psfp_sfi_list_add() argument
1978 ret = vsc9959_psfp_sfi_set(ocelot, sfi_entry); in vsc9959_psfp_sfi_list_add()
1984 vsc9959_psfp_sfidmask_set(ocelot, sfi->index, sfi->portmask); in vsc9959_psfp_sfi_list_add()
1991 static int vsc9959_psfp_sfi_table_add(struct ocelot *ocelot, in vsc9959_psfp_sfi_table_add() argument
1999 psfp = &ocelot->psfp; in vsc9959_psfp_sfi_table_add()
2021 return vsc9959_psfp_sfi_list_add(ocelot, sfi, last); in vsc9959_psfp_sfi_table_add()
2024 static int vsc9959_psfp_sfi_table_add2(struct ocelot *ocelot, in vsc9959_psfp_sfi_table_add2() argument
2034 psfp = &ocelot->psfp; in vsc9959_psfp_sfi_table_add2()
2048 ret = vsc9959_psfp_sfi_list_add(ocelot, sfi, last); in vsc9959_psfp_sfi_table_add2()
2054 return vsc9959_psfp_sfi_list_add(ocelot, sfi2, last->next); in vsc9959_psfp_sfi_table_add2()
2069 static void vsc9959_psfp_sfi_table_del(struct ocelot *ocelot, u32 index) in vsc9959_psfp_sfi_table_del() argument
2075 psfp = &ocelot->psfp; in vsc9959_psfp_sfi_table_del()
2082 vsc9959_psfp_sfi_set(ocelot, tmp); in vsc9959_psfp_sfi_table_del()
2105 static u32 vsc9959_sgi_cfg_status(struct ocelot *ocelot) in vsc9959_sgi_cfg_status() argument
2107 return ocelot_read(ocelot, ANA_SG_ACCESS_CTRL); in vsc9959_sgi_cfg_status()
2110 static int vsc9959_psfp_sgi_set(struct ocelot *ocelot, in vsc9959_psfp_sgi_set() argument
2122 ocelot_write(ocelot, ANA_SG_ACCESS_CTRL_SGID(sgi->index), in vsc9959_psfp_sgi_set()
2126 ocelot_rmw(ocelot, ANA_SG_CONFIG_REG_3_INIT_GATE_STATE, in vsc9959_psfp_sgi_set()
2141 vsc9959_new_base_time(ocelot, sgi->basetime, sgi->cycletime, &base_ts); in vsc9959_psfp_sgi_set()
2142 ocelot_write(ocelot, base_ts.tv_nsec, ANA_SG_CONFIG_REG_1); in vsc9959_psfp_sgi_set()
2144 ocelot_write(ocelot, val, ANA_SG_CONFIG_REG_2); in vsc9959_psfp_sgi_set()
2147 ocelot_write(ocelot, in vsc9959_psfp_sgi_set()
2156 ocelot_write(ocelot, sgi->cycletime, ANA_SG_CONFIG_REG_4); in vsc9959_psfp_sgi_set()
2162 ocelot_write_rix(ocelot, ANA_SG_GCL_GS_CONFIG_IPS(ips) | in vsc9959_psfp_sgi_set()
2168 ocelot_write_rix(ocelot, interval_sum, ANA_SG_GCL_TI_CONFIG, i); in vsc9959_psfp_sgi_set()
2171 ocelot_rmw(ocelot, ANA_SG_ACCESS_CTRL_CONFIG_CHANGE, in vsc9959_psfp_sgi_set()
2175 return readx_poll_timeout(vsc9959_sgi_cfg_status, ocelot, val, in vsc9959_psfp_sgi_set()
2180 static int vsc9959_psfp_sgi_table_add(struct ocelot *ocelot, in vsc9959_psfp_sgi_table_add() argument
2187 psfp = &ocelot->psfp; in vsc9959_psfp_sgi_table_add()
2199 ret = vsc9959_psfp_sgi_set(ocelot, sgi); in vsc9959_psfp_sgi_table_add()
2212 static void vsc9959_psfp_sgi_table_del(struct ocelot *ocelot, in vsc9959_psfp_sgi_table_del() argument
2220 psfp = &ocelot->psfp; in vsc9959_psfp_sgi_table_del()
2228 vsc9959_psfp_sgi_set(ocelot, &sgi); in vsc9959_psfp_sgi_table_del()
2236 static int vsc9959_psfp_filter_add(struct ocelot *ocelot, int port, in vsc9959_psfp_filter_add() argument
2252 psfp = &ocelot->psfp; in vsc9959_psfp_filter_add()
2272 ret = vsc9959_psfp_sgi_table_add(ocelot, sgi); in vsc9959_psfp_filter_add()
2294 ret = ocelot_vcap_policer_add(ocelot, index, &pol); in vsc9959_psfp_filter_add()
2340 vsc9959_psfp_sfi_table_del(ocelot, stream_entry->sfid); in vsc9959_psfp_filter_add()
2346 ret = vsc9959_psfp_sfi_table_add2(ocelot, &sfi, in vsc9959_psfp_filter_add()
2350 ret = vsc9959_psfp_sfi_table_add2(ocelot, &old_sfi, in vsc9959_psfp_filter_add()
2359 ret = vsc9959_psfp_sfi_table_add(ocelot, &sfi); in vsc9959_psfp_filter_add()
2366 ret = vsc9959_stream_table_add(ocelot, &psfp->stream_list, in vsc9959_psfp_filter_add()
2369 vsc9959_psfp_sfi_table_del(ocelot, stream.sfid); in vsc9959_psfp_filter_add()
2379 vsc9959_psfp_sgi_table_del(ocelot, sfi.sgid); in vsc9959_psfp_filter_add()
2382 ocelot_vcap_policer_del(ocelot, sfi.fmid); in vsc9959_psfp_filter_add()
2389 static int vsc9959_psfp_filter_del(struct ocelot *ocelot, in vsc9959_psfp_filter_del() argument
2393 struct ocelot_psfp_list *psfp = &ocelot->psfp; in vsc9959_psfp_filter_del()
2411 vsc9959_psfp_sgi_table_del(ocelot, sfi->sgid); in vsc9959_psfp_filter_del()
2414 ocelot_vcap_policer_del(ocelot, sfi->fmid); in vsc9959_psfp_filter_del()
2416 vsc9959_psfp_sfi_table_del(ocelot, stream->sfid); in vsc9959_psfp_filter_del()
2421 vsc9959_stream_table_del(ocelot, stream); in vsc9959_psfp_filter_del()
2428 vsc9959_mact_stream_set(ocelot, stream_entry, NULL); in vsc9959_psfp_filter_del()
2430 vsc9959_psfp_sfidmask_set(ocelot, stream_entry->sfid, in vsc9959_psfp_filter_del()
2439 static void vsc9959_update_sfid_stats(struct ocelot *ocelot, in vsc9959_update_sfid_stats() argument
2446 lockdep_assert_held(&ocelot->stat_view_lock); in vsc9959_update_sfid_stats()
2448 ocelot_rmw(ocelot, SYS_STAT_CFG_STAT_VIEW(sfid), in vsc9959_update_sfid_stats()
2452 match = ocelot_read(ocelot, SYS_COUNT_SF_MATCHING_FRAMES); in vsc9959_update_sfid_stats()
2453 not_pass_gate = ocelot_read(ocelot, SYS_COUNT_SF_NOT_PASSING_FRAMES); in vsc9959_update_sfid_stats()
2454 not_pass_sdu = ocelot_read(ocelot, SYS_COUNT_SF_NOT_PASSING_SDU); in vsc9959_update_sfid_stats()
2455 red = ocelot_read(ocelot, SYS_COUNT_SF_RED_FRAMES); in vsc9959_update_sfid_stats()
2458 ocelot_write(ocelot, in vsc9959_update_sfid_stats()
2469 /* Caller must hold &ocelot->stat_view_lock */
2470 static void vsc9959_update_stats(struct ocelot *ocelot) in vsc9959_update_stats() argument
2472 struct ocelot_psfp_list *psfp = &ocelot->psfp; in vsc9959_update_stats()
2478 vsc9959_update_sfid_stats(ocelot, sfi); in vsc9959_update_stats()
2483 static int vsc9959_psfp_stats_get(struct ocelot *ocelot, in vsc9959_psfp_stats_get() argument
2487 struct ocelot_psfp_list *psfp = &ocelot->psfp; in vsc9959_psfp_stats_get()
2500 mutex_lock(&ocelot->stat_view_lock); in vsc9959_psfp_stats_get()
2502 vsc9959_update_sfid_stats(ocelot, sfi); in vsc9959_psfp_stats_get()
2510 mutex_unlock(&ocelot->stat_view_lock); in vsc9959_psfp_stats_get()
2515 static void vsc9959_psfp_init(struct ocelot *ocelot) in vsc9959_psfp_init() argument
2517 struct ocelot_psfp_list *psfp = &ocelot->psfp; in vsc9959_psfp_init()
2534 static void vsc9959_cut_through_fwd(struct ocelot *ocelot) in vsc9959_cut_through_fwd() argument
2536 struct felix *felix = ocelot_to_felix(ocelot); in vsc9959_cut_through_fwd()
2540 lockdep_assert_held(&ocelot->fwd_domain_lock); in vsc9959_cut_through_fwd()
2542 for (port = 0; port < ocelot->num_phys_ports; port++) { in vsc9959_cut_through_fwd()
2543 struct ocelot_port *ocelot_port = ocelot->ports[port]; in vsc9959_cut_through_fwd()
2544 struct ocelot_mm_state *mm = &ocelot->mm[port]; in vsc9959_cut_through_fwd()
2554 /* Ocelot switches forward from the NPI port towards in vsc9959_cut_through_fwd()
2560 mask = ocelot_get_bridge_fwd_mask(ocelot, port); in vsc9959_cut_through_fwd()
2562 if (ocelot->npi >= 0) in vsc9959_cut_through_fwd()
2563 mask |= BIT(ocelot->npi); in vsc9959_cut_through_fwd()
2565 mask |= ocelot_port_assigned_dsa_8021q_cpu_mask(ocelot, in vsc9959_cut_through_fwd()
2572 for_each_set_bit(other_port, &mask, ocelot->num_phys_ports) { in vsc9959_cut_through_fwd()
2575 other_ocelot_port = ocelot->ports[other_port]; in vsc9959_cut_through_fwd()
2593 if (vsc9959_port_qmaxsdu_get(ocelot, port, tc)) in vsc9959_cut_through_fwd()
2598 tmp = ocelot_read_rix(ocelot, ANA_CUT_THRU_CFG, port); in vsc9959_cut_through_fwd()
2602 dev_dbg(ocelot->dev, in vsc9959_cut_through_fwd()
2607 ocelot_write_rix(ocelot, val, ANA_CUT_THRU_CFG, port); in vsc9959_cut_through_fwd()
2616 struct ocelot *ocelot = data; in vsc9959_irq_handler() local
2618 ocelot_get_txtstamp(ocelot); in vsc9959_irq_handler()
2619 ocelot_mm_irq(ocelot); in vsc9959_irq_handler()
2624 static int vsc9959_request_irq(struct ocelot *ocelot) in vsc9959_request_irq() argument
2626 struct pci_dev *pdev = to_pci_dev(ocelot->dev); in vsc9959_request_irq()
2628 return devm_request_threaded_irq(ocelot->dev, pdev->irq, NULL, in vsc9959_request_irq()
2630 "felix-intb", ocelot); in vsc9959_request_irq()