/linux/drivers/net/ethernet/microchip/lan966x/ |
H A D | lan966x_fdma.c | 12 struct lan966x *lan966x = (struct lan966x *)fdma->priv; in lan966x_fdma_rx_dataptr_cb() local 13 struct lan966x_rx *rx = &lan966x->rx; in lan966x_fdma_rx_dataptr_cb() 29 struct lan966x *lan966x = (struct lan966x *)fdma->priv; in lan966x_fdma_tx_dataptr_cb() local 31 *dataptr = lan966x->tx.dcbs_buf[dcb].dma_addr; in lan966x_fdma_tx_dataptr_cb() 39 struct lan966x *lan966x = (struct lan966x *)fdma->priv; in lan966x_fdma_xdp_tx_dataptr_cb() local 41 *dataptr = lan966x->tx.dcbs_buf[dcb].dma_addr + XDP_PACKET_HEADROOM; in lan966x_fdma_xdp_tx_dataptr_cb() 46 static int lan966x_fdma_channel_active(struct lan966x *lan966x) in lan966x_fdma_channel_active() argument 48 return lan_rd(lan966x, FDMA_CH_ACTIVE); in lan966x_fdma_channel_active() 77 struct lan966x *lan966x = rx->lan966x; in lan966x_fdma_rx_alloc_page_pool() local 83 .dev = lan966x->dev, in lan966x_fdma_rx_alloc_page_pool() [all …]
|
H A D | lan966x_vlan.c | 10 static int lan966x_vlan_get_status(struct lan966x *lan966x) in lan966x_vlan_get_status() argument 12 return lan_rd(lan966x, ANA_VLANACCESS); in lan966x_vlan_get_status() 15 static int lan966x_vlan_wait_for_completion(struct lan966x *lan966x) in lan966x_vlan_wait_for_completion() argument 20 lan966x, val, in lan966x_vlan_wait_for_completion() 26 static void lan966x_vlan_set_mask(struct lan966x *lan966x, u16 vid) in lan966x_vlan_set_mask() argument 28 u16 mask = lan966x->vlan_mask[vid]; in lan966x_vlan_set_mask() 38 lan966x, ANA_VLANTIDX); in lan966x_vlan_set_mask() 43 lan966x, ANA_VLAN_PORT_MASK); in lan966x_vlan_set_mask() 48 lan966x, ANA_VLANACCESS); in lan966x_vlan_set_mask() 50 if (lan966x_vlan_wait_for_completion(lan966x)) in lan966x_vlan_set_mask() [all …]
|
H A D | lan966x_ethtool.c | 293 static void lan966x_stats_update(struct lan966x *lan966x) in lan966x_stats_update() argument 297 mutex_lock(&lan966x->stats_lock); in lan966x_stats_update() 299 for (i = 0; i < lan966x->num_phys_ports; i++) { in lan966x_stats_update() 300 uint idx = i * lan966x->num_stats; in lan966x_stats_update() 303 lan966x, SYS_STAT_CFG); in lan966x_stats_update() 305 for (j = 0; j < lan966x->num_stats; j++) { in lan966x_stats_update() 306 u32 offset = lan966x->stats_layout[j].offset; in lan966x_stats_update() 308 lan966x_add_cnt(&lan966x->stats[idx++], in lan966x_stats_update() 309 lan_rd(lan966x, SYS_CNT(offset))); in lan966x_stats_update() 313 mutex_unlock(&lan966x->stats_lock); in lan966x_stats_update() [all …]
|
H A D | lan966x_main.c | 30 { .compatible = "microchip,lan966x-switch" }, 68 struct lan966x *lan966x) in lan966x_create_targets() argument 101 lan966x->regs[iomap->id] = begin[iomap->range] + iomap->offset; in lan966x_create_targets() 110 struct lan966x *lan966x = port->lan966x; in lan966x_port_unique_address() local 113 for (p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_port_unique_address() 114 port = lan966x->ports[p]; in lan966x_port_unique_address() 128 struct lan966x *lan966x = port->lan966x; in lan966x_port_set_mac_address() local 136 ret = lan966x_mac_cpu_learn(lan966x, addr->sa_data, HOST_PVID); in lan966x_port_set_mac_address() 147 ret = lan966x_mac_cpu_forget(lan966x, dev->dev_addr, HOST_PVID); in lan966x_port_set_mac_address() 172 struct lan966x *lan966x = port->lan966x; in lan966x_port_open() local [all …]
|
H A D | lan966x_mac.c | 35 static int lan966x_mac_get_status(struct lan966x *lan966x) in lan966x_mac_get_status() argument 37 return lan_rd(lan966x, ANA_MACACCESS); in lan966x_mac_get_status() 40 static int lan966x_mac_wait_for_completion(struct lan966x *lan966x) in lan966x_mac_wait_for_completion() argument 45 lan966x, val, in lan966x_mac_wait_for_completion() 52 static void lan966x_mac_select(struct lan966x *lan966x, in lan966x_mac_select() argument 69 lan_wr(macl, lan966x, ANA_MACLDATA); in lan966x_mac_select() 70 lan_wr(mach, lan966x, ANA_MACHDATA); in lan966x_mac_select() 73 static int __lan966x_mac_learn_locked(struct lan966x *lan966x, int pgid, in __lan966x_mac_learn_locked() argument 79 lockdep_assert_held(&lan966x->mac_lock); in __lan966x_mac_learn_locked() 81 lan966x_mac_select(lan966x, mac, vid); in __lan966x_mac_learn_locked() [all …]
|
H A D | lan966x_mdb.c | 23 void lan966x_mdb_init(struct lan966x *lan966x) in lan966x_mdb_init() argument 25 INIT_LIST_HEAD(&lan966x->mdb_entries); in lan966x_mdb_init() 26 INIT_LIST_HEAD(&lan966x->pgid_entries); in lan966x_mdb_init() 29 static void lan966x_mdb_purge_mdb_entries(struct lan966x *lan966x) in lan966x_mdb_purge_mdb_entries() argument 33 list_for_each_entry_safe(mdb_entry, tmp, &lan966x->mdb_entries, list) { in lan966x_mdb_purge_mdb_entries() 39 static void lan966x_mdb_purge_pgid_entries(struct lan966x *lan966x) in lan966x_mdb_purge_pgid_entries() argument 43 list_for_each_entry_safe(pgid_entry, tmp, &lan966x->pgid_entries, list) { in lan966x_mdb_purge_pgid_entries() 49 void lan966x_mdb_deinit(struct lan966x *lan966x) in lan966x_mdb_deinit() argument 51 lan966x_mdb_purge_mdb_entries(lan966x); in lan966x_mdb_deinit() 52 lan966x_mdb_purge_pgid_entries(lan966x); in lan966x_mdb_deinit() [all …]
|
H A D | lan966x_fdb.c | 12 struct lan966x *lan966x; member 24 lan966x_fdb_find_entry(struct lan966x *lan966x, in lan966x_fdb_find_entry() argument 29 list_for_each_entry(fdb_entry, &lan966x->fdb_entries, list) { in lan966x_fdb_find_entry() 38 static void lan966x_fdb_add_entry(struct lan966x *lan966x, in lan966x_fdb_add_entry() argument 43 fdb_entry = lan966x_fdb_find_entry(lan966x, fdb_info); in lan966x_fdb_add_entry() 56 list_add_tail(&fdb_entry->list, &lan966x->fdb_entries); in lan966x_fdb_add_entry() 59 static bool lan966x_fdb_del_entry(struct lan966x *lan966x, in lan966x_fdb_del_entry() argument 64 list_for_each_entry_safe(fdb_entry, tmp, &lan966x->fdb_entries, in lan966x_fdb_del_entry() 81 void lan966x_fdb_write_entries(struct lan966x *lan966x, u16 vid) in lan966x_fdb_write_entries() argument 85 list_for_each_entry(fdb_entry, &lan966x->fdb_entries, list) { in lan966x_fdb_write_entries() [all …]
|
H A D | lan966x_ptp.c | 57 struct lan966x *lan966x = port->lan966x; in lan966x_ptp_add_trap() local 61 vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id); in lan966x_ptp_add_trap() 76 vrule = vcap_alloc_rule(lan966x->vcap_ctrl, port->dev, in lan966x_ptp_add_trap() 103 struct lan966x *lan966x = port->lan966x; in lan966x_ptp_del_trap() local 108 vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id); in lan966x_ptp_del_trap() 116 if (mask == GENMASK(lan966x->num_phys_ports, 0)) { in lan966x_ptp_del_trap() 117 err = vcap_del_rule(lan966x->vcap_ctrl, port->dev, rule_id); in lan966x_ptp_del_trap() 264 struct lan966x *lan966x = port->lan966x; in lan966x_ptp_hwtstamp_set() local 307 mutex_lock(&lan966x->ptp_lock); in lan966x_ptp_hwtstamp_set() 308 phc = &lan966x->phc[LAN966X_PHC_PORT]; in lan966x_ptp_hwtstamp_set() [all …]
|
H A D | lan966x_lag.c | 7 static void lan966x_lag_set_aggr_pgids(struct lan966x *lan966x) in lan966x_lag_set_aggr_pgids() argument 9 u32 visited = GENMASK(lan966x->num_phys_ports - 1, 0); in lan966x_lag_set_aggr_pgids() 13 for (p = 0; p < lan966x->num_phys_ports; ++p) in lan966x_lag_set_aggr_pgids() 15 lan966x, ANA_PGID(p)); in lan966x_lag_set_aggr_pgids() 19 lan966x, ANA_PGID(p)); in lan966x_lag_set_aggr_pgids() 29 for (p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_lag_set_aggr_pgids() 30 struct lan966x_port *port = lan966x->ports[p]; in lan966x_lag_set_aggr_pgids() 39 for (lag = 0; lag < lan966x->num_phys_ports; ++lag) { in lan966x_lag_set_aggr_pgids() 40 struct lan966x_port *port = lan966x->ports[lag]; in lan966x_lag_set_aggr_pgids() 50 bond_mask = lan966x_lag_get_mask(lan966x, bond); in lan966x_lag_set_aggr_pgids() [all …]
|
H A D | lan966x_main.h | 195 struct lan966x *lan966x; member 231 struct lan966x *lan966x; member 251 struct lan966x *lan966x; member 265 struct lan966x { struct 390 struct lan966x *lan966x; member 433 bool lan966x_hw_offload(struct lan966x *lan966x, u32 port, struct sk_buff *skb); 442 int lan966x_stats_init(struct lan966x *lan966x); 457 int lan966x_mac_ip_learn(struct lan966x *lan966x, 462 int lan966x_mac_learn(struct lan966x *lan966x, int port, 466 int lan966x_mac_forget(struct lan966x *lan966x, [all …]
|
H A D | lan966x_vcap_impl.c | 58 struct lan966x *lan966x; member 64 return lan_rd(cb->lan966x, VCAP_UPDATE_CTRL(cb->instance)); in lan966x_vcap_read_update_ctrl() 67 static void lan966x_vcap_wait_update(struct lan966x *lan966x, int instance) in lan966x_vcap_wait_update() argument 69 const struct lan966x_vcap_cmd_cb cb = { .lan966x = lan966x, in lan966x_vcap_wait_update() 78 static void __lan966x_vcap_range_init(struct lan966x *lan966x, in __lan966x_vcap_range_init() argument 85 lan966x, VCAP_MV_CFG(admin->tgt_inst)); in __lan966x_vcap_range_init() 94 lan966x, VCAP_UPDATE_CTRL(admin->tgt_inst)); in __lan966x_vcap_range_init() 96 lan966x_vcap_wait_update(lan966x, admin->tgt_inst); in __lan966x_vcap_range_init() 129 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is1_get_port_keysets() local 132 val = lan_rd(lan966x, ANA_VCAP_S1_CFG(port->chip_port, lookup)); in lan966x_vcap_is1_get_port_keysets() [all …]
|
H A D | lan966x_port.c | 27 struct lan966x *lan966x = port->lan966x; in lan966x_port_link_down() local 35 lan966x, AFI_PORT_CFG(port->chip_port)); in lan966x_port_link_down() 39 val = lan_rd(lan966x, AFI_PORT_FRM_OUT(port->chip_port)); in lan966x_port_link_down() 56 lan966x, DEV_CLOCK_CFG(port->chip_port)); in lan966x_port_link_down() 61 lan966x, DEV_MAC_ENA_CFG(port->chip_port)); in lan966x_port_link_down() 66 lan966x, QSYS_SW_PORT_MODE(port->chip_port)); in lan966x_port_link_down() 71 lan966x, QSYS_PORT_MODE(port->chip_port)); in lan966x_port_link_down() 76 lan966x, SYS_PAUSE_CFG(port->chip_port)); in lan966x_port_link_down() 81 lan966x, QSYS_SW_PORT_MODE(port->chip_port)); in lan966x_port_link_down() 89 lan966x, SYS_FRONT_PORT_MODE(port->chip_port)); in lan966x_port_link_down() [all …]
|
H A D | lan966x_switchdev.c | 13 struct lan966x *lan966x = port->lan966x; in lan966x_port_set_mcast_ip_flood() local 16 flood_mask_ip = lan_rd(lan966x, ANA_PGID(pgid_ip)); in lan966x_port_set_mcast_ip_flood() 25 flood_mask = lan_rd(lan966x, ANA_PGID(PGID_MC)); in lan966x_port_set_mcast_ip_flood() 38 lan966x, ANA_PGID(pgid_ip)); in lan966x_port_set_mcast_ip_flood() 44 u32 val = lan_rd(port->lan966x, ANA_PGID(PGID_MC)); in lan966x_port_set_mcast_flood() 54 port->lan966x, ANA_PGID(PGID_MC)); in lan966x_port_set_mcast_flood() 65 u32 val = lan_rd(port->lan966x, ANA_PGID(PGID_UC)); in lan966x_port_set_ucast_flood() 75 port->lan966x, ANA_PGID(PGID_UC)); in lan966x_port_set_ucast_flood() 81 u32 val = lan_rd(port->lan966x, ANA_PGID(PGID_BC)); in lan966x_port_set_bcast_flood() 91 port->lan966x, ANA_PGID(PGID_BC)); in lan966x_port_set_bcast_flood() [all …]
|
H A D | lan966x_taprio.c | 48 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_state_get() local 51 val = lan_rd(lan966x, QSYS_TAS_LST); in lan966x_taprio_list_state_get() 58 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_index_state_get() local 62 lan966x, QSYS_TAS_CFG_CTRL); in lan966x_taprio_list_index_state_get() 70 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_state_set() local 74 lan966x, QSYS_TAS_LST); in lan966x_taprio_list_state_set() 80 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_list_shutdown() local 141 lan966x, QSYS_TAS_GS_CTRL); in lan966x_taprio_list_shutdown() 144 lan966x, QSYS_TAS_GATE_STATE); in lan966x_taprio_list_shutdown() 271 struct lan966x *lan966x = port->lan966x; in lan966x_taprio_gcl_free_get() local [all …]
|
H A D | lan966x_mirror.c | 11 struct lan966x *lan966x = port->lan966x; in lan966x_mirror_port_add() local 16 "Destination not an lan966x port"); in lan966x_mirror_port_add() 22 if (lan966x->mirror_mask[ingress] & BIT(port->chip_port)) { in lan966x_mirror_port_add() 28 if (lan966x->mirror_monitor && in lan966x_mirror_port_add() 29 lan966x->mirror_monitor != monitor_port) { in lan966x_mirror_port_add() 41 lan966x->mirror_mask[ingress] |= BIT(port->chip_port); in lan966x_mirror_port_add() 43 lan966x->mirror_monitor = monitor_port; in lan966x_mirror_port_add() 44 lan_wr(BIT(monitor_port->chip_port), lan966x, ANA_MIRRORPORTS); in lan966x_mirror_port_add() 49 lan966x, ANA_PORT_CFG(port->chip_port)); in lan966x_mirror_port_add() 51 lan_wr(lan966x->mirror_mask[0], lan966x, in lan966x_mirror_port_add() [all …]
|
H A D | lan966x_xdp.c | 12 struct lan966x *lan966x = port->lan966x; in lan966x_xdp_setup() local 17 if (!lan966x->fdma) { in lan966x_xdp_setup() 23 old_xdp = lan966x_xdp_present(lan966x); in lan966x_xdp_setup() 25 new_xdp = lan966x_xdp_present(lan966x); in lan966x_xdp_setup() 30 err = lan966x_fdma_reload_page_pool(lan966x); in lan966x_xdp_setup() 78 struct lan966x *lan966x = port->lan966x; in lan966x_xdp_run() local 82 xdp_init_buff(&xdp, PAGE_SIZE << lan966x->rx.page_order, in lan966x_xdp_run() 111 bool lan966x_xdp_present(struct lan966x *lan966x) in lan966x_xdp_present() argument 113 for (int p = 0; p < lan966x->num_phys_ports; ++p) { in lan966x_xdp_present() 114 if (!lan966x->ports[p]) in lan966x_xdp_present() [all …]
|
H A D | lan966x_police.c | 22 struct lan966x *lan966x = port->lan966x; in lan966x_police_add() local 40 lan966x, ANA_POL_MODE(pol_idx)); in lan966x_police_add() 43 lan966x, ANA_POL_PIR_STATE(pol_idx)); in lan966x_police_add() 47 lan966x, ANA_POL_PIR_CFG(pol_idx)); in lan966x_police_add() 54 struct lan966x *lan966x = port->lan966x; in lan966x_police_del() local 61 lan966x, ANA_POL_MODE(pol_idx)); in lan966x_police_del() 64 lan966x, ANA_POL_PIR_STATE(pol_idx)); in lan966x_police_del() 68 lan966x, ANA_POL_PIR_CFG(pol_idx)); in lan966x_police_del() 139 struct lan966x *lan966x = port->lan966x; in lan966x_police_port_add() local 166 lan966x, ANA_POL_CFG(port->chip_port)); in lan966x_police_port_add() [all …]
|
H A D | lan966x_cbs.c | 8 struct lan966x *lan966x = port->lan966x; in lan966x_cbs_add() local 42 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_cbs_add() 46 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_cbs_add() 54 struct lan966x *lan966x = port->lan966x; in lan966x_cbs_del() local 63 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_cbs_del() 67 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_cbs_del()
|
H A D | lan966x_tbf.c | 8 struct lan966x *lan966x = port->lan966x; in lan966x_tbf_add() local 46 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_tbf_add() 50 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_tbf_add() 58 struct lan966x *lan966x = port->lan966x; in lan966x_tbf_del() local 78 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_tbf_del() 82 lan966x, QSYS_CIR_CFG(se_idx)); in lan966x_tbf_del()
|
H A D | lan966x_vcap_debugfs.c | 12 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is1_port_keys() local 18 val = lan_rd(lan966x, ANA_VCAP_CFG(port->chip_port)); in lan966x_vcap_is1_port_keys() 28 val = lan_rd(lan966x, ANA_VCAP_S1_CFG(port->chip_port, l)); in lan966x_vcap_is1_port_keys() 129 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_is2_port_keys() local 135 val = lan_rd(lan966x, ANA_VCAP_S2_CFG(port->chip_port)); in lan966x_vcap_is2_port_keys() 199 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_es0_port_keys() local 205 val = lan_rd(lan966x, REW_PORT_CFG(port->chip_port)); in lan966x_vcap_es0_port_keys() 220 struct lan966x *lan966x = port->lan966x; in lan966x_vcap_port_info() local 224 vctrl = lan966x->vcap_ctrl; in lan966x_vcap_port_info()
|
H A D | lan966x_goto.c | 11 struct lan966x *lan966x = port->lan966x; in lan966x_goto_port_add() local 14 err = vcap_enable_lookups(lan966x->vcap_ctrl, port->dev, in lan966x_goto_port_add() 39 struct lan966x *lan966x = port->lan966x; in lan966x_goto_port_del() local 42 err = vcap_enable_lookups(lan966x->vcap_ctrl, port->dev, 0, 0, in lan966x_goto_port_del()
|
H A D | lan966x_ets.c | 22 struct lan966x *lan966x = port->lan966x; in lan966x_ets_add() local 65 lan966x, QSYS_SE_DWRR_CFG(se_idx, 7 - i)); in lan966x_ets_add() 72 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_ets_add() 80 struct lan966x *lan966x = port->lan966x; in lan966x_ets_del() local 87 lan_wr(0, lan966x, QSYS_SE_DWRR_CFG(se_idx, i)); in lan966x_ets_del() 93 lan966x, QSYS_SE_CFG(se_idx)); in lan966x_ets_del()
|
/linux/drivers/net/ethernet/microchip/vcap/ |
H A D | vcap_ag_api.h | 25 VCAP_KFS_5TUPLE_IP4, /* lan966x is1 X2 */ 26 VCAP_KFS_5TUPLE_IP6, /* lan966x is1 X4 */ 27 VCAP_KFS_7TUPLE, /* lan966x is1 X4 */ 28 VCAP_KFS_ARP, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */ 29 VCAP_KFS_DBL_VID, /* lan966x is1 X1 */ 30 VCAP_KFS_DMAC_VID, /* lan966x is1 X1 */ 32 VCAP_KFS_IP4_OTHER, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */ 33 VCAP_KFS_IP4_TCP_UDP, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */ 35 VCAP_KFS_IP6_OTHER, /* lan966x is2 X4 */ 36 VCAP_KFS_IP6_STD, /* sparx5 is2 X6, sparx5 es2 X6, lan966x is2 X2 */ [all …]
|
/linux/Documentation/devicetree/bindings/interrupt-controller/ |
H A D | microchip,lan966x-oic.yaml | 4 $id: http://devicetree.org/schemas/interrupt-controller/microchip,lan966x-oic.yaml# 7 title: Microchip LAN966x outband interrupt controller 16 The Microchip LAN966x outband interrupt controller (OIC) maps the internal 17 interrupt sources of the LAN966x device to an external interrupt. 18 When the LAN966x device is used as a PCI device, the external interrupt is 23 const: microchip,lan966x-oic 48 compatible = "microchip,lan966x-oic";
|
/linux/Documentation/devicetree/bindings/phy/ |
H A D | microchip,lan966x-serdes.yaml | 4 $id: http://devicetree.org/schemas/phy/microchip,lan966x-serdes.yaml# 7 title: Microchip Lan966x Serdes controller 13 Lan966x has 7 interfaces, consisting of 2 copper transceivers(CU), 30 const: microchip,lan966x-serdes 42 dt-bindings/phy/phy-lan966x-serdes. 54 compatible = "microchip,lan966x-serdes";
|