Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
netx-eth.c File Reference
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/mii.h>
#include <asm/io.h>
#include <mach/hardware.h>
#include <mach/netx-regs.h>
#include <mach/pfifo.h>
#include <mach/xc.h>
#include <linux/platform_data/eth-netx.h>

Go to the source code of this file.

Data Structures

struct  netx_eth_priv
 

Macros

#define EMPTY_PTR_FIFO(xcno)   (0 + ((xcno) << 3)) /* Index of the empty pointer FIFO */
 
#define IND_FIFO_PORT_HI(xcno)   (1 + ((xcno) << 3)) /* Index of the FIFO where received */
 
#define IND_FIFO_PORT_LO(xcno)   (2 + ((xcno) << 3)) /* Index of the FIFO where received */
 
#define REQ_FIFO_PORT_HI(xcno)   (3 + ((xcno) << 3)) /* Index of the FIFO where Data packages */
 
#define REQ_FIFO_PORT_LO(xcno)   (4 + ((xcno) << 3)) /* Index of the FIFO where Data packages */
 
#define CON_FIFO_PORT_HI(xcno)   (5 + ((xcno) << 3)) /* Index of the FIFO where sent Data packages */
 
#define CON_FIFO_PORT_LO(xcno)   (6 + ((xcno) << 3)) /* Index of the FIFO where sent Data */
 
#define PFIFO_MASK(xcno)   (0x7f << (xcno*8))
 
#define FIFO_PTR_FRAMELEN_SHIFT   0
 
#define FIFO_PTR_FRAMELEN_MASK   (0x7ff << 0)
 
#define FIFO_PTR_FRAMELEN(len)   (((len) << 0) & FIFO_PTR_FRAMELEN_MASK)
 
#define FIFO_PTR_TIMETRIG   (1<<11)
 
#define FIFO_PTR_MULTI_REQ
 
#define FIFO_PTR_ORIGIN   (1<<14)
 
#define FIFO_PTR_VLAN   (1<<15)
 
#define FIFO_PTR_FRAMENO_SHIFT   16
 
#define FIFO_PTR_FRAMENO_MASK   (0x3f << 16)
 
#define FIFO_PTR_FRAMENO(no)   (((no) << 16) & FIFO_PTR_FRAMENO_MASK)
 
#define FIFO_PTR_SEGMENT_SHIFT   22
 
#define FIFO_PTR_SEGMENT_MASK   (0xf << 22)
 
#define FIFO_PTR_SEGMENT(seg)   (((seg) & 0xf) << 22)
 
#define FIFO_PTR_ERROR_SHIFT   28
 
#define FIFO_PTR_ERROR_MASK   (0xf << 28)
 
#define ISR_LINK_STATUS_CHANGE   (1<<4)
 
#define ISR_IND_LO   (1<<3)
 
#define ISR_CON_LO   (1<<2)
 
#define ISR_IND_HI   (1<<1)
 
#define ISR_CON_HI   (1<<0)
 
#define ETH_MAC_LOCAL_CONFIG   0x1560
 
#define ETH_MAC_4321   0x1564
 
#define ETH_MAC_65   0x1568
 
#define MAC_TRAFFIC_CLASS_ARRANGEMENT_SHIFT   16
 
#define MAC_TRAFFIC_CLASS_ARRANGEMENT_MASK   (0xf<<MAC_TRAFFIC_CLASS_ARRANGEMENT_SHIFT)
 
#define MAC_TRAFFIC_CLASS_ARRANGEMENT(x)   (((x)<<MAC_TRAFFIC_CLASS_ARRANGEMENT_SHIFT) & MAC_TRAFFIC_CLASS_ARRANGEMENT_MASK)
 
#define LOCAL_CONFIG_LINK_STATUS_IRQ_EN   (1<<24)
 
#define LOCAL_CONFIG_CON_LO_IRQ_EN   (1<<23)
 
#define LOCAL_CONFIG_CON_HI_IRQ_EN   (1<<22)
 
#define LOCAL_CONFIG_IND_LO_IRQ_EN   (1<<21)
 
#define LOCAL_CONFIG_IND_HI_IRQ_EN   (1<<20)
 
#define CARDNAME   "netx-eth"
 
#define INTERNAL_PHY_ADR   0x1c
 

Functions

 module_init (netx_eth_init)
 
 module_exit (netx_eth_cleanup)
 
 MODULE_AUTHOR ("Sascha Hauer, Pengutronix")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:"CARDNAME)
 
 MODULE_FIRMWARE ("xc0.bin")
 
 MODULE_FIRMWARE ("xc1.bin")
 
 MODULE_FIRMWARE ("xc2.bin")
 

Macro Definition Documentation

#define CARDNAME   "netx-eth"

Definition at line 92 of file netx-eth.c.

#define CON_FIFO_PORT_HI (   xcno)    (5 + ((xcno) << 3)) /* Index of the FIFO where sent Data packages */

Definition at line 51 of file netx-eth.c.

#define CON_FIFO_PORT_LO (   xcno)    (6 + ((xcno) << 3)) /* Index of the FIFO where sent Data */

Definition at line 53 of file netx-eth.c.

#define EMPTY_PTR_FIFO (   xcno)    (0 + ((xcno) << 3)) /* Index of the empty pointer FIFO */

Definition at line 40 of file netx-eth.c.

#define ETH_MAC_4321   0x1564

Definition at line 80 of file netx-eth.c.

