61 mode.
u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface));
105 int interface = (port >> 4) & 1;
106 int index = port & 0xf;
111 gmx_cfg.
s.duplex = 1;
112 gmx_cfg.
s.slottime = 1;
115 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(index,
interface), 0x200);
116 cvmx_write_csr(CVMX_GMXX_TXX_BURST(index,
interface), 0x2000);
117 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index,
interface), gmx_cfg.
u64);
125 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index,
interface), gmx_cfg.
u64);
138 static int __cvmx_helper_errata_asx_pass1(
int interface,
int port,
142 if (cpu_clock_hz >= 325000000 && cpu_clock_hz < 375000000)
144 else if (cpu_clock_hz >= 375000000 && cpu_clock_hz < 437000000)
146 else if (cpu_clock_hz >= 437000000 && cpu_clock_hz < 550000000)
148 else if (cpu_clock_hz >= 550000000 && cpu_clock_hz < 687000000)
152 "CVMX_ASXX_TX_HI_WATERX not set\n", cpu_clock_hz);
173 mode.
u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface));
184 asx_tx.
s.prt_en = cvmx_build_mask(num_ports);
188 asx_rx.
s.prt_en = cvmx_build_mask(num_ports);
192 for (port = 0; port < num_ports; port++) {
196 if (cvmx_octeon_is_pass1())
197 __cvmx_helper_errata_asx_pass1(interface, port,
208 cvmx_read_csr(CVMX_GMXX_RXX_FRM_CTL
211 frm_ctl.
s.pre_free = 1;
212 cvmx_write_csr(CVMX_GMXX_RXX_FRM_CTL(port, interface),
223 cvmx_write_csr(CVMX_GMXX_TXX_PAUSE_PKT_TIME(port, interface),
225 cvmx_write_csr(CVMX_GMXX_TXX_PAUSE_PKT_INTERVAL
226 (port, interface), 19000);
244 for (port = 0; port < num_ports; port++) {
249 cvmx_read_csr(CVMX_GMXX_PRTX_CFG(port, interface));
251 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(port, interface),
272 int interface = cvmx_helper_get_interface_num(ipd_port);
277 if (asxx_prt_loop.
s.int_loop & (1 <<
index)) {
281 result.
s.full_duplex = 1;
282 result.
s.link_up = 1;
283 result.
s.speed = 1000;
305 int interface = cvmx_helper_get_interface_num(ipd_port);
320 original_gmx_cfg.
u64 =
321 cvmx_read_csr(CVMX_GMXX_PRTX_CFG(
index, interface));
322 new_gmx_cfg = original_gmx_cfg;
329 memset(pko_mem_queue_qos_save, 0,
sizeof(pko_mem_queue_qos_save));
331 for (
i = 0;
i < cvmx_pko_get_num_queues(ipd_port);
i++) {
332 int queue = cvmx_pko_get_base_queue(ipd_port) +
i;
335 pko_mem_queue_qos.
s.pid = ipd_port;
336 pko_mem_queue_qos.
s.qid = queue;
337 pko_mem_queue_qos_save[
i] = pko_mem_queue_qos;
338 pko_mem_queue_qos.
s.qos_mask = 0;
343 gmx_tx_ovr_bp.
u64 = cvmx_read_csr(CVMX_GMXX_TX_OVR_BP(interface));
344 gmx_tx_ovr_bp_save = gmx_tx_ovr_bp;
345 gmx_tx_ovr_bp.
s.bp &= ~(1 <<
index);
346 gmx_tx_ovr_bp.
s.en |= 1 <<
index;
347 cvmx_write_csr(CVMX_GMXX_TX_OVR_BP(interface), gmx_tx_ovr_bp.
u64);
348 cvmx_read_csr(CVMX_GMXX_TX_OVR_BP(interface));
358 interface * 0x800 +
index * 0x100 + 0x880);
365 new_gmx_cfg.
s.en = 0;
366 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(
index, interface), new_gmx_cfg.
u64);
367 cvmx_read_csr(CVMX_GMXX_PRTX_CFG(
index, interface));
370 if (cvmx_octeon_is_pass1())
372 new_gmx_cfg.
s.duplex = 1;
373 else if (!link_info.
s.link_up)
375 new_gmx_cfg.
s.duplex = 1;
377 new_gmx_cfg.
s.duplex = link_info.
s.full_duplex;
380 if (link_info.
s.speed == 10) {
381 new_gmx_cfg.
s.slottime = 0;
382 new_gmx_cfg.
s.speed = 0;
383 }
else if (link_info.
s.speed == 100) {
384 new_gmx_cfg.
s.slottime = 0;
385 new_gmx_cfg.
s.speed = 0;
387 new_gmx_cfg.
s.slottime = 1;
388 new_gmx_cfg.
s.speed = 1;
392 if (link_info.
s.speed == 10) {
394 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(
index, interface), 0x40);
395 cvmx_write_csr(CVMX_GMXX_TXX_BURST(
index, interface), 0);
396 }
else if (link_info.
s.speed == 100) {
398 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(
index, interface), 0x40);
399 cvmx_write_csr(CVMX_GMXX_TXX_BURST(
index, interface), 0);
402 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(
index, interface), 0x200);
403 cvmx_write_csr(CVMX_GMXX_TXX_BURST(
index, interface), 0x2000);
407 if ((link_info.
s.speed == 10) || (link_info.
s.speed == 100)) {
409 mode.
u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface));
423 if (((
index == 0) && (mode.
s.p0mii == 1))
424 || ((
index != 0) && (mode.
s.type == 1))) {
426 (
index, interface), 1);
432 cvmx_read_csr(CVMX_GMXX_PRTX_CFG(
index, interface));
435 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(
index, interface), new_gmx_cfg.
u64);
443 for (
i = 0;
i < cvmx_pko_get_num_queues(ipd_port);
i++) {
444 int queue = cvmx_pko_get_base_queue(ipd_port) +
i;
447 pko_mem_queue_qos_save[
i].
u64);
451 cvmx_write_csr(CVMX_GMXX_TX_OVR_BP(interface), gmx_tx_ovr_bp_save.
u64);
454 new_gmx_cfg.
s.en = original_gmx_cfg.
s.en;
455 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(
index, interface), new_gmx_cfg.
u64);
476 int interface = cvmx_helper_get_interface_num(ipd_port);
483 gmx_cfg.
u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(
index, interface));
484 original_enable = gmx_cfg.
s.en;
487 if (enable_internal) {
489 gmx_cfg.
s.duplex = 1;
490 gmx_cfg.
s.slottime = 1;
493 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(
index, interface), 0x200);
494 cvmx_write_csr(CVMX_GMXX_TXX_BURST(
index, interface), 0x2000);
496 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(
index, interface), gmx_cfg.
u64);
501 asxx_prt_loop.
s.int_loop |= 1 <<
index;
503 asxx_prt_loop.
s.int_loop &= ~(1 <<
index);
505 asxx_prt_loop.
s.ext_loop |= 1 <<
index;
507 asxx_prt_loop.
s.ext_loop &= ~(1 <<
index);
511 if (enable_internal) {
523 gmx_cfg.
s.en = original_enable;
524 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(
index, interface), gmx_cfg.
u64);