Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
davinci_emac.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/in.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/highmem.h>
#include <linux/proc_fs.h>
#include <linux/ctype.h>
#include <linux/spinlock.h>
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/semaphore.h>
#include <linux/phy.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <linux/pm_runtime.h>
#include <linux/davinci_emac.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_net.h>
#include <asm/irq.h>
#include <asm/page.h>
#include "davinci_cpdma.h"

Go to the source code of this file.

Data Structures

struct  emac_priv
 

Macros

#define DAVINCI_EMAC_DEBUG
 
#define EMAC_MAJOR_VERSION   6
 
#define EMAC_MINOR_VERSION   1
 
#define EMAC_MODULE_VERSION   "6.1"
 
#define EMAC_DEF_PASS_CRC   (0) /* Do not pass CRC up to frames */
 
#define EMAC_DEF_QOS_EN   (0) /* EMAC proprietary QoS disabled */
 
#define EMAC_DEF_NO_BUFF_CHAIN   (0) /* No buffer chain */
 
#define EMAC_DEF_MACCTRL_FRAME_EN   (0) /* Discard Maccontrol frames */
 
#define EMAC_DEF_SHORT_FRAME_EN   (0) /* Discard short frames */
 
#define EMAC_DEF_ERROR_FRAME_EN   (0) /* Discard error frames */
 
#define EMAC_DEF_PROM_EN   (0) /* Promiscuous disabled */
 
#define EMAC_DEF_PROM_CH   (0) /* Promiscuous channel is 0 */
 
#define EMAC_DEF_BCAST_EN   (1) /* Broadcast enabled */
 
#define EMAC_DEF_BCAST_CH   (0) /* Broadcast channel is 0 */
 
#define EMAC_DEF_MCAST_EN   (1) /* Multicast enabled */
 
#define EMAC_DEF_MCAST_CH   (0) /* Multicast channel is 0 */
 
#define EMAC_DEF_TXPRIO_FIXED   (1) /* TX Priority is fixed */
 
#define EMAC_DEF_TXPACING_EN   (0) /* TX pacing NOT supported*/
 
#define EMAC_DEF_BUFFER_OFFSET   (0) /* Buffer offset to DMA (future) */
 
#define EMAC_DEF_MIN_ETHPKTSIZE   (60) /* Minimum ethernet pkt size */
 
#define EMAC_DEF_MAX_FRAME_SIZE   (1500 + 14 + 4 + 4)
 
#define EMAC_DEF_TX_CH   (0) /* Default 0th channel */
 
#define EMAC_DEF_RX_CH   (0) /* Default 0th channel */
 
#define EMAC_DEF_RX_NUM_DESC   (128)
 
#define EMAC_DEF_TX_NUM_DESC   (128)
 
#define EMAC_DEF_MAX_TX_CH   (1) /* Max TX channels configured */
 
#define EMAC_DEF_MAX_RX_CH   (1) /* Max RX channels configured */
 
#define EMAC_POLL_WEIGHT   (64) /* Default NAPI poll weight */
 
#define EMAC_DEF_TX_MAX_SERVICE   (32) /* TX max service BD's */
 
#define EMAC_DEF_RX_MAX_SERVICE   (64) /* should = netdev->weight */
 
#define EMAC_ALL_MULTI_REG_VALUE   (0xFFFFFFFF)
 
#define EMAC_NUM_MULTICAST_BITS   (64)
 
#define EMAC_TX_CONTROL_TX_ENABLE_VAL   (0x1)
 
#define EMAC_RX_CONTROL_RX_ENABLE_VAL   (0x1)
 
#define EMAC_MAC_HOST_ERR_INTMASK_VAL   (0x2)
 
#define EMAC_RX_UNICAST_CLEAR_ALL   (0xFF)
 
#define EMAC_INT_MASK_CLEAR   (0xFF)
 
#define EMAC_RXMBP_PASSCRC_MASK   BIT(30)
 
#define EMAC_RXMBP_QOSEN_MASK   BIT(29)
 
#define EMAC_RXMBP_NOCHAIN_MASK   BIT(28)
 
#define EMAC_RXMBP_CMFEN_MASK   BIT(24)
 
#define EMAC_RXMBP_CSFEN_MASK   BIT(23)
 
#define EMAC_RXMBP_CEFEN_MASK   BIT(22)
 
#define EMAC_RXMBP_CAFEN_MASK   BIT(21)
 
#define EMAC_RXMBP_PROMCH_SHIFT   (16)
 
#define EMAC_RXMBP_PROMCH_MASK   (0x7 << 16)
 
#define EMAC_RXMBP_BROADEN_MASK   BIT(13)
 
#define EMAC_RXMBP_BROADCH_SHIFT   (8)
 
#define EMAC_RXMBP_BROADCH_MASK   (0x7 << 8)
 
