summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2018-02-13 00:21:19 +0000
committerRussell King <rmk+kernel@armlinux.org.uk>2019-07-09 12:20:56 +0100
commit953d64453aafcbf9937587989efa38fca490df21 (patch)
tree36f397c7eb09656ba8eff6eeac59e07fc740b216
parentcd7c5bfc550d9fe7629e686c785808d72ba16d36 (diff)
net: marvell: mvpp2x: hack around dma_to_phys() removal
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c b/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
index 3a29f5cead66..c2a58726cd66 100644
--- a/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2x/mv_pp2x_main.c
@@ -67,6 +67,17 @@
#include <mv_pp2x_ptp_init.h>
#endif
+static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr)
+{
+#ifdef __arm__
+ unsigned int offset = dev_addr & ~PAGE_MASK;
+ return __pfn_to_phys(dma_to_pfn(dev, dev_addr)) + offset;
+#else
+ phys_addr_t paddr = (phys_addr_t)dev_addr;
+ return paddr + ((phys_addr_t)dev->dma_pfn_offset << PAGE_SHIFT);
+#endif
+}
+
#define MVPP2_SKB_TEST_SIZE 64
#define MVPP2_ADDRESS 0xf2000000
#define CPN110_ADDRESS_SPACE_SIZE (16 * 1024 * 1024)