#define ETH_MAC_65   0x1568

Definition at line 81 of file netx-eth.c.

#define ETH_MAC_LOCAL_CONFIG   0x1560

Definition at line 79 of file netx-eth.c.

#define FIFO_PTR_ERROR_MASK   (0xf << 28)

Definition at line 71 of file netx-eth.c.

#define FIFO_PTR_ERROR_SHIFT   28

Definition at line 70 of file netx-eth.c.

#define FIFO_PTR_FRAMELEN (   len)    (((len) << 0) & FIFO_PTR_FRAMELEN_MASK)

Definition at line 59 of file netx-eth.c.

#define FIFO_PTR_FRAMELEN_MASK   (0x7ff << 0)

Definition at line 58 of file netx-eth.c.

#define FIFO_PTR_FRAMELEN_SHIFT   0

Definition at line 57 of file netx-eth.c.

#define FIFO_PTR_FRAMENO (   no)    (((no) << 16) & FIFO_PTR_FRAMENO_MASK)

Definition at line 66 of file netx-eth.c.

#define FIFO_PTR_FRAMENO_MASK   (0x3f << 16)

Definition at line 65 of file netx-eth.c.

#define FIFO_PTR_FRAMENO_SHIFT   16

Definition at line 64 of file netx-eth.c.

#define FIFO_PTR_MULTI_REQ

Definition at line 61 of file netx-eth.c.

#define FIFO_PTR_ORIGIN   (1<<14)

Definition at line 62 of file netx-eth.c.

#define FIFO_PTR_SEGMENT (   seg)    (((seg) & 0xf) << 22)

Definition at line 69 of file netx-eth.c.

#define FIFO_PTR_SEGMENT_MASK   (0xf << 22)

Definition at line 68 of file netx-eth.c.

#define FIFO_PTR_SEGMENT_SHIFT   22

Definition at line 67 of file netx-eth.c.

#define FIFO_PTR_TIMETRIG   (1<<11)

Definition at line 60 of file netx-eth.c.

#define FIFO_PTR_VLAN   (1<<15)

Definition at line 63 of file netx-eth.c.

#define IND_FIFO_PORT_HI (   xcno)    (1 + ((xcno) << 3)) /* Index of the FIFO where received */

Definition at line 41 of file netx-eth.c.

#define IND_FIFO_PORT_LO (   xcno)    (2 + ((xcno) << 3)) /* Index of the FIFO where received */

Definition at line 43 of file netx-eth.c.

#define INTERNAL_PHY_ADR   0x1c

Definition at line 95 of file netx-eth.c.

#define ISR_CON_HI   (1<<0)

Definition at line 77 of file netx-eth.c.

#define ISR_CON_LO   (1<<2)

Definition at line 75 of file netx-eth.c.

#define ISR_IND_HI   (1<<1)

Definition at line 76 of file netx-eth.c.

#define ISR_IND_LO   (1<<3)

Definition at line 74 of file netx-eth.c.

#define ISR_LINK_STATUS_CHANGE   (1<<4)

Definition at line 73 of file netx-eth.c.

#define LOCAL_CONFIG_CON_HI_IRQ_EN   (1<<22)

Definition at line 88 of file netx-eth.c.

#define LOCAL_CONFIG_CON_LO_IRQ_EN   (1<<23)

Definition at line 87 of file netx-eth.c.

#define LOCAL_CONFIG_IND_HI_IRQ_EN   (1<<20)

Definition at line 90 of file netx-eth.c.

#define LOCAL_CONFIG_IND_LO_IRQ_EN   (1<<21)

Definition at line 89 of file netx-eth.c.

#define LOCAL_CONFIG_LINK_STATUS_IRQ_EN   (1<<24)

Definition at line 86 of file netx-eth.c.

#define MAC_TRAFFIC_CLASS_ARRANGEMENT (   x)    (((x)<<MAC_TRAFFIC_CLASS_ARRANGEMENT_SHIFT) & MAC_TRAFFIC_CLASS_ARRANGEMENT_MASK)

Definition at line 85 of file netx-eth.c.

#define MAC_TRAFFIC_CLASS_ARRANGEMENT_MASK   (0xf<<MAC_TRAFFIC_CLASS_ARRANGEMENT_SHIFT)

Definition at line 84 of file netx-eth.c.

#define MAC_TRAFFIC_CLASS_ARRANGEMENT_SHIFT   16

Definition at line 83 of file netx-eth.c.

#define PFIFO_MASK (   xcno)    (0x7f << (xcno*8))

Definition at line 55 of file netx-eth.c.

#define REQ_FIFO_PORT_HI (   xcno)    (3 + ((xcno) << 3)) /* Index of the FIFO where Data packages */

Definition at line 45 of file netx-eth.c.

#define REQ_FIFO_PORT_LO (   xcno)    (4 + ((xcno) << 3)) /* Index of the FIFO where Data packages */

Definition at line 48 of file netx-eth.c.

Function Documentation

MODULE_ALIAS ( "platform:"  CARDNAME)
MODULE_AUTHOR ( "Sascha  Hauer,
Pengutronix"   
)
module_exit ( netx_eth_cleanup  )
MODULE_FIRMWARE ( "xc0.bin"  )
MODULE_FIRMWARE ( "xc1.bin"  )
MODULE_FIRMWARE ( "xc2.bin"  )
module_init ( netx_eth_init  )
MODULE_LICENSE ( "GPL"  )