Lines Matching full:cfg

210 	u64 cfg;  in cgx_lmac_get_p2x()  local
212 cfg = cgx_read(cgx_dev, lmac_id, CGXX_CMRX_CFG); in cgx_lmac_get_p2x()
214 return (cfg & CMR_P2X_SEL_MASK) >> CMR_P2X_SEL_SHIFT; in cgx_lmac_get_p2x()
258 u64 cfg; in cgx_lmac_addr_set() local
267 /* memcpy(&cfg, mac_addr, 6); */ in cgx_lmac_addr_set()
269 cfg = ether_addr_to_u64(mac_addr); in cgx_lmac_addr_set()
276 cfg | CGX_DMAC_CAM_ADDR_ENABLE | ((u64)lmac_id << 49)); in cgx_lmac_addr_set()
278 cfg = cgx_read(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0); in cgx_lmac_addr_set()
279 cfg |= (CGX_DMAC_CTL0_CAM_ENABLE | CGX_DMAC_BCAST_MODE | in cgx_lmac_addr_set()
281 cgx_write(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0, cfg); in cgx_lmac_addr_set()
320 u64 cfg = 0; in cgx_lmac_addr_add() local
336 cfg = ether_addr_to_u64(mac_addr); in cgx_lmac_addr_add()
337 cfg |= CGX_DMAC_CAM_ADDR_ENABLE; in cgx_lmac_addr_add()
338 cfg |= ((u64)lmac_id << 49); in cgx_lmac_addr_add()
339 cgx_write(cgx_dev, 0, (CGXX_CMRX_RX_DMAC_CAM0 + (index * 0x8)), cfg); in cgx_lmac_addr_add()
341 cfg = cgx_read(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0); in cgx_lmac_addr_add()
342 cfg |= (CGX_DMAC_BCAST_MODE | CGX_DMAC_CAM_ACCEPT); in cgx_lmac_addr_add()
345 cfg &= ~GENMASK_ULL(2, 1); in cgx_lmac_addr_add()
346 cfg |= CGX_DMAC_MCAST_MODE_CAM; in cgx_lmac_addr_add()
349 cfg |= CGX_DMAC_MCAST_MODE; in cgx_lmac_addr_add()
352 cgx_write(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0, cfg); in cgx_lmac_addr_add()
363 u64 cfg; in cgx_lmac_addr_reset() local
380 cfg = cgx_read(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0); in cgx_lmac_addr_reset()
381 cfg &= ~CGX_DMAC_CAM_ACCEPT; in cgx_lmac_addr_reset()
382 cfg |= (CGX_DMAC_BCAST_MODE | CGX_DMAC_MCAST_MODE); in cgx_lmac_addr_reset()
383 cgx_write(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0, cfg); in cgx_lmac_addr_reset()
397 u64 cfg; in cgx_lmac_addr_update() local
417 cfg = cgx_read(cgx_dev, 0, (CGXX_CMRX_RX_DMAC_CAM0 + (index * 0x8))); in cgx_lmac_addr_update()
418 cfg &= ~CGX_RX_DMAC_ADR_MASK; in cgx_lmac_addr_update()
419 cfg |= ether_addr_to_u64(mac_addr); in cgx_lmac_addr_update()
421 cgx_write(cgx_dev, 0, (CGXX_CMRX_RX_DMAC_CAM0 + (index * 0x8)), cfg); in cgx_lmac_addr_update()
431 u64 cfg; in cgx_lmac_addr_del() local
453 cfg = cgx_read(cgx_dev, 0, (CGXX_CMRX_RX_DMAC_CAM0 + (index * 0x8))); in cgx_lmac_addr_del()
455 u64_to_ether_addr(cfg, mac); in cgx_lmac_addr_del()
460 cfg = cgx_read(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0); in cgx_lmac_addr_del()
461 cfg &= ~GENMASK_ULL(2, 1); in cgx_lmac_addr_del()
462 cfg |= CGX_DMAC_MCAST_MODE; in cgx_lmac_addr_del()
463 cgx_write(cgx_dev, lmac_id, CGXX_CMRX_RX_DMAC_CTL0, cfg); in cgx_lmac_addr_del()
488 u64 cfg; in cgx_lmac_addr_get() local
497 cfg = cgx_read(cgx_dev, 0, CGXX_CMRX_RX_DMAC_CAM0 + index * 0x8); in cgx_lmac_addr_get()
498 return cfg & CGX_RX_DMAC_ADR_MASK; in cgx_lmac_addr_get()
515 u64 cfg; in cgx_get_lmac_type() local
517 cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_CFG); in cgx_get_lmac_type()
518 return (cfg >> CGX_LMAC_TYPE_SHIFT) & CGX_LMAC_TYPE_MASK; in cgx_get_lmac_type()
552 u64 cfg; in cgx_lmac_internal_loopback() local
560 cfg = cgx_read(cgx, lmac_id, CGXX_GMP_PCS_MRX_CTL); in cgx_lmac_internal_loopback()
562 cfg |= CGXX_GMP_PCS_MRX_CTL_LBK; in cgx_lmac_internal_loopback()
564 cfg &= ~CGXX_GMP_PCS_MRX_CTL_LBK; in cgx_lmac_internal_loopback()
565 cgx_write(cgx, lmac_id, CGXX_GMP_PCS_MRX_CTL, cfg); in cgx_lmac_internal_loopback()
567 cfg = cgx_read(cgx, lmac_id, CGXX_SPUX_CONTROL1); in cgx_lmac_internal_loopback()
569 cfg |= CGXX_SPUX_CONTROL1_LBK; in cgx_lmac_internal_loopback()
571 cfg &= ~CGXX_SPUX_CONTROL1_LBK; in cgx_lmac_internal_loopback()
572 cgx_write(cgx, lmac_id, CGXX_SPUX_CONTROL1, cfg); in cgx_lmac_internal_loopback()
584 u64 cfg = 0; in cgx_lmac_promisc_config() local
596 cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_RX_DMAC_CTL0); in cgx_lmac_promisc_config()
597 cfg &= ~CGX_DMAC_CAM_ACCEPT; in cgx_lmac_promisc_config()
598 cfg |= (CGX_DMAC_BCAST_MODE | CGX_DMAC_MCAST_MODE); in cgx_lmac_promisc_config()
599 cgx_write(cgx, lmac_id, CGXX_CMRX_RX_DMAC_CTL0, cfg); in cgx_lmac_promisc_config()
603 cfg = cgx_read(cgx, 0, in cgx_lmac_promisc_config()
605 cfg &= ~CGX_DMAC_CAM_ADDR_ENABLE; in cgx_lmac_promisc_config()
607 (CGXX_CMRX_RX_DMAC_CAM0 + index * 0x8), cfg); in cgx_lmac_promisc_config()
611 cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_RX_DMAC_CTL0); in cgx_lmac_promisc_config()
612 cfg |= CGX_DMAC_CAM_ACCEPT | CGX_DMAC_MCAST_MODE; in cgx_lmac_promisc_config()
613 cgx_write(cgx, lmac_id, CGXX_CMRX_RX_DMAC_CTL0, cfg); in cgx_lmac_promisc_config()
616 cfg = cgx_read(cgx, 0, in cgx_lmac_promisc_config()
618 if ((cfg & CGX_RX_DMAC_ADR_MASK) != 0) { in cgx_lmac_promisc_config()
619 cfg |= CGX_DMAC_CAM_ADDR_ENABLE; in cgx_lmac_promisc_config()
623 cfg); in cgx_lmac_promisc_config()
633 u64 cfg; in cgx_lmac_get_pause_frm_status() local
641 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); in cgx_lmac_get_pause_frm_status()
642 *rx_pause = !!(cfg & CGX_SMUX_RX_FRM_CTL_CTL_BCK); in cgx_lmac_get_pause_frm_status()
644 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_TX_CTL); in cgx_lmac_get_pause_frm_status()
645 *tx_pause = !!(cfg & CGX_SMUX_TX_CTL_L2P_BP_CONV); in cgx_lmac_get_pause_frm_status()
656 u64 cfg; in cgx_lmac_enadis_rx_pause_fwding() local
674 cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL); in cgx_lmac_enadis_rx_pause_fwding()
675 cfg |= CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK; in cgx_lmac_enadis_rx_pause_fwding()
676 cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg); in cgx_lmac_enadis_rx_pause_fwding()
678 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); in cgx_lmac_enadis_rx_pause_fwding()
679 cfg |= CGX_SMUX_RX_FRM_CTL_CTL_BCK; in cgx_lmac_enadis_rx_pause_fwding()
680 cgx_write(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL, cfg); in cgx_lmac_enadis_rx_pause_fwding()
682 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_CBFC_CTL); in cgx_lmac_enadis_rx_pause_fwding()
683 cfg |= CGXX_SMUX_CBFC_CTL_BCK_EN; in cgx_lmac_enadis_rx_pause_fwding()
684 cgx_write(cgx, lmac_id, CGXX_SMUX_CBFC_CTL, cfg); in cgx_lmac_enadis_rx_pause_fwding()
689 cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL); in cgx_lmac_enadis_rx_pause_fwding()
690 cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK; in cgx_lmac_enadis_rx_pause_fwding()
691 cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg); in cgx_lmac_enadis_rx_pause_fwding()
693 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); in cgx_lmac_enadis_rx_pause_fwding()
694 cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK; in cgx_lmac_enadis_rx_pause_fwding()
695 cgx_write(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL, cfg); in cgx_lmac_enadis_rx_pause_fwding()
697 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_CBFC_CTL); in cgx_lmac_enadis_rx_pause_fwding()
698 cfg &= ~CGXX_SMUX_CBFC_CTL_BCK_EN; in cgx_lmac_enadis_rx_pause_fwding()
699 cgx_write(cgx, lmac_id, CGXX_SMUX_CBFC_CTL, cfg); in cgx_lmac_enadis_rx_pause_fwding()
814 u64 cfg; in cgx_lmac_rx_tx_enable() local
819 cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_CFG); in cgx_lmac_rx_tx_enable()
821 cfg |= DATA_PKT_RX_EN | DATA_PKT_TX_EN; in cgx_lmac_rx_tx_enable()
823 cfg &= ~(DATA_PKT_RX_EN | DATA_PKT_TX_EN); in cgx_lmac_rx_tx_enable()
824 cgx_write(cgx, lmac_id, CGXX_CMRX_CFG, cfg); in cgx_lmac_rx_tx_enable()
831 u64 cfg, last; in cgx_lmac_tx_enable() local
836 cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_CFG); in cgx_lmac_tx_enable()
837 last = cfg; in cgx_lmac_tx_enable()
839 cfg |= DATA_PKT_TX_EN; in cgx_lmac_tx_enable()
841 cfg &= ~DATA_PKT_TX_EN; in cgx_lmac_tx_enable()
843 if (cfg != last) in cgx_lmac_tx_enable()
844 cgx_write(cgx, lmac_id, CGXX_CMRX_CFG, cfg); in cgx_lmac_tx_enable()
852 u64 cfg; in cgx_lmac_enadis_pause_frm() local
860 cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL); in cgx_lmac_enadis_pause_frm()
861 cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK; in cgx_lmac_enadis_pause_frm()
862 cfg |= rx_pause ? CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK : 0x0; in cgx_lmac_enadis_pause_frm()
863 cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg); in cgx_lmac_enadis_pause_frm()
865 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); in cgx_lmac_enadis_pause_frm()
866 cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK; in cgx_lmac_enadis_pause_frm()
867 cfg |= rx_pause ? CGX_SMUX_RX_FRM_CTL_CTL_BCK : 0x0; in cgx_lmac_enadis_pause_frm()
868 cgx_write(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL, cfg); in cgx_lmac_enadis_pause_frm()
870 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_TX_CTL); in cgx_lmac_enadis_pause_frm()
871 cfg &= ~CGX_SMUX_TX_CTL_L2P_BP_CONV; in cgx_lmac_enadis_pause_frm()
872 cfg |= tx_pause ? CGX_SMUX_TX_CTL_L2P_BP_CONV : 0x0; in cgx_lmac_enadis_pause_frm()
873 cgx_write(cgx, lmac_id, CGXX_SMUX_TX_CTL, cfg); in cgx_lmac_enadis_pause_frm()
875 cfg = cgx_read(cgx, 0, CGXX_CMR_RX_OVR_BP); in cgx_lmac_enadis_pause_frm()
877 cfg &= ~CGX_CMR_RX_OVR_BP_EN(lmac_id); in cgx_lmac_enadis_pause_frm()
879 cfg |= CGX_CMR_RX_OVR_BP_EN(lmac_id); in cgx_lmac_enadis_pause_frm()
880 cfg &= ~CGX_CMR_RX_OVR_BP_BP(lmac_id); in cgx_lmac_enadis_pause_frm()
882 cgx_write(cgx, 0, CGXX_CMR_RX_OVR_BP, cfg); in cgx_lmac_enadis_pause_frm()
889 u64 cfg; in cgx_lmac_pause_frm_config() local
898 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_TX_PAUSE_PKT_INTERVAL); in cgx_lmac_pause_frm_config()
899 cfg &= ~0xFFFFULL; in cgx_lmac_pause_frm_config()
901 cfg | (DEFAULT_PAUSE_TIME / 2)); in cgx_lmac_pause_frm_config()
906 cfg = cgx_read(cgx, lmac_id, in cgx_lmac_pause_frm_config()
908 cfg &= ~0xFFFFULL; in cgx_lmac_pause_frm_config()
910 cfg | (DEFAULT_PAUSE_TIME / 2)); in cgx_lmac_pause_frm_config()
914 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); in cgx_lmac_pause_frm_config()
915 cfg &= ~CGX_SMUX_RX_FRM_CTL_CTL_BCK; in cgx_lmac_pause_frm_config()
916 cgx_write(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL, cfg); in cgx_lmac_pause_frm_config()
918 cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL); in cgx_lmac_pause_frm_config()
919 cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK; in cgx_lmac_pause_frm_config()
920 cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg); in cgx_lmac_pause_frm_config()
923 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_TX_CTL); in cgx_lmac_pause_frm_config()
924 cfg &= ~CGX_SMUX_TX_CTL_L2P_BP_CONV; in cgx_lmac_pause_frm_config()
925 cgx_write(cgx, lmac_id, CGXX_SMUX_TX_CTL, cfg); in cgx_lmac_pause_frm_config()
927 cfg = cgx_read(cgx, 0, CGXX_CMR_RX_OVR_BP); in cgx_lmac_pause_frm_config()
928 cfg |= CGX_CMR_RX_OVR_BP_EN(lmac_id); in cgx_lmac_pause_frm_config()
929 cfg &= ~CGX_CMR_RX_OVR_BP_BP(lmac_id); in cgx_lmac_pause_frm_config()
930 cgx_write(cgx, 0, CGXX_CMR_RX_OVR_BP, cfg); in cgx_lmac_pause_frm_config()
933 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_CBFC_CTL); in cgx_lmac_pause_frm_config()
934 cfg = FIELD_SET(CGX_PFC_CLASS_MASK, 0, cfg); in cgx_lmac_pause_frm_config()
935 cgx_write(cgx, lmac_id, CGXX_SMUX_CBFC_CTL, cfg); in cgx_lmac_pause_frm_config()
978 u64 cfg; in cgx_lmac_pfc_config() local
987 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_CBFC_CTL); in cgx_lmac_pfc_config()
988 pfc_en |= FIELD_GET(CGX_PFC_CLASS_MASK, cfg); in cgx_lmac_pfc_config()
991 cfg |= (CGXX_SMUX_CBFC_CTL_RX_EN | in cgx_lmac_pfc_config()
995 cfg &= ~(CGXX_SMUX_CBFC_CTL_RX_EN | in cgx_lmac_pfc_config()
1001 cfg |= CGXX_SMUX_CBFC_CTL_TX_EN; in cgx_lmac_pfc_config()
1002 cfg = FIELD_SET(CGX_PFC_CLASS_MASK, pfc_en, cfg); in cgx_lmac_pfc_config()
1004 cfg &= ~CGXX_SMUX_CBFC_CTL_TX_EN; in cgx_lmac_pfc_config()
1005 cfg = FIELD_SET(CGX_PFC_CLASS_MASK, 0, cfg); in cgx_lmac_pfc_config()
1008 cgx_write(cgx, lmac_id, CGXX_SMUX_CBFC_CTL, cfg); in cgx_lmac_pfc_config()
1011 cfg = cgx_lmac_addr_get(cgx->cgx_id, lmac_id); in cgx_lmac_pfc_config()
1012 cgx_write(cgx, lmac_id, CGXX_SMUX_SMAC, cfg); in cgx_lmac_pfc_config()
1021 u64 cfg; in cgx_lmac_get_pfc_frm_cfg() local
1026 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_CBFC_CTL); in cgx_lmac_get_pfc_frm_cfg()
1028 *rx_pause = !!(cfg & CGXX_SMUX_CBFC_CTL_RX_EN); in cgx_lmac_get_pfc_frm_cfg()
1029 *tx_pause = !!(cfg & CGXX_SMUX_CBFC_CTL_TX_EN); in cgx_lmac_get_pfc_frm_cfg()
1037 u64 cfg; in cgx_lmac_ptp_config() local
1044 cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL); in cgx_lmac_ptp_config()
1045 cfg |= CGX_GMP_GMI_RXX_FRM_CTL_PTP_MODE; in cgx_lmac_ptp_config()
1046 cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg); in cgx_lmac_ptp_config()
1048 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); in cgx_lmac_ptp_config()
1049 cfg |= CGX_SMUX_RX_FRM_CTL_PTP_MODE; in cgx_lmac_ptp_config()
1050 cgx_write(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL, cfg); in cgx_lmac_ptp_config()
1053 cfg = cgx_read(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL); in cgx_lmac_ptp_config()
1054 cfg &= ~CGX_GMP_GMI_RXX_FRM_CTL_PTP_MODE; in cgx_lmac_ptp_config()
1055 cgx_write(cgx, lmac_id, CGXX_GMP_GMI_RXX_FRM_CTL, cfg); in cgx_lmac_ptp_config()
1057 cfg = cgx_read(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL); in cgx_lmac_ptp_config()
1058 cfg &= ~CGX_SMUX_RX_FRM_CTL_PTP_MODE; in cgx_lmac_ptp_config()
1059 cgx_write(cgx, lmac_id, CGXX_SMUX_RX_FRM_CTL, cfg); in cgx_lmac_ptp_config()
1611 u64 cfg; in cgx_lmac_reset() local
1617 cfg = 0xff; in cgx_lmac_reset()
1618 cgx_write(cgxd, lmac_id, CGXX_CMRX_RX_LOGL_XON, cfg); in cgx_lmac_reset()
1791 u64 cfg; in cgx_populate_features() local
1793 cfg = cgx_read(cgx, 0, CGX_CONST); in cgx_populate_features()
1794 cgx->fifo_len = FIELD_GET(CGX_CONST_RXFIFO_SIZE, cfg); in cgx_populate_features()
1795 cgx->max_lmac_per_mac = FIELD_GET(CGX_CONST_MAX_LMACS, cfg); in cgx_populate_features()
1818 u64 cfg; in cgx_x2p_reset() local
1826 cfg = cgx_read(cgx, 0, CGXX_CMR_GLOBAL_CONFIG); in cgx_x2p_reset()
1827 cfg |= cgx_get_nix_resetbit(cgx) | CGX_NSCI_DROP; in cgx_x2p_reset()
1828 cgx_write(cgx, 0, CGXX_CMR_GLOBAL_CONFIG, cfg); in cgx_x2p_reset()
1830 cfg = cgx_read(cgx, 0, CGXX_CMR_GLOBAL_CONFIG); in cgx_x2p_reset()
1831 cfg &= ~(cgx_get_nix_resetbit(cgx) | CGX_NSCI_DROP); in cgx_x2p_reset()
1832 cgx_write(cgx, 0, CGXX_CMR_GLOBAL_CONFIG, cfg); in cgx_x2p_reset()
1839 u64 cfg; in cgx_enadis_rx() local
1844 cfg = cgx_read(cgx, lmac_id, CGXX_CMRX_CFG); in cgx_enadis_rx()
1846 cfg |= DATA_PKT_RX_EN; in cgx_enadis_rx()
1848 cfg &= ~DATA_PKT_RX_EN; in cgx_enadis_rx()
1849 cgx_write(cgx, lmac_id, CGXX_CMRX_CFG, cfg); in cgx_enadis_rx()