mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
net: stmmac: xgmac: Implement tx_queue_prio()
Implement the TX Queue Priority callback in XGMAC core. Signed-off-by: Jose Abreu <joabreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5656ac5542
commit
7035aad875
2 changed files with 22 additions and 1 deletions
|
@ -127,6 +127,10 @@
|
||||||
#define XGMAC_MTL_RXQ_DMA_MAP1 0x00001034
|
#define XGMAC_MTL_RXQ_DMA_MAP1 0x00001034
|
||||||
#define XGMAC_QxMDMACH(x) GENMASK((x) * 8 + 3, (x) * 8)
|
#define XGMAC_QxMDMACH(x) GENMASK((x) * 8 + 3, (x) * 8)
|
||||||
#define XGMAC_QxMDMACH_SHIFT(x) ((x) * 8)
|
#define XGMAC_QxMDMACH_SHIFT(x) ((x) * 8)
|
||||||
|
#define XGMAC_TC_PRTY_MAP0 0x00001040
|
||||||
|
#define XGMAC_TC_PRTY_MAP1 0x00001044
|
||||||
|
#define XGMAC_PSTC(x) GENMASK((x) * 8 + 7, (x) * 8)
|
||||||
|
#define XGMAC_PSTC_SHIFT(x) ((x) * 8)
|
||||||
#define XGMAC_MTL_TXQ_OPMODE(x) (0x00001100 + (0x80 * (x)))
|
#define XGMAC_MTL_TXQ_OPMODE(x) (0x00001100 + (0x80 * (x)))
|
||||||
#define XGMAC_TQS GENMASK(25, 16)
|
#define XGMAC_TQS GENMASK(25, 16)
|
||||||
#define XGMAC_TQS_SHIFT 16
|
#define XGMAC_TQS_SHIFT 16
|
||||||
|
|
|
@ -118,6 +118,23 @@ static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio,
|
||||||
writel(value, ioaddr + reg);
|
writel(value, ioaddr + reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void dwxgmac2_tx_queue_prio(struct mac_device_info *hw, u32 prio,
|
||||||
|
u32 queue)
|
||||||
|
{
|
||||||
|
void __iomem *ioaddr = hw->pcsr;
|
||||||
|
u32 value, reg;
|
||||||
|
|
||||||
|
reg = (queue < 4) ? XGMAC_TC_PRTY_MAP0 : XGMAC_TC_PRTY_MAP1;
|
||||||
|
if (queue >= 4)
|
||||||
|
queue -= 4;
|
||||||
|
|
||||||
|
value = readl(ioaddr + reg);
|
||||||
|
value &= ~XGMAC_PSTC(queue);
|
||||||
|
value |= (prio << XGMAC_PSTC_SHIFT(queue)) & XGMAC_PSTC(queue);
|
||||||
|
|
||||||
|
writel(value, ioaddr + reg);
|
||||||
|
}
|
||||||
|
|
||||||
static void dwxgmac2_prog_mtl_rx_algorithms(struct mac_device_info *hw,
|
static void dwxgmac2_prog_mtl_rx_algorithms(struct mac_device_info *hw,
|
||||||
u32 rx_alg)
|
u32 rx_alg)
|
||||||
{
|
{
|
||||||
|
@ -428,7 +445,7 @@ const struct stmmac_ops dwxgmac210_ops = {
|
||||||
.rx_ipc = dwxgmac2_rx_ipc,
|
.rx_ipc = dwxgmac2_rx_ipc,
|
||||||
.rx_queue_enable = dwxgmac2_rx_queue_enable,
|
.rx_queue_enable = dwxgmac2_rx_queue_enable,
|
||||||
.rx_queue_prio = dwxgmac2_rx_queue_prio,
|
.rx_queue_prio = dwxgmac2_rx_queue_prio,
|
||||||
.tx_queue_prio = NULL,
|
.tx_queue_prio = dwxgmac2_tx_queue_prio,
|
||||||
.rx_queue_routing = NULL,
|
.rx_queue_routing = NULL,
|
||||||
.prog_mtl_rx_algorithms = dwxgmac2_prog_mtl_rx_algorithms,
|
.prog_mtl_rx_algorithms = dwxgmac2_prog_mtl_rx_algorithms,
|
||||||
.prog_mtl_tx_algorithms = dwxgmac2_prog_mtl_tx_algorithms,
|
.prog_mtl_tx_algorithms = dwxgmac2_prog_mtl_tx_algorithms,
|
||||||
|
|
Loading…
Reference in a new issue