#define EMAC_RXMBP_MULTIEN_MASK   BIT(5)
 
#define EMAC_RXMBP_MULTICH_SHIFT   (0)
 
#define EMAC_RXMBP_MULTICH_MASK   (0x7)
 
#define EMAC_RXMBP_CHMASK   (0x7)
 
#define EMAC_MBP_RXPROMISC   (0x00200000)
 
#define EMAC_MBP_PROMISCCH(ch)   (((ch) & 0x7) << 16)
 
#define EMAC_MBP_RXBCAST   (0x00002000)
 
#define EMAC_MBP_BCASTCHAN(ch)   (((ch) & 0x7) << 8)
 
#define EMAC_MBP_RXMCAST   (0x00000020)
 
#define EMAC_MBP_MCASTCHAN(ch)   ((ch) & 0x7)
 
#define EMAC_MACCONTROL_TXPTYPE   BIT(9)
 
#define EMAC_MACCONTROL_TXPACEEN   BIT(6)
 
#define EMAC_MACCONTROL_GMIIEN   BIT(5)
 
#define EMAC_MACCONTROL_GIGABITEN   BIT(7)
 
#define EMAC_MACCONTROL_FULLDUPLEXEN   BIT(0)
 
#define EMAC_MACCONTROL_RMIISPEED_MASK   BIT(15)
 
#define EMAC_DM646X_MACCONTORL_GIG   BIT(7)
 
#define EMAC_DM646X_MACCONTORL_GIGFORCE   BIT(17)
 
#define EMAC_MACSTATUS_TXERRCODE_MASK   (0xF00000)
 
#define EMAC_MACSTATUS_TXERRCODE_SHIFT   (20)
 
#define EMAC_MACSTATUS_TXERRCH_MASK   (0x7)
 
#define EMAC_MACSTATUS_TXERRCH_SHIFT   (16)
 
#define EMAC_MACSTATUS_RXERRCODE_MASK   (0xF000)
 
#define EMAC_MACSTATUS_RXERRCODE_SHIFT   (12)
 
#define EMAC_MACSTATUS_RXERRCH_MASK   (0x7)
 
#define EMAC_MACSTATUS_RXERRCH_SHIFT   (8)
 
#define EMAC_RX_MAX_LEN_MASK   (0xFFFF)
 
#define EMAC_RX_BUFFER_OFFSET_MASK   (0xFFFF)
 
#define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT   BIT(17)
 
#define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT   BIT(16)
 
#define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC   BIT(8)
 
#define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC   BIT(0)
 
#define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC   BIT(EMAC_DEF_RX_CH)
 
#define EMAC_DM646X_MAC_IN_VECTOR_TX_INT_VEC   BIT(16 + EMAC_DEF_TX_CH)
 
#define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT   BIT(26)
 
#define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT   BIT(27)
 
#define EMAC_CPPI_SOP_BIT   BIT(31)
 
#define EMAC_CPPI_EOP_BIT   BIT(30)
 
#define EMAC_CPPI_OWNERSHIP_BIT   BIT(29)
 
#define EMAC_CPPI_EOQ_BIT   BIT(28)
 
#define EMAC_CPPI_TEARDOWN_COMPLETE_BIT   BIT(27)
 
#define EMAC_CPPI_PASS_CRC_BIT   BIT(26)
 
#define EMAC_RX_BD_BUF_SIZE   (0xFFFF)
 
#define EMAC_BD_LENGTH_FOR_CACHE   (16) /* only CPPI bytes */
 
#define EMAC_RX_BD_PKT_LENGTH_MASK   (0xFFFF)
 
#define EMAC_MAX_TXRX_CHANNELS   (8) /* Max hardware channels */
 
#define EMAC_DEF_MAX_MULTICAST_ADDRESSES   (64) /* Max mcast addr's */
 
#define EMAC_MACINVECTOR   0x90
 
#define EMAC_DM646X_MACEOIVECTOR   0x94
 
#define EMAC_MACINTSTATRAW   0xB0
 
#define EMAC_MACINTSTATMASKED   0xB4
 
#define EMAC_MACINTMASKSET   0xB8
 
#define EMAC_MACINTMASKCLEAR   0xBC
 
#define EMAC_RXMBPENABLE   0x100
 
#define EMAC_RXUNICASTSET   0x104
 
#define EMAC_RXUNICASTCLEAR   0x108
 
#define EMAC_RXMAXLEN   0x10C
 
#define EMAC_RXBUFFEROFFSET   0x110
 
#define EMAC_RXFILTERLOWTHRESH   0x114
 
#define EMAC_MACCONTROL   0x160
 
#define EMAC_MACSTATUS   0x164
 
#define EMAC_EMCONTROL   0x168
 
#define EMAC_FIFOCONTROL   0x16C
 
#define EMAC_MACCONFIG   0x170
 
