Symbol: bgx
sys/dev/vnic/nic_main.c
1200
uint8_t vf, bgx, lmac;
sys/dev/vnic/nic_main.c
1212
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vf]);
sys/dev/vnic/nic_main.c
1215
bgx_get_lmac_link_state(nic->node, bgx, lmac, &link);
sys/dev/vnic/nic_main.c
307
int bgx, lmac;
sys/dev/vnic/nic_main.c
319
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vfnum]);
sys/dev/vnic/nic_main.c
321
bgx_set_lmac_mac(nic->node, bgx, lmac, mac);
sys/dev/vnic/nic_main.c
524
nic_get_bgx_stats(struct nicpf *nic, struct bgx_stats_msg *bgx)
sys/dev/vnic/nic_main.c
529
bgx_idx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[bgx->vf_id]);
sys/dev/vnic/nic_main.c
530
lmac = NIC_GET_LMAC_FROM_VF_LMAC_MAP(nic->vf_lmac_map[bgx->vf_id]);
sys/dev/vnic/nic_main.c
533
mbx.bgx_stats.vf_id = bgx->vf_id;
sys/dev/vnic/nic_main.c
534
mbx.bgx_stats.rx = bgx->rx;
sys/dev/vnic/nic_main.c
535
mbx.bgx_stats.idx = bgx->idx;
sys/dev/vnic/nic_main.c
536
if (bgx->rx != 0) {
sys/dev/vnic/nic_main.c
538
bgx_get_rx_stats(nic->node, bgx_idx, lmac, bgx->idx);
sys/dev/vnic/nic_main.c
541
bgx_get_tx_stats(nic->node, bgx_idx, lmac, bgx->idx);
sys/dev/vnic/nic_main.c
543
nic_send_msg_to_vf(nic, bgx->vf_id, &mbx);
sys/dev/vnic/nic_main.c
594
int bgx, next_bgx_lmac = 0;
sys/dev/vnic/nic_main.c
604
for (bgx = 0; bgx < NIC_MAX_BGX; bgx++) {
sys/dev/vnic/nic_main.c
605
if ((bgx_map & (1 << bgx)) == 0)
sys/dev/vnic/nic_main.c
607
lmac_cnt = bgx_get_lmac_count(nic->node, bgx);
sys/dev/vnic/nic_main.c
610
NIC_SET_VF_LMAC_MAP(bgx, lmac);
sys/dev/vnic/nic_main.c
619
lmac = bgx * MAX_LMAC_PER_BGX;
sys/dev/vnic/nic_main.c
620
for (; lmac < lmac_cnt + (bgx * MAX_LMAC_PER_BGX); lmac++) {
sys/dev/vnic/nic_main.c
691
uint32_t vnic, bgx, lmac, chan;
sys/dev/vnic/nic_main.c
697
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[vnic]);
sys/dev/vnic/nic_main.c
700
chan = (lmac * MAX_BGX_CHANS_PER_LMAC) + (bgx * NIC_CHANS_PER_INF);
sys/dev/vnic/nic_main.c
701
cpi_base = (lmac * NIC_MAX_CPI_PER_LMAC) + (bgx * NIC_CPI_PER_BGX);
sys/dev/vnic/nic_main.c
702
rssi_base = (lmac * nic->rss_ind_tbl_size) + (bgx * NIC_RSSI_PER_BGX);
sys/dev/vnic/nic_main.c
829
uint32_t bgx, lmac, chan;
sys/dev/vnic/nic_main.c
837
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[pqs_vnic]);
sys/dev/vnic/nic_main.c
843
tl4 = (lmac * NIC_TL4_PER_LMAC) + (bgx * NIC_TL4_PER_BGX);
sys/dev/vnic/nic_main.c
85
#define NIC_SET_VF_LMAC_MAP(bgx, lmac) ((((bgx) & 0xF) << 4) | ((lmac) & 0xF))
sys/dev/vnic/nic_main.c
854
chan = (lmac * MAX_BGX_CHANS_PER_LMAC) + (bgx * NIC_CHANS_PER_INF);
sys/dev/vnic/nic_main.c
891
int bgx, lmac;
sys/dev/vnic/nic_main.c
952
bgx = NIC_GET_BGX_FROM_VF_LMAC_MAP(nic->vf_lmac_map[lmac]);
sys/dev/vnic/nic_main.c
954
bgx_set_lmac_mac(nic->node, bgx, lmac, mbx.mac.mac_addr);
sys/dev/vnic/nicvf_main.c
888
nicvf_read_bgx_stats(struct nicvf *nic, struct bgx_stats_msg *bgx)
sys/dev/vnic/nicvf_main.c
891
if (bgx->rx)
sys/dev/vnic/nicvf_main.c
892
nic->bgx_stats.rx_stats[bgx->idx] = bgx->stats;
sys/dev/vnic/nicvf_main.c
894
nic->bgx_stats.tx_stats[bgx->idx] = bgx->stats;
sys/dev/vnic/thunder_bgx.c
1003
bgx_set_num_ports(bgx);
sys/dev/vnic/thunder_bgx.c
1005
bgx_reg_modify(bgx, 0, BGX_CMR_GLOBAL_CFG, CMR_GLOBAL_CFG_FCS_STRIP);
sys/dev/vnic/thunder_bgx.c
1006
if (bgx_reg_read(bgx, 0, BGX_CMR_BIST_STATUS))
sys/dev/vnic/thunder_bgx.c
1007
device_printf(bgx->dev, "BGX%d BIST failed\n", bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1010
for (i = 0; i < bgx->lmac_count; i++) {
sys/dev/vnic/thunder_bgx.c
1011
if (bgx->lmac_type == BGX_MODE_RXAUI) {
sys/dev/vnic/thunder_bgx.c
1013
bgx->lane_to_sds = 0x0e;
sys/dev/vnic/thunder_bgx.c
1015
bgx->lane_to_sds = 0x04;
sys/dev/vnic/thunder_bgx.c
1016
bgx_reg_write(bgx, i, BGX_CMRX_CFG,
sys/dev/vnic/thunder_bgx.c
1017
(bgx->lmac_type << 8) | bgx->lane_to_sds);
sys/dev/vnic/thunder_bgx.c
1020
bgx_reg_write(bgx, i, BGX_CMRX_CFG,
sys/dev/vnic/thunder_bgx.c
1021
(bgx->lmac_type << 8) | (bgx->lane_to_sds + i));
sys/dev/vnic/thunder_bgx.c
1022
bgx->lmac[i].lmacid_bd = lmac_count;
sys/dev/vnic/thunder_bgx.c
1026
bgx_reg_write(bgx, 0, BGX_CMR_TX_LMACS, bgx->lmac_count);
sys/dev/vnic/thunder_bgx.c
1027
bgx_reg_write(bgx, 0, BGX_CMR_RX_LMACS, bgx->lmac_count);
sys/dev/vnic/thunder_bgx.c
1030
for (i = 0; i < bgx->lmac_count; i++) {
sys/dev/vnic/thunder_bgx.c
1031
bgx_reg_modify(bgx, 0, BGX_CMR_CHAN_MSK_AND,
sys/dev/vnic/thunder_bgx.c
1038
bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM + (i * 8), 0x00);
sys/dev/vnic/thunder_bgx.c
1042
bgx_reg_write(bgx, 0, BGX_CMR_RX_STREERING + (i * 8), 0x00);
sys/dev/vnic/thunder_bgx.c
1046
bgx_get_qlm_mode(struct bgx *bgx)
sys/dev/vnic/thunder_bgx.c
1048
device_t dev = bgx->dev;
sys/dev/vnic/thunder_bgx.c
1055
lmac_type = bgx_reg_read(bgx, 0, BGX_CMRX_CFG);
sys/dev/vnic/thunder_bgx.c
1058
train_en = bgx_reg_read(bgx, 0, BGX_SPUX_BR_PMD_CRTL) &
sys/dev/vnic/thunder_bgx.c
1063
bgx->qlm_mode = QLM_MODE_SGMII;
sys/dev/vnic/thunder_bgx.c
1066
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1070
bgx->qlm_mode = QLM_MODE_XAUI_1X4;
sys/dev/vnic/thunder_bgx.c
1073
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1077
bgx->qlm_mode = QLM_MODE_RXAUI_2X2;
sys/dev/vnic/thunder_bgx.c
1080
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1085
bgx->qlm_mode = QLM_MODE_XFI_4X1;
sys/dev/vnic/thunder_bgx.c
1088
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1091
bgx->qlm_mode = QLM_MODE_10G_KR_4X1;
sys/dev/vnic/thunder_bgx.c
1094
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1100
bgx->qlm_mode = QLM_MODE_XLAUI_1X4;
sys/dev/vnic/thunder_bgx.c
1103
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1106
bgx->qlm_mode = QLM_MODE_40G_KR4_1X4;
sys/dev/vnic/thunder_bgx.c
1109
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1114
bgx->qlm_mode = QLM_MODE_SGMII;
sys/dev/vnic/thunder_bgx.c
1117
bgx->bgx_id);
sys/dev/vnic/thunder_bgx.c
1123
bgx_init_phy(struct bgx *bgx)
sys/dev/vnic/thunder_bgx.c
1130
err = bgx_fdt_init_phy(bgx);
sys/dev/vnic/thunder_bgx.c
131
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
137
bgx = malloc(sizeof(*bgx), M_BGX, (M_WAITOK | M_ZERO));
sys/dev/vnic/thunder_bgx.c
138
bgx->dev = dev;
sys/dev/vnic/thunder_bgx.c
141
lmac->bgx = bgx;
sys/dev/vnic/thunder_bgx.c
146
bgx->reg_base = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
sys/dev/vnic/thunder_bgx.c
148
if (bgx->reg_base == NULL) {
sys/dev/vnic/thunder_bgx.c
154
bgx->bgx_id = (rman_get_start(bgx->reg_base) >> BGX_NODE_ID_SHIFT) &
sys/dev/vnic/thunder_bgx.c
156
bgx->bgx_id += nic_get_node_id(bgx->reg_base) * MAX_BGX_PER_CN88XX;
sys/dev/vnic/thunder_bgx.c
158
bgx_vnic[bgx->bgx_id] = bgx;
sys/dev/vnic/thunder_bgx.c
159
bgx_get_qlm_mode(bgx);
sys/dev/vnic/thunder_bgx.c
161
err = bgx_init_phy(bgx);
sys/dev/vnic/thunder_bgx.c
165
bgx_init_hw(bgx);
sys/dev/vnic/thunder_bgx.c
168
for (lmacid = 0; lmacid < bgx->lmac_count; lmacid++) {
sys/dev/vnic/thunder_bgx.c
169
err = bgx_lmac_enable(bgx, lmacid);
sys/dev/vnic/thunder_bgx.c
172
bgx->bgx_id, lmacid);
sys/dev/vnic/thunder_bgx.c
180
bgx_vnic[bgx->bgx_id] = NULL;
sys/dev/vnic/thunder_bgx.c
182
rman_get_rid(bgx->reg_base), bgx->reg_base);
sys/dev/vnic/thunder_bgx.c
184
free(bgx, M_BGX);
sys/dev/vnic/thunder_bgx.c
194
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
198
bgx = lmac->bgx;
sys/dev/vnic/thunder_bgx.c
200
for (lmacid = 0; lmacid < bgx->lmac_count; lmacid++)
sys/dev/vnic/thunder_bgx.c
201
bgx_lmac_disable(bgx, lmacid);
sys/dev/vnic/thunder_bgx.c
203
bgx_vnic[bgx->bgx_id] = NULL;
sys/dev/vnic/thunder_bgx.c
205
rman_get_rid(bgx->reg_base), bgx->reg_base);
sys/dev/vnic/thunder_bgx.c
206
free(bgx, M_BGX);
sys/dev/vnic/thunder_bgx.c
214
bgx_reg_read(struct bgx *bgx, uint8_t lmac, uint64_t offset)
sys/dev/vnic/thunder_bgx.c
220
return (bus_read_8(bgx->reg_base, addr));
sys/dev/vnic/thunder_bgx.c
224
bgx_reg_write(struct bgx *bgx, uint8_t lmac, uint64_t offset, uint64_t val)
sys/dev/vnic/thunder_bgx.c
230
bus_write_8(bgx->reg_base, addr, val);
sys/dev/vnic/thunder_bgx.c
234
bgx_reg_modify(struct bgx *bgx, uint8_t lmac, uint64_t offset, uint64_t val)
sys/dev/vnic/thunder_bgx.c
240
bus_write_8(bgx->reg_base, addr, val | bus_read_8(bgx->reg_base, addr));
sys/dev/vnic/thunder_bgx.c
244
bgx_poll_reg(struct bgx *bgx, uint8_t lmac, uint64_t reg, uint64_t mask,
sys/dev/vnic/thunder_bgx.c
251
reg_val = bgx_reg_read(bgx, lmac, reg);
sys/dev/vnic/thunder_bgx.c
282
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
284
bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
sys/dev/vnic/thunder_bgx.c
285
if (bgx != NULL)
sys/dev/vnic/thunder_bgx.c
286
return (bgx->lmac_count);
sys/dev/vnic/thunder_bgx.c
296
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
299
bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
sys/dev/vnic/thunder_bgx.c
300
if (bgx == NULL)
sys/dev/vnic/thunder_bgx.c
303
lmac = &bgx->lmac[lmacid];
sys/dev/vnic/thunder_bgx.c
312
struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
sys/dev/vnic/thunder_bgx.c
314
if (bgx != NULL)
sys/dev/vnic/thunder_bgx.c
315
return (bgx->lmac[lmacid].mac);
sys/dev/vnic/thunder_bgx.c
323
struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
sys/dev/vnic/thunder_bgx.c
325
if (bgx == NULL)
sys/dev/vnic/thunder_bgx.c
328
memcpy(bgx->lmac[lmacid].mac, mac, ETHER_ADDR_LEN);
sys/dev/vnic/thunder_bgx.c
334
struct bgx *bgx = lmac->bgx;
sys/dev/vnic/thunder_bgx.c
339
cmr_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_CMRX_CFG);
sys/dev/vnic/thunder_bgx.c
341
bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg);
sys/dev/vnic/thunder_bgx.c
343
port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG);
sys/dev/vnic/thunder_bgx.c
344
misc_ctl = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL);
sys/dev/vnic/thunder_bgx.c
361
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64);
sys/dev/vnic/thunder_bgx.c
362
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0);
sys/dev/vnic/thunder_bgx.c
370
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 64);
sys/dev/vnic/thunder_bgx.c
371
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_BURST, 0);
sys/dev/vnic/thunder_bgx.c
379
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_TXX_SLOT, 512);
sys/dev/vnic/thunder_bgx.c
381
bgx_reg_write(bgx, lmac->lmacid,
sys/dev/vnic/thunder_bgx.c
384
bgx_reg_write(bgx, lmac->lmacid,
sys/dev/vnic/thunder_bgx.c
390
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_PCS_MISCX_CTL, misc_ctl);
sys/dev/vnic/thunder_bgx.c
391
bgx_reg_write(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG, port_cfg);
sys/dev/vnic/thunder_bgx.c
393
port_cfg = bgx_reg_read(bgx, lmac->lmacid, BGX_GMP_GMI_PRTX_CFG);
sys/dev/vnic/thunder_bgx.c
397
bgx_reg_write(bgx, lmac->lmacid, BGX_CMRX_CFG, cmr_cfg);
sys/dev/vnic/thunder_bgx.c
449
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
451
bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
sys/dev/vnic/thunder_bgx.c
452
if (bgx == NULL)
sys/dev/vnic/thunder_bgx.c
457
return (bgx_reg_read(bgx, lmac, BGX_CMRX_RX_STAT0 + (idx * 8)));
sys/dev/vnic/thunder_bgx.c
463
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
465
bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
sys/dev/vnic/thunder_bgx.c
466
if (bgx == NULL)
sys/dev/vnic/thunder_bgx.c
469
return (bgx_reg_read(bgx, lmac, BGX_CMRX_TX_STAT0 + (idx * 8)));
sys/dev/vnic/thunder_bgx.c
473
bgx_flush_dmac_addrs(struct bgx *bgx, int lmac)
sys/dev/vnic/thunder_bgx.c
477
while (bgx->lmac[lmac].dmac > 0) {
sys/dev/vnic/thunder_bgx.c
478
offset = ((bgx->lmac[lmac].dmac - 1) * sizeof(uint64_t)) +
sys/dev/vnic/thunder_bgx.c
480
bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM + offset, 0);
sys/dev/vnic/thunder_bgx.c
481
bgx->lmac[lmac].dmac--;
sys/dev/vnic/thunder_bgx.c
489
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
496
bgx = bgx_vnic[bgx_idx];
sys/dev/vnic/thunder_bgx.c
498
if (bgx == NULL) {
sys/dev/vnic/thunder_bgx.c
505
if (bgx->lmac[lmac].dmac == MAX_DMAC_PER_LMAC) {
sys/dev/vnic/thunder_bgx.c
506
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx.c
512
if (bgx->lmac[lmac].dmac == MAX_DMAC_PER_LMAC_TNS_BYPASS_MODE)
sys/dev/vnic/thunder_bgx.c
513
bgx->lmac[lmac].dmac = 1;
sys/dev/vnic/thunder_bgx.c
515
offset = (bgx->lmac[lmac].dmac * sizeof(uint64_t)) +
sys/dev/vnic/thunder_bgx.c
517
bgx_reg_write(bgx, 0, BGX_CMR_RX_DMACX_CAM + offset, dmac);
sys/dev/vnic/thunder_bgx.c
518
bgx->lmac[lmac].dmac++;
sys/dev/vnic/thunder_bgx.c
520
bgx_reg_write(bgx, lmac, BGX_CMRX_RX_DMAC_CTL,
sys/dev/vnic/thunder_bgx.c
530
struct bgx *bgx;
sys/dev/vnic/thunder_bgx.c
534
bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
sys/dev/vnic/thunder_bgx.c
535
if (bgx == NULL)
sys/dev/vnic/thunder_bgx.c
538
lmac = &bgx->lmac[lmac_idx];
sys/dev/vnic/thunder_bgx.c
540
cfg = bgx_reg_read(bgx, lmac_idx, BGX_GMP_PCS_MRX_CTL);
sys/dev/vnic/thunder_bgx.c
545
bgx_reg_write(bgx, lmac_idx, BGX_GMP_PCS_MRX_CTL, cfg);
sys/dev/vnic/thunder_bgx.c
547
cfg = bgx_reg_read(bgx, lmac_idx, BGX_SPUX_CONTROL1);
sys/dev/vnic/thunder_bgx.c
552
bgx_reg_write(bgx, lmac_idx, BGX_SPUX_CONTROL1, cfg);
sys/dev/vnic/thunder_bgx.c
557
bgx_lmac_sgmii_init(struct bgx *bgx, int lmacid)
sys/dev/vnic/thunder_bgx.c
561
bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_THRESH, 0x30);
sys/dev/vnic/thunder_bgx.c
563
bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_RXX_JABBER, MAX_FRAME_SIZE);
sys/dev/vnic/thunder_bgx.c
566
cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND);
sys/dev/vnic/thunder_bgx.c
568
bgx_reg_write(bgx, lmacid, BGX_GMP_GMI_TXX_SGMII_CTL, 0);
sys/dev/vnic/thunder_bgx.c
571
bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN);
sys/dev/vnic/thunder_bgx.c
574
bgx_reg_modify(bgx, lmacid, BGX_GMP_PCS_MRX_CTL, PCS_MRX_CTL_RESET);
sys/dev/vnic/thunder_bgx.c
575
if (bgx_poll_reg(bgx, lmacid, BGX_GMP_PCS_MRX_CTL,
sys/dev/vnic/thunder_bgx.c
577
device_printf(bgx->dev, "BGX PCS reset not completed\n");
sys/dev/vnic/thunder_bgx.c
582
cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_PCS_MRX_CTL);
sys/dev/vnic/thunder_bgx.c
585
bgx_reg_write(bgx, lmacid, BGX_GMP_PCS_MRX_CTL, cfg);
sys/dev/vnic/thunder_bgx.c
587
if (bgx_poll_reg(bgx, lmacid, BGX_GMP_PCS_MRX_STATUS,
sys/dev/vnic/thunder_bgx.c
589
device_printf(bgx->dev, "BGX AN_CPT not completed\n");
sys/dev/vnic/thunder_bgx.c
597
bgx_lmac_xaui_init(struct bgx *bgx, int lmacid, int lmac_type)
sys/dev/vnic/thunder_bgx.c
602
bgx_reg_modify(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_RESET);
sys/dev/vnic/thunder_bgx.c
603
if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_CONTROL1,
sys/dev/vnic/thunder_bgx.c
605
device_printf(bgx->dev, "BGX SPU reset not completed\n");
sys/dev/vnic/thunder_bgx.c
610
cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
sys/dev/vnic/thunder_bgx.c
612
bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cfg);
sys/dev/vnic/thunder_bgx.c
614
bgx_reg_modify(bgx, lmacid, BGX_SPUX_CONTROL1, SPU_CTL_LOW_POWER);
sys/dev/vnic/thunder_bgx.c
616
if (bgx->lmac_type != BGX_MODE_RXAUI) {
sys/dev/vnic/thunder_bgx.c
617
bgx_reg_modify(bgx, lmacid,
sys/dev/vnic/thunder_bgx.c
620
bgx_reg_modify(bgx, lmacid, BGX_SPUX_MISC_CONTROL,
sys/dev/vnic/thunder_bgx.c
625
cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_RX_INT);
sys/dev/vnic/thunder_bgx.c
626
bgx_reg_write(bgx, lmacid, BGX_SMUX_RX_INT, cfg);
sys/dev/vnic/thunder_bgx.c
627
cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_INT);
sys/dev/vnic/thunder_bgx.c
628
bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_INT, cfg);
sys/dev/vnic/thunder_bgx.c
629
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT);
sys/dev/vnic/thunder_bgx.c
630
bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg);
sys/dev/vnic/thunder_bgx.c
632
if (bgx->use_training) {
sys/dev/vnic/thunder_bgx.c
633
bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LP_CUP, 0x00);
sys/dev/vnic/thunder_bgx.c
634
bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LD_CUP, 0x00);
sys/dev/vnic/thunder_bgx.c
635
bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_LD_REP, 0x00);
sys/dev/vnic/thunder_bgx.c
637
bgx_reg_modify(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL,
sys/dev/vnic/thunder_bgx.c
642
bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_APPEND, SMU_TX_APPEND_FCS_D);
sys/dev/vnic/thunder_bgx.c
645
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_FEC_CONTROL);
sys/dev/vnic/thunder_bgx.c
647
bgx_reg_write(bgx, lmacid, BGX_SPUX_FEC_CONTROL, cfg);
sys/dev/vnic/thunder_bgx.c
650
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_AN_CONTROL);
sys/dev/vnic/thunder_bgx.c
652
bgx_reg_write(bgx, lmacid, BGX_SPUX_AN_CONTROL, cfg);
sys/dev/vnic/thunder_bgx.c
654
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_AN_ADV);
sys/dev/vnic/thunder_bgx.c
655
if (bgx->lmac_type == BGX_MODE_10G_KR)
sys/dev/vnic/thunder_bgx.c
657
else if (bgx->lmac_type == BGX_MODE_40G_KR)
sys/dev/vnic/thunder_bgx.c
662
bgx_reg_write(bgx, lmacid, BGX_SPUX_AN_ADV, cfg);
sys/dev/vnic/thunder_bgx.c
664
cfg = bgx_reg_read(bgx, 0, BGX_SPU_DBG_CONTROL);
sys/dev/vnic/thunder_bgx.c
666
bgx_reg_write(bgx, 0, BGX_SPU_DBG_CONTROL, cfg);
sys/dev/vnic/thunder_bgx.c
669
bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG, CMR_EN);
sys/dev/vnic/thunder_bgx.c
671
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_CONTROL1);
sys/dev/vnic/thunder_bgx.c
673
bgx_reg_write(bgx, lmacid, BGX_SPUX_CONTROL1, cfg);
sys/dev/vnic/thunder_bgx.c
675
cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_CTL);
sys/dev/vnic/thunder_bgx.c
678
bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_CTL, cfg);
sys/dev/vnic/thunder_bgx.c
681
bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_THRESH, (0x100 - 1));
sys/dev/vnic/thunder_bgx.c
683
bgx_reg_modify(bgx, lmacid, BGX_SMUX_RX_JABBER, MAX_FRAME_SIZE);
sys/dev/vnic/thunder_bgx.c
691
struct bgx *bgx = lmac->bgx;
sys/dev/vnic/thunder_bgx.c
693
int lmac_type = bgx->lmac_type;
sys/dev/vnic/thunder_bgx.c
696
bgx_reg_modify(bgx, lmacid, BGX_SPUX_MISC_CONTROL, SPU_MISC_CTL_RX_DIS);
sys/dev/vnic/thunder_bgx.c
697
if (bgx->use_training) {
sys/dev/vnic/thunder_bgx.c
698
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT);
sys/dev/vnic/thunder_bgx.c
701
bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg);
sys/dev/vnic/thunder_bgx.c
702
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL);
sys/dev/vnic/thunder_bgx.c
704
bgx_reg_write(bgx, lmacid, BGX_SPUX_BR_PMD_CRTL, cfg);
sys/dev/vnic/thunder_bgx.c
710
if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_CONTROL1,
sys/dev/vnic/thunder_bgx.c
712
device_printf(bgx->dev, "BGX SPU reset not completed\n");
sys/dev/vnic/thunder_bgx.c
718
if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_BR_STATUS1,
sys/dev/vnic/thunder_bgx.c
720
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx.c
725
if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_BX_STATUS,
sys/dev/vnic/thunder_bgx.c
727
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx.c
734
bgx_reg_modify(bgx, lmacid, BGX_SPUX_STATUS2, SPU_STATUS2_RCVFLT);
sys/dev/vnic/thunder_bgx.c
735
if (bgx_reg_read(bgx, lmacid, BGX_SPUX_STATUS2) & SPU_STATUS2_RCVFLT) {
sys/dev/vnic/thunder_bgx.c
736
device_printf(bgx->dev, "Receive fault, retry training\n");
sys/dev/vnic/thunder_bgx.c
737
if (bgx->use_training) {
sys/dev/vnic/thunder_bgx.c
738
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_INT);
sys/dev/vnic/thunder_bgx.c
74
static int bgx_init_phy(struct bgx *);
sys/dev/vnic/thunder_bgx.c
741
bgx_reg_write(bgx, lmacid, BGX_SPUX_INT, cfg);
sys/dev/vnic/thunder_bgx.c
742
cfg = bgx_reg_read(bgx, lmacid,
sys/dev/vnic/thunder_bgx.c
745
bgx_reg_write(bgx, lmacid,
sys/dev/vnic/thunder_bgx.c
754
if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_RX_CTL,
sys/dev/vnic/thunder_bgx.c
756
device_printf(bgx->dev, "SMU RX link not okay\n");
sys/dev/vnic/thunder_bgx.c
76
static struct bgx *bgx_vnic[MAX_BGX_THUNDER];
sys/dev/vnic/thunder_bgx.c
761
if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_CTL,
sys/dev/vnic/thunder_bgx.c
763
device_printf(bgx->dev, "SMU RX not idle\n");
sys/dev/vnic/thunder_bgx.c
768
if (bgx_poll_reg(bgx, lmacid, BGX_SMUX_CTL,
sys/dev/vnic/thunder_bgx.c
770
device_printf(bgx->dev, "SMU TX not idle\n");
sys/dev/vnic/thunder_bgx.c
774
if ((bgx_reg_read(bgx, lmacid, BGX_SPUX_STATUS2) &
sys/dev/vnic/thunder_bgx.c
776
device_printf(bgx->dev, "Receive fault\n");
sys/dev/vnic/thunder_bgx.c
781
bgx_reg_modify(bgx, lmacid, BGX_SPUX_STATUS1, SPU_STATUS1_RCV_LNK);
sys/dev/vnic/thunder_bgx.c
782
if (bgx_poll_reg(bgx, lmacid, BGX_SPUX_STATUS1,
sys/dev/vnic/thunder_bgx.c
784
device_printf(bgx->dev, "SPU receive link down\n");
sys/dev/vnic/thunder_bgx.c
788
cfg = bgx_reg_read(bgx, lmacid, BGX_SPUX_MISC_CONTROL);
sys/dev/vnic/thunder_bgx.c
790
bgx_reg_write(bgx, lmacid, BGX_SPUX_MISC_CONTROL, cfg);
sys/dev/vnic/thunder_bgx.c
80
static void bgx_get_qlm_mode(struct bgx *);
sys/dev/vnic/thunder_bgx.c
803
bgx_reg_modify(lmac->bgx, lmac->lmacid,
sys/dev/vnic/thunder_bgx.c
805
bgx_poll_reg(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1,
sys/dev/vnic/thunder_bgx.c
808
link = bgx_reg_read(lmac->bgx, lmac->lmacid, BGX_SPUX_STATUS1);
sys/dev/vnic/thunder_bgx.c
81
static void bgx_init_hw(struct bgx *);
sys/dev/vnic/thunder_bgx.c
811
if (lmac->bgx->lmac_type == BGX_MODE_XLAUI)
sys/dev/vnic/thunder_bgx.c
82
static int bgx_lmac_enable(struct bgx *, uint8_t);
sys/dev/vnic/thunder_bgx.c
83
static void bgx_lmac_disable(struct bgx *, uint8_t);
sys/dev/vnic/thunder_bgx.c
830
bgx_lmac_enable(struct bgx *bgx, uint8_t lmacid)
sys/dev/vnic/thunder_bgx.c
836
lmac = &bgx->lmac[lmacid];
sys/dev/vnic/thunder_bgx.c
837
lmac->bgx = bgx;
sys/dev/vnic/thunder_bgx.c
839
if (bgx->lmac_type == BGX_MODE_SGMII) {
sys/dev/vnic/thunder_bgx.c
841
if (bgx_lmac_sgmii_init(bgx, lmacid) != 0)
sys/dev/vnic/thunder_bgx.c
845
if (bgx_lmac_xaui_init(bgx, lmacid, bgx->lmac_type))
sys/dev/vnic/thunder_bgx.c
850
cfg = bgx_reg_read(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND);
sys/dev/vnic/thunder_bgx.c
852
bgx_reg_modify(bgx, lmacid, BGX_GMP_GMI_TXX_APPEND, cfg);
sys/dev/vnic/thunder_bgx.c
853
bgx_reg_write(bgx, lmacid, BGX_GMP_GMI_TXX_MIN_PKT, 60 - 1);
sys/dev/vnic/thunder_bgx.c
855
cfg = bgx_reg_read(bgx, lmacid, BGX_SMUX_TX_APPEND);
sys/dev/vnic/thunder_bgx.c
857
bgx_reg_modify(bgx, lmacid, BGX_SMUX_TX_APPEND, cfg);
sys/dev/vnic/thunder_bgx.c
858
bgx_reg_write(bgx, lmacid, BGX_SMUX_TX_MIN_PKT, 60 + 4);
sys/dev/vnic/thunder_bgx.c
862
bgx_reg_modify(bgx, lmacid, BGX_CMRX_CFG,
sys/dev/vnic/thunder_bgx.c
866
bgx_reg_write(bgx, lmacid, BGX_CMRX_RX_DMAC_CTL, 0x03);
sys/dev/vnic/thunder_bgx.c
869
bgx_add_dmac_addr(dmac_bcast, 0, bgx->bgx_id, lmacid);
sys/dev/vnic/thunder_bgx.c
871
if ((bgx->lmac_type != BGX_MODE_XFI) &&
sys/dev/vnic/thunder_bgx.c
872
(bgx->lmac_type != BGX_MODE_XAUI) &&
sys/dev/vnic/thunder_bgx.c
873
(bgx->lmac_type != BGX_MODE_XLAUI) &&
sys/dev/vnic/thunder_bgx.c
874
(bgx->lmac_type != BGX_MODE_40G_KR) &&
sys/dev/vnic/thunder_bgx.c
875
(bgx->lmac_type != BGX_MODE_10G_KR)) {
sys/dev/vnic/thunder_bgx.c
877
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx.c
884
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx.c
905
bgx_lmac_disable(struct bgx *bgx, uint8_t lmacid)
sys/dev/vnic/thunder_bgx.c
910
lmac = &bgx->lmac[lmacid];
sys/dev/vnic/thunder_bgx.c
916
cmrx_cfg = bgx_reg_read(bgx, lmacid, BGX_CMRX_CFG);
sys/dev/vnic/thunder_bgx.c
918
bgx_reg_write(bgx, lmacid, BGX_CMRX_CFG, cmrx_cfg);
sys/dev/vnic/thunder_bgx.c
919
bgx_flush_dmac_addrs(bgx, lmacid);
sys/dev/vnic/thunder_bgx.c
921
if ((bgx->lmac_type != BGX_MODE_XFI) &&
sys/dev/vnic/thunder_bgx.c
922
(bgx->lmac_type != BGX_MODE_XLAUI) &&
sys/dev/vnic/thunder_bgx.c
923
(bgx->lmac_type != BGX_MODE_40G_KR) &&
sys/dev/vnic/thunder_bgx.c
924
(bgx->lmac_type != BGX_MODE_10G_KR)) {
sys/dev/vnic/thunder_bgx.c
926
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx.c
932
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx.c
941
bgx_set_num_ports(struct bgx *bgx)
sys/dev/vnic/thunder_bgx.c
945
switch (bgx->qlm_mode) {
sys/dev/vnic/thunder_bgx.c
947
bgx->lmac_count = 4;
sys/dev/vnic/thunder_bgx.c
948
bgx->lmac_type = BGX_MODE_SGMII;
sys/dev/vnic/thunder_bgx.c
949
bgx->lane_to_sds = 0;
sys/dev/vnic/thunder_bgx.c
952
bgx->lmac_count = 1;
sys/dev/vnic/thunder_bgx.c
953
bgx->lmac_type = BGX_MODE_XAUI;
sys/dev/vnic/thunder_bgx.c
954
bgx->lane_to_sds = 0xE4;
sys/dev/vnic/thunder_bgx.c
957
bgx->lmac_count = 2;
sys/dev/vnic/thunder_bgx.c
958
bgx->lmac_type = BGX_MODE_RXAUI;
sys/dev/vnic/thunder_bgx.c
959
bgx->lane_to_sds = 0xE4;
sys/dev/vnic/thunder_bgx.c
962
bgx->lmac_count = 4;
sys/dev/vnic/thunder_bgx.c
963
bgx->lmac_type = BGX_MODE_XFI;
sys/dev/vnic/thunder_bgx.c
964
bgx->lane_to_sds = 0;
sys/dev/vnic/thunder_bgx.c
967
bgx->lmac_count = 1;
sys/dev/vnic/thunder_bgx.c
968
bgx->lmac_type = BGX_MODE_XLAUI;
sys/dev/vnic/thunder_bgx.c
969
bgx->lane_to_sds = 0xE4;
sys/dev/vnic/thunder_bgx.c
972
bgx->lmac_count = 4;
sys/dev/vnic/thunder_bgx.c
973
bgx->lmac_type = BGX_MODE_10G_KR;
sys/dev/vnic/thunder_bgx.c
974
bgx->lane_to_sds = 0;
sys/dev/vnic/thunder_bgx.c
975
bgx->use_training = 1;
sys/dev/vnic/thunder_bgx.c
978
bgx->lmac_count = 1;
sys/dev/vnic/thunder_bgx.c
979
bgx->lmac_type = BGX_MODE_40G_KR;
sys/dev/vnic/thunder_bgx.c
980
bgx->lane_to_sds = 0xE4;
sys/dev/vnic/thunder_bgx.c
981
bgx->use_training = 1;
sys/dev/vnic/thunder_bgx.c
984
bgx->lmac_count = 0;
sys/dev/vnic/thunder_bgx.c
993
lmac_count = bgx_reg_read(bgx, 0, BGX_CMR_RX_LMACS) & 0x7;
sys/dev/vnic/thunder_bgx.c
995
bgx->lmac_count = lmac_count;
sys/dev/vnic/thunder_bgx.c
999
bgx_init_hw(struct bgx *bgx)
sys/dev/vnic/thunder_bgx.h
207
int bgx_get_lmac_count(int node, int bgx);
sys/dev/vnic/thunder_bgx_fdt.c
147
bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name, ssize_t size)
sys/dev/vnic/thunder_bgx_fdt.c
153
switch (bgx->qlm_mode) {
sys/dev/vnic/thunder_bgx_fdt.c
320
bgx_fdt_find_node(struct bgx *bgx)
sys/dev/vnic/thunder_bgx_fdt.c
327
KASSERT(bgx->bgx_id <= BGX_MAXID,
sys/dev/vnic/thunder_bgx_fdt.c
328
("Invalid BGX ID: %d, max: %d", bgx->bgx_id, BGX_MAXID));
sys/dev/vnic/thunder_bgx_fdt.c
336
snprintf(bgx_sel, len + 1, "/"BGX_NODE_NAME"%d", bgx->bgx_id);
sys/dev/vnic/thunder_bgx_fdt.c
348
snprintf(bgx_sel, len, BGX_NODE_NAME"%d", bgx->bgx_id);
sys/dev/vnic/thunder_bgx_fdt.c
352
root_pcib = bgx_find_root_pcib(bgx->dev);
sys/dev/vnic/thunder_bgx_fdt.c
354
device_printf(bgx->dev, "Unable to find BGX root bridge\n");
sys/dev/vnic/thunder_bgx_fdt.c
361
device_printf(bgx->dev, "No parent FDT node for BGX\n");
sys/dev/vnic/thunder_bgx_fdt.c
365
node = bgx_fdt_traverse_nodes(bgx->bgx_id, node, bgx_sel, len);
sys/dev/vnic/thunder_bgx_fdt.c
372
bgx_fdt_init_phy(struct bgx *bgx)
sys/dev/vnic/thunder_bgx_fdt.c
381
node = bgx_fdt_find_node(bgx);
sys/dev/vnic/thunder_bgx_fdt.c
383
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx_fdt.c
384
"Could not find bgx%d node in FDT\n", bgx->bgx_id);
sys/dev/vnic/thunder_bgx_fdt.c
392
if (!bgx_fdt_phy_mode_match(bgx, qlm_mode, len)) {
sys/dev/vnic/thunder_bgx_fdt.c
405
if (!bgx_fdt_phy_name_match(bgx, node_name, len)) {
sys/dev/vnic/thunder_bgx_fdt.c
413
if (OF_getencprop(child, "reg", &bgx->lmac[lmac].phyaddr,
sys/dev/vnic/thunder_bgx_fdt.c
414
sizeof(bgx->lmac[lmac].phyaddr)) <= 0) {
sys/dev/vnic/thunder_bgx_fdt.c
416
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx_fdt.c
419
bgx->lmac[lmac].phyaddr = MII_PHY_ANY;
sys/dev/vnic/thunder_bgx_fdt.c
425
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx_fdt.c
436
bgx->lmac[lmac].phy_if_dev =
sys/dev/vnic/thunder_bgx_fdt.c
438
if (bgx->lmac[lmac].phy_if_dev == NULL) {
sys/dev/vnic/thunder_bgx_fdt.c
440
device_printf(bgx->dev,
sys/dev/vnic/thunder_bgx_fdt.c
447
bgx_fdt_get_macaddr(child, bgx->lmac[lmac].mac);
sys/dev/vnic/thunder_bgx_fdt.c
449
bgx->lmac[lmac].lmacid = lmac;
sys/dev/vnic/thunder_bgx_fdt.c
455
device_printf(bgx->dev, "Could not find matching PHY\n");
sys/dev/vnic/thunder_bgx_fdt.c
69
int bgx_fdt_init_phy(struct bgx *);
sys/dev/vnic/thunder_bgx_fdt.c
84
bgx_fdt_phy_mode_match(struct bgx *bgx, char *qlm_mode, ssize_t size)
sys/dev/vnic/thunder_bgx_fdt.c
90
switch (bgx->qlm_mode) {
sys/dev/vnic/thunder_bgx_var.h
34
struct bgx *bgx;
sys/dev/vnic/thunder_bgx_var.h
64
extern int bgx_fdt_init_phy(struct bgx *);