while(loop_count-- > 0){ status = ak_gmac_read_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, PHY_STATUS_REG, &data); if(status) continue; if((data & Mii_AutoNegCmplt) != 0){ if ((data_id1 == 0x2000) && ((data_id2 == 0xa140) || (data_id2 == 0xa130) || ((data_id2 == 0xa110)))) { status = ak_gmac_read_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, PHY_SPECIFIC_CTRL_REG, &data); if(status) continue; if((data & 0x10) != 0){ printk(KERN_ERR"Autonegotiation Complete,loop_count:%d\n", loop_count); #if 1 //xiaozijie , anjubao for(i = 0; i <= 0x1f; i++) { data =0; status = ak_gmac_read_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, i, &tmp_data); if(status) { printk(KERN_ERR"XZJ ak_gmac_read_phy_reg FAIL\n"); } printk(KERN_ERR"XZJ read reg:0x%x : 0x%x\n", i, tmp_data); } ak_gmac_write_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0D, 0x1F); ak_gmac_write_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0E, 0x0468); ak_gmac_write_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0D, 0x401F); ak_gmac_read_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0E, &tmp_data); printk(KERN_ERR"XZJ read reg:0x%x : 0x%x\n", 0x0468, tmp_data); ak_gmac_write_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0D, 0x1F); ak_gmac_write_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0E, 0x0467); ak_gmac_write_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0D, 0x401F); ak_gmac_read_phy_reg((u32 *)gmacdev->MacBase, gmacdev->PhyBase, 0x0E, &tmp_data); printk(KERN_ERR"XZJ read reg:0x%x : 0x%x\n", 0x0467, tmp_data); #endif break; } } else { printk(KERN_ERR"Autonegotiation Complete,loop_count:%d\n", loop_count); break; } } }