|
EBOOT中在初始化DM9000之前读取其ID一直返回错误,下面是程序:
- uint8 ReadReg(uint8 offset)
- {
- *((volatile uint8 *)(IOBase)) = (uint8)(offset);
- return ((uint8)*((volatile uint8 *)(DataBase)));
- }
- static BOOL Probe(void)
- {
- BOOL r = FALSE;
- DWORD id_val;
-
- id_val = READ_REG1(0x28);
- id_val |= READ_REG1(0x29) << 8;
- id_val |= READ_REG1(0x2a) << 16;
- id_val |= READ_REG1(0x2b) << 24;
- EdbgOutputDebugString ( "id_val = %x\r\n", id_val);
- if (id_val == DM9000_ID) {
- RETAILMSG(1, (TEXT("INFO: Probe: DM9000 is detected.\r\n")));
- DM9000_rev = READ_REG1(0x2c);
-
- r = TRUE;
- }
- else {
- RETAILMSG(1, (TEXT("ERROR: Probe: Can not find DM9000.\r\n")));
- }
- //这里id应该是0x90000A46
- return r;
- }
复制代码
出错信息如下:
id_val = E0B0E0E0
ERROR: Probe: Can not find DM9000.
DM9000: MAC Address: 0:0:0:0:0:0
ERROR: InitEthDevice: Failed to initialize Ethernet controller.
ERROR: OEMPlatformInit: Failed to initialize Ethernet controller.
刚开始弄这个,有点摸不着头脑。
想问一下这个读取DM9000的错误是怎么回事?怎么修改?
还有和DM9000相关的控制寄存器是那些?在那里看呢?
我的平台是wince5.0+S3C2440.
|
|