summaryrefslogtreecommitdiff
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-09-04 16:02:03 -0400
committerTom Rini <trini@konsulko.com>2019-09-04 16:02:03 -0400
commitece9834f7d223097cec92e3d3c70cd37b3768482 (patch)
treed2935e582cb3494364bf2b7bc89a3d227d616e97 /drivers/net/macb.c
parent448f11f7503995746a7b71e5e3b3a831c4651be9 (diff)
parent5a5d1def59024dd3225e2a6142f8ee3ee10180a8 (diff)
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-net
- Assorted CVE fixes - Other fixes
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index c99cf663a41..377188e361c 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -296,13 +296,15 @@ static inline void macb_flush_ring_desc(struct macb_device *macb, bool rx)
static inline void macb_flush_rx_buffer(struct macb_device *macb)
{
flush_dcache_range(macb->rx_buffer_dma, macb->rx_buffer_dma +
- ALIGN(MACB_RX_BUFFER_SIZE, PKTALIGN));
+ ALIGN(macb->rx_buffer_size * MACB_RX_RING_SIZE,
+ PKTALIGN));
}
static inline void macb_invalidate_rx_buffer(struct macb_device *macb)
{
invalidate_dcache_range(macb->rx_buffer_dma, macb->rx_buffer_dma +
- ALIGN(MACB_RX_BUFFER_SIZE, PKTALIGN));
+ ALIGN(macb->rx_buffer_size * MACB_RX_RING_SIZE,
+ PKTALIGN));
}
#if defined(CONFIG_CMD_NET)
@@ -643,7 +645,7 @@ static int macb_phy_init(struct macb_device *macb, const char *name)
/* First check for GMAC and that it is GiB capable */
if (gem_is_gigabit_capable(macb)) {
- lpa = macb_mdio_read(macb, MII_LPA);
+ lpa = macb_mdio_read(macb, MII_STAT1000);
if (lpa & (LPA_1000FULL | LPA_1000HALF | LPA_1000XFULL |
LPA_1000XHALF)) {