• PUDN用户
    了解作者
  • C/C++
    开发工具
  • 478KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 22
    下载次数
  • 2010-08-21 21:06
    上传日期
这是本人在2440A下实现过的基于DM9000A网卡的VXWORKS的BSP包,很有用
s3c2440A.rar
  • s3c2440A
  • s3c2440x
  • sysALib.s
    7.8KB
  • romInit.s
    13.2KB
  • bootInit_uncmp.o
    1.3KB
  • sysLib.o
    28.9KB
  • romInit.o
    2.5KB
  • sysLib.c
    15.8KB
  • depend.s3c2440x
    46.8KB
  • 复件sysLib.c
    15.8KB
  • dm9kEnd.c
    48.9KB
  • README
    1KB
  • version.o
    792B
  • dm9kEnd.h
    9.8KB
  • s3c2440xSio.c
    20.3KB
  • dm9000end.c
    71.6KB
  • s3c2440xTimer.c
    11KB
  • configNet1.h
    1.2KB
  • s3c2440xIntrCtl.c
    6.3KB
  • Makefile
    2.1KB
  • dm9kEnd.c.bak
    47.4KB
  • s3c2440x.h
    21.2KB
  • configNet.h
    1.8KB
  • bootrom_uncmp.bin
    382.8KB
  • sysSerial.c
    4KB
  • bootrom_uncmp
    472.6KB
  • bootConfig.o
    29.8KB
  • s3c2440xSio.h
    4.4KB
  • config.h
    9.2KB
  • bootInit.o
    1.6KB
  • dm9kEnd.h.bak
    9.5KB
  • sysALib.o
    1.4KB