#define EMAC_SOFTRESET   0x174
 
#define EMAC_MACSRCADDRLO   0x1D0
 
#define EMAC_MACSRCADDRHI   0x1D4
 
#define EMAC_MACHASH1   0x1D8
 
#define EMAC_MACHASH2   0x1DC
 
#define EMAC_MACADDRLO   0x500
 
#define EMAC_MACADDRHI   0x504
 
#define EMAC_MACINDEX   0x508
 
#define EMAC_RXGOODFRAMES   0x200
 
#define EMAC_RXBCASTFRAMES   0x204
 
#define EMAC_RXMCASTFRAMES   0x208
 
#define EMAC_RXPAUSEFRAMES   0x20C
 
#define EMAC_RXCRCERRORS   0x210
 
#define EMAC_RXALIGNCODEERRORS   0x214
 
#define EMAC_RXOVERSIZED   0x218
 
#define EMAC_RXJABBER   0x21C
 
#define EMAC_RXUNDERSIZED   0x220
 
#define EMAC_RXFRAGMENTS   0x224
 
#define EMAC_RXFILTERED   0x228
 
#define EMAC_RXQOSFILTERED   0x22C
 
#define EMAC_RXOCTETS   0x230
 
#define EMAC_TXGOODFRAMES   0x234
 
#define EMAC_TXBCASTFRAMES   0x238
 
#define EMAC_TXMCASTFRAMES   0x23C
 
#define EMAC_TXPAUSEFRAMES   0x240
 
#define EMAC_TXDEFERRED   0x244
 
#define EMAC_TXCOLLISION   0x248
 
#define EMAC_TXSINGLECOLL   0x24C
 
#define EMAC_TXMULTICOLL   0x250
 
#define EMAC_TXEXCESSIVECOLL   0x254
 
#define EMAC_TXLATECOLL   0x258
 
#define EMAC_TXUNDERRUN   0x25C
 
#define EMAC_TXCARRIERSENSE   0x260
 
#define EMAC_TXOCTETS   0x264
 
#define EMAC_NETOCTETS   0x280
 
#define EMAC_RXSOFOVERRUNS   0x284
 
#define EMAC_RXMOFOVERRUNS   0x288
 
#define EMAC_RXDMAOVERRUNS   0x28C
 
#define EMAC_CTRL_EWCTL   (0x4)
 
#define EMAC_CTRL_EWINTTCNT   (0x8)
 
#define EMAC_DM644X_EWINTCNT_MASK   0x1FFFF
 
#define EMAC_DM644X_INTMIN_INTVL   0x1
 
#define EMAC_DM644X_INTMAX_INTVL   (EMAC_DM644X_EWINTCNT_MASK)
 
#define EMAC_DM646X_CMINTCTRL   0x0C
 
#define EMAC_DM646X_CMRXINTEN   0x14
 
#define EMAC_DM646X_CMTXINTEN   0x18
 
#define EMAC_DM646X_CMRXINTMAX   0x70
 
#define EMAC_DM646X_CMTXINTMAX   0x74
 
#define EMAC_DM646X_INTPACEEN   (0x3 << 16)
 
#define EMAC_DM646X_INTPRESCALE_MASK   (0x7FF << 0)
 
#define EMAC_DM646X_CMINTMAX_CNT   63
 
#define EMAC_DM646X_CMINTMIN_CNT   2
 
#define EMAC_DM646X_CMINTMAX_INTVL   (1000 / EMAC_DM646X_CMINTMIN_CNT)
 
#define EMAC_DM646X_CMINTMIN_INTVL   ((1000 / EMAC_DM646X_CMINTMAX_CNT) + 1)
 
#define EMAC_DM646X_MAC_EOI_C0_RXEN   (0x01)
 
#define EMAC_DM646X_MAC_EOI_C0_TXEN   (0x02)
 
#define EMAC_STATS_CLR_MASK   (0xFFFFFFFF)
 
#define emac_read(reg)   ioread32(priv->emac_base + (reg))
 
#define emac_write(reg, val)   iowrite32(val, priv->emac_base + (reg))
 
#define emac_ctrl_read(reg)   ioread32((priv->ctrl_base + (reg)))
 
#define emac_ctrl_write(reg, val)   iowrite32(val, (priv->ctrl_base + (reg)))
 
#define EMAC_MULTICAST_ADD   0
 
#define EMAC_MULTICAST_DEL   1
 
#define EMAC_ALL_MULTI_SET   2
 
#define EMAC_ALL_MULTI_CLR   3
 

Functions

 module_param (debug_level, int, 0)
 
 MODULE_PARM_DESC (debug_level,"DaVinci EMAC debug level (NETIF_MSG bits)")
 
 MODULE_VERSION (EMAC_MODULE_VERSION)
 
 MODULE_DEVICE_TABLE (of, davinci_emac_of_match)
 
 late_initcall (davinci_emac_init)
 
 module_exit (davinci_emac_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("DaVinci EMAC Maintainer: Anant Gole <[email protected]>")
 
 MODULE_AUTHOR ("DaVinci EMAC Maintainer: Chaithrika U S <[email protected]>")
 
 MODULE_DESCRIPTION ("DaVinci EMAC Ethernet driver")
 

Macro Definition Documentation

#define DAVINCI_EMAC_DEBUG
Value:
NETIF_MSG_PROBE | \
NETIF_MSG_LINK | \
NETIF_MSG_TIMER | \
NETIF_MSG_IFDOWN | \
NETIF_MSG_IFUP | \
NETIF_MSG_RX_ERR | \
NETIF_MSG_TX_ERR | \
NETIF_MSG_TX_QUEUED | \
NETIF_MSG_INTR | \
NETIF_MSG_TX_DONE | \
NETIF_MSG_RX_STATUS | \
NETIF_MSG_PKTDATA | \
NETIF_MSG_HW | \
NETIF_MSG_WOL)

Definition at line 77 of file davinci_emac.c.

#define EMAC_ALL_MULTI_CLR   3

Definition at line 809 of file davinci_emac.c.

#define EMAC_ALL_MULTI_REG_VALUE   (0xFFFFFFFF)

Definition at line 133 of file davinci_emac.c.

#define EMAC_ALL_MULTI_SET   2

Definition at line 808 of file davinci_emac.c.

#define EMAC_BD_LENGTH_FOR_CACHE   (16) /* only CPPI bytes */

Definition at line 213 of file davinci_emac.c.

#define EMAC_CPPI_EOP_BIT   BIT(30)

Definition at line 207 of file davinci_emac.c.

#define EMAC_CPPI_EOQ_BIT   BIT(28)

Definition at line 209 of file davinci_emac.c.

#define EMAC_CPPI_OWNERSHIP_BIT   BIT(29)

Definition at line 208 of file davinci_emac.c.

#define EMAC_CPPI_PASS_CRC_BIT   BIT(26)

Definition at line 211 of file davinci_emac.c.

#define EMAC_CPPI_SOP_BIT   BIT(31)

Definition at line 206 of file davinci_emac.c.

#define EMAC_CPPI_TEARDOWN_COMPLETE_BIT   BIT(27)

Definition at line 210 of file davinci_emac.c.

#define EMAC_CTRL_EWCTL   (0x4)

Definition at line 284 of file davinci_emac.c.

#define EMAC_CTRL_EWINTTCNT   (0x8)

Definition at line 285 of file davinci_emac.c.

#define emac_ctrl_read (   reg)    ioread32((priv->ctrl_base + (reg)))

Definition at line 378 of file davinci_emac.c.

#define emac_ctrl_write (   reg,
  val 
)    iowrite32(val, (priv->ctrl_base + (reg)))

Definition at line 379 of file davinci_emac.c.

#define EMAC_DEF_BCAST_CH   (0) /* Broadcast channel is 0 */

Definition at line 110 of file davinci_emac.c.

#define EMAC_DEF_BCAST_EN   (1) /* Broadcast enabled */

Definition at line 109 of file davinci_emac.c.

#define EMAC_DEF_BUFFER_OFFSET   (0) /* Buffer offset to DMA (future) */

Definition at line 117 of file davinci_emac.c.

#define EMAC_DEF_ERROR_FRAME_EN   (0) /* Discard error frames */

Definition at line 106 of file davinci_emac.c.

#define EMAC_DEF_MACCTRL_FRAME_EN   (0) /* Discard Maccontrol frames */

Definition at line 104 of file davinci_emac.c.

#define EMAC_DEF_MAX_FRAME_SIZE   (1500 + 14 + 4 + 4)

Definition at line 119 of file davinci_emac.c.

#define EMAC_DEF_MAX_MULTICAST_ADDRESSES   (64) /* Max mcast addr's */

Definition at line 218 of file davinci_emac.c.

#define EMAC_DEF_MAX_RX_CH   (1) /* Max RX channels configured */

Definition at line 125 of file davinci_emac.c.

#define EMAC_DEF_MAX_TX_CH   (1) /* Max TX channels configured */

Definition at line 124 of file davinci_emac.c.

#define EMAC_DEF_MCAST_CH   (0) /* Multicast channel is 0 */

Definition at line 112 of file davinci_emac.c.

#define EMAC_DEF_MCAST_EN   (1) /* Multicast enabled */

Definition at line 111 of file davinci_emac.c.

#define EMAC_DEF_MIN_ETHPKTSIZE   (60) /* Minimum ethernet pkt size */

Definition at line 118 of file davinci_emac.c.

#define EMAC_DEF_NO_BUFF_CHAIN   (0) /* No buffer chain */

