📄 在vxworks中安装82559er网卡.txt
字号:
在VxWorks中安装82559ER网卡
1)把eeV_44_DRV.o文件拷贝到目录$(WIND_BASE)/target/lib/objPENTIUMgnuvx/中。
2)在BSP的makefile文件中修改MACH_EXTRA宏定义,如下:
MACH_EXTRA = $(WIND_BASE)/target/lib/objPENTIUMgnuvx/eeV_44_DRV.o
3)修改config.h中的DEFAULT_BOOT_LINE,类似如下(IP地址可根据实际环境修改):
#define DEFAULT_BOOT_LINE \
"eeE(0,0)host:vxWorks h=192.168.0.125 e=192.168.0.129 u=target pw=pass f=0x08 tn=VxTarget"
4)在config.h中的"/* Misc. options */"之前添加下面定义:
/* define the one you want to build for, undef the other */
/* also, in the Makefile, comment out the last MACH_EXTRA to build for eeV */
#undef INCLUDE_FEI /* include Intel Ether Express PRO100B PCI */
#define INCLUDE_EEV /* include Intel Ether Express PRO100B PCI */
#define INCLUDE_EEE_END /*hxy*/
#define INCLUDE_NETWORK
#define INCLUDE_PCI /* include PCI bus library
/* Misc. options */
5)在syslib.c中"#if defined (INCLUDE_FEI) || defined (INCLUDE_FEI_END)"宏定义段后面、
#ifdef INCLUDE_LN_97X_END之前添加:
#ifdef INCLUDE_EEV/*hxy*/
syseeVPciInit ();
#endif /* INCLUDE_EEV */
6)在sysNetIf.c中的#ifdef INCLUDE_FEI之前添加下面语句:
#ifdef INCLUDE_EEV/*hxy*/
#define INIT_STATE_MASK (VM_STATE_MASK_VALID | VM_STATE_MASK_WRITABLE | VM_STATE_MASK_CACHEABLE)
#define INIT_STATE (VM_STATE_VALID | VM_STATE_WRITABLE | VM_STATE_CACHEABLE_NOT)
/* these are also defined in equates.h */
/* we re-define them here so that users do not need our header file to build */
#define MAX_UNITS 4
#define PCI_VENDOR_ID 0x8086
#define PCI_DEVICE_ID 0x1229 /* 82559 (D101M or D101S) */
#define PCI_ER_DEVICE_ID 0x1209 /* 82559ER (D101ER) */
extern int eeE_board_pci_info[MAX_UNITS][3];
extern void *eeE_bdvect[];
extern int eeEboards;
/*******************************************************************************
*
* syseeVPciInit - prepare LAN adapter for eeV initialization
*
* This routine find out the PCI device, and map its memory and IO address.
* It must be done prior to initializing the eeV. Also
* must be done prior to MMU initialization, usrMmuInit().
* Also sets number of boards in system (eeEboards)
*
* RETURNS: N/A
*/
void syseeVPciInit (void)
{
char irq;
UINT32 membaseCsr;
int done = 0;
int count = 0;
UINT16 data;
int bus, dev, func;
/* Find the device and get bus, dev, func and figure out which device is first */
func = 0;
for ( bus = 0; bus < PCI_MAX_BUS; bus ++ )
{
for ( dev = 0; dev < PCI_MAX_DEV; dev++ )
{
pciConfigInWord (bus, dev, func, PCI_CFG_VENDOR_ID, &data);
if (data == PCI_VENDOR_ID)
{
pciConfigInWord (bus, dev, func, PCI_CFG_DEVICE_ID, &data);
if ((data == PCI_DEVICE_ID)||(data == PCI_ER_DEVICE_ID))
{
/* get memory base address */
pciConfigInLong (bus, dev, func, PCI_CFG_BASE_ADDRESS_0, &membaseCsr);
membaseCsr &= 0xFFFFFFF0;
/* get the irq level */
pciConfigInByte (bus, dev, func, PCI_CFG_DEV_INT_LINE, &irq);
/* add the entry to sysPhysMemDesc[] */
/* CHECK: this function only works for 1:1 mapping */
if (sysMmuMapAdd((void *)membaseCsr, (1024*4),
INIT_STATE_MASK, INIT_STATE) == ERROR) {
/* This error condition will be checked in the attach */
eeE_board_pci_info[count][0] = -1;
}
else {
/* This is the normal path of execution */
sysIntEnablePIC (irq);
eeE_board_pci_info[count][0] = bus;
}
eeE_board_pci_info[count][1] = dev;
eeE_board_pci_info[count][2] = func;
eeE_bdvect[count] = NULL;
eeEboards++;
if ((count++) == MAX_UNITS)
{
done = 1;
break;
}
}
}
}
if (done)
break;
}
}
void * eeV_PhysToVirt (UINT32 physaddr)
{
/* This is where you add your translation function */
return (void *)physaddr;
}
ulong_t eeV_VirtToPhys (void * virtaddr)
{
/* This is where you add your translation function */
return (ulong_t)virtaddr;
}
#endif /*INCLUDE_EEV*/
7)在configNet.h中的"#include "end.h" "后面添加:
#ifdef INCLUDE_EEE_END
#define EEE82559_LOAD_FUNC eeVEndLoad /* driver external interface*/
#define EEE82559_BUFF_LOAN 1 /* enable buffer loaning*/
/*
* The eeVEnd initialization string format is:
* <nCFDs>:<nRFDs>
*/
#define EEE82559_LOAD_STRING "0x30:0x30"
IMPORT END_OBJ* EEE82559_LOAD_FUNC (char*, void*);
#endif /* INCLUDE_EEE_END */
8)在configNet.h中的终端类型表"endDevTbl"中添加一个表行
#ifdef INCLUDE_EEE_END /*hxy*/
{ 0, EEE82559_LOAD_FUNC, EEE82559_LOAD_STRING, EEE82559_BUFF_LOAN,
NULL, FALSE},
#endif /* INCLUDE_EEE_END */
9)把eeV_44_DRV.o也编译到你的项目工程中,具体如下:
在你的Workspace的工程窗口中选择"build"页面,选中"default",点击右键,
在弹出的窗口中选择"Properties...",在"Properties..."窗口中选择"Macros"页面,
选择"EXTRA_MODULES"宏,修改其值为"$(WIND_BASE)/target/lib/objPENTIUMgnuvx/eeV_44_DRV.o",
然后点击"Add/Set"按钮(一定要按下该按钮,否则设置无效!!!),最后点击"OK"按钮完成设置。
10)最后重新生成启动盘,生成应用程序,用启动盘启动系统,就可以通过82559网卡加载VxWorks了。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -