Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
fec.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/clk.h>
#include <linux/platform_device.h>
#include <linux/phy.h>
#include <linux/fec.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/of_net.h>
#include <linux/pinctrl/consumer.h>
#include <linux/regulator/consumer.h>
#include <asm/cacheflush.h>
#include <asm/coldfire.h>
#include <asm/mcfsim.h>
#include "fec.h"

Go to the source code of this file.

Data Structures

struct  fec_enet_private
 

Macros

#define FEC_ALIGNMENT   0x3
 
#define DRIVER_NAME   "fec"
 
#define FEC_QUIRK_ENET_MAC   (1 << 0)
 
#define FEC_QUIRK_SWAP_FRAME   (1 << 1)
 
#define FEC_QUIRK_USE_GASKET   (1 << 2)
 
#define FEC_QUIRK_HAS_GBIT   (1 << 3)
 
#define FEC_ENET_RX_PAGES   8
 
#define FEC_ENET_RX_FRSIZE   2048
 
#define FEC_ENET_RX_FRPPG   (PAGE_SIZE / FEC_ENET_RX_FRSIZE)
 
#define RX_RING_SIZE   (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES)
 
#define FEC_ENET_TX_FRSIZE   2048
 
#define FEC_ENET_TX_FRPPG   (PAGE_SIZE / FEC_ENET_TX_FRSIZE)
 
#define TX_RING_SIZE   16 /* Must be power of two */
 
#define TX_RING_MOD_MASK   15 /* for this to work */
 
#define FEC_ENET_HBERR   ((uint)0x80000000) /* Heartbeat error */
 
#define FEC_ENET_BABR   ((uint)0x40000000) /* Babbling receiver */
 
#define FEC_ENET_BABT   ((uint)0x20000000) /* Babbling transmitter */
 
#define FEC_ENET_GRA   ((uint)0x10000000) /* Graceful stop complete */
 
#define FEC_ENET_TXF   ((uint)0x08000000) /* Full frame transmitted */
 
#define FEC_ENET_TXB   ((uint)0x04000000) /* A buffer was transmitted */
 
#define FEC_ENET_RXF   ((uint)0x02000000) /* Full frame received */
 
#define FEC_ENET_RXB   ((uint)0x01000000) /* A buffer was received */
 
#define FEC_ENET_MII   ((uint)0x00800000) /* MII interrupt */
 
#define FEC_ENET_EBERR   ((uint)0x00400000) /* SDMA bus error */
 
#define FEC_DEFAULT_IMASK   (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII)
 
#define PKT_MAXBUF_SIZE   1518
 
#define PKT_MINBUF_SIZE   64
 
#define PKT_MAXBLR_SIZE   1520
 
#define FEC_IRQ_NUM   3
 
#define OPT_FRAME_SIZE   0
 
#define FEC_MMFR_ST   (1 << 30)
 
#define FEC_MMFR_OP_READ   (2 << 28)
 
#define FEC_MMFR_OP_WRITE   (1 << 28)
 
#define FEC_MMFR_PA(v)   ((v & 0x1f) << 23)
 
#define FEC_MMFR_RA(v)   ((v & 0x1f) << 18)
 
#define FEC_MMFR_TA   (2 << 16)
 
#define FEC_MMFR_DATA(v)   (v & 0xffff)
 
#define FEC_MII_TIMEOUT   30000 /* us */
 
#define TX_TIMEOUT   (2 * HZ)
 
#define HASH_BITS   6 /* #bits in hash */
 
#define CRC32_POLY   0xEDB88320
 

Enumerations

enum  imx_fec_type { IMX25_FEC = 1, IMX27_FEC, IMX28_FEC, IMX6Q_FEC }
 

Functions

 MODULE_DEVICE_TABLE (platform, fec_devtype)
 
 MODULE_DEVICE_TABLE (of, fec_dt_ids)
 
 module_param_array (macaddr, byte, NULL, 0)
 
 MODULE_PARM_DESC (macaddr,"FEC Ethernet MAC address")
 
 module_platform_driver (fec_driver)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define CRC32_POLY   0xEDB88320

Definition at line 1307 of file fec.c.

#define DRIVER_NAME   "fec"

Definition at line 69 of file fec.c.

#define FEC_ALIGNMENT   0x3

Definition at line 66 of file fec.c.

#define FEC_DEFAULT_IMASK   (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII)

Definition at line 174 of file fec.c.

#define FEC_ENET_BABR   ((uint)0x40000000) /* Babbling receiver */

Definition at line 164 of file fec.c.

#define FEC_ENET_BABT   ((uint)0x20000000) /* Babbling transmitter */