Definition at line 103 of file davinci_emac.c.

#define EMAC_DEF_PASS_CRC   (0) /* Do not pass CRC up to frames */

Definition at line 101 of file davinci_emac.c.

#define EMAC_DEF_PROM_CH   (0) /* Promiscuous channel is 0 */

Definition at line 108 of file davinci_emac.c.

#define EMAC_DEF_PROM_EN   (0) /* Promiscuous disabled */

Definition at line 107 of file davinci_emac.c.

#define EMAC_DEF_QOS_EN   (0) /* EMAC proprietary QoS disabled */

Definition at line 102 of file davinci_emac.c.

#define EMAC_DEF_RX_CH   (0) /* Default 0th channel */

Definition at line 121 of file davinci_emac.c.

#define EMAC_DEF_RX_MAX_SERVICE   (64) /* should = netdev->weight */

Definition at line 130 of file davinci_emac.c.

#define EMAC_DEF_RX_NUM_DESC   (128)

Definition at line 122 of file davinci_emac.c.

#define EMAC_DEF_SHORT_FRAME_EN   (0) /* Discard short frames */

Definition at line 105 of file davinci_emac.c.

#define EMAC_DEF_TX_CH   (0) /* Default 0th channel */

Definition at line 120 of file davinci_emac.c.

#define EMAC_DEF_TX_MAX_SERVICE   (32) /* TX max service BD's */

Definition at line 129 of file davinci_emac.c.

#define EMAC_DEF_TX_NUM_DESC   (128)

Definition at line 123 of file davinci_emac.c.

#define EMAC_DEF_TXPACING_EN   (0) /* TX pacing NOT supported*/

Definition at line 115 of file davinci_emac.c.

#define EMAC_DEF_TXPRIO_FIXED   (1) /* TX Priority is fixed */

Definition at line 114 of file davinci_emac.c.

#define EMAC_DM644X_EWINTCNT_MASK   0x1FFFF

Definition at line 288 of file davinci_emac.c.

#define EMAC_DM644X_INTMAX_INTVL   (EMAC_DM644X_EWINTCNT_MASK)

Definition at line 290 of file davinci_emac.c.

#define EMAC_DM644X_INTMIN_INTVL   0x1

Definition at line 289 of file davinci_emac.c.

#define EMAC_DM644X_MAC_IN_VECTOR_HOST_INT   BIT(17)

Definition at line 194 of file davinci_emac.c.

#define EMAC_DM644X_MAC_IN_VECTOR_RX_INT_VEC   BIT(8)

Definition at line 196 of file davinci_emac.c.

#define EMAC_DM644X_MAC_IN_VECTOR_STATPEND_INT   BIT(16)

Definition at line 195 of file davinci_emac.c.

#define EMAC_DM644X_MAC_IN_VECTOR_TX_INT_VEC   BIT(0)

Definition at line 197 of file davinci_emac.c.

#define EMAC_DM646X_CMINTCTRL   0x0C

Definition at line 293 of file davinci_emac.c.

#define EMAC_DM646X_CMINTMAX_CNT   63

Definition at line 302 of file davinci_emac.c.

#define EMAC_DM646X_CMINTMAX_INTVL   (1000 / EMAC_DM646X_CMINTMIN_CNT)

Definition at line 304 of file davinci_emac.c.

#define EMAC_DM646X_CMINTMIN_CNT   2

Definition at line 303 of file davinci_emac.c.

#define EMAC_DM646X_CMINTMIN_INTVL   ((1000 / EMAC_DM646X_CMINTMAX_CNT) + 1)

Definition at line 305 of file davinci_emac.c.

#define EMAC_DM646X_CMRXINTEN   0x14

Definition at line 294 of file davinci_emac.c.

#define EMAC_DM646X_CMRXINTMAX   0x70

Definition at line 296 of file davinci_emac.c.

#define EMAC_DM646X_CMTXINTEN   0x18

Definition at line 295 of file davinci_emac.c.

#define EMAC_DM646X_CMTXINTMAX   0x74

Definition at line 297 of file davinci_emac.c.

#define EMAC_DM646X_INTPACEEN   (0x3 << 16)

Definition at line 300 of file davinci_emac.c.

#define EMAC_DM646X_INTPRESCALE_MASK   (0x7FF << 0)

Definition at line 301 of file davinci_emac.c.

#define EMAC_DM646X_MAC_EOI_C0_RXEN   (0x01)

Definition at line 309 of file davinci_emac.c.

#define EMAC_DM646X_MAC_EOI_C0_TXEN   (0x02)

Definition at line 310 of file davinci_emac.c.

#define EMAC_DM646X_MAC_IN_VECTOR_HOST_INT   BIT(26)

Definition at line 202 of file davinci_emac.c.

#define EMAC_DM646X_MAC_IN_VECTOR_RX_INT_VEC   BIT(EMAC_DEF_RX_CH)

