This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR2944EVM: Ethernet driver change from DP83867 driver to DP83tc812 driver

Part Number: AWR2944EVM
Other Parts Discussed in Thread: DP83TC812R-Q1

Hi,

    The AWR2944EVM supports two RGMII Ethernet ports to provide the connection to the network.One is a MATEnet port (9-2304372-9 connector) via a DP83TC812R-Q1 PHY ,the other is an RJ45 port via a DP83867ERGZR PHY. By default, the RGMII interfaces is connected to the RJ45 port. In the demo, .syscfg file only supports DP83867ERGZR PHY driver. We want to use MATEnet port via a DP83TC812R-Q1 PHY and we have done smoe work.

  Firstly in software aspect,I have sucessfully added the DP83TC812R drivers (including DP83TC812.c ,DP83TC812_priv.hand DP83TC812.h files ) to the mcu_plus_sdk_awr294x_08_04_00_22 and ti_board_config.c can be autogenerated as belows:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Copyright (C) 2021 Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there any error with the configuration for DP83TC812 ?Such as:

static const Dp83tc812_Cfg gEnetCpbBoard_dp83tc812PhyCfg =
{  
    .txClkShiftEn = true,
    .rxClkShiftEn = true,
    .interruptEn = false,
    .sgmiiAutoNegEn = true,
    .MasterSlaveMode = DP83TC812_MASTER_SLAVE_STRAP,
    
};

 
static const EnetBoard_PortCfg gEnetCpbBoard_awr294xEthPort[] =
{
    {    /* "CPSW3G" */
        .enetType = ENET_CPSW_2G,
        .instId   = 0U,
        .macPort  = ENET_MAC_PORT_1,
        .mii      = { ENET_MAC_LAYER_GMII, ENET_MAC_SUBLAYER_REDUCED },
        .phyCfg   =
        {
            .phyAddr         = 0,
            .isStrapped      = false,
            .skipExtendedCfg = false,
            .extendedCfg     = &gEnetCpbBoard_dp83tc812PhyCfg,
            .extendedCfgSize = sizeof(gEnetCpbBoard_dp83tc812PhyCfg),
        },
        .flags    = 0U,
    },
};
static const EnetBoard_PortCfg gEnetLpbkBoard_awr294xEthPort[] =
{
    {    /* RGMII MAC loopback */
        .enetType = ENET_CPSW_2G,
        .instId   = 0U,
        .macPort  = ENET_MAC_PORT_1,
        .mii      = { ENET_MAC_LAYER_GMII, ENET_MAC_SUBLAYER_REDUCED },
        .phyCfg   =
        {
            .phyAddr = ENETPHY_INVALID_PHYADDR,
        },
        .flags    = 0U,
    },
    {    /* RMII MAC loopback */
        .enetType = ENET_CPSW_2G,
        .instId   = 0U,
        .macPort  = ENET_MAC_PORT_1,
        .mii      = { ENET_MAC_LAYER_MII, ENET_MAC_SUBLAYER_REDUCED },
        .phyCfg   =
        {
            .phyAddr = ENETPHY_INVALID_PHYADDR,
        },
        .flags    = 0U,
    },
};

 The  configurations  are reasonable or not.

If it is, can you point them out?

Secondly in hardware aspect,  we have do some changes in the hardware as description in the AWR2944EVM User’s Guide to enable the DP83TC812R PHY.


Besides that,  in order to make DP83TC812R work normally, is there any other change that we should do especially in  software aspect?

BR,