Definition at line 165 of file fec.c.

#define FEC_ENET_EBERR   ((uint)0x00400000) /* SDMA bus error */

Definition at line 172 of file fec.c.

#define FEC_ENET_GRA   ((uint)0x10000000) /* Graceful stop complete */

Definition at line 166 of file fec.c.

#define FEC_ENET_HBERR   ((uint)0x80000000) /* Heartbeat error */

Definition at line 163 of file fec.c.

#define FEC_ENET_MII   ((uint)0x00800000) /* MII interrupt */

Definition at line 171 of file fec.c.

#define FEC_ENET_RX_FRPPG   (PAGE_SIZE / FEC_ENET_RX_FRSIZE)

Definition at line 151 of file fec.c.

#define FEC_ENET_RX_FRSIZE   2048

Definition at line 150 of file fec.c.

#define FEC_ENET_RX_PAGES   8

Definition at line 149 of file fec.c.

#define FEC_ENET_RXB   ((uint)0x01000000) /* A buffer was received */

Definition at line 170 of file fec.c.

#define FEC_ENET_RXF   ((uint)0x02000000) /* Full frame received */

Definition at line 169 of file fec.c.

#define FEC_ENET_TX_FRPPG   (PAGE_SIZE / FEC_ENET_TX_FRSIZE)

Definition at line 154 of file fec.c.

#define FEC_ENET_TX_FRSIZE   2048

Definition at line 153 of file fec.c.

#define FEC_ENET_TXB   ((uint)0x04000000) /* A buffer was transmitted */

Definition at line 168 of file fec.c.

#define FEC_ENET_TXF   ((uint)0x08000000) /* Full frame transmitted */

Definition at line 167 of file fec.c.

#define FEC_IRQ_NUM   3

Definition at line 183 of file fec.c.

#define FEC_MII_TIMEOUT   30000 /* us */

Definition at line 261 of file fec.c.

#define FEC_MMFR_DATA (   v)    (v & 0xffff)

Definition at line 259 of file fec.c.

#define FEC_MMFR_OP_READ   (2 << 28)

Definition at line 254 of file fec.c.

#define FEC_MMFR_OP_WRITE   (1 << 28)

Definition at line 255 of file fec.c.

#define FEC_MMFR_PA (   v)    ((v & 0x1f) << 23)

Definition at line 256 of file fec.c.

#define FEC_MMFR_RA (   v)    ((v & 0x1f) << 18)

Definition at line 257 of file fec.c.

#define FEC_MMFR_ST   (1 << 30)

Definition at line 253 of file fec.c.

#define FEC_MMFR_TA   (2 << 16)

Definition at line 258 of file fec.c.

#define FEC_QUIRK_ENET_MAC   (1 << 0)

Definition at line 72 of file fec.c.

#define FEC_QUIRK_HAS_GBIT   (1 << 3)

Definition at line 78 of file fec.c.

#define FEC_QUIRK_SWAP_FRAME   (1 << 1)

Definition at line 74 of file fec.c.

#define FEC_QUIRK_USE_GASKET   (1 << 2)

Definition at line 76 of file fec.c.

#define HASH_BITS   6 /* #bits in hash */

Definition at line 1306 of file fec.c.

#define OPT_FRAME_SIZE   0

Definition at line 194 of file fec.c.

#define PKT_MAXBLR_SIZE   1520

Definition at line 180 of file fec.c.

#define PKT_MAXBUF_SIZE   1518

Definition at line 178 of file fec.c.

#define PKT_MINBUF_SIZE   64

Definition at line 179 of file fec.c.

#define RX_RING_SIZE   (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES)

Definition at line 152 of file fec.c.

#define TX_RING_MOD_MASK   15 /* for this to work */

Definition at line 156 of file fec.c.

#define TX_RING_SIZE   16 /* Must be power of two */

Definition at line 155 of file fec.c.

#define TX_TIMEOUT   (2 * HZ)

Definition at line 264 of file fec.c.

Enumeration Type Documentation

Enumerator:
IMX25_FEC 
IMX27_FEC 
IMX28_FEC 
IMX6Q_FEC 

Definition at line 103 of file fec.c.

Function Documentation

MODULE_DEVICE_TABLE ( platform  ,
fec_devtype   
)
MODULE_DEVICE_TABLE ( of  ,
fec_dt_ids   
)
MODULE_LICENSE ( "GPL"  )
module_param_array ( macaddr  ,
byte  ,
NULL  ,
 
)
MODULE_PARM_DESC ( macaddr  ,
"FEC Ethernet MAC address  
)
module_platform_driver ( fec_driver  )