NOTE:: For DM646x the IN_VECTOR has changed

Definition at line 200 of file davinci_emac.c.

#define EMAC_DM646X_MAC_IN_VECTOR_STATPEND_INT   BIT(27)

Definition at line 203 of file davinci_emac.c.

#define EMAC_DM646X_MAC_IN_VECTOR_TX_INT_VEC   BIT(16 + EMAC_DEF_TX_CH)

Definition at line 201 of file davinci_emac.c.

#define EMAC_DM646X_MACCONTORL_GIG   BIT(7)

Definition at line 176 of file davinci_emac.c.

#define EMAC_DM646X_MACCONTORL_GIGFORCE   BIT(17)

Definition at line 177 of file davinci_emac.c.

#define EMAC_DM646X_MACEOIVECTOR   0x94

Definition at line 223 of file davinci_emac.c.

#define EMAC_EMCONTROL   0x168

Definition at line 239 of file davinci_emac.c.

#define EMAC_FIFOCONTROL   0x16C

Definition at line 240 of file davinci_emac.c.

#define EMAC_INT_MASK_CLEAR   (0xFF)

Definition at line 139 of file davinci_emac.c.

#define EMAC_MAC_HOST_ERR_INTMASK_VAL   (0x2)

Definition at line 137 of file davinci_emac.c.

#define EMAC_MACADDRHI   0x504

Definition at line 248 of file davinci_emac.c.

#define EMAC_MACADDRLO   0x500

Definition at line 247 of file davinci_emac.c.

#define EMAC_MACCONFIG   0x170

Definition at line 241 of file davinci_emac.c.

#define EMAC_MACCONTROL   0x160

Definition at line 237 of file davinci_emac.c.

#define EMAC_MACCONTROL_FULLDUPLEXEN   BIT(0)

Definition at line 172 of file davinci_emac.c.

#define EMAC_MACCONTROL_GIGABITEN   BIT(7)

Definition at line 171 of file davinci_emac.c.

#define EMAC_MACCONTROL_GMIIEN   BIT(5)

Definition at line 170 of file davinci_emac.c.

#define EMAC_MACCONTROL_RMIISPEED_MASK   BIT(15)

Definition at line 173 of file davinci_emac.c.

#define EMAC_MACCONTROL_TXPACEEN   BIT(6)

Definition at line 169 of file davinci_emac.c.

#define EMAC_MACCONTROL_TXPTYPE   BIT(9)

Definition at line 168 of file davinci_emac.c.

#define EMAC_MACHASH1   0x1D8

Definition at line 245 of file davinci_emac.c.

#define EMAC_MACHASH2   0x1DC

Definition at line 246 of file davinci_emac.c.

#define EMAC_MACINDEX   0x508

Definition at line 249 of file davinci_emac.c.

#define EMAC_MACINTMASKCLEAR   0xBC

Definition at line 228 of file davinci_emac.c.

#define EMAC_MACINTMASKSET   0xB8

Definition at line 227 of file davinci_emac.c.

#define EMAC_MACINTSTATMASKED   0xB4

Definition at line 226 of file davinci_emac.c.

#define EMAC_MACINTSTATRAW   0xB0

Definition at line 225 of file davinci_emac.c.

#define EMAC_MACINVECTOR   0x90

Definition at line 221 of file davinci_emac.c.

#define EMAC_MACSRCADDRHI   0x1D4

Definition at line 244 of file davinci_emac.c.

#define EMAC_MACSRCADDRLO   0x1D0

Definition at line 243 of file davinci_emac.c.

#define EMAC_MACSTATUS   0x164

Definition at line 238 of file davinci_emac.c.

#define EMAC_MACSTATUS_RXERRCH_MASK   (0x7)

Definition at line 186 of file davinci_emac.c.

#define EMAC_MACSTATUS_RXERRCH_SHIFT   (8)

Definition at line 187 of file davinci_emac.c.

#define EMAC_MACSTATUS_RXERRCODE_MASK   (0xF000)

Definition at line 184 of file davinci_emac.c.

#define EMAC_MACSTATUS_RXERRCODE_SHIFT   (12)

Definition at line 185 of file davinci_emac.c.

#define EMAC_MACSTATUS_TXERRCH_MASK   (0x7)

Definition at line 182 of file davinci_emac.c.

#define EMAC_MACSTATUS_TXERRCH_SHIFT   (16)

Definition at line 183 of file davinci_emac.c.

#define EMAC_MACSTATUS_TXERRCODE_MASK   (0xF00000)

Definition at line 180 of file davinci_emac.c.

#define EMAC_MACSTATUS_TXERRCODE_SHIFT   (20)

Definition at line 181 of file davinci_emac.c.

#define EMAC_MAJOR_VERSION   6

Definition at line 94 of file davinci_emac.c.

