Browse Source

Fixup the gmac1 phy address for it can be used.

Change-Id: I10c44dedd4e75c47001d30d83a7c778013b90344
master
zhangbaoqi 7 years ago
parent
commit
1e17e46211
  1. 18
      sys/dev/gmac/synopGMAC_Dev.c
  2. 2
      sys/dev/gmac/synopGMAC_network_interface.c

18
sys/dev/gmac/synopGMAC_Dev.c

@ -1405,6 +1405,24 @@ s32 synopGMAC_attach (synopGMACdevice * gmacdev, u64 macBase, u64 dmaBase, u32 p
gmacdev->PhyBase = phyBase;
#else
gmacdev->PhyBase = phyBase;
{
int i,j;
u16 data;
for (i = phyBase,j=0;j<32;i=(i+1)&0x1f,j++)
{
synopGMAC_read_phy_reg(gmacdev->MacBase,i,2,&data);
if(data != 0 && data != 0xffff) break;
synopGMAC_read_phy_reg(gmacdev->MacBase,i,3,&data);
if(data != 0 && data != 0xffff) break;
}
if(j==32) {
TR("phy_detect: can't find PHY!\n");
}
gmacdev->PhyBase = i;
}
#endif
/* Program/flash in the station/IP's Mac address */

2
sys/dev/gmac/synopGMAC_network_interface.c

@ -525,8 +525,6 @@ s32 synopGMAC_setup_tx_desc_queue(synopGMACdevice * gmacdev,u32 no_of_desc, u32
/* first_desc is cached addr */
first_desc = (DmaDesc *)plat_alloc_memory(sizeof(DmaDesc) * no_of_desc+15);
#endif
//first_desc is cache addr, dma_addr is uncache_to_phy addr mtf add
printf("===Tx first_desc:0x%x, dma_addr:0x%x\n", first_desc, dma_addr);
if(first_desc == NULL){
TR("Error in Tx Descriptors memory allocation\n");
return -ESYNOPGMACNOMEM;

Loading…
Cancel
Save