• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » C6000 Multicore DSP » Keystone Multicore Forum (C66, 66A, AM5) » EMAC port 0 of 6678EVM via MicroTCA
Share
C6000 Multicore DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Training Available
TI provides self-paced online training that introduces the primary components of the KeyStone II family of SoC devices.

  • KeyStone II SoC Overview >
  • KeyStone II Software Overview >
  • KeyStone II ARM Cortex-A15 Corepac Overview >
  • More Information >
  • Check out
    Multicore Mix blog
    • $core_v2_blog.Current.Name

      OpenMP - All aboard!

      Posted 10 hours ago
      by Debbie Greenstreet
      With so many end products today relying on multicore DSPs for...
    • $core_v2_blog.Current.Name

      A look back: Two years of Multicore Mix

      Posted 1 day ago
      by Lauren Reed1
      A big thank you to everyone who participated in our contest last...
    • $core_v2_blog.Current.Name

      It’s our second anniversary, but you get the present!

      Posted 8 days ago
      by Lindsey Bare
      It’s hard to believe it’s already been two years...

    EMAC port 0 of 6678EVM via MicroTCA

    EMAC port 0 of 6678EVM via MicroTCA

    This question is answered
    Vladimir Sidorov
    Posted by Vladimir Sidorov
    on Jun 20 2012 05:17 AM
    Prodigy40 points

    Hi,

    I have to connect GbE port of MCH AM4901 (BCM5396 Ethernet switch) with EMAC port 0 of 6678EVM via MicroTCA.  
    I am using PA_emacExample with modification.

    There is a part of cpsw_mgmt.c:

          Int32 Init_SGMII (UInt32 macPortNum)
          {  
              CSL_SGMII_ADVABILITY    sgmiiCfg;
              CSL_SGMII_STATUS        sgmiiStatus;
              
              /* Configure SGMII Port 1 only since it is connected to RJ45 at all known EVMs */
              if(macPortNum == 0)    
              {
                  /* Reset the port before configuring it */
                  CSL_SGMII_doSoftReset (macPortNum);        
                  while (CSL_SGMII_getSoftResetStatus (macPortNum) != 0);   
          
                  /* Hold the port in soft reset and set up
                  * the SGMII control register:
                  *      (1) Enable Master Mode (default)
                  *      (2) Enable Auto-negotiation
                  */
                  CSL_SGMII_startRxTxSoftReset (macPortNum);  
                  if (SGMII_MASTER == 0)    
          
                  {      
                      CSL_SGMII_disableMasterMode (macPortNum);
                  }
                  else
                  {
                      CSL_SGMII_enableMasterMode (macPortNum);
                  
                  }
              
                  /* Setup the Advertised Ability register for this port:
                  *      (1) Enable Full duplex mode
                  *      (2) Enable Auto Negotiation
                  */
                  sgmiiCfg.linkSpeed      =   CSL_SGMII_1000_MBPS;
                  sgmiiCfg.duplexMode     =   CSL_SGMII_FULL_DUPLEX;
                  CSL_SGMII_setAdvAbility (macPortNum, &sgmiiCfg);
              
                  CSL_SGMII_enableAutoNegotiation (macPortNum);
                  CSL_SGMII_endRxTxSoftReset (macPortNum);   
                  
                  /* Wait for SGMII Link */
                  if (!cpswSimTest)
                  {
    infinite loop -->

    ->              do
    ->                  {
    ->                      CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
    ->                  } while (sgmiiStatus.bIsLinkUp != 1);
                      
                      /* Wait for SGMII Autonegotiation to complete without error */
                      do
                      {
                          CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
                          if (sgmiiStatus.bIsAutoNegError != 0)
                              return -1;
                      } while (sgmiiStatus.bIsAutoNegComplete != 1);
                      
                      /*
                       * May need to wait some more time for the external PHY to be ready to transmit packets reliabily.
                       * It is possible to access the PHY status register through the MDIO interface to check when
                       * the PHY is ready.
                       * To avoid platform-dependent code, we just introduce about 2ms wait here
                       */
                      if((cpswLpbkMode == CPSW_LOOPBACK_EXTERNAL) || (cpswLpbkMode == CPSW_LOOPBACK_NONE))
                          CycleDelay(2000000);
                  }
              }
          
              /* All done with configuration. Return Now. */
              return 0;
          }


    I have infinite loop in:
                do
                {
                    CSL_SGMII_getStatus(macPortNum, &sgmiiStatus);
                } while (sgmiiStatus.bIsLinkUp != 1);


    The value of the variables:
        cpswSimTest=0;
        SGMII_MASTER=1 | SGMII_MASTER=0

    Why not pass the initialization of the port 0?

    Is the problem in EVM or  in MHC?




    Thank You,

    Vladimir.

    C6678 EMAC AMC MicroTCA
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Javier Malave-Bonet
      Posted by Javier Malave-Bonet
      on Jun 20 2012 12:51 PM
      Verified Answer
      Verified by Vladimir Sidorov
      Intellectual880 points

      2727.eth_utils_250.c

      0020.eth_utils_312_5.c

      Hi Vladimir,

      The emacExample on PA LLD examples directory does not program the EVM PHY. Futhermore, I see that you are trying to setup SGMII Port 0 instead of SGMII Port 1. The EVM's has only 1 port mapped to the RJ-45 and that is SGMII Port 1. Why do you say you want to connect specifically Port 0?

      I am attaching a self-contained Ethernet configuration code for the EVM. Since I don't know which version you have of the EVM I am attaching two versions, one that assumes a SERDES refclk of 312.5mhz and one that assumes a refclk of 250mhz. Pick the appropriate one and add it to your emacExample project. Then, substitute the call to Init_CPSW() on cpsw_mgmt.c with SWSS_Setup_Swss (1). This sets up CPSW, ALE, CPGMAC, SGMII, SERDES and PHY on the EVM. You will need to setup the Broadcoam switch as master and set auto-negotiation with desired advertise ability configuration.

      Regards,

      Javier

       

      emacExample eth_utils.c
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Alpaslan Lorasda����
      Posted by Alpaslan Lorasda����
      on Jun 21 2012 05:28 AM
      Verified Answer
      Verified by Vladimir Sidorov
      Prodigy135 points

      Hi,

      I encountered this problem before. You must use SGMII to SGMII with forced link configuration as in mentioned in GbE Switch Subsystem User Guide. If it resides "sgmiiStatus.bIsLinkUp" loop this can correspond a physical connection problem. You can observe the same behavior when you disconnect SGMII port 0.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Vladimir Sidorov
      Posted by Vladimir Sidorov
      on Jun 29 2012 02:44 AM
      Prodigy40 points

      Hi, Alpaslan,

      You have already solved this problem?

      Unfortunately all my attempts to link the two boards 6678 through the SGMII port 0 were unsuccessful. I have tried to establish a link between the two cards directly, by combining the transmitters and receivers in mode SGMII to SGMII with forcedlink configuration as described in the sprugv9a-GbE_ug.pdf ).
      The value of the variable sgmiiStatusbIsLinkUp in
                   do
                   {
                         CSL_SGMII_getStatus (macPortNum, &sgmiiStatus);
                    } while (sgmiiStatus.bIsLinkUp! = 1);
      is equal to 0.

      Thanks.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Javier Malave-Bonet
      Posted by Javier Malave-Bonet
      on Jun 29 2012 19:40 PM
      Verified Answer
      Verified by Vladimir Sidorov
      Intellectual880 points

      Hi Vladimir,

      I attached the proper ethernet configuration code. If you are connecting SGMII-to-SGMII through an AMC setup then you only need to comment out the

      mdio_init(PHY_1, duplex); call.

      And change

      *((volatile unsigned int *) (SGMII_BASE[i] + 0x10)) |= 0x00000001; to  *((volatile unsigned int *) (SGMII_BASE[i] + 0x10)) |= 0x00000020; // 0x20 is forced link, 0x21 is master with auto-negotiation, then the broadcoam switch will need to be a slave with auto-negotiation turned on.

      If the link is not coming up either your SERDES configuration is wrong (i.e. MPY and/or RATE) or your hardware setup is wrong. I have given you two SERDES configurations one that works for a reference clock of 250mhz and one for 312.5mzh depdneing on the EVM version your using.

      Kind regards,

      Javier

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Javier Malave-Bonet
      Posted by Javier Malave-Bonet
      on Jun 29 2012 19:42 PM
      Verified Answer
      Verified by Vladimir Sidorov
      Intellectual880 points

      Also, change

      #define SGMII_BASE_A 0x02090200 -> 0x02090100

      #define EMAC_BASE_A 0x02090940 -> 0x02090900

      Regards,

      Javier

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • River Liu
      Posted by River Liu
      on Jul 06 2012 23:27 PM
      Prodigy195 points

      Assuming you have made correct settings for cpsw&sgmii, I suggest checking SGMII clock and SGMII0P/N signal. You can watch the eye diagram of them to see whether what's wrong.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yanuar Nugraha
      Posted by Yanuar Nugraha
      on May 02 2013 03:23 AM
      Prodigy150 points

      Dear guys,

      I just got my EVM C6670 several weeks and now, I want to use PA_emacExample for receiving UDP packets generated by my PC using RJ45 port, which means I will be using EMAC Port-1 from now on. At this state, I am successfully running these cases: LOOPBACK_INTERNAL and EXTERNAL, and LOOPBACK_NONE (one-way EVM to PC only). The packet captured by Wireshark in my PC.

      My plan is to send exactly same packet, with the MAC, IP and Port exchanged between Destination and Source, because now the source is my PC and the destination is the EVM. But, it seems like the packet never trigger the interrupt.

      Several changes and steps I've done on PA_emacExample:

      1. Set cpswSimTest = 0;

      2. Set cpswLpbkMode = CPSW_LOOPBACK_NONE;

      3. Set cpswEvm6678 = 1 (I'm using C6670, but If set this var to 0, then always got stuck when linking up the emac port 0)

      Int cpswSimTest     = 0;
      Int cpswLpbkMode = CPSW_LOOPBACK_NONE;
      Int cpswEvm6678   = 1;

      4. on Init_CPSW, the EMAC Port initialization start at 1 (EMAC Port-1 connected to RJ-45), because I don't want to use AMC connected EMAC Port-0.

      for (macPortNum = 1/*0*/; macPortNum < NUM_MAC_PORTS; macPortNum++)
      {

      /*.....codes.....*/

      }

      5. on Init_CPSW, leave the Init_MDIO() as it be, it seems this function is empty and always return SUCCESS.

      6. on Send_Packet(), I changed the psFlags to 0x2, because I read that 0x1 would configure EMAC Port-0 and 0x2 for EMAC Port-1.

      7. on Send_Packet(), on pktMatch (main data and payload), I changed the MAC header, specifically, I changed the MAC destination with my laptop's NIC MAC Address. I left the rest on default.

      8. Build, Connect, load GEL, and RUN.

      9. Watch my laptop NIC activity using Wireshark, packet successfully read by Wireshark. There are 10 UDP packets. (It seems the packets is unicasted).

      10. Generate same stream of packets using Packeth, but the MAC address, IP address and Port swapped. Generate the 10 packets with 1ms delay between each packet.

      11. On CCS console stuck on "Receiving 0 packets...." infinite loop.

      You can see that I want to have standard PC to EVM and vice versa operation using wired RJ-45 connection. How I should make those steps works? And how I can watch/debug the interrupt and make sure whether the interrupt is triggered or not?

      Thank you and regards,

      Aditya

      6670 EVM 6678 ISR PA_emacExample 320C667x
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yanuar Nugraha
      Posted by Yanuar Nugraha
      on May 06 2013 05:30 AM
      Prodigy150 points

      Hey,

      I've just found about Shannon_Interrupts_v0.2.gel in http://processors.wiki.ti.com/index.php/File:Shannon_Interrupts_v0.2.gel.zip. And it seems that we can trigger the interrupt using the function inside GEL instead, rather using trigger from original interrupt from the SGMII-1 (RJ-45) which still be my problem right now. I just want to know why the packet sent from my PC can't trigger the interrupt inside EVM.

      Now, from the code inside cppi_qmss_mgmt.c on PA_emacExample, the interrupt event ID is 48, and linking it up with Table 5-11 from Keystone Multicore Guide (C6670 sprugr9e.pdf), it does make sense that the Rx Queue is 704 because the core ID or N is 0 (i'm using core 0 to run the PA_emacExample). So, I guess just execute a trigger to interrupt for event ID 48 with correspond vector ID using function on this GEL file.

      I just wonder if it can be done, so ask you guys before.

      Thank you and regards,

      Aditya

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Yanuar Nugraha
      Posted by Yanuar Nugraha
      on May 21 2013 03:21 AM
      Prodigy150 points

      Hey guys,

      later after last problem, I've updated the PDK and the CCS. Now, just with a little change on cpswLoopbackMode to LOOPBACK_NONE, already set the app to use RJ45 Port (SGMII-1 port) instead of AMC connected port. Now much more easier to use this emacExample on new PDK (1.1.2.6) to send packets to external PC.

      Later, on Setup_PASS, I removed IPv4 and Port filter, left only Add_MACAddress only to forward packet to accumulator with corresponding MAC destination address. Now it seems that ALE table updated whenever a packet generated from PC (I'm using packeth). However, the ISR Rx (CPSW_RXISR) never been triggered yet.

      Anyone have any solution or clue on how to solve this out? 

      Thank you,

      Aditya

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use