bcm-v4

[Specification

chipphywr(phyaddr, reg, v)

write v to 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 I_MDIO into gmac core reg intstatus
  8. write PA_START to tmp
  9. binary or tmp with PA_WRITE
  10. binary or tmp with phyaddr shifted by PA_ADDR_SHIFT bytes
  11. binary or tmp with reg shifted by PA_REG_SHIFT bytes
  12. binary or tmp with v
  13. write tmp into reg at address phyaccess_addr
  14. Spinwait until reg at address phyaccess_addr has bit PA_START unset, at most 1000 usecs, with a delay of 10 usecs
  15. if reg at address phyaccess_addr has bit PA_START set
    1. write error message to log

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