bgx                53 drivers/net/ethernet/cavium/thunder/nic_main.c #define	NIC_SET_VF_LMAC_MAP(bgx, lmac)	(((bgx & 0xF) << 4) | (lmac & 0xF))
bgx               231 drivers/net/ethernet/cavium/thunder/nic_main.c static void nic_get_bgx_stats(struct nicpf *nic, struct bgx_stats_msg *bgx)
bgx               236 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx_idx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[bgx->vf_id]);
bgx               237 drivers/net/ethernet/cavium/thunder/nic_main.c 	lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[bgx->vf_id]);
bgx               240 drivers/net/ethernet/cavium/thunder/nic_main.c 	mbx.bgx_stats.vf_id = bgx->vf_id;
bgx               241 drivers/net/ethernet/cavium/thunder/nic_main.c 	mbx.bgx_stats.rx = bgx->rx;
bgx               242 drivers/net/ethernet/cavium/thunder/nic_main.c 	mbx.bgx_stats.idx = bgx->idx;
bgx               243 drivers/net/ethernet/cavium/thunder/nic_main.c 	if (bgx->rx)
bgx               245 drivers/net/ethernet/cavium/thunder/nic_main.c 							    lmac, bgx->idx);
bgx               248 drivers/net/ethernet/cavium/thunder/nic_main.c 							    lmac, bgx->idx);
bgx               249 drivers/net/ethernet/cavium/thunder/nic_main.c 	nic_send_msg_to_vf(nic, bgx->vf_id, &mbx);
bgx               255 drivers/net/ethernet/cavium/thunder/nic_main.c 	int bgx, lmac, lmac_cnt;
bgx               261 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
bgx               263 drivers/net/ethernet/cavium/thunder/nic_main.c 	lmac += bgx * MAX_LMAC_PER_BGX;
bgx               268 drivers/net/ethernet/cavium/thunder/nic_main.c 	lmac_cnt = bgx_get_lmac_count(nic->node, bgx);
bgx               320 drivers/net/ethernet/cavium/thunder/nic_main.c 	int bgx, next_bgx_lmac = 0;
bgx               326 drivers/net/ethernet/cavium/thunder/nic_main.c 	for (bgx = 0; bgx < nic->hw->bgx_cnt; bgx++) {
bgx               327 drivers/net/ethernet/cavium/thunder/nic_main.c 		if (!(bgx_map & (1 << bgx)))
bgx               329 drivers/net/ethernet/cavium/thunder/nic_main.c 		lmac_cnt = bgx_get_lmac_count(nic->node, bgx);
bgx               332 drivers/net/ethernet/cavium/thunder/nic_main.c 						NIC_SET_VF_LMAC_MAP(bgx, lmac);
bgx               341 drivers/net/ethernet/cavium/thunder/nic_main.c 		lmac = bgx * MAX_LMAC_PER_BGX;
bgx               342 drivers/net/ethernet/cavium/thunder/nic_main.c 		for (; lmac < lmac_cnt + (bgx * MAX_LMAC_PER_BGX); lmac++)
bgx               475 drivers/net/ethernet/cavium/thunder/nic_main.c 	u32 vnic, bgx, lmac, chan;
bgx               481 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vnic]);
bgx               484 drivers/net/ethernet/cavium/thunder/nic_main.c 	chan = (lmac * hw->chans_per_lmac) + (bgx * hw->chans_per_bgx);
bgx               615 drivers/net/ethernet/cavium/thunder/nic_main.c 	u32 bgx, lmac, chan;
bgx               627 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[pqs_vnic]);
bgx               637 drivers/net/ethernet/cavium/thunder/nic_main.c 		tl4 = bgx * (hw->tl4_cnt / hw->bgx_cnt);
bgx               669 drivers/net/ethernet/cavium/thunder/nic_main.c 	chan = (lmac * hw->chans_per_lmac) + (bgx * hw->chans_per_bgx);
bgx               692 drivers/net/ethernet/cavium/thunder/nic_main.c 			      lmac + (bgx * MAX_LMAC_PER_BGX));
bgx               848 drivers/net/ethernet/cavium/thunder/nic_main.c 	int bgx, lmac;
bgx               855 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
bgx               858 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx_lmac_rx_tx_enable(nic->node, bgx, lmac, enable);
bgx               863 drivers/net/ethernet/cavium/thunder/nic_main.c 	int bgx, lmac;
bgx               869 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
bgx               873 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx_lmac_get_pfc(nic->node, bgx, lmac, &pfc);
bgx               880 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx_lmac_set_pfc(nic->node, bgx, lmac, cfg);
bgx               931 drivers/net/ethernet/cavium/thunder/nic_main.c 	u8 bgx, lmac;
bgx               936 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
bgx               940 drivers/net/ethernet/cavium/thunder/nic_main.c 	bgx_get_lmac_link_state(nic->node, bgx, lmac, &link);
bgx               960 drivers/net/ethernet/cavium/thunder/nic_main.c 	int bgx, lmac;
bgx              1034 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]);
bgx              1036 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx_set_lmac_mac(nic->node, bgx, lmac, mbx.mac.mac_addr);
bgx              1095 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
bgx              1097 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx_reset_xcast_mode(nic->node, bgx, lmac,
bgx              1107 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
bgx              1109 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx_set_dmac_cam_filter(nic->node, bgx, lmac,
bgx              1120 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
bgx              1122 drivers/net/ethernet/cavium/thunder/nic_main.c 		bgx_set_xcast_mode(nic->node, bgx, lmac, mbx.xcast.mode);
bgx               193 drivers/net/ethernet/cavium/thunder/nicvf_main.c static void nicvf_read_bgx_stats(struct nicvf *nic, struct bgx_stats_msg *bgx)
bgx               195 drivers/net/ethernet/cavium/thunder/nicvf_main.c 	if (bgx->rx)
bgx               196 drivers/net/ethernet/cavium/thunder/nicvf_main.c 		nic->bgx_stats.rx_stats[bgx->idx] = bgx->stats;
bgx               198 drivers/net/ethernet/cavium/thunder/nicvf_main.c 		nic->bgx_stats.tx_stats[bgx->idx] = bgx->stats;
bgx                43 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx		*bgx;
bgx                79 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static struct bgx *bgx_vnic[MAX_BGX_THUNDER];
bgx               107 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static u64 bgx_reg_read(struct bgx *bgx, u8 lmac, u64 offset)
bgx               109 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	void __iomem *addr = bgx->reg_base + ((u32)lmac << 20) + offset;
bgx               114 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_reg_write(struct bgx *bgx, u8 lmac, u64 offset, u64 val)
bgx               116 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	void __iomem *addr = bgx->reg_base + ((u32)lmac << 20) + offset;
bgx               121 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_reg_modify(struct bgx *bgx, u8 lmac, u64 offset, u64 val)
bgx               123 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	void __iomem *addr = bgx->reg_base + ((u32)lmac << 20) + offset;
bgx               128 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_poll_reg(struct bgx *bgx, u8 lmac, u64 reg, u64 mask, bool zero)
bgx               134 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		reg_val = bgx_reg_read(bgx, lmac, reg);
bgx               169 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static struct bgx *get_bgx(int node, int bgx_idx)
bgx               194 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx;
bgx               196 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx = get_bgx(node, bgx_idx);
bgx               197 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx)
bgx               198 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		return bgx->lmac_count;
bgx               208 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx;
bgx               211 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx = get_bgx(node, bgx_idx);
bgx               212 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               215 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               225 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               227 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx)
bgx               228 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		return bgx->lmac[lmacid].mac;
bgx               236 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               238 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               241 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	ether_addr_copy(bgx->lmac[lmacid].mac, mac);
bgx               245 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_flush_dmac_cam_filter(struct bgx *bgx, int lmacid)
bgx               250 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               253 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM +
bgx               311 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_set_dmac_cam_filter_mac(struct bgx *bgx, int lmacid,
bgx               318 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!cam_dmac || !bgx)
bgx               321 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               326 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM +
bgx               334 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               337 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               340 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               356 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               361 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               364 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               366 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_RX_DMAC_CTL);
bgx               381 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx_set_dmac_cam_filter_mac(bgx, lmacid,
bgx               384 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_CMRX_RX_DMAC_CTL, cfg);
bgx               390 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               392 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               395 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_lmac_remove_filters(&bgx->lmac[lmacid], vf_id);
bgx               396 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_flush_dmac_cam_filter(bgx, lmacid);
bgx               404 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               408 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               410 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               412 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
bgx               417 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_INT_ENA_W1S,
bgx               423 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_INT_ENA_W1C,
bgx               426 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg);
bgx               428 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx->is_rgx)
bgx               436 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               440 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               443 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               452 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, csr_offset);
bgx               458 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, csr_offset, cfg);
bgx               465 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               469 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               471 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               475 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_CBFC_CTL);
bgx               485 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = get_bgx(node, bgx_idx);
bgx               489 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               491 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx               495 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_CBFC_CTL);
bgx               499 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SMUX_CBFC_CTL, cfg);
bgx               505 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = lmac->bgx;
bgx               511 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cmr_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_CMRX_CFG);
bgx               515 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg);
bgx               518 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG,
bgx               520 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "BGX%d LMAC%d GMI RX not idle\n",
bgx               521 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx->bgx_id, lmac->lmacid);
bgx               526 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG,
bgx               528 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "BGX%d LMAC%d GMI TX not idle\n",
bgx               529 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx->bgx_id, lmac->lmacid);
bgx               533 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG);
bgx               534 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	misc_ctl = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL);
bgx               551 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64);
bgx               552 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0);
bgx               560 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64);
bgx               561 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0);
bgx               569 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 512);
bgx               571 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx_reg_write(bgx, lmac->lmacid,
bgx               574 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx_reg_write(bgx, lmac->lmacid,
bgx               580 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL, misc_ctl);
bgx               581 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG, port_cfg);
bgx               585 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg);
bgx               587 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx->is_rgx && (cmr_cfg & (CMR_PKT_RX_EN | CMR_PKT_TX_EN)))
bgx               632 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx;
bgx               634 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx = get_bgx(node, bgx_idx);
bgx               635 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               640 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	return bgx_reg_read(bgx, lmac, BGX_CMRX_RX_STAT0 + (idx * 8));
bgx               646 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx;
bgx               648 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx = get_bgx(node, bgx_idx);
bgx               649 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               652 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	return bgx_reg_read(bgx, lmac, BGX_CMRX_TX_STAT0 + (idx * 8));
bgx               660 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx;
bgx               664 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx = get_bgx(node, bgx_idx);
bgx               665 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx               668 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmac_idx];
bgx               670 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		cfg = bgx_reg_read(bgx, lmac_idx, BGX_GMP_PCS_MRX_CTL);
bgx               675 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac_idx, BGX_GMP_PCS_MRX_CTL, cfg);
bgx               677 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		cfg = bgx_reg_read(bgx, lmac_idx, BGX_SPUX_CONTROL1);
bgx               682 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac_idx, BGX_SPUX_CONTROL1, cfg);
bgx               687 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_lmac_sgmii_init(struct bgx *bgx, struct lmac *lmac)
bgx               692 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_THRESH, 0x30);
bgx               694 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_RXX_JABBER, MAX_FRAME_SIZE);
bgx               697 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND);
bgx               699 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmacid, BGX_GMP_GMI_TXX_SGMII_CTL, 0);
bgx               702 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN);
bgx               705 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_GMP_PCS_MRX_CTL, PCS_MRX_CTL_RESET);
bgx               706 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(bgx, lmacid, BGX_GMP_PCS_MRX_CTL,
bgx               708 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "BGX PCS reset not completed\n");
bgx               713 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_PCS_MRX_CTL);
bgx               726 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_GMP_PCS_MRX_CTL, cfg);
bgx               730 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_PCS_MISCX_CTL);
bgx               732 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmacid, BGX_GMP_PCS_MISCX_CTL, cfg);
bgx               737 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (bgx_poll_reg(bgx, lmacid, BGX_GMP_PCS_MRX_STATUS,
bgx               739 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			dev_err(&bgx->pdev->dev, "BGX AN_CPT not completed\n");
bgx               747 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_lmac_xaui_init(struct bgx *bgx, struct lmac *lmac)
bgx               753 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_RESET);
bgx               754 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_RESET, true)) {
bgx               755 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "BGX SPU reset not completed\n");
bgx               760 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
bgx               762 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg);
bgx               764 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_LOW_POWER);
bgx               767 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, lmacid, BGX_SPUX_MISC_CONTROL,
bgx               771 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_MISC_CONTROL);
bgx               773 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SPUX_MISC_CONTROL, cfg);
bgx               776 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_RX_INT);
bgx               777 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SMUX_RX_INT, cfg);
bgx               778 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_INT);
bgx               779 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_INT, cfg);
bgx               780 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT);
bgx               781 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg);
bgx               784 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LP_CUP, 0x00);
bgx               785 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LD_CUP, 0x00);
bgx               786 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LD_REP, 0x00);
bgx               788 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, lmacid,
bgx               793 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_APPEND, SMU_TX_APPEND_FCS_D);
bgx               796 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_FEC_CONTROL);
bgx               798 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SPUX_FEC_CONTROL, cfg);
bgx               801 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_AN_CONTROL);
bgx               803 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SPUX_AN_CONTROL, cfg);
bgx               805 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_AN_ADV);
bgx               813 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SPUX_AN_ADV, cfg);
bgx               815 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, 0, BGX_SPU_DBG_CONTROL);
bgx               817 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, 0, BGX_SPU_DBG_CONTROL, cfg);
bgx               820 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN);
bgx               822 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_CONTROL1);
bgx               824 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SPUX_CONTROL1, cfg);
bgx               826 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_CTL);
bgx               829 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_CTL, cfg);
bgx               832 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SMUX_CBFC_CTL, ((0xffffULL << 32) |
bgx               835 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid,
bgx               837 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_PAUSE_PKT_INTERVAL);
bgx               839 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_PAUSE_PKT_INTERVAL,
bgx               841 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_PAUSE_ZERO, 0x01);
bgx               844 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_THRESH, (0x100 - 1));
bgx               846 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_SMUX_RX_JABBER, MAX_FRAME_SIZE);
bgx               853 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = lmac->bgx;
bgx               859 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT);
bgx               862 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg);
bgx               863 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL);
bgx               865 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL, cfg);
bgx               871 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_RESET, true)) {
bgx               872 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "BGX SPU reset not completed\n");
bgx               878 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_BR_STATUS1,
bgx               880 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			dev_err(&bgx->pdev->dev,
bgx               885 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_BX_STATUS,
bgx               887 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			dev_err(&bgx->pdev->dev,
bgx               894 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_reg_read(bgx, lmacid, BGX_SPUX_STATUS2) & SPU_STATUS2_RCVFLT)
bgx               895 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, lmacid,
bgx               897 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_reg_read(bgx, lmacid, BGX_SPUX_STATUS2) & SPU_STATUS2_RCVFLT) {
bgx               898 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "Receive fault, retry training\n");
bgx               900 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT);
bgx               903 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 				bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg);
bgx               904 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 				cfg = bgx_reg_read(bgx, lmacid,
bgx               907 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 				bgx_reg_write(bgx, lmacid,
bgx               916 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_CTL, SMU_CTL_RX_IDLE, false)) {
bgx               917 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "SMU RX not idle\n");
bgx               922 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_CTL, SMU_CTL_TX_IDLE, false)) {
bgx               923 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "SMU TX not idle\n");
bgx               928 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_RX_CTL);
bgx               937 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_lmac_xaui_init(bgx, lmac);
bgx               947 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	pcs_link = bgx_reg_read(lmac->bgx, lmac->lmacid,
bgx               952 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		pcs_link = bgx_reg_read(lmac->bgx, lmac->lmacid,
bgx               955 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_GMP_PCS_MRX_STATUS,
bgx               964 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	an_result = bgx_reg_read(lmac->bgx, lmac->lmacid,
bgx              1009 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(lmac->bgx, lmac->lmacid,
bgx              1011 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
bgx              1014 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	spu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1);
bgx              1015 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	smu_link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SMUX_RX_CTL);
bgx              1056 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_lmac_enable(struct bgx *bgx, u8 lmacid)
bgx              1061 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx              1062 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac->bgx = bgx;
bgx              1068 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (bgx_lmac_sgmii_init(bgx, lmac))
bgx              1072 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (bgx_lmac_xaui_init(bgx, lmac))
bgx              1077 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND);
bgx              1079 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND, cfg);
bgx              1080 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmacid, BGX_GMP_GMI_TXX_MIN_PKT, 60 - 1);
bgx              1082 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_APPEND);
bgx              1084 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_APPEND, cfg);
bgx              1085 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_MIN_PKT, 60 + 4);
bgx              1089 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac->dmacs_count = (RX_DMAC_COUNT / bgx->lmac_count);
bgx              1096 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN);
bgx              1099 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_CMRX_RX_DMAC_CTL, 0x03);
bgx              1107 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 				bgx_reg_write(bgx, lmacid,
bgx              1142 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_lmac_disable(struct bgx *bgx, u8 lmacid)
bgx              1147 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx              1155 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
bgx              1157 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg);
bgx              1160 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_poll_reg(bgx, lmacid, BGX_CMRX_RX_FIFO_LEN, (u64)0x1FFF, true);
bgx              1161 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_poll_reg(bgx, lmacid, BGX_CMRX_TX_FIFO_LEN, (u64)0x3FFF, true);
bgx              1164 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
bgx              1166 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg);
bgx              1170 drivers/net/ethernet/cavium/thunder/thunder_bgx.c                 bgx_reg_modify(bgx, lmacid,
bgx              1173 drivers/net/ethernet/cavium/thunder/thunder_bgx.c                 bgx_reg_modify(bgx, lmacid,
bgx              1177 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
bgx              1179 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg);
bgx              1181 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_flush_dmac_cam_filter(bgx, lmacid);
bgx              1193 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_init_hw(struct bgx *bgx)
bgx              1198 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_modify(bgx, 0, BGX_CMR_GLOBAL_CFG, CMR_GLOBAL_CFG_FCS_STRIP);
bgx              1199 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx_reg_read(bgx, 0, BGX_CMR_BIST_STATUS))
bgx              1200 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		dev_err(&bgx->pdev->dev, "BGX%d BIST failed\n", bgx->bgx_id);
bgx              1203 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	for (i = 0; i < bgx->lmac_count; i++) {
bgx              1204 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		lmac = &bgx->lmac[i];
bgx              1205 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, i, BGX_CMRX_CFG,
bgx              1207 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->lmac[i].lmacid_bd = lmac_count;
bgx              1211 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, 0, BGX_CMR_TX_LMACS, bgx->lmac_count);
bgx              1212 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_reg_write(bgx, 0, BGX_CMR_RX_LMACS, bgx->lmac_count);
bgx              1215 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	for (i = 0; i < bgx->lmac_count; i++)
bgx              1216 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_modify(bgx, 0, BGX_CMR_CHAN_MSK_AND,
bgx              1222 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM + (i * 8), 0x00);
bgx              1226 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, 0, BGX_CMR_RX_STEERING + (i * 8), 0x00);
bgx              1229 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static u8 bgx_get_lane2sds_cfg(struct bgx *bgx, struct lmac *lmac)
bgx              1231 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	return (u8)(bgx_reg_read(bgx, lmac->lmacid, BGX_CMRX_CFG) & 0xFF);
bgx              1234 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_print_qlm_mode(struct bgx *bgx, u8 lmacid)
bgx              1236 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct device *dev = &bgx->pdev->dev;
bgx              1240 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx->is_dlm && lmacid)
bgx              1243 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[lmacid];
bgx              1244 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx->is_dlm)
bgx              1245 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		sprintf(str, "BGX%d QLM mode", bgx->bgx_id);
bgx              1247 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		sprintf(str, "BGX%d LMAC%d mode", bgx->bgx_id, lmacid);
bgx              1283 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void lmac_set_lane2sds(struct bgx *bgx, struct lmac *lmac)
bgx              1304 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		lmac->lane_to_sds = bgx_get_lane2sds_cfg(bgx, lmac);
bgx              1312 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void lmac_set_training(struct bgx *bgx, struct lmac *lmac, int lmacid)
bgx              1320 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac->use_training = bgx_reg_read(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL) &
bgx              1324 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_set_lmac_config(struct bgx *bgx, u8 idx)
bgx              1331 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac = &bgx->lmac[idx];
bgx              1333 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx->is_dlm || bgx->is_rgx) {
bgx              1337 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		cmr_cfg = bgx_reg_read(bgx, 0, BGX_CMRX_CFG);
bgx              1339 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (bgx->is_rgx)
bgx              1341 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		lmac_set_training(bgx, lmac, 0);
bgx              1342 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		lmac_set_lane2sds(bgx, lmac);
bgx              1351 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	cmr_cfg = bgx_reg_read(bgx, idx, BGX_CMRX_CFG);
bgx              1360 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	lmac_set_training(bgx, lmac, lmac->lmacid);
bgx              1363 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static void bgx_get_qlm_mode(struct bgx *bgx)
bgx              1369 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	for (idx = 0; idx < bgx->max_lmac; idx++) {
bgx              1370 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		lmac = &bgx->lmac[idx];
bgx              1377 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx->lmac_count = bgx_reg_read(bgx, 0, BGX_CMR_RX_LMACS) & 0x7;
bgx              1378 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (bgx->lmac_count > bgx->max_lmac)
bgx              1379 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->lmac_count = bgx->max_lmac;
bgx              1381 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	for (idx = 0; idx < bgx->lmac_count; idx++) {
bgx              1382 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_set_lmac_config(bgx, idx);
bgx              1383 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_print_qlm_mode(bgx, idx);
bgx              1411 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = context;
bgx              1412 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct device *dev = &bgx->pdev->dev;
bgx              1418 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	acpi_get_mac_address(dev, adev, bgx->lmac[bgx->acpi_lmac_idx].mac);
bgx              1420 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	SET_NETDEV_DEV(&bgx->lmac[bgx->acpi_lmac_idx].netdev, dev);
bgx              1422 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx->lmac[bgx->acpi_lmac_idx].lmacid = bgx->acpi_lmac_idx;
bgx              1423 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx->acpi_lmac_idx++; /* move to next LMAC */
bgx              1432 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = context;
bgx              1435 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	snprintf(bgx_sel, 5, "BGX%d", bgx->bgx_id);
bgx              1445 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			    bgx_acpi_register_phy, NULL, bgx, NULL);
bgx              1451 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_init_acpi_phy(struct bgx *bgx)
bgx              1453 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	acpi_get_devices(NULL, bgx_acpi_match_id, bgx, (void **)NULL);
bgx              1459 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_init_acpi_phy(struct bgx *bgx)
bgx              1468 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_init_of_phy(struct bgx *bgx)
bgx              1474 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	device_for_each_child_node(&bgx->pdev->dev, fwn) {
bgx              1488 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			ether_addr_copy(bgx->lmac[lmac].mac, mac);
bgx              1490 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		SET_NETDEV_DEV(&bgx->lmac[lmac].netdev, &bgx->pdev->dev);
bgx              1491 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->lmac[lmac].lmacid = lmac;
bgx              1504 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx->lmac[lmac].phydev = pd;
bgx              1508 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (lmac == bgx->max_lmac) {
bgx              1520 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		if (bgx->lmac[lmac].phydev) {
bgx              1521 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			put_device(&bgx->lmac[lmac].phydev->mdio.dev);
bgx              1522 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx->lmac[lmac].phydev = NULL;
bgx              1532 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_init_of_phy(struct bgx *bgx)
bgx              1539 drivers/net/ethernet/cavium/thunder/thunder_bgx.c static int bgx_init_phy(struct bgx *bgx)
bgx              1542 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		return bgx_init_acpi_phy(bgx);
bgx              1544 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	return bgx_init_of_phy(bgx);
bgx              1549 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = (struct bgx *)data;
bgx              1553 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
bgx              1554 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		status = bgx_reg_read(bgx, lmac, BGX_GMP_GMI_TXX_INT);
bgx              1556 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			pci_err(bgx->pdev, "BGX%d lmac%d UNDFLW\n",
bgx              1557 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 				bgx->bgx_id, lmac);
bgx              1558 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			val = bgx_reg_read(bgx, lmac, BGX_CMRX_CFG);
bgx              1560 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
bgx              1562 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			bgx_reg_write(bgx, lmac, BGX_CMRX_CFG, val);
bgx              1565 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_reg_write(bgx, lmac, BGX_GMP_GMI_TXX_INT, status);
bgx              1573 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = pci_get_drvdata(pdev);
bgx              1584 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 			      bgx, "BGX%d", bgx->bgx_id);
bgx              1586 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		pci_free_irq(pdev, GMPX_GMI_TX_INT, bgx);
bgx              1593 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = NULL;
bgx              1597 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx = devm_kzalloc(dev, sizeof(*bgx), GFP_KERNEL);
bgx              1598 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx)
bgx              1600 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx->pdev = pdev;
bgx              1602 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	pci_set_drvdata(pdev, bgx);
bgx              1618 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx->reg_base = pcim_iomap(pdev, PCI_CFG_REG_BAR_NUM, 0);
bgx              1619 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	if (!bgx->reg_base) {
bgx              1629 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->bgx_id = (pci_resource_start(pdev,
bgx              1631 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->bgx_id += nic_get_node_id(pdev) * max_bgx_per_node;
bgx              1632 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->max_lmac = MAX_LMAC_PER_BGX;
bgx              1633 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_vnic[bgx->bgx_id] = bgx;
bgx              1635 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->is_rgx = true;
bgx              1636 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->max_lmac = 1;
bgx              1637 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->bgx_id = MAX_BGX_PER_CN81XX - 1;
bgx              1638 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_vnic[bgx->bgx_id] = bgx;
bgx              1647 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	    ((sdevid == PCI_SUBSYS_DEVID_83XX_BGX) && (bgx->bgx_id == 2)))
bgx              1648 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx->is_dlm = true;
bgx              1650 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_get_qlm_mode(bgx);
bgx              1652 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	err = bgx_init_phy(bgx);
bgx              1656 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_init_hw(bgx);
bgx              1661 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	for (lmac = 0; lmac < bgx->lmac_count; lmac++) {
bgx              1662 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		err = bgx_lmac_enable(bgx, lmac);
bgx              1665 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 				bgx->bgx_id, lmac);
bgx              1667 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 				bgx_lmac_disable(bgx, --lmac);
bgx              1675 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_vnic[bgx->bgx_id] = NULL;
bgx              1676 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	pci_free_irq(pdev, GMPX_GMI_TX_INT, bgx);
bgx              1687 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	struct bgx *bgx = pci_get_drvdata(pdev);
bgx              1691 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	for (lmac = 0; lmac < bgx->lmac_count; lmac++)
bgx              1692 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 		bgx_lmac_disable(bgx, lmac);
bgx              1694 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	pci_free_irq(pdev, GMPX_GMI_TX_INT, bgx);
bgx              1696 drivers/net/ethernet/cavium/thunder/thunder_bgx.c 	bgx_vnic[bgx->bgx_id] = NULL;
bgx               226 drivers/net/ethernet/cavium/thunder/thunder_bgx.h int bgx_get_lmac_count(int node, int bgx);
bgx               219 drivers/video/fbdev/core/cfbimgblt.c 	u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel;
bgx               242 drivers/video/fbdev/core/cfbimgblt.c 		bgx <<= bpp;
bgx               244 drivers/video/fbdev/core/cfbimgblt.c 		bgx |= bgcolor;
bgx               248 drivers/video/fbdev/core/cfbimgblt.c 	eorx = fgx ^ bgx;
bgx               257 drivers/video/fbdev/core/cfbimgblt.c 			FB_WRITEL((end_mask & eorx)^bgx, dst++);
bgx               189 drivers/video/fbdev/core/sysimgblt.c 	u32 fgx = fgcolor, bgx = bgcolor, bpp = p->var.bits_per_pixel;
bgx               212 drivers/video/fbdev/core/sysimgblt.c 		bgx <<= bpp;
bgx               214 drivers/video/fbdev/core/sysimgblt.c 		bgx |= bgcolor;
bgx               218 drivers/video/fbdev/core/sysimgblt.c 	eorx = fgx ^ bgx;
bgx               229 drivers/video/fbdev/core/sysimgblt.c 			*dst++ = (end_mask & eorx) ^ bgx;
bgx               337 drivers/video/fbdev/matrox/matroxfb_accel.c static void matroxfb_cfb4_clear(struct matrox_fb_info *minfo, u_int32_t bgx,
bgx               363 drivers/video/fbdev/matrox/matroxfb_accel.c 		mga_outl(M_FCOL, bgx);
bgx               375 drivers/video/fbdev/matrox/matroxfb_accel.c 			u_int8_t bgx2 = bgx & 0xF0;
bgx               384 drivers/video/fbdev/matrox/matroxfb_accel.c 			u_int8_t bgx2 = bgx & 0x0F;
bgx               406 drivers/video/fbdev/matrox/matroxfb_accel.c 				    u_int32_t bgx, const u_int8_t *chardata,
bgx               442 drivers/video/fbdev/matrox/matroxfb_accel.c 	mga_outl(M_BCOL, bgx);
bgx               505 drivers/video/fbdev/matrox/matroxfb_accel.c 		u_int32_t fgx, bgx;
bgx               508 drivers/video/fbdev/matrox/matroxfb_accel.c 		bgx = ((u_int32_t*)info->pseudo_palette)[image->bg_color];
bgx               509 drivers/video/fbdev/matrox/matroxfb_accel.c 		matroxfb_1bpp_imageblit(minfo, fgx, bgx, image->data, image->width, image->height, image->dy, image->dx);
bgx              1154 drivers/video/fbdev/pm2fb.c 	u32 fgx, bgx;
bgx              1172 drivers/video/fbdev/pm2fb.c 		bgx = image->bg_color;
bgx              1177 drivers/video/fbdev/pm2fb.c 		bgx = par->palette[image->bg_color];
bgx              1182 drivers/video/fbdev/pm2fb.c 		bgx |= bgx << 8;
bgx              1186 drivers/video/fbdev/pm2fb.c 		bgx |= bgx << 16;
bgx              1207 drivers/video/fbdev/pm2fb.c 		pm2_WR(par, PM2R_CONSTANT_COLOR, bgx);
bgx              1221 drivers/video/fbdev/pm2fb.c 		pm2_WR(par, PM2R_FB_BLOCK_COLOR, bgx);
bgx               515 drivers/video/fbdev/pm3fb.c 	u32 fgx, bgx;
bgx               527 drivers/video/fbdev/pm3fb.c 		bgx = image->bg_color;
bgx               532 drivers/video/fbdev/pm3fb.c 		bgx = par->palette[image->bg_color];
bgx               542 drivers/video/fbdev/pm3fb.c 		bgx |= bgx << 8;
bgx               546 drivers/video/fbdev/pm3fb.c 		bgx |= bgx << 16;
bgx               552 drivers/video/fbdev/pm3fb.c 	PM3_WRITE_REG(par, PM3BackgroundColor, bgx);
bgx              1495 drivers/video/fbdev/riva/fbdev.c 	u32 fgx = 0, bgx = 0, width, tmp;
bgx              1508 drivers/video/fbdev/riva/fbdev.c 		bgx = image->bg_color;
bgx              1514 drivers/video/fbdev/riva/fbdev.c 			bgx = ((u32 *)info->pseudo_palette)[image->bg_color];
bgx              1517 drivers/video/fbdev/riva/fbdev.c 			bgx = par->palette[image->bg_color];
bgx              1520 drivers/video/fbdev/riva/fbdev.c 			convert_bgcolor_16(&bgx);	
bgx              1530 drivers/video/fbdev/riva/fbdev.c 	NV_WR32(&par->riva.Bitmap->Color0E, 0, bgx);