diff options
Diffstat (limited to 'usrp2/firmware')
-rw-r--r-- | usrp2/firmware/apps/gen_eth_packets.c | 12 | ||||
-rw-r--r-- | usrp2/firmware/lib/eth_mac.c | 7 | ||||
-rw-r--r-- | usrp2/firmware/lib/ethernet.c | 4 |
3 files changed, 18 insertions, 5 deletions
diff --git a/usrp2/firmware/apps/gen_eth_packets.c b/usrp2/firmware/apps/gen_eth_packets.c index b81f60dac..dd2996752 100644 --- a/usrp2/firmware/apps/gen_eth_packets.c +++ b/usrp2/firmware/apps/gen_eth_packets.c @@ -147,6 +147,9 @@ main(void) link_is_up = true; } */ + + link_is_up = true; /* FIXME tell s/w link is up */ + // fire off a receive from the ethernet bp_receive_to_buf(CPU_RX_BUF, PORT_ETH, 1, 0, BP_LAST_LINE); @@ -160,10 +163,15 @@ main(void) } if (status & (BPS_DONE(CPU_TX_BUF) | BPS_ERROR(CPU_TX_BUF))){ + if (status & BPS_ERROR(CPU_TX_BUF)){ + putchar('E'); + } bp_clear_buf(CPU_TX_BUF); npackets_sent++; - if ((npackets_sent & 0xF) == 0) // print after every 16 packets - print_rmon_regs(); + if ((npackets_sent & 0xF) == 0){ // print after every 16 packets + //print_rmon_regs(); + putchar('.'); + } } if (link_is_up && send_packet_now && (status & BPS_IDLE(CPU_TX_BUF))){ diff --git a/usrp2/firmware/lib/eth_mac.c b/usrp2/firmware/lib/eth_mac.c index 41690af95..f38ea65f9 100644 --- a/usrp2/firmware/lib/eth_mac.c +++ b/usrp2/firmware/lib/eth_mac.c @@ -118,8 +118,9 @@ eth_mac_miim_read(int addr) while((eth_mac->miistatus & MIIS_BUSY) != 0) ; - printf("MIIM-READ ADDR %d DATA %d\n",addr, eth_mac->miirx_data); - return eth_mac->miirx_data; + int r = eth_mac->miirx_data; + printf("MIIM-READ ADDR 0x%x DATA 0x%x\n",addr, r); + return r; } void @@ -130,7 +131,7 @@ eth_mac_miim_write(int addr, int value) eth_mac->miitx_data = value; eth_mac->miicommand = MIIC_WCTRLDATA; - printf("MIIM-WRITE ADDR %d VAL %d\n",addr,value); + printf("MIIM-WRITE ADDR 0x%x VAL 0x%x\n",addr,value); while((eth_mac->miistatus & MIIS_BUSY) != 0) ; } diff --git a/usrp2/firmware/lib/ethernet.c b/usrp2/firmware/lib/ethernet.c index 32d2e39bd..f554e0179 100644 --- a/usrp2/firmware/lib/ethernet.c +++ b/usrp2/firmware/lib/ethernet.c @@ -259,6 +259,10 @@ ethernet_init(void) t &= ~(NWAY_AR_10T_HD_CAPS | NWAY_AR_10T_FD_CAPS | NWAY_AR_100TX_HD_CAPS | NWAY_AR_100TX_FD_CAPS); eth_mac_miim_write(PHY_AUTONEG_ADV, t); + int r = eth_mac_miim_read(PHY_AUTONEG_ADV); // DEBUG, read back + if (t != r){ + printf("PHY_AUTONEG_ADV: wrote 0x%x, got 0x%x\n", t, r); + } // Restart autonegotation. // We want to ensure that we're advertising our PAUSE capabilities. |