DM9000A
APPLICATION NOTES
Preliminary 24
Version: DM9000A-AN-V121
November 27, 2007
udelay ( 40 );
iow ( 0x0B, 0 );
5. EE_PHY_H REG. 0EH for the high-byte of the SROM data, and
(UINT8) e2prom[i*2+1] = ior ( 0x0E );
EE_PHY_L REG. 0DH for the low-byte
(UINT8) e2prom[i*2] = ior( 0x0D );
For example, to read the MAC address from the SROM word address 0& 1& 2:
for ( i = 0; i < 3; i++ ) {
/* read Ethernet MAC address from SROM */
iow ( 0x0C, i );
iow ( 0x0B, 0x04 );
udelay ( 40 );
iow ( 0x0B, 0 );
/* read the SROM word data from EPDR to device address */
(UINT8) dev_addr[i*2+1] = ior ( 0x0E );/* the high byte of this 16-bit word */
(UINT8) dev_addr[i*2] = ior ( 0x0D );
/* the low byte of this 16-bit word */
}
5.3.2 HOWTO Write EEPROM Data
The following steps are to write data into the SROM:
Step 1: write the word address into EPAR REG. 0CH.
Step 2: write the data high byte into EE_PHY_H REG. 0EH, and the low byte to EE_PHY_L.
Step 3: write command= 0x12 into EPCR REG. 0BH to start the SROM + WRITE operation:
i. EPCR REG. 0BH WEP Bit [4] = 1: enable SROM WRITE operation.
ii. EPCR REG. 0BH EPOS Bit [3] = 0: select SROM mode (this is default: 0).
iii. EPCR (REG. 0BH) ERPRW Bit [1] = 1: issue WRITE command.
Step 4: read EPCR REG. 0BH and wait until ERRE Bit [0] = 0 ok, or just following Step 5.
Step 5: wait 500 us at least, then, write "0" into EPCR REG. 0BH to clear WRITE command.
HOWTO write 0x1E7 into SROM Word 0x06, Pin Control, shown as follows:
1.
write word address = 0x06 to EPAR REG. 0CH
iow ( 0x0C, 0x06 );