内容介绍
/* dm9000End.c - dm9000 END network interface driver */ /* Copyright Reserevd all by Davicom Semiconductor CO.,LTD */ /* V1.0 */ /* V1.1 2006/02/20 Bill */ /* V1.11 2006/04/14 JOB */ /* ADD DM9008A , DM900xA PCEL */ /* V1.2 2006/12/31 Landsailor */ /* Ported to ARM s3c2440a, corrected structure */ /* end_device align error; modified dmfe_start_xmit() */ /* and dm9000Int(), now can ping big packet(>1532); */ #include "copyright_wrs.h" #include "vxWorks.h" #include "stdlib.h" #include "cacheLib.h" #include "intLib.h" #include "end.h" /* Common END structures. */ #include "endLib.h" #include "lstLib.h" /* Needed to maintain protocol list. */ #include "wdLib.h" #include "iv.h" #include "semLib.h" #include "etherLib.h" #include "logLib.h" #include "netLib.h" #include "netBufLib.h" #include "stdio.h" #include "sysLib.h" #include "errno.h" #include "errnoLib.h" #include "memLib.h" #include "iosLib.h" #undef ETHER_MAP_IP_MULTICAST #include "etherMultiLib.h" /* multicast stuff. */ #include "end.h" #include "muxLib.h" #include "etherLib.h" #include "net/mbuf.h" #include "net/unixLib.h" #include "net/protosw.h" #include "net/systm.h" #include "net/if_subr.h" #include "net/route.h" #include "netinet/in.h" #include "sys/socket.h" #include "sys/ioctl.h" #include "sys/times.h" #include "arpLib.h" #include "config.h" IMPORT int endMultiLstCnt (END_OBJ* pEnd); #define EEmyMAC 0x00 #define EEmyIP 0x30 #define EEhostIP 0x34 /* defines */ #undef UCHAR #undef UWORD #define UCHAR unsigned char #define UWORD unsigned short #define DM9000_REG00 0x00 #define DM9000_REG05 0x31 /*clj SKIP_CRC/SKIP_LONG whz modify*/ #define DM9000_REG05_OFF 0x00 /*clj reset stop receive */ #define DM9000_REG08 0x27 /* SAILOR yuan 0x27 *//*old =0x3f */ #define DM9000_REG09 0x38 #define DM9000_REG0A 0x08 #define DM9000_REGFF 0x83 /*clj 0x8F IMR enable tr and re intrupt */ #define DM9000_REGFF_OFF 0x80 /*clj reset stop int request*/ #define DM9000_PHY 0x40 /* clj represent PHY address 0x01 bit 7,6 01 */ #define DM9000_PHY_OFF 0x01 /*clj powerdown the internal phy register*/ #define DM9000_PHY_ON 0x00 /*clj poweron the internal phy register*/ #define DM9000_PKT_MAX 1536 /* Received packet max size */ #define DM9000_PKT_RDY 0x01 /*clj regf0 bit[0]=1 indicate pkt-ready Packet ready to receive */ #define DM9000_10MHD 0x00 #define DM9000_100MHD 0x01 #define DM9000_10MFD 0x04 #define DM9000_100MFD 0x05 #define DM9000_AUTO 0x08 /*#define DM9008A 0x10 cljG*/ #define DM900xA_PECL 0x15 #define DM9000_MEDIA_MODE DM9000_AUTO #define DM9000_DEV_NAME "dm" #define DM9000_DEV_NAME_LEN 4 /*clj dmf's length*/ #define DM9000_BSAEADDR 0x20000000 #define DM9000_IOADDR DM9000_BSAEADDR + 0x0 /*cljG io addrbase*/ #define DM9000_IODATA DM9000_BSAEADDR + 0x4 /*cljG io database*/ /* Configuration items */ /*cljG*/ #ifndef ETHERMTU #define ETHERMTU (1500) #endif #ifndef ENET_HDR_REAL_SIZ #define ENET_HDR_REAL_SIZ 14 #endif #define END_BUFSIZ (ETHERMTU + ENET_HDR_REAL_SIZ + 6) /* 1500 + 14 + 6 */ #define EH_SIZE (14) #define END_SPEED_10M 10000000 /* 10Mbs */ #define END_SPEED_100M 100000000 /* 100Mbs */ #define END_SPEED END_SPEED_100M /*s3c2440a registers define*/ #undef rEXTINT0 #undef rEXTINT1 #undef rEXTINT2 #undef rGPFCON #undef rGPFDAT #undef rGPFUP #undef rSRCPND #undef rINTMOD #undef rINTMSK #undef rPRIORITY #undef rINTPND #undef rINTOFFSET #undef rSUBSRCPND #undef rINTSUBMSK #undef rEINTMASK #undef rEINTPEND #define rEXTINT0 (*(volatile unsigned long *)0x56000088) #define rEXTINT1 (*(volatile unsigned long *)0x5600008c) #define rEXTINT2 (*(volatile unsigned long *)0x56000090) #define rGPFCON (*(volatile unsigned long *)0x56000050) #define rGPFDAT (*(volatile unsigned long *)0x56000054) #define rGPFUP (*(volatile unsigned long *)0x56000058) #define rSRCPND (*(volatile unsigned long *)0x4a000000) #define rINTMOD (*(volatile unsigned long *)0x4a000004) #define rINTMSK (*(volatile unsigned long *)0x4a000008) #define rPRIORITY (*(volatile unsigned long *)0x4a00000c) #define rINTPND (*(volatile unsigned long *)0x4a000010) #define rINTOFFSET (*(volatile unsigned long *)0x4a000014) #define rSUBSRCPND (*(volatile unsigned long *)0x4a000018) #define rINTSUBMSK (*(volatile unsigned long *)0x4a00001c) #define rEINTMASK (*(volatile unsigned long *)0x560000a4) #define rEINTPEND (*(volatile unsigned long *)0x560000a8) #undef htons #define htons(x) ((((x)&0xff00)>>8)|((x)&0x00ff)<<8) /* Cache macros */ #define END_CACHE_INVALIDATE(address, len) \ CACHE_DRV_INVALIDATE (&pDrvCtrl->cacheFuncs, (address), (len)) #define END_CACHE_PHYS_TO_VIRT(address) \ CACHE_DRV_PHYS_TO_VIRT (&pDrvCtrl->cacheFuncs, (address)) #define END_CACHE_VIRT_TO_PHYS(address) \ CACHE_DRV_VIRT_TO_PHYS (&pDrvCtrl->cacheFuncs, (address)) /* * Default macro definitions for BSP interface. * These macros can be redefined in a wrapper file, to generate * a new module with an optimized interface. */ /* Macro to connect interrupt handler to vector */ #ifndef SYS_INT_CONNECT #define SYS_INT_CONNECT(pDrvCtrl,rtn,arg,pResult) \ { \ IMPORT STATUS intConnect(); \ *pResult = intConnect ((VOIDFUNCPTR *)INUM_TO_IVEC (pDrvCtrl->ivec), \ rtn, (int)arg); \ } #endif /* Macro to disconnect interrupt handler from vector */ #ifndef SYS_INT_DISCONNECT #define SYS_INT_DISCONNECT(pDrvCtrl,rtn,pResult) \ { \ *pResult = OK; /* HELP: need a real routine */ \ } #endif /* Macro to get the ethernet address from the BSP */ /* * Macros to do a short (UINT16) access to the chip. Default * assumes a normal memory mapped device. */ #ifndef DM9000_IN_ADDR /*clj*/ #define DM9000_IN_ADDR( addr ) \ (addr = *(volatile UCHAR *)(DM9000_IOADDR)) /*addr = sysInByte( (DM9000_IOADDR)); */ #endif #ifndef DM9000_OUT_ADDR /*clj*/ #define DM9000_OUT_ADDR( addr ) \ (*(volatile UCHAR *)(DM9000_IOADDR) = addr) /*sysOutByte(DM9000_IOADDR,addr);*/ #endif #ifndef DM9000_IN_BYTE /*clj*/ #define DM9000_IN_BYTE( data ) \ (data = *(volatile UCHAR *)(DM9000_IODATA)) /*data=sysInByte( (DM9000_IODATA)); */ #endif #ifndef DM9000_OUT_BYTE /*clj*/ #define DM9000_OUT_BYTE( data ) \ (*(volatile UCHAR *)(DM9000_IODATA) = data) /*sysOutByte( (DM9000_IODATA),(data))*/ #endif #ifndef DM9000_IN_WORD /*clj*/ #define DM9000_IN_WORD( data ) \ (data = *(volatile UWORD *)(DM9000_IODATA)) /*data = sysInWord( DM9000_IODATA);*/ #endif #ifndef DM9000_OUT_WORD /*clj*/ #define DM9000_OUT_WORD( data ) \ (*(volatile UWORD *)(DM9000_IODATA) = data) /*sysOutWord( (DM9000_IODATA),data);*/ #endif #ifndef DM9000_OUT_CHAR /*clj*/ #define DM9000_OUT_CHAR(addr,value)\ { \ (*(volatile UCHAR *)(DM9000_IOADDR) = addr); \ (*(volatile UCHAR *)(DM9000_IODATA) = value); \ } /*sysOutByte( DM9000_IOADDR,addr);\ sysOutByte( DM9000_IODATA,value);\ */ #endif #ifndef DM9000_IN_CHAR
评论
    相关推荐