Rata

  • Hi Rata,

    Let me check with the team if there is any reference implementation available and get back to you tomorrow.

    Regards,

    Ajay

  • Hi Rata,

    Please find the porting steps below - 


    1. Under <mcu_plus_sdk_awr294x_xx_xx_xx_xx>\source\networking\enet\core\src\phy

    a. Source files and private header files have been added for the automotive PHY
    b. Added the new phy drivers in makefile.


    2. Under <mcu_plus_sdk_awr294x_xx_xx_xx_xx>\source\networking\enet\core\src\phy\enetphy.c

    a. Added the new(automotive phy driver under "Global variable section"
    b. The following items have been added under the section "Function Definitions"

    - Add "phyCfg->supportRegCaps = true;" to "void EnetPhy_initCfg(EnetPhy_Cfg *phyCfg)"
    - Add if/else statement to "static void EnetPhy_enableState(EnetPhy_Handle hPhy)"


    3. Under <mcu_plus_sdk_awr294x_xx_xx_xx_xx>\source\networking\enet\core\include\phy

    a. The header files for the automotive PHY drivers have been added
    b. in the enetphy.h file, bool supportRegCaps element has been added to the structure EnetPhy_Cfg


    4. Changes made in the makefile <mcu_plus_sdk_awr294x_xx_xx_xx_xx>\source\networking\enet\makefile.cpsw.awr294x.r5f.ti-arm-clang

    a. Adjust the specified PHY driver source files (include necessary PHY drivers)


    5. Changes made in the syscfg file template

    a. In the "<mcu_plus_sdk_awr294x_xx_xx_xx_xx>\source\networking\.meta\enet_cpsw\templates\awr294x\enet_board_cfg.c.xdt" file, configurations for the automotive phy dp83tc812 has been added

    Regards,

    Shruti

  • Hi Shruti,

        Thanks for your detailed reply, it helps us a lot. Now I still have some questions:

        First one,the autogenerated  ti_board_config.c file is as belows:

        

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    static const Dp83tc812_Cfg gEnetCpbBoard_dp83tc812PhyCfg =
    {
    .txClkShiftEn = true,
    .rxClkShiftEn = true,
    .interruptEn = false,
    .sgmiiAutoNegEn = true,
    .MasterSlaveMode = DP83TC812_MASTER_SLAVE_STRAP,
    };
    static const EnetBoard_PortCfg gEnetCpbBoard_awr294xEthPort[] =
    {
    { /* "CPSW3G" */
    .enetType = ENET_CPSW_2G,
    .instId = 0U,
    .macPort = ENET_MAC_PORT_1,
    .mii = { ENET_MAC_LAYER_GMII, ENET_MAC_SUBLAYER_REDUCED },
    .phyCfg =
    {
    .phyAddr = 0,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Is there any question for that?

    Second one,

    2. Under <mcu_plus_sdk_awr294x_xx_xx_xx_xx>\source\networking\enet\core\src\phy\enetphy.c

    a. Added the new(automotive phy driver under "Global variable section"

      What should I do for that? The Global variable section is as belows:

    /* ========================================================================== */
    /*                            Global Variables                                */
    /* ========================================================================== */


    extern EnetPhy_DrvInfoTbl gEnetPhyDrvTbl;

    /*! \brief Enet MAC port objects. */
    static EnetPhy_Obj gEnetPhy_phyObjs[ENET_CFG_ENETPHY_PHY_MAX];

    #if ((ENET_CFG_TRACE_LEVEL >= ENET_CFG_TRACE_LEVEL_DEBUG) && ENET_CFG_IS_OFF(TRACE_DISABLE_INFOSTRING))
    /*! \brief Name of the FSM states. */
    static const char *gEnetPhyStateNames[] =
    {
        "INIT",
        "FINDING",
        "RESET_WAIT",
        "ENABLE",
        "FOUND",
        "NWAY_START",
        "NWAY_WAIT",
        "LINK_WAIT",
        "LINKED",
        "LOOPBACK",
    };
    #endif

    #if ((ENET_CFG_TRACE_LEVEL >= ENET_CFG_TRACE_LEVEL_WARN) && ENET_CFG_IS_OFF(TRACE_DISABLE_INFOSTRING))
    /*! \brief Ethernet PHY capabilities string buffer. */
    static char gEnetPhyCapsBuf[ENETPHY_CAPS_BUF_LEN];
    #endif

    #if ((ENET_CFG_TRACE_LEVEL >= ENET_CFG_TRACE_LEVEL_DEBUG) && ENET_CFG_IS_OFF(TRACE_DISABLE_INFOSTRING))
    /*! \brief Ethernet PHY mode string buffer. */
    static char gEnetPhyModeBuf[ENETPHY_MODE_BUF_LEN];
    #endif

     How should I do for  adding  the new automotive phy driver?

    BR

    Rata

  • Hi Rata,

    you can use the following configuration for the Dp83tc812_Cfg gEnetCpbBoard_dp83tc812PhyCfg

        .txClkShiftEn         = false,
        .rxClkShiftEn         = true,
        .interruptEn          = false,
        .sgmiiAutoNegEn       = false,
        .MasterSlaveMode      = DP83TC812_MASTER_MODE,
    for your second query, you just need to declare the phy driver like the following - 
    extern EnetPhy_Drv gEnetPhyDrvDp83tc812.
    also, for teh AUTO phy to work, you have to modify some hardware in your board as well.
    Regards,
    Shruti
  • Hi Shruti

    Thanks for your reply, I got it.

    BR,

    Rata

  • Hi Rata,

    Good to know that your issue is resolved. 

    Regards,

    Shruti

  • Hi Shruti,

        I still have an question, as you said if we configure gEnetCpbBoard_dp83tc812PhyCfg as:

       .txClkShiftEn         = false,
        .rxClkShiftEn         = true,
        .interruptEn          = false,
        .sgmiiAutoNegEn       = false,
        .MasterSlaveMode      = DP83TC812_MASTER_MODE,
    also, for teh AUTO phy to work, you have to modify some hardware in your board as well

      The MAC[2:0]must be [1 1 1], is that right? Besides that, what hardware modifications are still needed?

     The txDelay must be set as 0ns, and rxDelay must be set as 2ns by register 0x430,  is that right?

    BR;

    Rata

  • Hi Rata,

    The MAC mode the user can adjust based on their application, as to which mode they want to use. We have tested with the 110 mode which is internal delay mode for both rx and tx and so we are not setting any delay here.

    In the default EVM's the AUTO PHY IC is disconnected from the main interface, meaning there are many unpopulated registers which you have to populate to use the AUTO PHY on EVM.

    Regards,

    Shruti