/***************************************************************************** * * ip_phySet - Modify the value of a PHY register (debug only). */ void ip_phySet(int phyUnit, UINT32 regnum, UINT32 value) { UINT32 phyBase; UINT32 phyAddr; if (ip_validPhyId(phyUnit)) { phyBase = IP_PHYBASE(phyUnit); phyAddr = IP_PHYADDR(phyUnit); phyRegWrite(phyBase, phyAddr, regnum, value); } }
/***************************************************************************** * * ip_phySet - Modify the value of a PHY register (debug only). */ void ip_phySet(int phyUnit, uint32_t regnum, uint32_t value) { uint32_t phyBase; uint32_t phyAddr; if (ip_validPhyId(phyUnit)) { phyBase = IP_PHYBASE(phyUnit); phyAddr = IP_PHYADDR(phyUnit); phy_reg_write(phyBase, phyAddr, regnum, value); } }
/***************************************************************************** * * ip_phyShow - Dump the state of a PHY. * There are two sets of registers for each phy port: * "phy registers" and * "switch port registers" * We dump 'em all, plus the switch global registers. */ void ip_phyShow(int phyUnit) { int i; UINT16 value; UINT32 phyBase; UINT32 phyAddr; if (!ip_validPhyId(phyUnit)) { return; } phyBase = IP_PHYBASE(phyUnit); phyAddr = IP_PHYADDR(phyUnit); printf("PHY state for PHY%d (enet%d, phyBase 0x%8x, phyAddr 0x%x)\n", phyUnit, IP_ETHUNIT(phyUnit), IP_PHYBASE(phyUnit), IP_PHYADDR(phyUnit)); printf("PHY Registers:\n"); for (i=0; i < ipPhyNumRegs; i++) { value = phyRegRead(phyBase, phyAddr, ipPhyRegisterTable[i].regNum); printf("Reg %02d (0x%02x) %s = 0x%08x\n", ipPhyRegisterTable[i].regNum, ipPhyRegisterTable[i].regNum, ipPhyRegisterTable[i].regIdString, value); } phyBase = IP_GLOBALREGBASE; printf("Switch Global Registers:\n"); printf("Phy29 Registers:\n"); for (i=0; i < ipPhy29GlobalNumRegs; i++) { value = phyRegRead(phyBase, IP_GLOBAL_PHY29_ADDR, ipPhy29GlobalRegisterTable[i].regNum); printf("Reg %02d (0x%02x) %s = 0x%08x\n", ipPhy29GlobalRegisterTable[i].regNum, ipPhy29GlobalRegisterTable[i].regNum, ipPhy29GlobalRegisterTable[i].regIdString, value); } printf("Phy30 Registers:\n"); for (i=0; i < ipPhy30GlobalNumRegs; i++) { value = phyRegRead(phyBase, IP_GLOBAL_PHY30_ADDR, ipPhy30GlobalRegisterTable[i].regNum); printf("Reg %02d (0x%02x) %s = 0x%08x\n", ipPhy30GlobalRegisterTable[i].regNum, ipPhy30GlobalRegisterTable[i].regNum, ipPhy30GlobalRegisterTable[i].regIdString, value); } printf("Phy31 Registers:\n"); for (i=0; i < ipPhy31GlobalNumRegs; i++) { value = phyRegRead(phyBase, IP_GLOBAL_PHY31_ADDR, ipPhy31GlobalRegisterTable[i].regNum); printf("Reg %02d (0x%02x) %s = 0x%08x\n", ipPhy31GlobalRegisterTable[i].regNum, ipPhy31GlobalRegisterTable[i].regNum, ipPhy31GlobalRegisterTable[i].regIdString, value); } }