]> rtime.felk.cvut.cz Git - rpp-test-sw.git/commitdiff
EMAC: Works on rpp V00.01-001 with modified HW
authorRostislav Lisovy <lisovy@gmail.com>
Tue, 9 Oct 2012 11:30:37 +0000 (13:30 +0200)
committerRostislav Lisovy <lisovy@gmail.com>
Tue, 9 Oct 2012 11:30:37 +0000 (13:30 +0200)
source/emac_test.c

index 3666dedf75a0b1cc48828a5e02f3f57bd262fa52..a6d36d7ae3321d0f28b45ddd8e21b1640fc7c6a6 100644 (file)
@@ -71,7 +71,7 @@ int emac_test(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
        gioSetBit(dmmPORT, DMM_CLK, 1);
        dummy_wait();
 */
-       /* Fill some testing ethernet frame with relevant data */
+       /* Fill some testing Ethernet frame with relevant data */
        efr1.destination[0] = 0x00;
        efr1.destination[1] = 0x21;
        efr1.destination[2] = 0x70;
@@ -107,12 +107,12 @@ int emac_test(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
        }
        //} while (phyalive == 0);
        phylink = MDIOPhyLinkStatusGet(mdioBase);
-       if (!phylink) {
+       if (!phylink)
                print((uint8_t *)"PHY link down\r\n");
-               return -1;
-       }
-
+       else
+               print((uint8_t *)"PHY link up\r\n");
 
+       print((uint8_t *)"Configuring PHY and EMAC...\r\n");
        PHY_configure(mdioBase, emacPhyAddress);
 
        /* Set the EMAC with the negotiation results if it is successful */
@@ -138,10 +138,16 @@ int emac_test(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
        //EMACRxEnable(emacBase);
        EMACTxEnable(emacBase);
 
-
        EMACMIIEnable(emacBase);
 
 
+       phylink = MDIOPhyLinkStatusGet(mdioBase);
+       if (!phylink)
+               print((uint8_t *)"PHY link down\r\n");
+       else
+               print((uint8_t *)"PHY link up\r\n");
+
+
        for (j = 0; j < 8; j++) {
                fr1.pNext = NULL;
                fr1.pBuffer = (uint8_t*)&efr1;