|
RT,平台是2440+wince5.0,现在想在eboot中通过以太网下载映像,在网上找了DM9000中的代码,把iobase修改了下,读取ID正确,然后经过下面配置后:
- /* set the internal PHY power-on, GPIOs normal */
- WRITE_REG1(0x1f, 0x0); /* GPR (reg_1Fh)bit GPIO0=0 pre-activate PHY */
- DM9000_Delay(200000000);
-
- /* do a software reset */
- WRITE_REG1(0x0, 3); /* NCR (reg_00h) bit[0] RST=1 & Loopback=1, reset on */
- DM9000_Delay(200000000);
-
- WRITE_REG1(0x0, 3); /* NCR (reg_00h) bit[0] RST=1 & Loopback=1, reset on */
- DM9000_Delay(200000000);
-
- /* I/O mode */
- DM9000_iomode = READ_REG1(0xfe) >> 6; /* ISR bit7:6 keeps I/O mode */
- //Add by lihao
- WRITE_REG1(0x1e,(1<<0));
- WRITE_REG1(0x1f,0x0);
- //Add end
-
- /* Program operating register */
- WRITE_REG1(0x0, 0);
- WRITE_REG1(0x02, 0); /* TX Polling clear */
- WRITE_REG1(0x2f, 0); /* Special Mode */
- WRITE_REG1(0x01, 0x2c); /* clear TX status */
- WRITE_REG1(0xfe, 0x0f); /* Clear interrupt status */
-
- /* Set address filter table */
- dm9000_hash_table(MacAddr);
-
- /* Activate DM9000A/DM9010 */
- WRITE_REG1(0x05, 0x30 | 1); /* Discard long packet and CRC error packets*//* RX enable */
- WRITE_REG1(0xff, 0x80); /* Enable SRAM automatically return */
- RETAILMSG(1, (TEXT("<>DM9000DBG_Init: wait link.\r\n")));
- /* wait link ok */
- while(1)
- {
- //RETAILMSG(1, (TEXT("<>DM9000DBG_Init: READ_REG1(0x01) = 0x%x!\r\n"),READ_REG1(0x01)));
- if(READ_REG1(0x01) & 0x40)
- break;
- DM9000_Delay(200000000);
- }
- RETAILMSG(1, (TEXT("<>DM9000DBG_Init: link ok!!!.\r\n")));
复制代码
不知道哪位兄弟做过这方面的,给点意见··
|
|