Home
last modified time | relevance | path

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

1234567

/kernel/linux/linux-6.6/include/soc/mscc/
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 …]
/kernel/linux/linux-6.6/drivers/net/ethernet/mscc/
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
42 ocelot, val, in ocelot_mact_wait_for_completion()
48 /* Caller must hold &ocelot->mact_lock */
[all …]
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 …]
Docelot_ptp.c2 /* Microsemi Ocelot PTP clock driver
9 #include <linux/dsa/ocelot.h>
14 #include <soc/mscc/ocelot.h>
15 #include "ocelot.h"
19 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info); in ocelot_ptp_gettime64() local
25 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags); in ocelot_ptp_gettime64()
27 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN); in ocelot_ptp_gettime64()
30 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN); in ocelot_ptp_gettime64()
32 s = ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_MSB, TOD_ACC_PIN) & 0xffff; in ocelot_ptp_gettime64()
34 s += ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_LSB, TOD_ACC_PIN); in ocelot_ptp_gettime64()
[all …]
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 …]
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 …]
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 …]
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 …]
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 …]
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 …]
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 …]
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 …]
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 …]
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 …]
/kernel/linux/linux-5.10/drivers/net/ethernet/mscc/
Docelot.c3 * Microsemi Ocelot Switch driver
9 #include "ocelot.h"
21 static inline u32 ocelot_mact_read_macaccess(struct ocelot *ocelot) in ocelot_mact_read_macaccess() argument
23 return ocelot_read(ocelot, ANA_TABLES_MACACCESS); in ocelot_mact_read_macaccess()
26 static inline int ocelot_mact_wait_for_completion(struct ocelot *ocelot) in ocelot_mact_wait_for_completion() argument
31 ocelot, val, in ocelot_mact_wait_for_completion()
37 static void ocelot_mact_select(struct ocelot *ocelot, in ocelot_mact_select() argument
54 ocelot_write(ocelot, macl, ANA_TABLES_MACLDATA); in ocelot_mact_select()
55 ocelot_write(ocelot, mach, ANA_TABLES_MACHDATA); in ocelot_mact_select()
59 int ocelot_mact_learn(struct ocelot *ocelot, int port, in ocelot_mact_learn() argument
[all …]
Docelot_ptp.c2 /* Microsemi Ocelot PTP clock driver
9 #include <soc/mscc/ocelot.h>
13 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info); in ocelot_ptp_gettime64() local
19 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags); in ocelot_ptp_gettime64()
21 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN); in ocelot_ptp_gettime64()
24 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN); in ocelot_ptp_gettime64()
26 s = ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_MSB, TOD_ACC_PIN) & 0xffff; in ocelot_ptp_gettime64()
28 s += ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_LSB, TOD_ACC_PIN); in ocelot_ptp_gettime64()
29 ns = ocelot_read_rix(ocelot, PTP_PIN_TOD_NSEC, TOD_ACC_PIN); in ocelot_ptp_gettime64()
31 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags); in ocelot_ptp_gettime64()
[all …]
Docelot_net.c2 /* Microsemi Ocelot Switch driver
8 #include "ocelot.h"
15 struct ocelot *ocelot = priv->port.ocelot; in ocelot_setup_tc_cls_flower() local
23 return ocelot_cls_flower_replace(ocelot, port, f, ingress); in ocelot_setup_tc_cls_flower()
25 return ocelot_cls_flower_destroy(ocelot, port, f, ingress); in ocelot_setup_tc_cls_flower()
27 return ocelot_cls_flower_stats(ocelot, port, f, ingress); in ocelot_setup_tc_cls_flower()
38 struct ocelot *ocelot = priv->port.ocelot; in ocelot_setup_tc_cls_matchall() local
79 err = ocelot_port_policer_add(ocelot, port, &pol); in ocelot_setup_tc_cls_matchall()
92 err = ocelot_port_policer_del(ocelot, port); in ocelot_setup_tc_cls_matchall()
203 struct ocelot *ocelot = priv->port.ocelot; in ocelot_port_adjust_link() local
[all …]
Docelot_io.c3 * Microsemi Ocelot Switch driver
11 #include "ocelot.h"
13 u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset) in __ocelot_read_ix() argument
20 regmap_read(ocelot->targets[target], in __ocelot_read_ix()
21 ocelot->map[target][reg & REG_MASK] + offset, &val); in __ocelot_read_ix()
26 void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset) in __ocelot_write_ix() argument
32 regmap_write(ocelot->targets[target], in __ocelot_write_ix()
33 ocelot->map[target][reg & REG_MASK] + offset, val); in __ocelot_write_ix()
37 void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, in __ocelot_rmw_ix() argument
44 regmap_update_bits(ocelot->targets[target], in __ocelot_rmw_ix()
[all …]
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 …]
/kernel/linux/linux-6.6/drivers/net/dsa/ocelot/
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 …]
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 …]
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 …]
/kernel/linux/linux-5.10/drivers/net/dsa/ocelot/
Dfelix.c5 * register-compatible with Ocelot and that perform I/O to their host CPU
15 #include <soc/mscc/ocelot.h>
37 struct ocelot *ocelot = ds->priv; in felix_set_ageing_time() local
39 ocelot_set_ageing_time(ocelot, ageing_time); in felix_set_ageing_time()
47 struct ocelot *ocelot = ds->priv; in felix_fdb_dump() local
49 return ocelot_fdb_dump(ocelot, port, cb, data); in felix_fdb_dump()
55 struct ocelot *ocelot = ds->priv; in felix_fdb_add() local
57 return ocelot_fdb_add(ocelot, port, addr, vid); in felix_fdb_add()
63 struct ocelot *ocelot = ds->priv; in felix_fdb_del() local
65 return ocelot_fdb_del(ocelot, port, addr, vid); in felix_fdb_del()
[all …]
Dfelix.h7 #define ocelot_to_felix(o) container_of((o), struct felix, ocelot)
28 int (*mdio_bus_alloc)(struct ocelot *ocelot);
29 void (*mdio_bus_free)(struct ocelot *ocelot);
30 void (*phylink_validate)(struct ocelot *ocelot, int port,
33 int (*prevalidate_phy_mode)(struct ocelot *ocelot, int port,
37 void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
39 void (*xmit_template_populate)(struct ocelot *ocelot, int port);
44 /* DSA glue / front-end for struct ocelot */
48 struct ocelot ocelot; member
55 struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port);
/kernel/linux/linux-5.10/include/soc/mscc/
Docelot.h32 * ocelot->num_phys_ports - 1, or a multicast set: the PGIDs from
33 * ocelot->num_phys_ports to 63. By convention, a unicast PGID corresponds to
68 #define for_each_unicast_dest_pgid(ocelot, pgid) \ argument
70 (pgid) < (ocelot)->num_phys_ports; \
73 #define for_each_nonreserved_multicast_dest_pgid(ocelot, pgid) \ argument
74 for ((pgid) = (ocelot)->num_phys_ports + 1; \
78 #define for_each_aggr_pgid(ocelot, pgid) \ argument
559 struct ocelot;
562 struct net_device *(*port_to_netdev)(struct ocelot *ocelot, int port);
564 int (*reset)(struct ocelot *ocelot);
[all …]

1234567