阅读:1135回复:0
请教高人关于WinCE Eboot 启动搜索不到网卡无法实现镜像下载的问题
版主,你好,我是新手,刚接触Wince不久,最近碰见一个问题,想请教,也请各位高人指点一下。
我的开发板PXA270+网卡DM9000A,通过片选信号nCS2连接,GPIO 78。 请教各位,这个nCS2 GPIO要设置为输出,复选功能为2,在程序中应该在哪个位置设置。 我之前尝试在 (Platform目录)\src\common\xllp\source\xllp_pccardsocket.c文件中修改,如下函数 void XllpPCCardConfigureGPIOs(XLLP_PCCARDSOCKET_T *pstrSocketHandle) { XLLP_UINT32_T ulLockID; volatile XLLP_GPIO_T *vpstrBvdGPIORegs = (volatile XLLP_GPIO_T *)pstrSocketHandle->pstrGpioRegsHandle; // //Configure GPIO Output Set registers for active-low, output GPIO pins.This is a required //step for programming Bulverde GPIOs. // ulLockID = XllpLock(GPSR1); vpstrBvdGPIORegs->GPSR1 |= (XLLP_GPIO_BIT_PCMCIA_nPOE | XLLP_GPIO_BIT_nPWE | XLLP_GPIO_BIT_PCMCIA_nPIOR | XLLP_GPIO_BIT_PCMCIA_nPIOW | XLLP_GPIO_BIT_PCMCIA_nPCE2 | XLLP_GPIO_BIT_PCMCIA_nPREG); XllpUnlock(ulLockID); ulLockID = XllpLock(GPSR2); vpstrBvdGPIORegs->GPSR2 |= (XLLP_GPIO_BIT_PCMCIA_PSKTSEL | XLLP_GPIO_BIT_PCMCIA_nPCE1); XllpUnlock(ulLockID); ulLockID = XllpLock(GPSR3); vpstrBvdGPIORegs->GPSR3 |= (XLLP_GPIO_BIT_SCL |XLLP_GPIO_BIT_SDA); XllpUnlock(ulLockID); // //Configure GPIO pin directions // //PC Card interface GPIO Output pins: GPIO 50, 51, 54,55, 78 ,79and 85 //PC Card interface GPIO Input pins: GPIO 49,48,56 and 57 ulLockID = XllpLock(GPDR1); vpstrBvdGPIORegs->GPDR1 |= (XLLP_GPIO_BIT_PCMCIA_nPIOR | XLLP_GPIO_BIT_PCMCIA_nPIOW | XLLP_GPIO_BIT_PCMCIA_nPCE2 | XLLP_GPIO_BIT_PCMCIA_nPREG); vpstrBvdGPIORegs->GPDR1 &= ~(XLLP_GPIO_BIT_nPWE); vpstrBvdGPIORegs->GPDR1 &= ~(XLLP_GPIO_BIT_PCMCIA_nPOE); vpstrBvdGPIORegs->GPDR1 &= ~(XLLP_GPIO_BIT_PCMCIA_nPWAIT); vpstrBvdGPIORegs->GPDR1 &= ~(XLLP_GPIO_BIT_PCMCIA_nIOIS16); XllpUnlock(ulLockID); ulLockID = XllpLock(GPDR2); vpstrBvdGPIORegs->GPDR2 |= XLLP_GPIO_BIT_nCS2; vpstrBvdGPIORegs->GPDR2 |= XLLP_GPIO_BIT_PCMCIA_PSKTSEL; vpstrBvdGPIORegs->GPDR2 |= XLLP_GPIO_BIT_PCMCIA_nPCE1; XllpUnlock(ulLockID); ulLockID = XllpLock(GPDR3); vpstrBvdGPIORegs->GPDR3 |= XLLP_GPIO_BIT_SCL; vpstrBvdGPIORegs->GPDR3 |= XLLP_GPIO_BIT_SDA; XllpUnlock(ulLockID); // //Configure GPIO pin alternate functions // ulLockID = XllpLock(GAFR1_U); vpstrBvdGPIORegs->GAFR1_U &= 0xFFF00F00; //Clear the alternate function bits //for GPIO 48, 49, 50, 51, 54,55, 56 and 57 //Set Alternate Function 2 for GPIO 50, 51 and 55,Set Alternate Function 0 GPIO 48,49,54,55 vpstrBvdGPIORegs->GAFR1_U |= (XLLP_GPIO_AF_BIT_PCMCIA_nPIOR | XLLP_GPIO_AF_BIT_PCMCIA_nPIOW | XLLP_GPIO_AF_BIT_PCMCIA_nPCE2 | XLLP_GPIO_AF_BIT_PCMCIA_nPREG); //Set Alternate Function 1 for GPIO 56 and 57 vpstrBvdGPIORegs->GAFR1_U |= (XLLP_GPIO_AF_BIT_PCMCIA_nPWAIT | XLLP_GPIO_AF_BIT_PCMCIA_nIOIS16); XllpUnlock(ulLockID); ulLockID = XllpLock(GAFR2_L); vpstrBvdGPIORegs->GAFR2_L &= 0x0FFFFFFFF; //Clear the alternate function bits //for GPIO 79 //Set Alternate Function 2 for GPIO 78 vpstrBvdGPIORegs->GAFR2_L |= XLLP_GPIO_AF_BIT_nCS2; //Set Alternate Function 1 for GPIO 79 vpstrBvdGPIORegs->GAFR2_L |= XLLP_GPIO_AF_BIT_PCMCIA_PSKTSEL; XllpUnlock(ulLockID); EdbgOutputDebugString ("vpstrBvdGPIORegs->GPDR2 = 0x%x\r\n", vpstrBvdGPIORegs->GPDR2); EdbgOutputDebugString ("vpstrBvdGPIORegs->GAFR2_L = 0x%x\r\n", vpstrBvdGPIORegs->GAFR2_L); ulLockID = XllpLock(GAFR2_U); vpstrBvdGPIORegs->GAFR2_U &= 0xFFFFF3FF; //Clear the alternate function bits for GPIO 85 //Set Alternate Function 1 for GPIO 85 vpstrBvdGPIORegs->GAFR2_U |= XLLP_GPIO_AF_BIT_PCMCIA_nPCE1; XllpUnlock(ulLockID); ulLockID = XllpLock(GAFR3_U); vpstrBvdGPIORegs->GAFR3_U &= 0xFFFFC3FF; //Clear the alternate function bits for GPIO 117 and 118 //Set Alternate Function 1 for GPIO 117 and 118 vpstrBvdGPIORegs->GAFR3_U |= (XLLP_GPIO_AF_BIT_SCL |XLLP_GPIO_AF_BIT_SDA); XllpUnlock(ulLockID); } //end XllpPCCardConfigureGPIOs() 程序中加红色字体的就是我的设置,但是非常奇怪的是,每次调试到该代码,总是出错,程序无法执行下去,还有一个vpstrBvdGPIORegs->GAFR2_L |= XLLP_GPIO_AF_BIT_PCMCIA_PSKTSEL;这句话也会导致程序出错, 我怀疑是不是修改的位置不对,硬件应该是好的,因为跑过linux试过了。这个问题导致我的系统镜像下载不了,因为搜索不到网卡。 已经被困在这个位置有两周时间了,还请哪位高人指点一下,片选信号该在什么地方配置才正确, 还有,想请教一下,xlli_Bulverde_defs.inc和xlli_Mainstone_defs.inc这两个初始化配置文件是在什么时候被实现呢?是在系统一上电么? 谢谢,静候回音! |
|