Lines Matching refs:ocelot

9 #include <soc/mscc/ocelot.h>
13 #include "ocelot.h"
52 void ocelot_port_update_active_preemptible_tcs(struct ocelot *ocelot, int port)
54 struct ocelot_port *ocelot_port = ocelot->ports[port];
55 struct ocelot_mm_state *mm = &ocelot->mm[port];
58 lockdep_assert_held(&ocelot->fwd_domain_lock);
76 ocelot->ops->tas_guard_bands_update(ocelot, port);
78 dev_dbg(ocelot->dev,
85 ocelot_rmw_rix(ocelot, QSYS_PREEMPTION_CFG_P_QUEUES(val),
90 void ocelot_port_change_fp(struct ocelot *ocelot, int port,
93 struct ocelot_mm_state *mm = &ocelot->mm[port];
95 lockdep_assert_held(&ocelot->fwd_domain_lock);
102 ocelot_port_update_active_preemptible_tcs(ocelot, port);
105 static void ocelot_mm_update_port_status(struct ocelot *ocelot, int port)
107 struct ocelot_port *ocelot_port = ocelot->ports[port];
108 struct ocelot_mm_state *mm = &ocelot->mm[port];
119 dev_dbg(ocelot->dev,
128 dev_dbg(ocelot->dev, "Port %d TX preemption %s\n",
130 ocelot_port_update_active_preemptible_tcs(ocelot, port);
136 dev_err(ocelot->dev,
144 dev_err(ocelot->dev,
155 void ocelot_mm_irq(struct ocelot *ocelot)
159 mutex_lock(&ocelot->fwd_domain_lock);
161 for (port = 0; port < ocelot->num_phys_ports; port++)
162 ocelot_mm_update_port_status(ocelot, port);
164 mutex_unlock(&ocelot->fwd_domain_lock);
168 int ocelot_port_set_mm(struct ocelot *ocelot, int port,
172 struct ocelot_port *ocelot_port = ocelot->ports[port];
177 if (!ocelot->mm_supported)
180 mm = &ocelot->mm[port];
196 mutex_lock(&ocelot->fwd_domain_lock);
209 ocelot_rmw_rix(ocelot,
222 ocelot_mm_update_port_status(ocelot, port);
228 mutex_unlock(&ocelot->fwd_domain_lock);
234 int ocelot_port_get_mm(struct ocelot *ocelot, int port,
237 struct ocelot_port *ocelot_port = ocelot->ports[port];
241 if (!ocelot->mm_supported)
244 mm = &ocelot->mm[port];
246 mutex_lock(&ocelot->fwd_domain_lock);
257 val = ocelot_read_rix(ocelot, QSYS_PREEMPTION_CFG, port);
262 ocelot_mm_update_port_status(ocelot, port);
266 mutex_unlock(&ocelot->fwd_domain_lock);
272 int ocelot_mm_init(struct ocelot *ocelot)
278 if (!ocelot->mm_supported)
281 ocelot->mm = devm_kcalloc(ocelot->dev, ocelot->num_phys_ports,
282 sizeof(*ocelot->mm), GFP_KERNEL);
283 if (!ocelot->mm)
286 for (port = 0; port < ocelot->num_phys_ports; port++) {
289 mm = &ocelot->mm[port];
290 ocelot_port = ocelot->ports[port];