diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-02-20 09:37:59 (GMT) |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2017-03-29 05:40:30 (GMT) |
commit | cd9ee19226a15039127801915803769720071316 (patch) | |
tree | 3ec3bf4b1633ce02fe0a571f222b698add43a38b /drivers | |
parent | 15f4df3091e20a0cbb8ab23a2d009cc71d9e37f5 (diff) | |
download | u-boot-cd9ee19226a15039127801915803769720071316.tar.xz |
net: mvpp2: store physical address of buffer in rx_desc->buf_cookie
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/mvpp2.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c index 90ab6d7..17ce0e9 100644 --- a/drivers/net/mvpp2.c +++ b/drivers/net/mvpp2.c @@ -2352,20 +2352,25 @@ static inline int mvpp2_bm_cookie_pool_get(unsigned long cookie) /* Release buffer to BM */ static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool, dma_addr_t buf_dma_addr, - unsigned long buf_virt_addr) + unsigned long buf_phys_addr) { - mvpp2_write(port->priv, MVPP2_BM_VIRT_RLS_REG, buf_virt_addr); + /* MVPP2_BM_VIRT_RLS_REG is not interpreted by HW, and simply + * returned in the "cookie" field of the RX + * descriptor. Instead of storing the virtual address, we + * store the physical address + */ + mvpp2_write(port->priv, MVPP2_BM_VIRT_RLS_REG, buf_phys_addr); mvpp2_write(port->priv, MVPP2_BM_PHY_RLS_REG(pool), buf_dma_addr); } /* Refill BM pool */ static void mvpp2_pool_refill(struct mvpp2_port *port, u32 bm, dma_addr_t dma_addr, - u32 cookie) + phys_addr_t phys_addr) { int pool = mvpp2_bm_cookie_pool_get(bm); - mvpp2_bm_pool_put(port, pool, dma_addr, cookie); + mvpp2_bm_pool_put(port, pool, dma_addr, phys_addr); } /* Allocate buffers for the pool */ |