Searched refs:lmacid (Results 1 - 2 of 2) sorted by relevance

/linux-4.4.14/drivers/net/ethernet/cavium/thunder/
H A Dthunder_bgx.c32 int lmacid; /* ID within BGX */ member in struct:lmac
150 void bgx_get_lmac_link_state(int node, int bgx_idx, int lmacid, void *status) bgx_get_lmac_link_state() argument
160 lmac = &bgx->lmac[lmacid]; bgx_get_lmac_link_state()
167 const u8 *bgx_get_lmac_mac(int node, int bgx_idx, int lmacid) bgx_get_lmac_mac() argument
172 return bgx->lmac[lmacid].mac; bgx_get_lmac_mac()
178 void bgx_set_lmac_mac(int node, int bgx_idx, int lmacid, const u8 *mac) bgx_set_lmac_mac() argument
185 ether_addr_copy(bgx->lmac[lmacid].mac, mac); bgx_set_lmac_mac()
189 void bgx_lmac_rx_tx_enable(int node, int bgx_idx, int lmacid, bool enable) bgx_lmac_rx_tx_enable() argument
197 cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG); bgx_lmac_rx_tx_enable()
202 bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg); bgx_lmac_rx_tx_enable()
213 cmr_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_CMRX_CFG); bgx_sgmii_change_link_state()
215 bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg); bgx_sgmii_change_link_state()
217 port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG); bgx_sgmii_change_link_state()
218 misc_ctl = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL); bgx_sgmii_change_link_state()
235 bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64); bgx_sgmii_change_link_state()
236 bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0); bgx_sgmii_change_link_state()
244 bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64); bgx_sgmii_change_link_state()
245 bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0); bgx_sgmii_change_link_state()
253 bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 512); bgx_sgmii_change_link_state()
255 bgx_reg_write(bgx, lmac->lmacid, bgx_sgmii_change_link_state()
258 bgx_reg_write(bgx, lmac->lmacid, bgx_sgmii_change_link_state()
264 bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL, misc_ctl); bgx_sgmii_change_link_state()
265 bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG, port_cfg); bgx_sgmii_change_link_state()
267 port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG); bgx_sgmii_change_link_state()
271 bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg); bgx_sgmii_change_link_state()
380 static int bgx_lmac_sgmii_init(struct bgx *bgx, int lmacid) bgx_lmac_sgmii_init() argument
384 bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_THRESH, 0x30); bgx_lmac_sgmii_init()
386 bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_RXX_JABBER, MAX_FRAME_SIZE); bgx_lmac_sgmii_init()
389 cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND); bgx_lmac_sgmii_init()
391 bgx_reg_write(bgx, lmacid, BGX_GMP_GMI_TXX_SGMII_CTL, 0); bgx_lmac_sgmii_init()
394 bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN); bgx_lmac_sgmii_init()
397 bgx_reg_modify(bgx, lmacid, BGX_GMP_PCS_MRX_CTL, PCS_MRX_CTL_RESET); bgx_lmac_sgmii_init()
398 if (bgx_poll_reg(bgx, lmacid, BGX_GMP_PCS_MRX_CTL, bgx_lmac_sgmii_init()
405 cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_PCS_MRX_CTL); bgx_lmac_sgmii_init()
408 bgx_reg_write(bgx, lmacid, BGX_GMP_PCS_MRX_CTL, cfg); bgx_lmac_sgmii_init()
410 if (bgx_poll_reg(bgx, lmacid, BGX_GMP_PCS_MRX_STATUS, bgx_lmac_sgmii_init()
419 static int bgx_lmac_xaui_init(struct bgx *bgx, int lmacid, int lmac_type) bgx_lmac_xaui_init() argument
424 bgx_reg_modify(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_RESET); bgx_lmac_xaui_init()
425 if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_RESET, true)) { bgx_lmac_xaui_init()
431 cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG); bgx_lmac_xaui_init()
433 bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg); bgx_lmac_xaui_init()
435 bgx_reg_modify(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_LOW_POWER); bgx_lmac_xaui_init()
438 bgx_reg_modify(bgx, lmacid, bgx_lmac_xaui_init()
441 bgx_reg_modify(bgx, lmacid, BGX_SPUX_MISC_CONTROL, bgx_lmac_xaui_init()
445 cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_RX_INT); bgx_lmac_xaui_init()
446 bgx_reg_write(bgx, lmacid, BGX_SMUX_RX_INT, cfg); bgx_lmac_xaui_init()
447 cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_INT); bgx_lmac_xaui_init()
448 bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_INT, cfg); bgx_lmac_xaui_init()
449 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT); bgx_lmac_xaui_init()
450 bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg); bgx_lmac_xaui_init()
453 bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LP_CUP, 0x00); bgx_lmac_xaui_init()
454 bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LD_CUP, 0x00); bgx_lmac_xaui_init()
455 bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LD_REP, 0x00); bgx_lmac_xaui_init()
457 bgx_reg_modify(bgx, lmacid, bgx_lmac_xaui_init()
462 bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_APPEND, SMU_TX_APPEND_FCS_D); bgx_lmac_xaui_init()
465 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_FEC_CONTROL); bgx_lmac_xaui_init()
467 bgx_reg_write(bgx, lmacid, BGX_SPUX_FEC_CONTROL, cfg); bgx_lmac_xaui_init()
470 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_AN_CONTROL); bgx_lmac_xaui_init()
472 bgx_reg_write(bgx, lmacid, BGX_SPUX_AN_CONTROL, cfg); bgx_lmac_xaui_init()
474 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_AN_ADV); bgx_lmac_xaui_init()
482 bgx_reg_write(bgx, lmacid, BGX_SPUX_AN_ADV, cfg); bgx_lmac_xaui_init()
489 bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN); bgx_lmac_xaui_init()
491 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_CONTROL1); bgx_lmac_xaui_init()
493 bgx_reg_write(bgx, lmacid, BGX_SPUX_CONTROL1, cfg); bgx_lmac_xaui_init()
495 cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_CTL); bgx_lmac_xaui_init()
498 bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_CTL, cfg); bgx_lmac_xaui_init()
501 bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_THRESH, (0x100 - 1)); bgx_lmac_xaui_init()
503 bgx_reg_modify(bgx, lmacid, BGX_SMUX_RX_JABBER, MAX_FRAME_SIZE); bgx_lmac_xaui_init()
511 int lmacid = lmac->lmacid; bgx_xaui_check_link() local
515 bgx_reg_modify(bgx, lmacid, BGX_SPUX_MISC_CONTROL, SPU_MISC_CTL_RX_DIS); bgx_xaui_check_link()
517 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT); bgx_xaui_check_link()
520 bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg); bgx_xaui_check_link()
521 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL); bgx_xaui_check_link()
523 bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL, cfg); bgx_xaui_check_link()
529 if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_RESET, true)) { bgx_xaui_check_link()
536 if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_BR_STATUS1, bgx_xaui_check_link()
543 if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_BX_STATUS, bgx_xaui_check_link()
552 bgx_reg_modify(bgx, lmacid, BGX_SPUX_STATUS2, SPU_STATUS2_RCVFLT); bgx_xaui_check_link()
553 if (bgx_reg_read(bgx, lmacid, BGX_SPUX_STATUS2) & SPU_STATUS2_RCVFLT) { bgx_xaui_check_link()
556 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT); bgx_xaui_check_link()
559 bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg); bgx_xaui_check_link()
560 cfg = bgx_reg_read(bgx, lmacid, bgx_xaui_check_link()
563 bgx_reg_write(bgx, lmacid, bgx_xaui_check_link()
572 if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_RX_CTL, bgx_xaui_check_link()
579 if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_CTL, SMU_CTL_RX_IDLE, false)) { bgx_xaui_check_link()
585 if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_CTL, SMU_CTL_TX_IDLE, false)) { bgx_xaui_check_link()
590 if (bgx_reg_read(bgx, lmacid, BGX_SPUX_STATUS2) & SPU_STATUS2_RCVFLT) { bgx_xaui_check_link()
596 bgx_reg_modify(bgx, lmacid, BGX_SPUX_STATUS1, SPU_STATUS1_RCV_LNK); bgx_xaui_check_link()
597 if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_STATUS1, bgx_xaui_check_link()
603 cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_MISC_CONTROL); bgx_xaui_check_link()
605 bgx_reg_write(bgx, lmacid, BGX_SPUX_MISC_CONTROL, cfg); bgx_xaui_check_link()
617 bgx_reg_modify(lmac->bgx, lmac->lmacid, bgx_poll_for_link()
619 bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1, bgx_poll_for_link()
622 link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1); bgx_poll_for_link()
645 static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid) bgx_lmac_enable() argument
650 lmac = &bgx->lmac[lmacid]; bgx_lmac_enable()
655 if (bgx_lmac_sgmii_init(bgx, lmacid)) bgx_lmac_enable()
659 if (bgx_lmac_xaui_init(bgx, lmacid, bgx->lmac_type)) bgx_lmac_enable()
664 cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND); bgx_lmac_enable()
666 bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND, cfg); bgx_lmac_enable()
667 bgx_reg_write(bgx, lmacid, BGX_GMP_GMI_TXX_MIN_PKT, 60 - 1); bgx_lmac_enable()
669 cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_APPEND); bgx_lmac_enable()
671 bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_APPEND, cfg); bgx_lmac_enable()
672 bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_MIN_PKT, 60 + 4); bgx_lmac_enable()
676 bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN); bgx_lmac_enable()
679 bgx_reg_write(bgx, lmacid, BGX_CMRX_RX_DMAC_CTL, 0x03); bgx_lmac_enable()
708 static void bgx_lmac_disable(struct bgx *bgx, u8 lmacid) bgx_lmac_disable() argument
713 lmac = &bgx->lmac[lmacid]; bgx_lmac_disable()
720 cmrx_cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG); bgx_lmac_disable()
722 bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cmrx_cfg); bgx_lmac_disable()
723 bgx_flush_dmac_addrs(bgx, lmacid); bgx_lmac_disable()
923 bgx->lmac[bgx->lmac_count].lmacid = bgx->lmac_count; bgx_acpi_register_phy()
995 bgx->lmac[lmac].lmacid = lmac; for_each_child_of_node()
H A Dthunder_bgx.h186 void bgx_lmac_rx_tx_enable(int node, int bgx_idx, int lmacid, bool enable);
190 const u8 *bgx_get_lmac_mac(int node, int bgx_idx, int lmacid);
191 void bgx_set_lmac_mac(int node, int bgx_idx, int lmacid, const u8 *mac);
192 void bgx_get_lmac_link_state(int node, int bgx_idx, int lmacid, void *status);

Completed in 82 milliseconds