Lines Matching full:ocelot
9 #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
93 struct ocelot_mm_state *mm = &ocelot->mm[port]; in ocelot_port_change_fp()
95 lockdep_assert_held(&ocelot->fwd_domain_lock); in ocelot_port_change_fp()
102 ocelot_port_update_active_preemptible_tcs(ocelot, port); in ocelot_port_change_fp()
105 static void ocelot_mm_update_port_status(struct ocelot *ocelot, int port) in ocelot_mm_update_port_status() argument
107 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_mm_update_port_status()
108 struct ocelot_mm_state *mm = &ocelot->mm[port]; in ocelot_mm_update_port_status()
119 dev_dbg(ocelot->dev, in ocelot_mm_update_port_status()
128 dev_dbg(ocelot->dev, "Port %d TX preemption %s\n", in ocelot_mm_update_port_status()
130 ocelot_port_update_active_preemptible_tcs(ocelot, port); in ocelot_mm_update_port_status()
136 dev_err(ocelot->dev, in ocelot_mm_update_port_status()
144 dev_err(ocelot->dev, in ocelot_mm_update_port_status()
155 void ocelot_mm_irq(struct ocelot *ocelot) in ocelot_mm_irq() argument
159 mutex_lock(&ocelot->fwd_domain_lock); in ocelot_mm_irq()
161 for (port = 0; port < ocelot->num_phys_ports; port++) in ocelot_mm_irq()
162 ocelot_mm_update_port_status(ocelot, port); in ocelot_mm_irq()
164 mutex_unlock(&ocelot->fwd_domain_lock); in ocelot_mm_irq()
168 int ocelot_port_set_mm(struct ocelot *ocelot, int port, in ocelot_port_set_mm() argument
172 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_port_set_mm()
177 if (!ocelot->mm_supported) in ocelot_port_set_mm()
180 mm = &ocelot->mm[port]; in ocelot_port_set_mm()
196 mutex_lock(&ocelot->fwd_domain_lock); in ocelot_port_set_mm()
209 ocelot_rmw_rix(ocelot, in ocelot_port_set_mm()
222 ocelot_mm_update_port_status(ocelot, port); in ocelot_port_set_mm()
228 mutex_unlock(&ocelot->fwd_domain_lock); in ocelot_port_set_mm()
234 int ocelot_port_get_mm(struct ocelot *ocelot, int port, in ocelot_port_get_mm() argument
237 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_port_get_mm()
241 if (!ocelot->mm_supported) in ocelot_port_get_mm()
244 mm = &ocelot->mm[port]; in ocelot_port_get_mm()
246 mutex_lock(&ocelot->fwd_domain_lock); in ocelot_port_get_mm()
257 val = ocelot_read_rix(ocelot, QSYS_PREEMPTION_CFG, port); in ocelot_port_get_mm()
262 ocelot_mm_update_port_status(ocelot, port); in ocelot_port_get_mm()
266 mutex_unlock(&ocelot->fwd_domain_lock); in ocelot_port_get_mm()
272 int ocelot_mm_init(struct ocelot *ocelot) in ocelot_mm_init() argument
278 if (!ocelot->mm_supported) in ocelot_mm_init()
281 ocelot->mm = devm_kcalloc(ocelot->dev, ocelot->num_phys_ports, in ocelot_mm_init()
282 sizeof(*ocelot->mm), GFP_KERNEL); in ocelot_mm_init()
283 if (!ocelot->mm) in ocelot_mm_init()
286 for (port = 0; port < ocelot->num_phys_ports; port++) { in ocelot_mm_init()
289 mm = &ocelot->mm[port]; in ocelot_mm_init()
290 ocelot_port = ocelot->ports[port]; in ocelot_mm_init()