1 Accessing Configuration Registers

The configuration settings for the LAN8670/1/2 consist of a series of configuration register accesses performed through the Serial Management Interface (SMI). The register accesses must be written immediately following a power cycle or reset of the device and must be performed in the sequence provided in this application note. Details for accessing the configuration registers through the SMI may be found in the device data sheet.

The types of register functions utilized in the configuration include:

  • W – Write of value to specified register
  • R – Read of value from specified register
  • IR – Indirect read of value from specified register

Read Pseudocode

(uint16) value = read_register(uint8 mmd, uint16 addr)

Write Pseudocode

write_register(uint8 mmd, uint16 addr, uint16 value)

where:

mmd       MDIO Managed Device address of register
address   Address of the register to access
value     Value to be written to or read from the register at address

Indirect Read Pseudocode

Proprietary access mechanism. Do not confuse this with the Clause 22 indirect access to Clause 45 registers.

uint8 indirect_read(uint8 addr, uint8 mask)
{
      write_register(0x1F, 0x00D8, addr)
      write_register(0x1F, 0x00DA, 0x2)
      return (read_register(0x1F, 0x00D9) & mask)
}