Home
last modified time | relevance | path

Searched refs:ocelot (Results 1 – 25 of 58) sorted by relevance

123

/linux-6.1.9/drivers/net/ethernet/mscc/
Docelot.c24 static inline u32 ocelot_mact_read_macaccess(struct ocelot *ocelot) in ocelot_mact_read_macaccess() argument
26 return ocelot_read(ocelot, ANA_TABLES_MACACCESS); in ocelot_mact_read_macaccess()
30 static inline int ocelot_mact_wait_for_completion(struct ocelot *ocelot) in ocelot_mact_wait_for_completion() argument
35 ocelot, val, in ocelot_mact_wait_for_completion()
42 static void ocelot_mact_select(struct ocelot *ocelot, in ocelot_mact_select() argument
59 ocelot_write(ocelot, macl, ANA_TABLES_MACLDATA); in ocelot_mact_select()
60 ocelot_write(ocelot, mach, ANA_TABLES_MACHDATA); in ocelot_mact_select()
64 static int __ocelot_mact_learn(struct ocelot *ocelot, int port, in __ocelot_mact_learn() argument
83 if (mc_ports & BIT(ocelot->num_phys_ports)) in __ocelot_mact_learn()
86 ocelot_mact_select(ocelot, mac, vid); in __ocelot_mact_learn()
[all …]
Docelot_stats.c15 static int ocelot_port_update_stats(struct ocelot *ocelot, int port) in ocelot_port_update_stats() argument
21 ocelot_write(ocelot, SYS_STAT_CFG_STAT_VIEW(port), SYS_STAT_CFG); in ocelot_port_update_stats()
23 list_for_each_entry(region, &ocelot->stats_regions, node) { in ocelot_port_update_stats()
24 err = ocelot_bulk_read(ocelot, region->base, region->buf, in ocelot_port_update_stats()
36 static void ocelot_port_transfer_stats(struct ocelot *ocelot, int port) in ocelot_port_transfer_stats() argument
42 list_for_each_entry(region, &ocelot->stats_regions, node) { in ocelot_port_transfer_stats()
44 u64 *stat = &ocelot->stats[idx + j]; in ocelot_port_transfer_stats()
60 struct ocelot *ocelot = container_of(del_work, struct ocelot, in ocelot_check_stats_work() local
64 mutex_lock(&ocelot->stat_view_lock); in ocelot_check_stats_work()
66 for (port = 0; port < ocelot->num_phys_ports; port++) { in ocelot_check_stats_work()
[all …]
Docelot_devlink.c221 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()
252 static void ocelot_disable_reservation_watermarks(struct ocelot *ocelot, in ocelot_disable_reservation_watermarks() argument
[all …]
Docelot_ptp.c19 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()
35 ns = ocelot_read_rix(ocelot, PTP_PIN_TOD_NSEC, TOD_ACC_PIN); in ocelot_ptp_gettime64()
37 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags); in ocelot_ptp_gettime64()
54 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info); in ocelot_ptp_settime64() local
58 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags); in ocelot_ptp_settime64()
[all …]
Docelot_fdma.c23 static void ocelot_fdma_writel(struct ocelot *ocelot, u32 reg, u32 data) in ocelot_fdma_writel() argument
25 regmap_write(ocelot->targets[FDMA], reg, data); in ocelot_fdma_writel()
28 static u32 ocelot_fdma_readl(struct ocelot *ocelot, u32 reg) in ocelot_fdma_readl() argument
32 regmap_read(ocelot->targets[FDMA], reg, &retval); in ocelot_fdma_readl()
86 static void ocelot_fdma_activate_chan(struct ocelot *ocelot, dma_addr_t dma, in ocelot_fdma_activate_chan() argument
89 ocelot_fdma_writel(ocelot, MSCC_FDMA_DCB_LLP(chan), dma); in ocelot_fdma_activate_chan()
94 ocelot_fdma_writel(ocelot, MSCC_FDMA_CH_ACTIVATE, BIT(chan)); in ocelot_fdma_activate_chan()
97 static u32 ocelot_fdma_read_ch_safe(struct ocelot *ocelot) in ocelot_fdma_read_ch_safe() argument
99 return ocelot_fdma_readl(ocelot, MSCC_FDMA_CH_SAFE); in ocelot_fdma_read_ch_safe()
102 static int ocelot_fdma_wait_chan_safe(struct ocelot *ocelot, int chan) in ocelot_fdma_wait_chan_safe() argument
[all …]
Docelot_vsc7514.c107 static void ocelot_pll5_init(struct ocelot *ocelot) in ocelot_pll5_init() argument
112 regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG4, in ocelot_pll5_init()
115 regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG0, in ocelot_pll5_init()
127 regmap_write(ocelot->targets[HSIO], HSIO_PLL5G_CFG2, in ocelot_pll5_init()
136 static int ocelot_chip_init(struct ocelot *ocelot, const struct ocelot_ops *ops) in ocelot_chip_init() argument
140 ocelot->map = ocelot_regmap; in ocelot_chip_init()
141 ocelot->stats_layout = ocelot_stats_layout; in ocelot_chip_init()
142 ocelot->num_mact_rows = 1024; in ocelot_chip_init()
143 ocelot->ops = ops; in ocelot_chip_init()
145 ret = ocelot_regfields_init(ocelot, ocelot_regfields); in ocelot_chip_init()
[all …]
Docelot_mrp.c18 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()
73 err = ocelot_vcap_filter_add(ocelot, filter, NULL); in ocelot_mrp_redirect_add_vcap()
91 static int ocelot_mrp_trap_add(struct ocelot *ocelot, int port) in ocelot_mrp_trap_add() argument
[all …]
Docelot_net.c32 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()
68 struct ocelot *ocelot = devlink_port_to_ocelot(dlp); in ocelot_devlink_sb_port_pool_get() local
71 return ocelot_sb_port_pool_get(ocelot, port, sb_index, pool_index, in ocelot_devlink_sb_port_pool_get()
80 struct ocelot *ocelot = devlink_port_to_ocelot(dlp); in ocelot_devlink_sb_port_pool_set() local
[all …]
Docelot.h77 int ocelot_bridge_num_find(struct ocelot *ocelot,
80 int ocelot_mact_learn(struct ocelot *ocelot, int port,
83 int ocelot_mact_forget(struct ocelot *ocelot,
85 struct net_device *ocelot_port_to_netdev(struct ocelot *ocelot, int port);
91 int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target,
94 int ocelot_devlink_init(struct ocelot *ocelot);
95 void ocelot_devlink_teardown(struct ocelot *ocelot);
96 int ocelot_port_devlink_init(struct ocelot *ocelot, int port,
98 void ocelot_port_devlink_teardown(struct ocelot *ocelot, int port);
100 int ocelot_trap_add(struct ocelot *ocelot, int port,
[all …]
Docelot_io.c13 int __ocelot_bulk_read_ix(struct ocelot *ocelot, u32 reg, u32 offset, void *buf, in __ocelot_bulk_read_ix() argument
20 return regmap_bulk_read(ocelot->targets[target], in __ocelot_bulk_read_ix()
21 ocelot->map[target][reg & REG_MASK] + offset, in __ocelot_bulk_read_ix()
26 u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset) in __ocelot_read_ix() argument
33 regmap_read(ocelot->targets[target], in __ocelot_read_ix()
34 ocelot->map[target][reg & REG_MASK] + offset, &val); in __ocelot_read_ix()
39 void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset) in __ocelot_write_ix() argument
45 regmap_write(ocelot->targets[target], in __ocelot_write_ix()
46 ocelot->map[target][reg & REG_MASK] + offset, val); in __ocelot_write_ix()
50 void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, in __ocelot_rmw_ix() argument
[all …]
Docelot_vcap.c49 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()
99 ocelot_target_write_rix(ocelot, vcap->target, ~data->mask[i], in vcap_entry2cache()
[all …]
Docelot_police.c23 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()
145 ocelot_write_gix(ocelot, in qos_policer_conf_set()
149 ocelot_write_gix(ocelot, in qos_policer_conf_set()
154 ocelot_write_gix(ocelot, in qos_policer_conf_set()
[all …]
Docelot_flower.c145 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
340 pol_ix = a->hw_index + ocelot->vcap_pol.base; in ocelot_flower_parse_action()
341 pol_max = ocelot->vcap_pol.max; in ocelot_flower_parse_action()
343 if (ocelot->vcap_pol.max2 && pol_ix > pol_max) { in ocelot_flower_parse_action()
344 pol_ix += ocelot->vcap_pol.base2 - pol_max - 1; in ocelot_flower_parse_action()
[all …]
Docelot_fdma.h154 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,
Docelot_vcap.h15 int ocelot_vcap_filter_stats_update(struct ocelot *ocelot,
18 void ocelot_detect_vcap_constants(struct ocelot *ocelot);
19 int ocelot_vcap_init(struct ocelot *ocelot);
/linux-6.1.9/include/soc/mscc/
Docelot.h71 #define for_each_unicast_dest_pgid(ocelot, pgid) \ argument
73 (pgid) < (ocelot)->num_phys_ports; \
76 #define for_each_nonreserved_multicast_dest_pgid(ocelot, pgid) \ argument
77 for ((pgid) = (ocelot)->num_phys_ports + 1; \
81 #define for_each_aggr_pgid(ocelot, pgid) \ argument
821 struct ocelot;
824 struct net_device *(*port_to_netdev)(struct ocelot *ocelot, int port);
826 int (*reset)(struct ocelot *ocelot);
830 void (*psfp_init)(struct ocelot *ocelot);
831 int (*psfp_filter_add)(struct ocelot *ocelot, int port,
[all …]
Docelot_vcap.h14 #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
22 #define OCELOT_VCAP_IS2_IPV6_GEN_PTP_TRAP(ocelot) ((ocelot)->num_phys_ports * 2 + 4) argument
23 #define OCELOT_VCAP_IS2_IPV6_EV_PTP_TRAP(ocelot) ((ocelot)->num_phys_ports * 2 + 5) argument
[all …]
Docelot_ptp.h57 int ocelot_init_timestamp(struct ocelot *ocelot,
59 int ocelot_deinit_timestamp(struct ocelot *ocelot);
/linux-6.1.9/drivers/net/dsa/ocelot/
Dfelix.c48 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()
82 cookie = OCELOT_VCAP_ES0_TAG_8021Q_RXVLAN(ocelot, port, upstream); in felix_tag_8021q_vlan_add_rx()
100 err = ocelot_vcap_filter_add(ocelot, outer_tagging_rule, NULL); in felix_tag_8021q_vlan_add_rx()
112 struct ocelot *ocelot = ds->priv; in felix_tag_8021q_vlan_del_rx() local
115 block_vcap_es0 = &ocelot->block[VCAP_ES0]; in felix_tag_8021q_vlan_del_rx()
[all …]
Dfelix_vsc9959.c841 static int vsc9959_gcb_soft_rst_status(struct ocelot *ocelot) in vsc9959_gcb_soft_rst_status() argument
845 ocelot_field_read(ocelot, GCB_SOFT_RST_SWC_RST, &val); in vsc9959_gcb_soft_rst_status()
850 static int vsc9959_sys_ram_init_status(struct ocelot *ocelot) in vsc9959_sys_ram_init_status() argument
852 return ocelot_read(ocelot, SYS_RAM_INIT); in vsc9959_sys_ram_init_status()
858 static int vsc9959_reset(struct ocelot *ocelot) in vsc9959_reset() argument
863 ocelot_field_write(ocelot, GCB_SOFT_RST_SWC_RST, 1); in vsc9959_reset()
865 err = readx_poll_timeout(vsc9959_gcb_soft_rst_status, ocelot, val, !val, in vsc9959_reset()
868 dev_err(ocelot->dev, "timeout: switch core reset\n"); in vsc9959_reset()
873 ocelot_write(ocelot, SYS_RAM_INIT_RAM_INIT, SYS_RAM_INIT); in vsc9959_reset()
874 err = readx_poll_timeout(vsc9959_sys_ram_init_status, ocelot, val, !val, in vsc9959_reset()
[all …]
Dfelix.h7 #define ocelot_to_felix(o) container_of((o), struct felix, ocelot)
53 int (*mdio_bus_alloc)(struct ocelot *ocelot);
54 void (*mdio_bus_free)(struct ocelot *ocelot);
55 void (*phylink_validate)(struct ocelot *ocelot, int port,
60 void (*tas_guard_bands_update)(struct ocelot *ocelot, int port);
61 void (*port_sched_speed_set)(struct ocelot *ocelot, int port,
87 struct ocelot ocelot; member
98 struct net_device *felix_port_to_netdev(struct ocelot *ocelot, int port);
Dseville_vsc9953.c788 static int vsc9953_gcb_soft_rst_status(struct ocelot *ocelot) in vsc9953_gcb_soft_rst_status() argument
792 ocelot_field_read(ocelot, GCB_SOFT_RST_SWC_RST, &val); in vsc9953_gcb_soft_rst_status()
797 static int vsc9953_sys_ram_init_status(struct ocelot *ocelot) in vsc9953_sys_ram_init_status() argument
801 ocelot_field_read(ocelot, SYS_RESET_CFG_MEM_INIT, &val); in vsc9953_sys_ram_init_status()
811 static int vsc9953_reset(struct ocelot *ocelot) in vsc9953_reset() argument
816 ocelot_field_write(ocelot, GCB_SOFT_RST_SWC_RST, 1); in vsc9953_reset()
818 err = readx_poll_timeout(vsc9953_gcb_soft_rst_status, ocelot, val, !val, in vsc9953_reset()
821 dev_err(ocelot->dev, "timeout: switch core reset\n"); in vsc9953_reset()
826 ocelot_field_write(ocelot, SYS_RESET_CFG_MEM_ENA, 1); in vsc9953_reset()
827 ocelot_field_write(ocelot, SYS_RESET_CFG_MEM_INIT, 1); in vsc9953_reset()
[all …]
/linux-6.1.9/Documentation/devicetree/bindings/mfd/
Dmscc,ocelot.yaml4 $id: http://devicetree.org/schemas/mfd/mscc,ocelot.yaml#
41 $ref: /schemas/pinctrl/mscc,ocelot-pinctrl.yaml
49 - mscc,ocelot-sgpio
57 - mscc,ocelot-miim
70 ocelot_clock: ocelot-clock {
88 compatible = "mscc,ocelot-miim";
99 compatible = "mscc,ocelot-miim";
112 compatible = "mscc,ocelot-pinctrl";
130 compatible = "mscc,ocelot-sgpio";
/linux-6.1.9/Documentation/devicetree/bindings/mips/
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";
/linux-6.1.9/arch/mips/boot/dts/mscc/
Docelot.dtsi7 compatible = "mscc,ocelot";
55 compatible = "mscc,ocelot-cpu-syscon", "syscon";
60 compatible = "mscc,ocelot-icpu-intr";
82 compatible = "mscc,ocelot-i2c", "snps,designware-i2c";
108 compatible = "mscc,ocelot-spi", "snps,dw-apb-ssi";
200 compatible = "mscc,ocelot-chip-reset";
205 compatible = "mscc,ocelot-pinctrl";
239 compatible = "mscc,ocelot-miim";
261 compatible = "mscc,ocelot-miim";
270 compatible = "mscc,ocelot-hsio", "syscon", "simple-mfd";

123