common: Move command functions out of common.h
[oweals/u-boot.git] / drivers / net / macb.c
index 25f79136e0fc428c751e575fc6e685a390c427da..f809f3eb07bb48a36c34cd28aefc7f18a75c0263 100644 (file)
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <dm.h>
 
 /*
@@ -296,13 +297,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)
@@ -1319,6 +1322,7 @@ static const struct macb_config sifive_config = {
 static const struct udevice_id macb_eth_ids[] = {
        { .compatible = "cdns,macb" },
        { .compatible = "cdns,at91sam9260-macb" },
+       { .compatible = "cdns,sam9x60-macb" },
        { .compatible = "atmel,sama5d2-gem" },
        { .compatible = "atmel,sama5d3-gem" },
        { .compatible = "atmel,sama5d4-gem", .data = (ulong)&sama5d4_config },