From 1fd3ca4e14aa6f054b262f0923df9a5e8e9a69be Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:06 +0000 Subject: net/macb: add AT91RM9200 specific registers and bits to header Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 335e288..0e5d55b 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -14,6 +14,8 @@ #define MACB_NCR 0x0000 #define MACB_NCFGR 0x0004 #define MACB_NSR 0x0008 +#define MACB_TAR 0x000c /* AT91RM9200 only */ +#define MACB_TCR 0x0010 /* AT91RM9200 only */ #define MACB_TSR 0x0014 #define MACB_RBQP 0x0018 #define MACB_TBQP 0x001c @@ -133,6 +135,8 @@ #define MACB_RTY_SIZE 1 #define MACB_PAE_OFFSET 13 #define MACB_PAE_SIZE 1 +#define MACB_RM9200_RMII_OFFSET 13 /* AT91RM9200 only */ +#define MACB_RM9200_RMII_SIZE 1 /* AT91RM9200 only */ #define MACB_RBOF_OFFSET 14 #define MACB_RBOF_SIZE 2 #define MACB_RLCE_OFFSET 16 @@ -178,6 +182,8 @@ #define MACB_TGO_SIZE 1 #define MACB_BEX_OFFSET 4 #define MACB_BEX_SIZE 1 +#define MACB_RM9200_BNQ_OFFSET 4 /* AT91RM9200 only */ +#define MACB_RM9200_BNQ_SIZE 1 /* AT91RM9200 only */ #define MACB_COMP_OFFSET 5 #define MACB_COMP_SIZE 1 #define MACB_UND_OFFSET 6 -- cgit v1.1 From b85008b7020ce00fbf9a36ae56285216fc37737a Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:10 +0000 Subject: net/at91_ether/macb: absorb at91_private in to macb private struct This will make it easier to share code between the drivers and eventually merge them into one driver. Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 0e5d55b..5661094 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -504,6 +504,19 @@ struct gem_stats { u32 rx_udp_checksum_errors; }; +struct rbf_t { + unsigned int addr; + unsigned long size; +}; + +#define MAX_RBUFF_SZ 0x600 /* 1518 rounded up */ +#define MAX_RX_DESCR 9 /* max number of receive buffers */ + +struct recv_desc_bufs { + struct rbf_t descriptors[MAX_RX_DESCR]; /* must be on sizeof (rbf_t) boundary */ + char recv_buf[MAX_RX_DESCR][MAX_RBUFF_SZ]; /* must be on long boundary */ +}; + struct macb { void __iomem *regs; @@ -540,6 +553,29 @@ struct macb { unsigned int duplex; phy_interface_t phy_interface; + + /* at91_private */ + struct mii_if_info mii; /* ethtool support */ + struct macb_platform_data board_data; /* board-specific + * configuration (shared with + * macb for common data */ + struct clk *ether_clk; /* clock */ + + /* PHY */ + unsigned long phy_type; /* type of PHY (PHY_ID) */ + short phy_media; /* media interface type */ + unsigned short phy_address; /* 5-bit MDI address of PHY (0..31) */ + struct timer_list check_timer; /* Poll link status */ + + /* Transmit */ + struct sk_buff *skb; /* holds skb until xmit interrupt completes */ + dma_addr_t skb_physaddr; /* phys addr from pci_map_single */ + int skb_length; /* saved skb length for pci_unmap_single */ + + /* Receive */ + int rxBuffIndex; /* index into receive descriptor list */ + struct recv_desc_bufs *dlist; /* descriptor list address */ + struct recv_desc_bufs *dlist_phys; /* descriptor list physical address */ }; static inline bool macb_is_gem(struct macb *bp) -- cgit v1.1 From 54f14e4b4d4759ddb0e1c61cb7469bea33842f78 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:11 +0000 Subject: net/at91_ether: use pclk member instead of ether_clk Remove old at91_priv member and use pclk member from macb. Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 5661094..138311f 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -559,7 +559,6 @@ struct macb { struct macb_platform_data board_data; /* board-specific * configuration (shared with * macb for common data */ - struct clk *ether_clk; /* clock */ /* PHY */ unsigned long phy_type; /* type of PHY (PHY_ID) */ -- cgit v1.1 From 0005f54102a7bcaffc9caa73db7d04d7587ab3c3 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:12 +0000 Subject: net/macb: export some symbols for at91_ether Export some symbols to start sharing code between macb and at91_ether drivers. Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 138311f..335d111 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -577,6 +577,11 @@ struct macb { struct recv_desc_bufs *dlist_phys; /* descriptor list physical address */ }; +extern const struct ethtool_ops macb_ethtool_ops; + +int macb_mii_init(struct macb *bp); +int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); + static inline bool macb_is_gem(struct macb *bp) { return MACB_BFEXT(IDNUM, macb_readl(bp, MID)) == 0x2; -- cgit v1.1 From 5e32353d318835a76f0bb61fd62271c30a43ee22 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:14 +0000 Subject: net/at91_ether: use ethtool and mdio from macb This rips out the at91_ether phy handling and ethtool stuff and replace it with equivalent stuff from macb. The only thing lost is the phy irq support from at91_ether, but this can be added to macb and then benefit all users. Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 335d111..fd2961a 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -555,17 +555,10 @@ struct macb { phy_interface_t phy_interface; /* at91_private */ - struct mii_if_info mii; /* ethtool support */ struct macb_platform_data board_data; /* board-specific * configuration (shared with * macb for common data */ - /* PHY */ - unsigned long phy_type; /* type of PHY (PHY_ID) */ - short phy_media; /* media interface type */ - unsigned short phy_address; /* 5-bit MDI address of PHY (0..31) */ - struct timer_list check_timer; /* Poll link status */ - /* Transmit */ struct sk_buff *skb; /* holds skb until xmit interrupt completes */ dma_addr_t skb_physaddr; /* phys addr from pci_map_single */ -- cgit v1.1 From e0da1f144abd34b3e29fe0ba871fee2c57b991c6 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:15 +0000 Subject: net/at91_ether: share macb_set_rx_mode with macb Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index fd2961a..2710562 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -574,6 +574,7 @@ extern const struct ethtool_ops macb_ethtool_ops; int macb_mii_init(struct macb *bp); int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); +void macb_set_rx_mode(struct net_device *dev); static inline bool macb_is_gem(struct macb *bp) { -- cgit v1.1 From fbb7a6e7d4ee2139405957a131623815060cb966 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:16 +0000 Subject: net/at91_ether: use macb dma description struct Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 2710562..31a877a 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -504,16 +504,11 @@ struct gem_stats { u32 rx_udp_checksum_errors; }; -struct rbf_t { - unsigned int addr; - unsigned long size; -}; - #define MAX_RBUFF_SZ 0x600 /* 1518 rounded up */ #define MAX_RX_DESCR 9 /* max number of receive buffers */ struct recv_desc_bufs { - struct rbf_t descriptors[MAX_RX_DESCR]; /* must be on sizeof (rbf_t) boundary */ + struct dma_desc descriptors[MAX_RX_DESCR]; /* must be on sizeof (dma_desc) boundary */ char recv_buf[MAX_RX_DESCR][MAX_RBUFF_SZ]; /* must be on long boundary */ }; -- cgit v1.1 From 04879e5cb47f40534bc108d4aec1c49232de65fd Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Thu, 18 Oct 2012 11:01:17 +0000 Subject: net/at91_ether: clean up rx buffer handling This patch does two things: * Use macb struct members and remove at91_ether ones * Alloc DMA buffers on netdev start and dealloc on stop Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 31a877a..a362751 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -504,14 +504,6 @@ struct gem_stats { u32 rx_udp_checksum_errors; }; -#define MAX_RBUFF_SZ 0x600 /* 1518 rounded up */ -#define MAX_RX_DESCR 9 /* max number of receive buffers */ - -struct recv_desc_bufs { - struct dma_desc descriptors[MAX_RX_DESCR]; /* must be on sizeof (dma_desc) boundary */ - char recv_buf[MAX_RX_DESCR][MAX_RBUFF_SZ]; /* must be on long boundary */ -}; - struct macb { void __iomem *regs; @@ -558,11 +550,6 @@ struct macb { struct sk_buff *skb; /* holds skb until xmit interrupt completes */ dma_addr_t skb_physaddr; /* phys addr from pci_map_single */ int skb_length; /* saved skb length for pci_unmap_single */ - - /* Receive */ - int rxBuffIndex; /* index into receive descriptor list */ - struct recv_desc_bufs *dlist; /* descriptor list address */ - struct recv_desc_bufs *dlist_phys; /* descriptor list physical address */ }; extern const struct ethtool_ops macb_ethtool_ops; -- cgit v1.1 From 140b7552fdff04bbceeb842f0e04f0b4015fe97b Mon Sep 17 00:00:00 2001 From: Patrice Vilchez Date: Wed, 31 Oct 2012 06:04:50 +0000 Subject: net/macb: Add support for Gigabit Ethernet mode Add Gigabit Ethernet mode to GEM cadence IP and enable RGMII connection. Signed-off-by: Patrice Vilchez Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index a362751..33a050f 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -149,6 +149,8 @@ #define MACB_IRXFCS_SIZE 1 /* GEM specific NCFGR bitfields. */ +#define GEM_GBE_OFFSET 10 +#define GEM_GBE_SIZE 1 #define GEM_CLK_OFFSET 18 #define GEM_CLK_SIZE 3 #define GEM_DBW_OFFSET 21 @@ -252,6 +254,8 @@ /* Bitfields in USRIO (AT91) */ #define MACB_RMII_OFFSET 0 #define MACB_RMII_SIZE 1 +#define GEM_RGMII_OFFSET 0 /* GEM gigabit mode */ +#define GEM_RGMII_SIZE 1 #define MACB_CLKEN_OFFSET 1 #define MACB_CLKEN_SIZE 1 -- cgit v1.1 From 55054a16a5ecf7202e698b07f00ad8e0dadf7d50 Mon Sep 17 00:00:00 2001 From: Havard Skinnemoen Date: Wed, 31 Oct 2012 06:04:55 +0000 Subject: net/macb: clean up ring buffer logic Instead of masking head and tail every time we increment them, just let them wrap through UINT_MAX and mask them when subscripting. Add simple accessor functions to do the subscripting properly to minimize the chances of messing this up. This makes the code slightly smaller, and hopefully faster as well. Also, doing the ring buffer management this way will simplify things a lot when making the ring sizes configurable in the future. Available number of descriptors in ring buffer function by David Laight. Signed-off-by: Havard Skinnemoen [nicolas.ferre@atmel.com: split patch in topics, adapt to newer kernel] Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 33a050f..024a270 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -362,7 +362,12 @@ __v; \ }) -struct dma_desc { +/** + * struct macb_dma_desc - Hardware DMA descriptor + * @addr: DMA address of data buffer + * @ctrl: Control and status bits + */ +struct macb_dma_desc { u32 addr; u32 ctrl; }; @@ -427,7 +432,12 @@ struct dma_desc { #define MACB_TX_USED_OFFSET 31 #define MACB_TX_USED_SIZE 1 -struct ring_info { +/** + * struct macb_tx_skb - data about an skb which is being transmitted + * @skb: skb currently being transmitted + * @mapping: DMA address of the skb's data buffer + */ +struct macb_tx_skb { struct sk_buff *skb; dma_addr_t mapping; }; @@ -512,12 +522,12 @@ struct macb { void __iomem *regs; unsigned int rx_tail; - struct dma_desc *rx_ring; + struct macb_dma_desc *rx_ring; void *rx_buffers; unsigned int tx_head, tx_tail; - struct dma_desc *tx_ring; - struct ring_info *tx_skb; + struct macb_dma_desc *tx_ring; + struct macb_tx_skb *tx_skb; spinlock_t lock; struct platform_device *pdev; @@ -535,8 +545,6 @@ struct macb { dma_addr_t tx_ring_dma; dma_addr_t rx_buffers_dma; - unsigned int rx_pending, tx_pending; - struct mii_bus *mii_bus; struct phy_device *phy_dev; unsigned int link; -- cgit v1.1 From d1d1b53d9d28c8e44a72fadae491702b36e2e1fb Mon Sep 17 00:00:00 2001 From: Nicolas Ferre Date: Wed, 31 Oct 2012 06:04:56 +0000 Subject: net/macb: ethtool interface: add register dump feature Add macb_get_regs() ethtool function and its helper function: macb_get_regs_len(). The version field is deduced from the IP revision which gives the "MACB or GEM" information. An additional version field is reserved. Signed-off-by: Nicolas Ferre Reviewed-by: Ben Hutchings Tested-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 024a270..232dca6 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -10,6 +10,9 @@ #ifndef _MACB_H #define _MACB_H +#define MACB_GREGS_NBR 16 +#define MACB_GREGS_VERSION 1 + /* MACB register offsets */ #define MACB_NCR 0x0000 #define MACB_NCFGR 0x0004 -- cgit v1.1 From e86cd53afc5907f7c221b709916e2dd354e14691 Mon Sep 17 00:00:00 2001 From: Nicolas Ferre Date: Wed, 31 Oct 2012 06:04:57 +0000 Subject: net/macb: better manage tx errors Handle all TX errors, not only underruns. TX error management is deferred to a dedicated workqueue. Reinitialize the TX ring after treating all remaining frames, and restart the controller when everything has been cleaned up properly. Napi is not stopped during this task as the driver only handles napi for RX for now. With this sequence, we do not need a special check during the xmit method as the packets will be caught by TX disable during workqueue execution. Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 232dca6..4235ab8 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -538,6 +538,7 @@ struct macb { struct clk *hclk; struct net_device *dev; struct napi_struct napi; + struct work_struct tx_error_task; struct net_device_stats stats; union { struct macb_stats macb; -- cgit v1.1 From 314bccc4f5b625f9c5a2cf7d74a610cc2612272a Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Wed, 7 Nov 2012 08:14:52 +0000 Subject: net/macb: export macb_set_hwaddr and macb_get_hwaddr for usage in at91_ether driver. Signed-off-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 4235ab8..d723494 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -573,6 +573,8 @@ extern const struct ethtool_ops macb_ethtool_ops; int macb_mii_init(struct macb *bp); int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); void macb_set_rx_mode(struct net_device *dev); +void macb_set_hwaddr(struct macb *bp); +void macb_get_hwaddr(struct macb *bp); static inline bool macb_is_gem(struct macb *bp) { -- cgit v1.1 From 2ea32eedc09e5bed031020905c7ee349987a5878 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Wed, 7 Nov 2012 08:14:54 +0000 Subject: net/at91_ether: use stat function from macb Signed-off-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index d723494..97f74dd 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -572,6 +572,7 @@ extern const struct ethtool_ops macb_ethtool_ops; int macb_mii_init(struct macb *bp); int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); +struct net_device_stats *macb_get_stats(struct net_device *dev); void macb_set_rx_mode(struct net_device *dev); void macb_set_hwaddr(struct macb *bp); void macb_get_hwaddr(struct macb *bp); -- cgit v1.1 From 4dda6f6d241c846a7783461ee66671866781e305 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Wed, 7 Nov 2012 08:14:55 +0000 Subject: net/at91_ether: drop board_data private struct member No longer used after gpio phy interrupt support was removed from at91_ether. Signed-off-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 97f74dd..864e380 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -557,12 +557,7 @@ struct macb { phy_interface_t phy_interface; - /* at91_private */ - struct macb_platform_data board_data; /* board-specific - * configuration (shared with - * macb for common data */ - - /* Transmit */ + /* AT91RM9200 transmit */ struct sk_buff *skb; /* holds skb until xmit interrupt completes */ dma_addr_t skb_physaddr; /* phys addr from pci_map_single */ int skb_length; /* saved skb length for pci_unmap_single */ -- cgit v1.1 From 3629a6cebcdcfe16f3dbbffcaab25583285a7125 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Sun, 11 Nov 2012 13:56:28 +0000 Subject: net/macb: clear unused address register Only the first register set is used for matching but we support getting the initial hw addr from any of the registers. To prevent stale entries and false matches clear unused register sets. This most important for the at91_ether driver where u-boot always uses the 2nd register set. Signed-off-by: Joachim Eastwood Signed-off-by: David S. Miller --- drivers/net/ethernet/cadence/macb.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 864e380..4414421 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -74,6 +74,12 @@ #define GEM_HRT 0x0084 #define GEM_SA1B 0x0088 #define GEM_SA1T 0x008C +#define GEM_SA2B 0x0090 +#define GEM_SA2T 0x0094 +#define GEM_SA3B 0x0098 +#define GEM_SA3T 0x009C +#define GEM_SA4B 0x00A0 +#define GEM_SA4T 0x00A4 #define GEM_OTX 0x0100 #define GEM_DCFG1 0x0280 #define GEM_DCFG2 0x0284 -- cgit v1.1 From b3e3bd71b429c04490d6a57671f2bbe2121d4f5a Mon Sep 17 00:00:00 2001 From: Nicolas Ferre Date: Fri, 23 Nov 2012 03:49:01 +0000 Subject: net/macb: GEM DMA configuration register update Add information to the DMA Configuration Register to maximize system performance: - rx/tx packet buffer full memory size - allow possibility to use INCR16 if supported Signed-off-by: Nicolas Ferre Acked-by: Joachim Eastwood --- drivers/net/ethernet/cadence/macb.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/net/ethernet/cadence/macb.h') diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 4414421..570908b 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -171,8 +171,19 @@ #define GEM_DBW128 2 /* Bitfields in DMACFG. */ +#define GEM_FBLDO_OFFSET 0 +#define GEM_FBLDO_SIZE 5 +#define GEM_RXBMS_OFFSET 8 +#define GEM_RXBMS_SIZE 2 +#define GEM_TXPBMS_OFFSET 10 +#define GEM_TXPBMS_SIZE 1 +#define GEM_TXCOEN_OFFSET 11 +#define GEM_TXCOEN_SIZE 1 #define GEM_RXBS_OFFSET 16 #define GEM_RXBS_SIZE 8 +#define GEM_DDRP_OFFSET 24 +#define GEM_DDRP_SIZE 1 + /* Bitfields in NSR */ #define MACB_NSR_LINK_OFFSET 0 -- cgit v1.1