#define EMAC_MAX_TXRX_CHANNELS   (8) /* Max hardware channels */

Definition at line 217 of file davinci_emac.c.

#define EMAC_MBP_BCASTCHAN (   ch)    (((ch) & 0x7) << 8)

Definition at line 163 of file davinci_emac.c.

#define EMAC_MBP_MCASTCHAN (   ch)    ((ch) & 0x7)

Definition at line 165 of file davinci_emac.c.

#define EMAC_MBP_PROMISCCH (   ch)    (((ch) & 0x7) << 16)

Definition at line 161 of file davinci_emac.c.

#define EMAC_MBP_RXBCAST   (0x00002000)

Definition at line 162 of file davinci_emac.c.

#define EMAC_MBP_RXMCAST   (0x00000020)

Definition at line 164 of file davinci_emac.c.

#define EMAC_MBP_RXPROMISC   (0x00200000)

Definition at line 160 of file davinci_emac.c.

#define EMAC_MINOR_VERSION   1

Definition at line 95 of file davinci_emac.c.

#define EMAC_MODULE_VERSION   "6.1"

Definition at line 96 of file davinci_emac.c.

#define EMAC_MULTICAST_ADD   0

Definition at line 806 of file davinci_emac.c.

#define EMAC_MULTICAST_DEL   1

Definition at line 807 of file davinci_emac.c.

#define EMAC_NETOCTETS   0x280

Definition at line 278 of file davinci_emac.c.

#define EMAC_NUM_MULTICAST_BITS   (64)

Definition at line 134 of file davinci_emac.c.

#define EMAC_POLL_WEIGHT   (64) /* Default NAPI poll weight */

Definition at line 126 of file davinci_emac.c.

#define emac_read (   reg)    ioread32(priv->emac_base + (reg))

Definition at line 375 of file davinci_emac.c.

#define EMAC_RX_BD_BUF_SIZE   (0xFFFF)

Definition at line 212 of file davinci_emac.c.

#define EMAC_RX_BD_PKT_LENGTH_MASK   (0xFFFF)

Definition at line 214 of file davinci_emac.c.

#define EMAC_RX_BUFFER_OFFSET_MASK   (0xFFFF)

Definition at line 191 of file davinci_emac.c.

#define EMAC_RX_CONTROL_RX_ENABLE_VAL   (0x1)

Definition at line 136 of file davinci_emac.c.

#define EMAC_RX_MAX_LEN_MASK   (0xFFFF)

Definition at line 190 of file davinci_emac.c.

#define EMAC_RX_UNICAST_CLEAR_ALL   (0xFF)

Definition at line 138 of file davinci_emac.c.

#define EMAC_RXALIGNCODEERRORS   0x214

Definition at line 257 of file davinci_emac.c.

#define EMAC_RXBCASTFRAMES   0x204

Definition at line 253 of file davinci_emac.c.

#define EMAC_RXBUFFEROFFSET   0x110

Definition at line 234 of file davinci_emac.c.

#define EMAC_RXCRCERRORS   0x210

Definition at line 256 of file davinci_emac.c.

#define EMAC_RXDMAOVERRUNS   0x28C

Definition at line 281 of file davinci_emac.c.

#define EMAC_RXFILTERED   0x228

Definition at line 262 of file davinci_emac.c.

#define EMAC_RXFILTERLOWTHRESH   0x114

Definition at line 235 of file davinci_emac.c.

#define EMAC_RXFRAGMENTS   0x224

Definition at line 261 of file davinci_emac.c.

#define EMAC_RXGOODFRAMES   0x200

Definition at line 252 of file davinci_emac.c.

#define EMAC_RXJABBER   0x21C

Definition at line 259 of file davinci_emac.c.

#define EMAC_RXMAXLEN   0x10C

Definition at line 233 of file davinci_emac.c.

#define EMAC_RXMBP_BROADCH_MASK   (0x7 << 8)

Definition at line 153 of file davinci_emac.c.

#define EMAC_RXMBP_BROADCH_SHIFT   (8)

Definition at line 152 of file davinci_emac.c.

#define EMAC_RXMBP_BROADEN_MASK   BIT(13)

Definition at line 151 of file davinci_emac.c.

#define EMAC_RXMBP_CAFEN_MASK   BIT(21)

Definition at line 148 of file davinci_emac.c.

#define EMAC_RXMBP_CEFEN_MASK   BIT(22)

Definition at line 147 of file davinci_emac.c.

#define EMAC_RXMBP_CHMASK   (0x7)

Definition at line 157 of file davinci_emac.c.

#define EMAC_RXMBP_CMFEN_MASK   BIT(24)

Definition at line 145 of file davinci_emac.c.

#define EMAC_RXMBP_CSFEN_MASK   BIT(23)

Definition at line 146 of file davinci_emac.c.

