我用S3C44B0X读CS8900的ID总是读不出来,读到的总是0x4100肯定不对应该是630e。所以在网上参考了下面这段在2410上有人成功的程序
#define CS8900_BASE (*(volatile unsigned short*)0x06000000)
#define EthIOAddr (*(volatile unsigned short*)0x06000300)
#define EthPPP (*(volatile unsigned short*)0x0600030a)
#define EthPPD0 (*(volatile unsigned short*)0x0600030c)
void Test_CS8900(void){
rBWSCON = rBWSCON & ~(0xf << 12) | (0xd << 12); //nGCS3=nUB/nLB(sSBHE),nWAIT,16-bit
rBANKCON3 = (0 << 13) | (3 << 11) | (7 << 8) | (1 << 6) | (0 << 4) | (3 << 2) | 0;
EthPPP = 0;
Uart_Printf("CS8900A ChipID1 is %x ", EthPPD0);//打印ID
EthPPP = 2;
Uart_Printf("CS8900A ChipID2 is %x ", EthPPD0);
}
我接的是BANK3,44B0的BANK3的内存地址是0x06000000。
但是还是不对,所以请教一下各位前辈。 |