bcm-v4

[Specification

chipphyrd(phyaddr, reg)

Read something from the phy

  1. if corerev is 0x80000000
    1. set phycontrol_addr to address of gmac common reg phycontrol
    2. set phyaccess_addr to address of gmac common reg phyaccess
  2. else
    1. set phycontrol_addr to address of gmac core reg phycontrol
    2. set phyaccess_addr to address of gmac core reg phyaccess
  3. write value from address phycontrol_addr into tmp
  4. binary and tmp with negation of 0x1f
  5. binary or tmp with phyaddr
  6. write tmp into reg at address phycontrol_addr
  7. write PA_START to tmp
  8. binary or tmp with phyaddr shifted by PA_ADDR_SHIFT bytes
  9. binary or tmp with reg shifted by PA_REG_SHIFT bytes
  10. write tmp into reg at address phyaccess_addr
  11. Spinwait until reg at address phyaccess_addr has bit PA_START unset, at most 1000 usecs, with a delay of 10 usecs
  12. write value of reg at address phyaccess_addr into tmp
  13. if bit PA_START is set in tmp
    1. return 0xffff, because of an error
  14. binary or tmp with PA_DATA_MASK and return it

Exported/Archived from the wiki to HTML on 2016-10-27