Lines Matching refs:rpm
43 static void rpm_write(rpm_t *rpm, u64 lmac, u64 offset, u64 val) in rpm_write() argument
45 cgx_write(rpm, lmac, offset, val); in rpm_write()
48 static u64 rpm_read(rpm_t *rpm, u64 lmac, u64 offset) in rpm_read() argument
50 return cgx_read(rpm, lmac, offset); in rpm_read()
55 rpm_t *rpm = rpmd; in rpm_get_nr_lmacs() local
57 return hweight8(rpm_read(rpm, 0, CGXX_CMRX_RX_LMACS) & 0xFULL); in rpm_get_nr_lmacs()
62 rpm_t *rpm = rpmd; in rpm_lmac_tx_enable() local
65 if (!is_lmac_valid(rpm, lmac_id)) in rpm_lmac_tx_enable()
68 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_tx_enable()
76 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_tx_enable()
82 rpm_t *rpm = rpmd; in rpm_lmac_rx_tx_enable() local
85 if (!is_lmac_valid(rpm, lmac_id)) in rpm_lmac_rx_tx_enable()
88 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_rx_tx_enable()
93 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_rx_tx_enable()
99 rpm_t *rpm = rpmd; in rpm_lmac_enadis_rx_pause_fwding() local
102 if (!rpm) in rpm_lmac_enadis_rx_pause_fwding()
106 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_enadis_rx_pause_fwding()
108 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_enadis_rx_pause_fwding()
110 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_enadis_rx_pause_fwding()
112 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_enadis_rx_pause_fwding()
119 rpm_t *rpm = rpmd; in rpm_lmac_get_pause_frm_status() local
122 if (!is_lmac_valid(rpm, lmac_id)) in rpm_lmac_get_pause_frm_status()
125 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_get_pause_frm_status()
128 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_get_pause_frm_status()
136 rpm_t *rpm = rpmd; in rpm_lmac_enadis_pause_frm() local
139 if (!is_lmac_valid(rpm, lmac_id)) in rpm_lmac_enadis_pause_frm()
142 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_enadis_pause_frm()
147 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_enadis_pause_frm()
149 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_enadis_pause_frm()
152 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_enadis_pause_frm()
154 cfg = rpm_read(rpm, 0, RPMX_CMR_RX_OVR_BP); in rpm_lmac_enadis_pause_frm()
161 rpm_write(rpm, 0, RPMX_CMR_RX_OVR_BP, cfg); in rpm_lmac_enadis_pause_frm()
167 rpm_t *rpm = rpmd; in rpm_lmac_pause_frm_config() local
172 cfg = rpm_read(rpm, lmac_id, in rpm_lmac_pause_frm_config()
175 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_CL01_PAUSE_QUANTA, in rpm_lmac_pause_frm_config()
178 cfg = rpm_read(rpm, lmac_id, in rpm_lmac_pause_frm_config()
181 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_CL01_QUANTA_THRESH, in rpm_lmac_pause_frm_config()
186 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_pause_frm_config()
188 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_pause_frm_config()
191 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_pause_frm_config()
193 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_pause_frm_config()
196 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG); in rpm_lmac_pause_frm_config()
198 rpm_write(rpm, lmac_id, RPMX_MTI_MAC100X_COMMAND_CONFIG, cfg); in rpm_lmac_pause_frm_config()
203 rpm_t *rpm = rpmd; in rpm_get_rx_stats() local
206 if (!rpm || lmac_id >= rpm->lmac_count) in rpm_get_rx_stats()
209 mutex_lock(&rpm->lock); in rpm_get_rx_stats()
212 idx += lmac_id * rpm->mac_ops->rx_stats_cnt; in rpm_get_rx_stats()
215 val_lo = rpm_read(rpm, 0, RPMX_MTI_STAT_RX_STAT_PAGES_COUNTERX + in rpm_get_rx_stats()
221 val_hi = rpm_read(rpm, 0, RPMX_MTI_STAT_DATA_HI_CDC); in rpm_get_rx_stats()
225 mutex_unlock(&rpm->lock); in rpm_get_rx_stats()
231 rpm_t *rpm = rpmd; in rpm_get_tx_stats() local
234 if (!rpm || lmac_id >= rpm->lmac_count) in rpm_get_tx_stats()
237 mutex_lock(&rpm->lock); in rpm_get_tx_stats()
240 idx += lmac_id * rpm->mac_ops->tx_stats_cnt; in rpm_get_tx_stats()
242 val_lo = rpm_read(rpm, 0, RPMX_MTI_STAT_TX_STAT_PAGES_COUNTERX + in rpm_get_tx_stats()
244 val_hi = rpm_read(rpm, 0, RPMX_MTI_STAT_DATA_HI_CDC); in rpm_get_tx_stats()
248 mutex_unlock(&rpm->lock); in rpm_get_tx_stats()
254 rpm_t *rpm = rpmd; in rpm_get_lmac_type() local
259 err = cgx_fwi_cmd_generic(req, &resp, rpm, 0); in rpm_get_lmac_type()
267 rpm_t *rpm = rpmd; in rpm_get_lmac_fifo_len() local
272 fifo_len = rpm->mac_ops->fifo_len; in rpm_get_lmac_fifo_len()
273 num_lmacs = rpm->mac_ops->get_nr_lmacs(rpm); in rpm_get_lmac_fifo_len()
282 hi_perf_lmac = rpm_read(rpm, 0, CGXX_CMRX_RX_LMACS); in rpm_get_lmac_fifo_len()
296 rpm_t *rpm = rpmd; in rpm_lmac_internal_loopback() local
300 if (!rpm || lmac_id >= rpm->lmac_count) in rpm_lmac_internal_loopback()
302 lmac_type = rpm->mac_ops->get_lmac_type(rpm, lmac_id); in rpm_lmac_internal_loopback()
305 dev_err(&rpm->pdev->dev, "loopback not supported for LPC mode\n"); in rpm_lmac_internal_loopback()
309 cfg = rpm_read(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1); in rpm_lmac_internal_loopback()
315 rpm_write(rpm, lmac_id, RPMX_MTI_PCS100X_CONTROL1, cfg); in rpm_lmac_internal_loopback()
322 rpm_t *rpm = rpmd; in rpm_lmac_ptp_config() local
325 if (!is_lmac_valid(rpm, lmac_id)) in rpm_lmac_ptp_config()
328 cfg = rpm_read(rpm, lmac_id, RPMX_CMRX_CFG); in rpm_lmac_ptp_config()
333 rpm_write(rpm, lmac_id, RPMX_CMRX_CFG, cfg); in rpm_lmac_ptp_config()