Home
last modified time | relevance | path

Searched full:ocelot (Results 1 – 25 of 123) sorted by relevance

12345

/openbmc/linux/include/soc/mscc/
H A Docelot.h34 * ocelot->num_phys_ports - 1, or a multicast set: the PGIDs from
35 * ocelot->num_phys_ports to 63. By convention, a unicast PGID corresponds to
73 #define for_each_unicast_dest_pgid(ocelot, pgid) \ argument
75 (pgid) < (ocelot)->num_phys_ports; \
78 #define for_each_nonreserved_multicast_dest_pgid(ocelot, pgid) \ argument
79 for ((pgid) = (ocelot)->num_phys_ports + 1; \
83 #define for_each_aggr_pgid(ocelot, pgid) \ argument
648 struct ocelot;
652 struct net_device *(*port_to_netdev)(struct ocelot *ocelot, int port);
654 int (*reset)(struct ocelot *ocelot);
[all …]
H A Docelot_vcap.h2 * Microsemi Ocelot Switch driver
9 #include <soc/mscc/ocelot.h>
14 #define OCELOT_VCAP_ES0_TAG_8021Q_RXVLAN(ocelot, port, upstream) ((upstream) << 16 | (port)) argument
15 #define OCELOT_VCAP_IS1_TAG_8021Q_TXVLAN(ocelot, port) (port) argument
16 #define OCELOT_VCAP_IS2_TAG_8021Q_TXVLAN(ocelot, port) (port) argument
17 #define OCELOT_VCAP_IS2_MRP_REDIRECT(ocelot, port) ((ocelot)->num_phys_ports + (port)) argument
18 #define OCELOT_VCAP_IS2_MRP_TRAP(ocelot) ((ocelot)->num_phys_ports * 2) argument
19 #define OCELOT_VCAP_IS2_L2_PTP_TRAP(ocelot) ((ocelot)->num_phys_ports * 2 + 1) argument
20 #define OCELOT_VCAP_IS2_IPV4_GEN_PTP_TRAP(ocelot) ((ocelot)->num_phys_ports * 2 + 2) argument
21 #define OCELOT_VCAP_IS2_IPV4_EV_PTP_TRAP(ocelot) ((ocelot)->num_phys_ports * 2 + 3) argument
[all …]
/openbmc/linux/drivers/net/ethernet/mscc/
H A Docelot.c3 * Microsemi Ocelot Switch driver
7 #include <linux/dsa/ocelot.h>
14 #include "ocelot.h"
30 /* Caller must hold &ocelot->mact_lock */
31 static inline u32 ocelot_mact_read_macaccess(struct ocelot *ocelot) in ocelot_mact_read_macaccess() argument
33 return ocelot_read(ocelot, ANA_TABLES_MACACCESS); in ocelot_mact_read_macaccess()
36 /* Caller must hold &ocelot->mact_lock */
37 static inline int ocelot_mact_wait_for_completion(struct ocelot *ocelot) in ocelot_mact_wait_for_completion() argument
49 ocelot_mact_select(struct ocelot * ocelot,const unsigned char mac[ETH_ALEN],unsigned int vid) ocelot_mact_select() argument
71 __ocelot_mact_learn(struct ocelot * ocelot,int port,const unsigned char mac[ETH_ALEN],unsigned int vid,enum macaccess_entry_type type) __ocelot_mact_learn() argument
103 ocelot_mact_learn(struct ocelot * ocelot,int port,const unsigned char mac[ETH_ALEN],unsigned int vid,enum macaccess_entry_type type) ocelot_mact_learn() argument
117 ocelot_mact_forget(struct ocelot * ocelot,const unsigned char mac[ETH_ALEN],unsigned int vid) ocelot_mact_forget() argument
139 ocelot_mact_lookup(struct ocelot * ocelot,int * dst_idx,const unsigned char mac[ETH_ALEN],unsigned int vid,enum macaccess_entry_type * type) ocelot_mact_lookup() argument
174 ocelot_mact_learn_streamdata(struct ocelot * ocelot,int dst_idx,const unsigned char mac[ETH_ALEN],unsigned int vid,enum macaccess_entry_type type,int sfid,int ssid) ocelot_mact_learn_streamdata() argument
199 ocelot_mact_init(struct ocelot * ocelot) ocelot_mact_init() argument
217 ocelot_pll5_init(struct ocelot * ocelot) ocelot_pll5_init() argument
247 ocelot_vcap_enable(struct ocelot * ocelot,int port) ocelot_vcap_enable() argument
261 ocelot_single_vlan_aware_bridge(struct ocelot * ocelot,struct netlink_ext_ack * extack) ocelot_single_vlan_aware_bridge() argument
290 ocelot_vlant_read_vlanaccess(struct ocelot * ocelot) ocelot_vlant_read_vlanaccess() argument
295 ocelot_vlant_wait_for_completion(struct ocelot * ocelot) ocelot_vlant_wait_for_completion() argument
307 ocelot_vlant_set_mask(struct ocelot * ocelot,u16 vid,u32 mask) ocelot_vlant_set_mask() argument
320 ocelot_port_num_untagged_vlans(struct ocelot * ocelot,int port) ocelot_port_num_untagged_vlans() argument
343 ocelot_port_num_tagged_vlans(struct ocelot * ocelot,int port) ocelot_port_num_tagged_vlans() argument
362 ocelot_port_uses_native_vlan(struct ocelot * ocelot,int port) ocelot_port_uses_native_vlan() argument
369 ocelot_port_find_native_vlan(struct ocelot * ocelot,int port) ocelot_port_find_native_vlan() argument
384 ocelot_port_manage_port_tag(struct ocelot * ocelot,int port) ocelot_port_manage_port_tag() argument
423 ocelot_bridge_num_find(struct ocelot * ocelot,const struct net_device * bridge) ocelot_bridge_num_find() argument
439 ocelot_vlan_unaware_pvid(struct ocelot * ocelot,const struct net_device * bridge) ocelot_vlan_unaware_pvid() argument
457 ocelot_port_set_pvid(struct ocelot * ocelot,int port,const struct ocelot_bridge_vlan * pvid_vlan) ocelot_port_set_pvid() argument
489 ocelot_bridge_vlan_find(struct ocelot * ocelot,u16 vid) ocelot_bridge_vlan_find() argument
501 ocelot_vlan_member_add(struct ocelot * ocelot,int port,u16 vid,bool untagged) ocelot_vlan_member_add() argument
550 ocelot_vlan_member_del(struct ocelot * ocelot,int port,u16 vid) ocelot_vlan_member_del() argument
575 ocelot_add_vlan_unaware_pvid(struct ocelot * ocelot,int port,const struct net_device * bridge) ocelot_add_vlan_unaware_pvid() argument
583 ocelot_del_vlan_unaware_pvid(struct ocelot * ocelot,int port,const struct net_device * bridge) ocelot_del_vlan_unaware_pvid() argument
591 ocelot_port_vlan_filtering(struct ocelot * ocelot,int port,bool vlan_aware,struct netlink_ext_ack * extack) ocelot_port_vlan_filtering() argument
641 ocelot_vlan_prepare(struct ocelot * ocelot,int port,u16 vid,bool pvid,bool untagged,struct netlink_ext_ack * extack) ocelot_vlan_prepare() argument
670 ocelot_vlan_add(struct ocelot * ocelot,int port,u16 vid,bool pvid,bool untagged) ocelot_vlan_add() argument
698 ocelot_vlan_del(struct ocelot * ocelot,int port,u16 vid) ocelot_vlan_del() argument
725 ocelot_vlan_init(struct ocelot * ocelot) ocelot_vlan_init() argument
756 ocelot_read_eq_avail(struct ocelot * ocelot,int port) ocelot_read_eq_avail() argument
761 ocelot_port_flush(struct ocelot * ocelot,int port) ocelot_port_flush() argument
814 ocelot_port_configure_serdes(struct ocelot * ocelot,int port,struct device_node * portnp) ocelot_port_configure_serdes() argument
853 ocelot_phylink_mac_config(struct ocelot * ocelot,int port,unsigned int link_an_mode,const struct phylink_link_state * state) ocelot_phylink_mac_config() argument
879 ocelot_phylink_mac_link_down(struct ocelot * ocelot,int port,unsigned int link_an_mode,phy_interface_t interface,unsigned long quirks) ocelot_phylink_mac_link_down() argument
917 ocelot_phylink_mac_link_up(struct ocelot * ocelot,int port,struct phy_device * phydev,unsigned int link_an_mode,phy_interface_t interface,int speed,int duplex,bool tx_pause,bool rx_pause,unsigned long quirks) ocelot_phylink_mac_link_up() argument
1024 ocelot_rx_frame_word(struct ocelot * ocelot,u8 grp,bool ifh,u32 * rval) ocelot_rx_frame_word() argument
1066 ocelot_xtr_poll_xfh(struct ocelot * ocelot,int grp,u32 * xfh) ocelot_xtr_poll_xfh() argument
1079 ocelot_ptp_rx_timestamp(struct ocelot * ocelot,struct sk_buff * skb,u64 timestamp) ocelot_ptp_rx_timestamp() argument
1102 ocelot_lock_inj_grp(struct ocelot * ocelot,int grp) ocelot_lock_inj_grp() argument
1109 ocelot_unlock_inj_grp(struct ocelot * ocelot,int grp) ocelot_unlock_inj_grp() argument
1116 ocelot_lock_xtr_grp(struct ocelot * ocelot,int grp) ocelot_lock_xtr_grp() argument
1123 ocelot_unlock_xtr_grp(struct ocelot * ocelot,int grp) ocelot_unlock_xtr_grp() argument
1130 ocelot_lock_xtr_grp_bh(struct ocelot * ocelot,int grp) ocelot_lock_xtr_grp_bh() argument
1137 ocelot_unlock_xtr_grp_bh(struct ocelot * ocelot,int grp) ocelot_unlock_xtr_grp_bh() argument
1144 ocelot_xtr_poll_frame(struct ocelot * ocelot,int grp,struct sk_buff ** nskb) ocelot_xtr_poll_frame() argument
1227 ocelot_can_inject(struct ocelot * ocelot,int grp) ocelot_can_inject() argument
1253 ocelot_ifh_set_basic(void * ifh,struct ocelot * ocelot,int port,u32 rew_op,struct sk_buff * skb) ocelot_ifh_set_basic() argument
1279 ocelot_port_inject_frame(struct ocelot * ocelot,int port,int grp,u32 rew_op,struct sk_buff * skb) ocelot_port_inject_frame() argument
1321 ocelot_drain_cpu_queue(struct ocelot * ocelot,int grp) ocelot_drain_cpu_queue() argument
1330 ocelot_fdb_add(struct ocelot * ocelot,int port,const unsigned char * addr,u16 vid,const struct net_device * bridge) ocelot_fdb_add() argument
1340 ocelot_fdb_del(struct ocelot * ocelot,int port,const unsigned char * addr,u16 vid,const struct net_device * bridge) ocelot_fdb_del() argument
1351 ocelot_mact_read(struct ocelot * ocelot,int port,int row,int col,struct ocelot_mact_entry * entry) ocelot_mact_read() argument
1398 ocelot_mact_flush(struct ocelot * ocelot,int port) ocelot_mact_flush() argument
1435 ocelot_fdb_dump(struct ocelot * ocelot,int port,dsa_fdb_dump_cb_t * cb,void * data) ocelot_fdb_dump() argument
1481 ocelot_trap_add(struct ocelot * ocelot,int port,unsigned long cookie,bool take_ts,void (* populate)(struct ocelot_vcap_filter * f)) ocelot_trap_add() argument
1530 ocelot_trap_del(struct ocelot * ocelot,int port,unsigned long cookie) ocelot_trap_del() argument
1549 ocelot_get_bond_mask(struct ocelot * ocelot,struct net_device * bond) ocelot_get_bond_mask() argument
1572 ocelot_bond_get_id(struct ocelot * ocelot,struct net_device * bond) ocelot_bond_get_id() argument
1593 ocelot_dsa_8021q_cpu_assigned_ports(struct ocelot * ocelot,struct ocelot_port * cpu) ocelot_dsa_8021q_cpu_assigned_ports() argument
1618 ocelot_port_assigned_dsa_8021q_cpu_mask(struct ocelot * ocelot,int port) ocelot_port_assigned_dsa_8021q_cpu_mask() argument
1633 ocelot_get_bridge_fwd_mask(struct ocelot * ocelot,int src_port) ocelot_get_bridge_fwd_mask() argument
1662 ocelot_apply_bridge_fwd_mask(struct ocelot * ocelot,bool joining) ocelot_apply_bridge_fwd_mask() argument
1732 ocelot_update_pgid_cpu(struct ocelot * ocelot) ocelot_update_pgid_cpu() argument
1752 ocelot_port_setup_dsa_8021q_cpu(struct ocelot * ocelot,int cpu) ocelot_port_setup_dsa_8021q_cpu() argument
1770 ocelot_port_teardown_dsa_8021q_cpu(struct ocelot * ocelot,int cpu) ocelot_port_teardown_dsa_8021q_cpu() argument
1788 ocelot_port_assign_dsa_8021q_cpu(struct ocelot * ocelot,int port,int cpu) ocelot_port_assign_dsa_8021q_cpu() argument
1802 ocelot_port_unassign_dsa_8021q_cpu(struct ocelot * ocelot,int port) ocelot_port_unassign_dsa_8021q_cpu() argument
1813 ocelot_bridge_stp_state_set(struct ocelot * ocelot,int port,u8 state) ocelot_bridge_stp_state_set() argument
1835 ocelot_set_ageing_time(struct ocelot * ocelot,unsigned int msecs) ocelot_set_ageing_time() argument
1849 ocelot_multicast_get(struct ocelot * ocelot,const unsigned char * addr,u16 vid) ocelot_multicast_get() argument
1872 ocelot_pgid_alloc(struct ocelot * ocelot,int index,unsigned long ports) ocelot_pgid_alloc() argument
1889 ocelot_pgid_free(struct ocelot * ocelot,struct ocelot_pgid * pgid) ocelot_pgid_free() argument
1898 ocelot_mdb_get_pgid(struct ocelot * ocelot,const struct ocelot_multicast * mc) ocelot_mdb_get_pgid() argument
1956 ocelot_port_mdb_add(struct ocelot * ocelot,int port,const struct switchdev_obj_port_mdb * mdb,const struct net_device * bridge) ocelot_port_mdb_add() argument
2013 ocelot_port_mdb_del(struct ocelot * ocelot,int port,const struct switchdev_obj_port_mdb * mdb,const struct net_device * bridge) ocelot_port_mdb_del() argument
2058 ocelot_port_bridge_join(struct ocelot * ocelot,int port,struct net_device * bridge,int bridge_num,struct netlink_ext_ack * extack) ocelot_port_bridge_join() argument
2085 ocelot_port_bridge_leave(struct ocelot * ocelot,int port,struct net_device * bridge) ocelot_port_bridge_leave() argument
2106 ocelot_set_aggr_pgids(struct ocelot * ocelot) ocelot_set_aggr_pgids() argument
2192 ocelot_setup_logical_port_ids(struct ocelot * ocelot) ocelot_setup_logical_port_ids() argument
2220 ocelot_migrate_mc(struct ocelot * ocelot,struct ocelot_multicast * mc,unsigned long from_mask,unsigned long to_mask) ocelot_migrate_mc() argument
2262 ocelot_migrate_mdbs(struct ocelot * ocelot,unsigned long from_mask,unsigned long to_mask) ocelot_migrate_mdbs() argument
2291 ocelot_migrate_lag_fdbs(struct ocelot * ocelot,struct net_device * bond,int lag) ocelot_migrate_lag_fdbs() argument
2321 ocelot_port_lag_join(struct ocelot * ocelot,int port,struct net_device * bond,struct netdev_lag_upper_info * info,struct netlink_ext_ack * extack) ocelot_port_lag_join() argument
2346 ocelot_port_lag_leave(struct ocelot * ocelot,int port,struct net_device * bond) ocelot_port_lag_leave() argument
2370 ocelot_port_lag_change(struct ocelot * ocelot,int port,bool lag_tx_active) ocelot_port_lag_change() argument
2385 ocelot_lag_fdb_add(struct ocelot * ocelot,struct net_device * bond,const unsigned char * addr,u16 vid,const struct net_device * bridge) ocelot_lag_fdb_add() argument
2421 ocelot_lag_fdb_del(struct ocelot * ocelot,struct net_device * bond,const unsigned char * addr,u16 vid,const struct net_device * bridge) ocelot_lag_fdb_del() argument
2457 ocelot_port_set_maxlen(struct ocelot * ocelot,int port,size_t sdu) ocelot_port_set_maxlen() argument
2492 ocelot_get_max_mtu(struct ocelot * ocelot,int port) ocelot_get_max_mtu() argument
2509 ocelot_port_set_learning(struct ocelot * ocelot,int port,bool enabled) ocelot_port_set_learning() argument
2524 ocelot_port_set_ucast_flood(struct ocelot * ocelot,int port,bool enabled) ocelot_port_set_ucast_flood() argument
2535 ocelot_port_set_mcast_flood(struct ocelot * ocelot,int port,bool enabled) ocelot_port_set_mcast_flood() argument
2548 ocelot_port_set_bcast_flood(struct ocelot * ocelot,int port,bool enabled) ocelot_port_set_bcast_flood() argument
2559 ocelot_port_pre_bridge_flags(struct ocelot * ocelot,int port,struct switchdev_brport_flags flags) ocelot_port_pre_bridge_flags() argument
2570 ocelot_port_bridge_flags(struct ocelot * ocelot,int port,struct switchdev_brport_flags flags) ocelot_port_bridge_flags() argument
2591 ocelot_port_get_default_prio(struct ocelot * ocelot,int port) ocelot_port_get_default_prio() argument
2599 ocelot_port_set_default_prio(struct ocelot * ocelot,int port,u8 prio) ocelot_port_set_default_prio() argument
2614 ocelot_port_get_dscp_prio(struct ocelot * ocelot,int port,u8 dscp) ocelot_port_get_dscp_prio() argument
2639 ocelot_port_add_dscp_prio(struct ocelot * ocelot,int port,u8 dscp,u8 prio) ocelot_port_add_dscp_prio() argument
2666 ocelot_port_del_dscp_prio(struct ocelot * ocelot,int port,u8 dscp,u8 prio) ocelot_port_del_dscp_prio() argument
2707 ocelot_mirror_get(struct ocelot * ocelot,int to,struct netlink_ext_ack * extack) ocelot_mirror_get() argument
2737 ocelot_mirror_put(struct ocelot * ocelot) ocelot_mirror_put() argument
2749 ocelot_port_mirror_add(struct ocelot * ocelot,int from,int to,bool ingress,struct netlink_ext_ack * extack) ocelot_port_mirror_add() argument
2770 ocelot_port_mirror_del(struct ocelot * ocelot,int from,bool ingress) ocelot_port_mirror_del() argument
2783 ocelot_port_reset_mqprio(struct ocelot * ocelot,int port) ocelot_port_reset_mqprio() argument
2791 ocelot_port_mqprio(struct ocelot * ocelot,int port,struct tc_mqprio_qopt_offload * mqprio) ocelot_port_mqprio() argument
2835 ocelot_init_port(struct ocelot * ocelot,int port) ocelot_init_port() argument
2904 ocelot_cpu_port_init(struct ocelot * ocelot) ocelot_cpu_port_init() argument
2935 ocelot_detect_features(struct ocelot * ocelot) ocelot_detect_features() argument
2950 ocelot_mem_init_status(struct ocelot * ocelot) ocelot_mem_init_status() argument
2961 ocelot_reset(struct ocelot * ocelot) ocelot_reset() argument
2990 ocelot_init(struct ocelot * ocelot) ocelot_init() argument
3143 ocelot_deinit(struct ocelot * ocelot) ocelot_deinit() argument
3150 ocelot_deinit_port(struct ocelot * ocelot,int port) ocelot_deinit_port() argument
[all...]
H A Docelot_vsc7514.c3 * Microsemi Ocelot Switch driver
7 #include <linux/dsa/ocelot.h>
20 #include <soc/mscc/ocelot.h>
24 #include "ocelot.h"
29 static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) in ocelot_chip_init() argument
33 ocelot->map = vsc7514_regmap; in ocelot_chip_init()
34 ocelot->num_mact_rows = 1024; in ocelot_chip_init()
35 ocelot->ops = ops; in ocelot_chip_init()
37 ret = ocelot_regfields_init(ocelot, vsc7514_regfields); in ocelot_chip_init()
41 ocelot_pll5_init(ocelot); in ocelot_chip_init()
[all …]
H A Docelot_ptp.c2 /* Microsemi Ocelot PTP clock driver
9 #include <linux/dsa/ocelot.h>
14 #include <soc/mscc/ocelot.h>
15 #include "ocelot.h"
21 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info); in ocelot_ptp_gettime64() local
27 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags); in ocelot_ptp_gettime64()
29 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN); in ocelot_ptp_gettime64()
32 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN); in ocelot_ptp_gettime64()
34 s = ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_MSB, TOD_ACC_PIN) & 0xffff; in ocelot_ptp_gettime64()
36 s += ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_LSB, TOD_ACC_PIN); in ocelot_ptp_gettime64()
[all …]
H A Docelot_net.c2 /* Microsemi Ocelot Switch driver
11 #include <linux/dsa/ocelot.h>
16 #include "ocelot.h"
32 static struct ocelot *devlink_port_to_ocelot(struct devlink_port *dlp) in devlink_port_to_ocelot()
39 struct ocelot *ocelot = devlink_port_to_ocelot(dlp); in devlink_port_to_port() local
41 return dlp - ocelot->devlink_ports; in devlink_port_to_port()
48 struct ocelot *ocelot = devlink_priv(dl); in ocelot_devlink_sb_pool_get() local
50 return ocelot_sb_pool_get(ocelot, sb_index, pool_index, pool_info); in ocelot_devlink_sb_pool_get()
58 struct ocelot *ocelot = devlink_priv(dl); in ocelot_devlink_sb_pool_set() local
60 return ocelot_sb_pool_set(ocelot, sb_index, pool_index, size, in ocelot_devlink_sb_pool_set()
[all …]
H A Docelot_fdma.c13 #include <linux/dsa/ocelot.h>
22 static void ocelot_fdma_writel(struct ocelot *ocelot, u32 reg, u32 data) in ocelot_fdma_writel() argument
24 regmap_write(ocelot->targets[FDMA], reg, data); in ocelot_fdma_writel()
27 static u32 ocelot_fdma_readl(struct ocelot *ocelot, u32 reg) in ocelot_fdma_readl() argument
31 regmap_read(ocelot->targets[FDMA], reg, &retval); in ocelot_fdma_readl()
85 static void ocelot_fdma_activate_chan(struct ocelot *ocelot, dma_addr_t dma, in ocelot_fdma_activate_chan() argument
88 ocelot_fdma_writel(ocelot, MSCC_FDMA_DCB_LLP(chan), dma); in ocelot_fdma_activate_chan()
93 ocelot_fdma_writel(ocelot, MSCC_FDMA_CH_ACTIVATE, BIT(chan)); in ocelot_fdma_activate_chan()
96 static u32 ocelot_fdma_read_ch_safe(struct ocelot *ocelot) in ocelot_fdma_read_ch_safe() argument
98 return ocelot_fdma_readl(ocelot, MSCC_FDMA_CH_SAFE); in ocelot_fdma_read_ch_safe()
[all …]
H A Docelot_stats.c2 /* Statistics for Ocelot switch family
11 #include "ocelot.h"
153 * and copied to ocelot->stats.
312 ocelot_get_stats_layout(struct ocelot *ocelot) in ocelot_get_stats_layout() argument
314 if (ocelot->mm_supported) in ocelot_get_stats_layout()
321 * Caller must hold &ocelot->stat_view_lock.
323 static int ocelot_port_update_stats(struct ocelot *ocelot, int port) in ocelot_port_update_stats() argument
329 ocelot_write(ocelot, SYS_STAT_CFG_STAT_VIEW(port), SYS_STAT_CFG); in ocelot_port_update_stats()
331 list_for_each_entry(region, &ocelot->stats_regions, node) { in ocelot_port_update_stats()
332 err = ocelot_bulk_read(ocelot, region->base, region->buf, in ocelot_port_update_stats()
[all …]
H A Docelot_mrp.c2 /* Microsemi Ocelot Switch driver
12 #include "ocelot.h"
18 static int ocelot_mrp_find_partner_port(struct ocelot *ocelot, in ocelot_mrp_find_partner_port() argument
23 for (i = 0; i < ocelot->num_phys_ports; ++i) { in ocelot_mrp_find_partner_port()
24 struct ocelot_port *ocelot_port = ocelot->ports[i]; in ocelot_mrp_find_partner_port()
36 static int ocelot_mrp_del_vcap(struct ocelot *ocelot, int id) in ocelot_mrp_del_vcap() argument
41 block_vcap_is2 = &ocelot->block[VCAP_IS2]; in ocelot_mrp_del_vcap()
47 return ocelot_vcap_filter_del(ocelot, filter); in ocelot_mrp_del_vcap()
50 static int ocelot_mrp_redirect_add_vcap(struct ocelot *ocelot, int src_port, in ocelot_mrp_redirect_add_vcap() argument
63 filter->id.cookie = OCELOT_VCAP_IS2_MRP_REDIRECT(ocelot, src_port); in ocelot_mrp_redirect_add_vcap()
[all …]
H A Docelot_io.c3 * Microsemi Ocelot Switch driver
11 #include "ocelot.h"
13 int __ocelot_bulk_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, in __ocelot_bulk_read_ix() argument
19 ocelot_reg_to_target_addr(ocelot, reg, &target, &addr); in __ocelot_bulk_read_ix()
22 return regmap_bulk_read(ocelot->targets[target], addr + offset, in __ocelot_bulk_read_ix()
27 u32 __ocelot_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, u32 offset) in __ocelot_read_ix() argument
32 ocelot_reg_to_target_addr(ocelot, reg, &target, &addr); in __ocelot_read_ix()
35 regmap_read(ocelot->targets[target], addr + offset, &val); in __ocelot_read_ix()
40 void __ocelot_write_ix(struct ocelot *ocelot, u32 val, enum ocelot_reg reg, in __ocelot_write_ix() argument
46 ocelot_reg_to_target_addr(ocelot, reg, &target, &addr); in __ocelot_write_ix()
[all …]
H A Docelot_mm.c9 #include <soc/mscc/ocelot.h>
13 #include "ocelot.h"
52 void ocelot_port_update_active_preemptible_tcs(struct ocelot *ocelot, int port) in ocelot_port_update_active_preemptible_tcs() argument
54 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_port_update_active_preemptible_tcs()
55 struct ocelot_mm_state *mm = &ocelot->mm[port]; in ocelot_port_update_active_preemptible_tcs()
58 lockdep_assert_held(&ocelot->fwd_domain_lock); in ocelot_port_update_active_preemptible_tcs()
76 ocelot->ops->tas_guard_bands_update(ocelot, port); in ocelot_port_update_active_preemptible_tcs()
78 dev_dbg(ocelot->dev, in ocelot_port_update_active_preemptible_tcs()
85 ocelot_rmw_rix(ocelot, QSYS_PREEMPTION_CFG_P_QUEUES(val), in ocelot_port_update_active_preemptible_tcs()
90 void ocelot_port_change_fp(struct ocelot *ocelot, int port, in ocelot_port_change_fp() argument
[all …]
H A Docelot.h3 * Microsemi Ocelot Switch driver
25 #include <soc/mscc/ocelot.h>
54 /* A (PGID) port mask structure, encoding the 2^ocelot->num_phys_ports
77 static inline void ocelot_reg_to_target_addr(struct ocelot *ocelot, in ocelot_reg_to_target_addr() argument
83 *addr = ocelot->map[*target][reg & REG_MASK]; in ocelot_reg_to_target_addr()
86 int ocelot_bridge_num_find(struct ocelot *ocelot,
89 int ocelot_mact_learn(struct ocelot *ocelot, int port,
92 int ocelot_mact_forget(struct ocelot *ocelot,
94 struct net_device *ocelot_port_to_netdev(struct ocelot *ocelot, int port);
97 int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target,
[all …]
H A Docelot_devlink.c5 #include "ocelot.h"
221 static u32 ocelot_wm_read(struct ocelot *ocelot, int index) in ocelot_wm_read() argument
223 int wm = ocelot_read_gix(ocelot, QSYS_RES_CFG, index); in ocelot_wm_read()
225 return ocelot->ops->wm_dec(wm); in ocelot_wm_read()
228 static void ocelot_wm_write(struct ocelot *ocelot, int index, u32 val) in ocelot_wm_write() argument
230 u32 wm = ocelot->ops->wm_enc(val); in ocelot_wm_write()
232 ocelot_write_gix(ocelot, wm, QSYS_RES_CFG, index); in ocelot_wm_write()
235 static void ocelot_wm_status(struct ocelot *ocelot, int index, u32 *inuse, in ocelot_wm_status() argument
238 int res_stat = ocelot_read_gix(ocelot, QSYS_RES_STAT, index); in ocelot_wm_status()
240 return ocelot->ops->wm_stat(res_stat, inuse, maxuse); in ocelot_wm_status()
[all …]
H A Docelot_vcap.c2 /* Microsemi Ocelot Switch driver
49 static u32 vcap_read_update_ctrl(struct ocelot *ocelot, in vcap_read_update_ctrl() argument
52 return ocelot_target_read(ocelot, vcap->target, VCAP_CORE_UPDATE_CTRL); in vcap_read_update_ctrl()
55 static void vcap_cmd(struct ocelot *ocelot, const struct vcap_props *vcap, in vcap_cmd() argument
74 ocelot_target_write(ocelot, vcap->target, value, VCAP_CORE_UPDATE_CTRL); in vcap_cmd()
78 10, 100000, false, ocelot, vcap); in vcap_cmd()
82 static void vcap_row_cmd(struct ocelot *ocelot, const struct vcap_props *vcap, in vcap_row_cmd() argument
85 vcap_cmd(ocelot, vcap, vcap->entry_count - row - 1, cmd, sel); in vcap_row_cmd()
88 static void vcap_entry2cache(struct ocelot *ocelot, in vcap_entry2cache() argument
97 ocelot_target_write_rix(ocelot, vcap->target, data->entry[i], in vcap_entry2cache()
[all …]
H A Docelot_flower.c2 /* Microsemi Ocelot Switch driver
39 * offload support in Ocelot in ocelot_chain_to_block()
65 * offload support in Ocelot in ocelot_chain_to_lookup()
81 * offload support in Ocelot in ocelot_chain_to_pag()
145 ocelot_find_vcap_filter_that_points_at(struct ocelot *ocelot, int chain) in ocelot_find_vcap_filter_that_points_at() argument
156 block = &ocelot->block[VCAP_IS1]; in ocelot_find_vcap_filter_that_points_at()
164 list_for_each_entry(filter, &ocelot->dummy_rules, list) in ocelot_find_vcap_filter_that_points_at()
172 ocelot_flower_parse_ingress_vlan_modify(struct ocelot *ocelot, int port, in ocelot_flower_parse_ingress_vlan_modify() argument
177 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_flower_parse_ingress_vlan_modify()
231 static int ocelot_flower_parse_action(struct ocelot *ocelot, int port, in ocelot_flower_parse_action() argument
[all …]
H A Docelot_police.c2 /* Microsemi Ocelot Switch driver
7 #include <soc/mscc/ocelot.h>
21 #define POL_ORDER 0x1d3 /* Ocelot policer order: Serial (QoS -> Port -> VCAP) */
23 int qos_policer_conf_set(struct ocelot *ocelot, u32 pol_ix, in qos_policer_conf_set() argument
105 dev_err(ocelot->dev, in qos_policer_conf_set()
112 dev_err(ocelot->dev, in qos_policer_conf_set()
119 dev_err(ocelot->dev, in qos_policer_conf_set()
126 dev_err(ocelot->dev, in qos_policer_conf_set()
138 ocelot_write_gix(ocelot, value, ANA_POL_MODE_CFG, pol_ix); in qos_policer_conf_set()
140 ocelot_write_gix(ocelot, in qos_policer_conf_set()
[all …]
H A Docelot_fdma.h10 #include "ocelot.h"
144 * @ocelot: Back-pointer to ocelot struct
154 struct ocelot *ocelot; member
157 void ocelot_fdma_init(struct platform_device *pdev, struct ocelot *ocelot);
158 void ocelot_fdma_start(struct ocelot *ocelot);
159 void ocelot_fdma_deinit(struct ocelot *ocelot);
160 int ocelot_fdma_inject_frame(struct ocelot *fdma, int port, u32 rew_op,
162 void ocelot_fdma_netdev_init(struct ocelot *ocelot, struct net_device *dev);
163 void ocelot_fdma_netdev_deinit(struct ocelot *ocelot,
H A Docelot_vcap.h2 /* Microsemi Ocelot Switch driver
9 #include "ocelot.h"
15 int ocelot_vcap_filter_stats_update(struct ocelot *ocelot,
18 int ocelot_vcap_init(struct ocelot *ocelot);
/openbmc/linux/drivers/net/dsa/ocelot/
H A Dfelix.c5 * register-compatible with Ocelot and that perform I/O to their host CPU
15 #include <soc/mscc/ocelot.h>
17 #include <linux/dsa/ocelot.h>
28 /* Translate the DSA database API into the ocelot switch library API,
48 struct ocelot *ocelot = ds->priv; in felix_cpu_port_for_master() local
53 mutex_lock(&ocelot->fwd_domain_lock); in felix_cpu_port_for_master()
54 lag = ocelot_bond_get_id(ocelot, master); in felix_cpu_port_for_master()
55 mutex_unlock(&ocelot->fwd_domain_lock); in felix_cpu_port_for_master()
71 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_add_rx() local
75 key_length = ocelot->vcap[VCAP_ES0].keys[VCAP_ES0_IGR_PORT].length; in felix_tag_8021q_vlan_add_rx()
[all …]
H A Dfelix_vsc9959.c13 #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()
[all …]
H A Dfelix.h7 #define ocelot_to_felix(o) container_of((o), struct felix, ocelot)
44 /* Some Ocelot switches are integrated into the SoC without the
56 int (*mdio_bus_alloc)(struct ocelot *ocelot);
57 void (*mdio_bus_free)(struct ocelot *ocelot);
60 void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
62 void (*phylink_mac_config)(struct ocelot *ocelot, int port,
65 int (*configure_serdes)(struct ocelot *ocelot, int port,
70 * protocol (like the NPI port, for "ocelot" or "seville", or the VCAP TCAMs,
71 * for "ocelot-8021q").
87 /* DSA glue / front-end for struct ocelot */
[all …]
H A Docelot_ext.c6 #include <linux/mfd/ocelot.h>
9 #include <soc/mscc/ocelot.h>
70 struct ocelot *ocelot; in ocelot_ext_probe() local
80 ocelot = &felix->ocelot; in ocelot_ext_probe()
81 ocelot->dev = dev; in ocelot_ext_probe()
83 ocelot->num_flooding_pgids = 1; in ocelot_ext_probe()
99 ds->priv = ocelot; in ocelot_ext_probe()
153 .name = "ocelot-ext-switch",
162 MODULE_DESCRIPTION("External Ocelot Switch driver");
/openbmc/linux/drivers/mfd/
H A Docelot-core.c3 * Core driver for the Ocelot chip family.
22 #include <linux/mfd/ocelot.h>
27 #include <soc/mscc/ocelot.h>
29 #include "ocelot.h"
164 .name = "ocelot-pinctrl",
165 .of_compatible = "mscc,ocelot-pinctrl",
169 .name = "ocelot-sgpio",
170 .of_compatible = "mscc,ocelot-sgpio",
174 .name = "ocelot-miim0",
175 .of_compatible = "mscc,ocelot-miim",
[all …]
/openbmc/linux/Documentation/devicetree/bindings/mfd/
H A Dmscc,ocelot.yaml4 $id: http://devicetree.org/schemas/mfd/mscc,ocelot.yaml#
7 title: Ocelot Externally-Controlled Ethernet Switch
13 The Ocelot ethernet switch family contains chips that have an internal CPU
42 $ref: /schemas/pinctrl/mscc,ocelot-pinctrl.yaml
50 - mscc,ocelot-sgpio
58 - mscc,ocelot-miim
79 ocelot_clock: ocelot-clock {
97 compatible = "mscc,ocelot-miim";
108 compatible = "mscc,ocelot-miim";
121 compatible = "mscc,ocelot-pinctrl";
[all …]
/openbmc/linux/Documentation/devicetree/bindings/mips/
H A Dmscc.txt7 - compatible: "mscc,ocelot", "mscc,luton", "mscc,serval" or "mscc,jr2"
19 - compatible: Should be "mscc,ocelot-chip-regs", "simple-mfd", "syscon"
24 compatible = "mscc,ocelot-chip-regs", "simple-mfd", "syscon";
36 - compatible: Should be "mscc,ocelot-cpu-syscon", "syscon"
41 compatible = "mscc,ocelot-cpu-syscon", "syscon";
52 - compatible: Should be "mscc,ocelot-hsio", "syscon", "simple-mfd"
57 compatible = "mscc,ocelot-hsio", "syscon", "simple-mfd";

12345