Lines Matching +full:tse +full:- +full:msgdma +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Altera TSE SGDMA and MSGDMA Linux driver
12 /* No initialization work to do for MSGDMA */
30 /* Reset Rx mSGDMA */ in msgdma_reset()
31 csrwr32(MSGDMA_CSR_STAT_MASK, priv->rx_dma_csr, in msgdma_reset()
33 csrwr32(MSGDMA_CSR_CTL_RESET, priv->rx_dma_csr, in msgdma_reset()
38 if (tse_bit_is_clear(priv->rx_dma_csr, msgdma_csroffs(status), in msgdma_reset()
41 udelay(1); in msgdma_reset()
45 netif_warn(priv, drv, priv->dev, in msgdma_reset()
46 "TSE Rx mSGDMA resetting bit never cleared!\n"); in msgdma_reset()
49 csrwr32(MSGDMA_CSR_STAT_MASK, priv->rx_dma_csr, msgdma_csroffs(status)); in msgdma_reset()
51 /* Reset Tx mSGDMA */ in msgdma_reset()
52 csrwr32(MSGDMA_CSR_STAT_MASK, priv->tx_dma_csr, in msgdma_reset()
55 csrwr32(MSGDMA_CSR_CTL_RESET, priv->tx_dma_csr, in msgdma_reset()
60 if (tse_bit_is_clear(priv->tx_dma_csr, msgdma_csroffs(status), in msgdma_reset()
63 udelay(1); in msgdma_reset()
67 netif_warn(priv, drv, priv->dev, in msgdma_reset()
68 "TSE Tx mSGDMA resetting bit never cleared!\n"); in msgdma_reset()
71 csrwr32(MSGDMA_CSR_STAT_MASK, priv->tx_dma_csr, msgdma_csroffs(status)); in msgdma_reset()
76 tse_clear_bit(priv->rx_dma_csr, msgdma_csroffs(control), in msgdma_disable_rxirq()
82 tse_set_bit(priv->rx_dma_csr, msgdma_csroffs(control), in msgdma_enable_rxirq()
88 tse_clear_bit(priv->tx_dma_csr, msgdma_csroffs(control), in msgdma_disable_txirq()
94 tse_set_bit(priv->tx_dma_csr, msgdma_csroffs(control), in msgdma_enable_txirq()
100 csrwr32(MSGDMA_CSR_STAT_IRQ, priv->rx_dma_csr, msgdma_csroffs(status)); in msgdma_clear_rxirq()
105 csrwr32(MSGDMA_CSR_STAT_IRQ, priv->tx_dma_csr, msgdma_csroffs(status)); in msgdma_clear_txirq()
111 csrwr32(lower_32_bits(buffer->dma_addr), priv->tx_dma_desc, in msgdma_tx_buffer()
113 csrwr32(upper_32_bits(buffer->dma_addr), priv->tx_dma_desc, in msgdma_tx_buffer()
115 csrwr32(0, priv->tx_dma_desc, msgdma_descroffs(write_addr_lo)); in msgdma_tx_buffer()
116 csrwr32(0, priv->tx_dma_desc, msgdma_descroffs(write_addr_hi)); in msgdma_tx_buffer()
117 csrwr32(buffer->len, priv->tx_dma_desc, msgdma_descroffs(len)); in msgdma_tx_buffer()
118 csrwr32(0, priv->tx_dma_desc, msgdma_descroffs(burst_seq_num)); in msgdma_tx_buffer()
119 csrwr32(MSGDMA_DESC_TX_STRIDE, priv->tx_dma_desc, in msgdma_tx_buffer()
121 csrwr32(MSGDMA_DESC_CTL_TX_SINGLE, priv->tx_dma_desc, in msgdma_tx_buffer()
133 inuse = csrrd32(priv->tx_dma_csr, msgdma_csroffs(rw_fill_level)) in msgdma_tx_completions()
138 priv->tx_prod - priv->tx_cons - inuse - 1, 0); in msgdma_tx_completions()
141 status = csrrd32(priv->tx_dma_csr, msgdma_csroffs(status)); in msgdma_tx_completions()
143 ready = priv->tx_prod - priv->tx_cons - 1; in msgdma_tx_completions()
145 ready = priv->tx_prod - priv->tx_cons; in msgdma_tx_completions()
150 /* Put buffer to the mSGDMA RX FIFO
155 u32 len = priv->rx_dma_buf_sz; in msgdma_add_rx_desc()
156 dma_addr_t dma_addr = rxbuffer->dma_addr; in msgdma_add_rx_desc()
164 csrwr32(0, priv->rx_dma_desc, msgdma_descroffs(read_addr_lo)); in msgdma_add_rx_desc()
165 csrwr32(0, priv->rx_dma_desc, msgdma_descroffs(read_addr_hi)); in msgdma_add_rx_desc()
166 csrwr32(lower_32_bits(dma_addr), priv->rx_dma_desc, in msgdma_add_rx_desc()
168 csrwr32(upper_32_bits(dma_addr), priv->rx_dma_desc, in msgdma_add_rx_desc()
170 csrwr32(len, priv->rx_dma_desc, msgdma_descroffs(len)); in msgdma_add_rx_desc()
171 csrwr32(0, priv->rx_dma_desc, msgdma_descroffs(burst_seq_num)); in msgdma_add_rx_desc()
172 csrwr32(0x00010001, priv->rx_dma_desc, msgdma_descroffs(stride)); in msgdma_add_rx_desc()
173 csrwr32(control, priv->rx_dma_desc, msgdma_descroffs(control)); in msgdma_add_rx_desc()
185 if (csrrd32(priv->rx_dma_csr, msgdma_csroffs(resp_fill_level)) in msgdma_rx_status()
187 pktlength = csrrd32(priv->rx_dma_resp, in msgdma_rx_status()
189 pktstatus = csrrd32(priv->rx_dma_resp, in msgdma_rx_status()