]> git.sur5r.net Git - u-boot/commitdiff
net: pch_gbe: Fix rx descriptor buffer addresses
authorPaul Burton <paul.burton@imgtec.com>
Sun, 30 Apr 2017 19:57:06 +0000 (21:57 +0200)
committerJoe Hershberger <joe.hershberger@ni.com>
Fri, 2 Jun 2017 19:44:20 +0000 (14:44 -0500)
The loop to set up buffer addresses in rx descriptors always operated on
descriptor 0, rather than on each descriptor sequentially. Fix this in
order to setup correct buffer addresses for each descriptor.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/pch_gbe.c

index 4aac0f67a050d19f1af74392eb3cb254e1ecc809..7d1561635651034ec89e1c0cff715212ffbf59f6 100644 (file)
@@ -117,8 +117,8 @@ static void pch_gbe_rx_descs_init(struct udevice *dev)
 
        memset(rx_desc, 0, sizeof(struct pch_gbe_rx_desc) * PCH_GBE_DESC_NUM);
        for (i = 0; i < PCH_GBE_DESC_NUM; i++)
-               rx_desc->buffer_addr = dm_pci_phys_to_mem(priv->dev,
-                       (ulong)(priv->rx_buff[i]));
+               rx_desc[i].buffer_addr = dm_pci_phys_to_mem(priv->dev,
+                       priv->rx_buff[i]);
 
        writel(dm_pci_phys_to_mem(priv->dev, (ulong)rx_desc),
               &mac_regs->rx_dsc_base);