Commit dc97a89e authored by Rafal Ozieblo's avatar Rafal Ozieblo Committed by David S. Miller

net: macb: Fix 64 bit addressing support for GEM

This patch adds support for 32 bit GEM in
64 bit system. It checks capability at runtime
and uses appropriate buffer descriptor.
Signed-off-by: default avatarRafal Ozieblo <rafalo@cadence.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a764db1
This diff is collapsed.
...@@ -385,6 +385,8 @@ ...@@ -385,6 +385,8 @@
/* Bitfields in DCFG6. */ /* Bitfields in DCFG6. */
#define GEM_PBUF_LSO_OFFSET 27 #define GEM_PBUF_LSO_OFFSET 27
#define GEM_PBUF_LSO_SIZE 1 #define GEM_PBUF_LSO_SIZE 1
#define GEM_DAW64_OFFSET 23
#define GEM_DAW64_SIZE 1
/* Constants for CLK */ /* Constants for CLK */
#define MACB_CLK_DIV8 0 #define MACB_CLK_DIV8 0
...@@ -487,12 +489,20 @@ ...@@ -487,12 +489,20 @@
struct macb_dma_desc { struct macb_dma_desc {
u32 addr; u32 addr;
u32 ctrl; u32 ctrl;
};
#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
u32 addrh; enum macb_hw_dma_cap {
u32 resvd; HW_DMA_CAP_32B,
#endif HW_DMA_CAP_64B,
}; };
struct macb_dma_desc_64 {
u32 addrh;
u32 resvd;
};
#endif
/* DMA descriptor bitfields */ /* DMA descriptor bitfields */
#define MACB_RX_USED_OFFSET 0 #define MACB_RX_USED_OFFSET 0
#define MACB_RX_USED_SIZE 1 #define MACB_RX_USED_SIZE 1
...@@ -874,6 +884,10 @@ struct macb { ...@@ -874,6 +884,10 @@ struct macb {
unsigned int jumbo_max_len; unsigned int jumbo_max_len;
u32 wol; u32 wol;
#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
enum macb_hw_dma_cap hw_dma_cap;
#endif
}; };
static inline bool macb_is_gem(struct macb *bp) static inline bool macb_is_gem(struct macb *bp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment