DM9000A
APPLICATION NOTES
Preliminary 25
Version: DM9000A-AN-V121
November 27, 2007
2. write the high-byte 0x01 into EE_PHY_H, and the low-byte 0xE7 into EE_PHY_L
iow ( 0x0E, 0x01 );
iow ( 0x0D, 0xE7 );
3. write the SROM + WRITE command = 0x12 into EPCR REG. 0BH
iow ( 0x0B, ( 0x02 | 0x10 ) );
4.
wait until EPCR (REG. 0BH) ERRE Bit [0] = 0 ok, or just following Step 5
do { udelay ( 10 ); i++; } while ( ( i < 500 ) && ( inb ( 4 ) & 1 ) );
5.
delay 500 us at least, then write "0" into EPCR REG. 0BH
udelay ( 60000 );
iow ( 0x0B, 0 );
For example, to write Ethernet node address 00:E0:63:0E:56:78 into SROM Word 0& 1& 2:
srom_write ( 0x00, 0xE000 );
/* Word 0: low-byte = 00, high-byte = E0 */
srom_write ( 0x01, 0x0E63 );
/* Word 1: low-byte = 63, high-byte = 0E */
srom_write ( 0x02, 0x7856 );
/* Word 2: low-byte = 56, high-byte = 78 */
void srom_write ( int offset, UINT16 dataW )
{
UINT16
i,
tmpv;
/* write the SROM word address into EPAR REG. 0CH */
iow ( 0x0C, offset );
/* write the high-byte to EE_PHY_H REG. 0EH, low-byte to EE_PHY_L REG. 0DH */
iow ( 0x0D, dataW & 0xff );
/* the low-byte of this 16-bit word */
iow ( 0x0E, (dataW >> 8) & 0xff ); /* the high-byte of this 16-bit word */
/* issue the SROM + WRITE command = 0x12 into EPCR REG. 0BH */
iow ( 0x0B, 0x02 | 0x10 );
/* wait >500 us for SROM + WRITE completed then write "0" to clear command */
do { udelay (10); tmpv= inb (4); i++; } while ( (i < 500) && (tmpv & 1) );
udelay ( 60000 );
iow( 0x0B, 0 );
}