dm9000连接在NGS1上
那么ethernetmembase 为0x08000000
Ethernetiobase 为 0x09000300
现在
dm9000c中对io口读的定义如下:
include <halether.h>
#define DM9000_ID 0x90000A46
// Hash creation constants.
//
#define CRC_PRIME 0xFFFFFFFF;
#define CRC_POLYNOMIAL 0x04C11DB6;
#define IOREAD(o) ((UCHAR)*((volatile UCHAR *)(o)))
#define IOWRITE(o, d) *((volatile UCHAR *)(o)) = (UCHAR)(d)
#define IOREAD16(o) ((USHORT)*((volatile USHORT *)(o)))
#define IOWRITE16(o, d) *((volatile USHORT *)(o)) = (USHORT)(d)
#define IOREAD32(o) ((ULONG)*((volatile ULONG *)(o)))
#define IOWRITE32(o, d) *((volatile ULONG *)(o)) = (ULONG)(d)
#define MEMREAD(o) ((USHORT)*((volatile USHORT *)(dwEthernetMemBase + (o))))
#define MEMWRITE(o, d) *((volatile USHORT *)(dwEthernetMemBase + (o))) = (USHORT)(d)
在probe函数中:
* return : TRUE, detect DM9000
* FALSE, Not find DM9000
*/
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;
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")));
}
return r;
}
可以探测到dm9000。输出id-val也是对的
为什么可以直接读寄存器而不是像cs8900中要加上Ethernetiobase
而且,我发现寄存器有些写入后读是正确的
有些写入后和读出的值不一致,
在发送数据的时候,在网卡芯片的txo+ txo-都没有示波器信号,求救啊
------解决方案--------------------
NGS1是什么东西?
先把你的平台说清楚,不是所有人都和你用一样的东西。
------解决方案--------------------
IOBASE就是片选地址吧。