#define EMAC_RXMBP_MULTICH_MASK   (0x7)

Definition at line 156 of file davinci_emac.c.

#define EMAC_RXMBP_MULTICH_SHIFT   (0)

Definition at line 155 of file davinci_emac.c.

#define EMAC_RXMBP_MULTIEN_MASK   BIT(5)

Definition at line 154 of file davinci_emac.c.

#define EMAC_RXMBP_NOCHAIN_MASK   BIT(28)

Definition at line 144 of file davinci_emac.c.

#define EMAC_RXMBP_PASSCRC_MASK   BIT(30)

Definition at line 142 of file davinci_emac.c.

#define EMAC_RXMBP_PROMCH_MASK   (0x7 << 16)

Definition at line 150 of file davinci_emac.c.

#define EMAC_RXMBP_PROMCH_SHIFT   (16)

Definition at line 149 of file davinci_emac.c.

#define EMAC_RXMBP_QOSEN_MASK   BIT(29)

Definition at line 143 of file davinci_emac.c.

#define EMAC_RXMBPENABLE   0x100

Definition at line 230 of file davinci_emac.c.

#define EMAC_RXMCASTFRAMES   0x208

Definition at line 254 of file davinci_emac.c.

#define EMAC_RXMOFOVERRUNS   0x288

Definition at line 280 of file davinci_emac.c.

#define EMAC_RXOCTETS   0x230

Definition at line 264 of file davinci_emac.c.

#define EMAC_RXOVERSIZED   0x218

Definition at line 258 of file davinci_emac.c.

#define EMAC_RXPAUSEFRAMES   0x20C

Definition at line 255 of file davinci_emac.c.

#define EMAC_RXQOSFILTERED   0x22C

Definition at line 263 of file davinci_emac.c.

#define EMAC_RXSOFOVERRUNS   0x284

Definition at line 279 of file davinci_emac.c.

#define EMAC_RXUNDERSIZED   0x220

Definition at line 260 of file davinci_emac.c.

#define EMAC_RXUNICASTCLEAR   0x108

Definition at line 232 of file davinci_emac.c.

#define EMAC_RXUNICASTSET   0x104

Definition at line 231 of file davinci_emac.c.

#define EMAC_SOFTRESET   0x174

Definition at line 242 of file davinci_emac.c.

#define EMAC_STATS_CLR_MASK   (0xFFFFFFFF)

Definition at line 313 of file davinci_emac.c.

#define EMAC_TX_CONTROL_TX_ENABLE_VAL   (0x1)

Definition at line 135 of file davinci_emac.c.

#define EMAC_TXBCASTFRAMES   0x238

Definition at line 266 of file davinci_emac.c.

#define EMAC_TXCARRIERSENSE   0x260

Definition at line 276 of file davinci_emac.c.

#define EMAC_TXCOLLISION   0x248

Definition at line 270 of file davinci_emac.c.

#define EMAC_TXDEFERRED   0x244

Definition at line 269 of file davinci_emac.c.

#define EMAC_TXEXCESSIVECOLL   0x254

Definition at line 273 of file davinci_emac.c.

#define EMAC_TXGOODFRAMES   0x234

Definition at line 265 of file davinci_emac.c.

#define EMAC_TXLATECOLL   0x258

Definition at line 274 of file davinci_emac.c.

#define EMAC_TXMCASTFRAMES   0x23C

Definition at line 267 of file davinci_emac.c.

#define EMAC_TXMULTICOLL   0x250

Definition at line 272 of file davinci_emac.c.

#define EMAC_TXOCTETS   0x264

Definition at line 277 of file davinci_emac.c.

#define EMAC_TXPAUSEFRAMES   0x240

Definition at line 268 of file davinci_emac.c.

#define EMAC_TXSINGLECOLL   0x24C

Definition at line 271 of file davinci_emac.c.

#define EMAC_TXUNDERRUN   0x25C

Definition at line 275 of file davinci_emac.c.

#define emac_write (   reg,
  val 
)    iowrite32(val, priv->emac_base + (reg))

Definition at line 376 of file davinci_emac.c.

Function Documentation

late_initcall ( davinci_emac_init  )
MODULE_AUTHOR ( "DaVinci EMAC Maintainer: Anant Gole <[email protected]>"  )
MODULE_AUTHOR ( "DaVinci EMAC Maintainer: Chaithrika U S <[email protected]>"  )
MODULE_DESCRIPTION ( "DaVinci EMAC Ethernet driver )
MODULE_DEVICE_TABLE ( of  ,
davinci_emac_of_match   
)
module_exit ( davinci_emac_exit  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug_level  ,
int  ,
 
)
MODULE_PARM_DESC ( debug_level  ,
"DaVinci EMAC debug level (NETIF_MSG bits)"   
)
MODULE_VERSION ( EMAC_MODULE_VERSION  )