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.

dm8148 GMII 1000Mbps ethernet problem

Hello,

I am developing a custom dm8148 board.

I am using the GMII PHY. 
Although I have to ping the target board between the host,


Destination Host Unreachable


But it will be displayed on the console.

The test environment
HOST <-> 1000BaseHUB (Logitec LAN-GSW05 / PH) <-> TARGET

In the console output of the target board,

PHY: 0:00 - Link is Up - 1000 / Full

It is output.

But I fail to ping.

What is wrong?

u-boot  evm.c

int board_init(void)

{
u32 regVal;

/* Do the required pin-muxing before modules are setup */
set_muxconf_regs();

nor_pad_config_mux();

/* setup RMII_REFCLK to be sourced from audio_pll */
__raw_writel(0x4, RMII_REFCLK_SRC);

if (PG2_1 <= get_cpu_rev()) {
/*program GMII_SEL register for RGMII mode */
// __raw_writel(0x30a,GMII_SEL);
/*program GMII_SEL register for GMII mode */
__raw_writel(0x0,GMII_SEL); // brastvision setting
}
/* Get Timer and UART out of reset */

/* UART softreset */
regVal = __raw_readl(UART_SYSCFG);
regVal |= 0x2;
__raw_writel(regVal, UART_SYSCFG);
while( (__raw_readl(UART_SYSSTS) & 0x1) != 0x1);

/* Disable smart idle */
regVal = __raw_readl(UART_SYSCFG);
regVal |= (1<<3);
__raw_writel(regVal, UART_SYSCFG);

/* mach type passed to kernel */
gd->bd->bi_arch_number = MACH_TYPE_TI8148EVM;

/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;
gpmc_init();

#ifndef CONFIG_NOR
/* GPMC will come up with default buswidth configuration,
* we will override it based on BW pin CONFIG_STATUS register.
* This is currently required only for NAND/NOR to
* support 8/16 bit NAND/NOR part. Also we always use chipselect 0
* for NAND/NOR boot.
*
* NOTE: This code is DM8168 EVM specific, hence we are using CS 0.
* Also, even for other boot modes user is expected to
* on/off the BW pin on the EVM.
*/
gpmc_set_cs_buswidth(0, get_sysboot_bw());
#endif
return 0;
}


static void pcie_pll_config()
{
/* Powerdown both reclkp/n single ended receiver */
__raw_writel(0x00000002, SERDES_REFCLK_CTRL);

__raw_writel(0x00000000, PCIE_PLLCFG0);

/* PCIe(2.5GHz) mode, 100MHz refclk, MDIVINT = 25,
* disable (50,100,125M) clks
*/
__raw_writel(0x00640000, PCIE_PLLCFG1);

/* SSC Mantissa and exponent = 0 */
__raw_writel(0x00000000, PCIE_PLLCFG2);

/* TBD */
__raw_writel(0x004008E0, PCIE_PLLCFG3);

/* TBD */
__raw_writel(0x0000609C, PCIE_PLLCFG4);

/* pcie_serdes_cfg_misc */
/* TODO: verify the address over here
* (CTRL_BASE + 0x6FC = 0x481406FC ???)
*/
//__raw_writel(0x00000E7B, 0x48141318);
delay(3);

/* Enable PLL LDO */
__raw_writel(0x00000004, PCIE_PLLCFG0);
delay(3);

/* Enable DIG LDO, PLL LD0 */
__raw_writel(0x00000014, PCIE_PLLCFG0);
delay(3);

/* Enable DIG LDO, ENBGSC_REF, PLL LDO */
__raw_writel(0x00000016, PCIE_PLLCFG0);
delay(3);
__raw_writel(0x30000016, PCIE_PLLCFG0);
delay(3);
__raw_writel(0x70000016, PCIE_PLLCFG0);
delay(3);

/* Enable DIG LDO, SELSC, ENBGSC_REF, PLL LDO */
__raw_writel(0x70000017, PCIE_PLLCFG0);
delay(3);

/* wait for ADPLL lock */
while(__raw_readl(PCIE_PLLSTATUS) != 0x1);

}

void prcm_init(u32 in_ddr)
{
/* Enable the control module */
__raw_writel(0x2, CM_ALWON_CONTROL_CLKCTRL);

#ifdef CONFIG_SETUP_PLL
/* Setup the various plls */
audio_pll_config();
sata_pll_config();
#if 1 // TODO 140731 need gigE
pcie_pll_config();
#endif
modena_pll_config();
l3_pll_config();
ddr_pll_config();
dsp_pll_config();
iva_pll_config();
iss_pll_config();

usb_pll_config();

/* With clk freqs setup to desired values,
* enable the required peripherals
*/
per_clocks_enable();
#endif
}

  • Hideki,

    Are you working with EZSDK 5.05.02.00 / PSP 04.04.00.01?

    Are you able to ping the host PC from u-boot?

    BR
    Pavel

  • Hi Pavel,

    Thank you for your reply.

    That's right.

    EZSDK 5.05.02.00 / PSP 04.04.00.01

    I am running a ping from u-boot.
    I will get the same results from Linux.
    If you use the 100BaseHUB, both successful ping.

    Regards,

    Hideki

     

     

  • Hideki,

    Please see if the below e2e threads will be in help:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/358123/1259587.aspx#1259587

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/358366.aspx

    BR
    Pavel

  • Hi Pavel,

    Thank you for information.

    I've checked the following link.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/358123/1259587.aspx#1259587

    (I have resolved my problem. The problem was in the default selection of the GMII_SEL register to RGMII in the env.c file and we were using GMII.)

    >I have chosen the GMII. 

     __raw_writel(0x0,GMII_SEL); // GMII selected

     

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/358366.aspx

    (Solved. It was issue of usb-ethernet converted which is limited to 100M.)

    >I am using 1000BaseHUB.

     and

    PHY: 0:00 - Link is Up - 1000 / Full
    It is output

    Is there a place to check the other?

    Regards,

    Hideki

     

  • Hideki,

    What is the external ethernet PHY that you are using on your custom board? On the DM8148 EVM it is Atheros AR8031.


    Are you trying to ping from eth0 or eth1?

    Can you provide me full console output when you boot to u-boot and there trying to ping?

    BR
    Pavel

  • Hi Pavel,

    Thank you for reply.

    Custom board uses  microchip LAN8810I-AKZE

    I have been using the eth0.

    ==== console output (u-boot) ======

    U-Boot 2010.06 (Jul 31 2014 - 14:04:43)

    TI8148-GP rev 3.0

    ARM clk: 720MHz
    DSP clk: 600MHz
    DDR clk: 400MHz
    L3 clk: 220MHz
    DSS clk: 200MHz
    IVA clk: 306MHz
    ISS clk: 400MHz

    I2C: ready
    DRAM: 2 GiB
    NAND: HW ECC BCH8 Selected
    256 MiB
    MMC: OMAP SD/MMC: 0
    .:;rrr;;.
    ,5#@@@@#####@@@@@@#2,
    ,A@@@hi;;;r5;;;;r;rrSG@@@A,
    r@@#i;:;s222hG;rr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:7e:40:e3:f6:f4
    cpsw
    Hit any key to stop autoboot: 3 0

    TI8148_EVM#ping 192.168.1.15                          <=== PC IP address
    link up on port 0, speed 1000, full duplex
    Using cpsw device
    ping failed; host 192.168.1.15 is not alive
    TI8148_EVM#

    ===== end console =====

  • Hideki,

    hideki said:
    TI8148_EVM#ping 192.168.1.15                          <=== PC IP address
    link up on port 0, speed 1000, full duplex
    Using cpsw device
    ping failed; host 192.168.1.15 is not alive
    TI8148_EVM#

    Do you have the same if connecting the DM814x board to the host PC directly (without using hub between)?

    BR
    Pavel

  • Pavel,

    By connecting directly to the computer, I tried to ping.

    It was the same result.

    ===== console =====

    U-Boot 2010.06 (Jul 31 2014 - 14:04:43)

    TI8148-GP rev 3.0

    ARM clk: 720MHz
    DSP clk: 600MHz
    DDR clk: 400MHz
    L3 clk: 220MHz
    DSS clk: 200MHz
    IVA clk: 306MHz
    ISS clk: 400MHz

    I2C: ready
    DRAM: 2 GiB
    NAND: HW ECC BCH8 Selected
    256 MiB
    MMC: OMAP SD/MMC: 0
    .:;rrr;;.
    ,5#@@@@#####@@@@@@#2,
    ,A@@@hi;;;r5;;;;r;rrSG@@@A,
    r@@#i;:;s222hG;rrsrrrrrr;ri#@@r
    :@@hr:r;SG3ssrr2r;rrsrsrsrsrr;rh@@:
    B@H;;rr;3Hs;rrr;sr;;rrsrsrsrsrsr;;H@B
    @@s:rrs;5#;;rrrr;r#@H:;;rrsrsrsrsrr:s@@
    @@;;srs&X#9;r;r;;,2@@@rrr:;;rrsrsrsrr;;@@
    @@;;rrsrrs@MB#@@@@@###@@@@@@#rsrsrsrsrr;;@@
    G@r;rrsrsr;#X;SX25Ss#@@#M@#9H9rrsrsrsrsrs;r@G
    @9:srsrsrs;2@;:;;:.X@@@@@H::;rrsrsrsrsrsrr:3@
    X@;rrsrsrsrr;XAi;;:&@@#@Bs:rrsrsrsrsrsrsrsrr;@X
    @#;rsrsrsrsrr;r2ir@@@###::rrsrsrsrsrsrsrsrsr:@@
    @A:rrsrsrsrr;:2@29@@M@@@;:;rrrrsrsrsrsrsrsrs;H@
    @&;rsrsrsrr;A@@@@@@###@@@s::;:;;rrsrsrsrsrsr;G@
    @#:rrsrsrsr;G@5Hr25@@@#@@@#9XG9s:rrrrsrsrsrs:#@
    M@;rsrsrsrs;r@&#;::S@@@@@@@M@@@@Grr:;rsrsrsr;@#
    :@s;rsrsrsrr:M#Msrr;;&#@@@@@@@@@@H@@5;rsrsr;s@,
    @@:rrsrsrsr;S@rrrsr;:;r3MH@@#@M5,S@@irrsrr:@@
    @A:rrsrsrsrrrrrsrsrrr;::;@##@r:;rH@h;srr:H@
    ;@9:rrsrsrsrrrsrsrsrsr;,S@Hi@i:;s;MX;rr:h@;
    r@B:rrrrsrsrsrsrsrr;;sA@#i,i@h;r;S5;r:H@r
    ,@@r;rrrsrsrsrsrr;2BM3r:;r:G@:rrr;;r@@,
    B@Mr;rrrrsrsrsr@@S;;;rrr:5M;rr;rM@H
    .@@@i;;rrrrsrs2i;rrrrr;r@M:;i@@@.
    .A@@#5r;;;r;;;rrr;r:r#AsM@@H.
    ;&@@@@MhXS5i5SX9B@@@@G;
    :ihM#@@@@@##hs,

    Net: Detected MACID:84:7e:40:e3:f6:f4
    cpsw
    Hit any key to stop autoboot: 3 0
    TI8148_EVM#
    TI8148_EVM#ping 192.168.1.15
    link up on port 0, speed 1000, full duplex
    Using cpsw device
    ping failed; host 192.168.1.15 is not alive

  • Hideki,

    The u-boot pinmux is by default configured for RGMII interface. Have you made the changes for the GMII interface?

    See TRM, Table 9-1. G/MII Signal Description for the GMII pins and Table 9-3. RGMII Signal Description for the RGMII pins.

    Regards,
    Pavel

  • Hi Pavel,

    In the custom board I'm using GMII with RDK (dm8148) ,

    I have configured pinmux and still get no result from ping (but get phy up 1000 printing). 

    root@dm814x-evm:~# PHY: 0:01 - Link is Down
    PHY: 0:01 - Link is Up - 1000/Full

    ping to 100M port is successful, but ping to 1000M port fails.


    Are there any other changes required for using linux networking with GMII ?

    Thanks,

    Ran

  • Hi Hideki,

    Did you manage working with GMII 1000M ?

    Can you share the required changes  ?

    Thanks,

    Ran

  • Hi Ran,

    I am not able to solve unfortunately still.

    I am trying to confirm the pinmax.

    Please tell me if there is progress.

    Thanks,

    Hideki

  • Hi Pavel,

    CPU revision of custom board I was (rev = 4).
    It seems to be setting in GMII when PG_1 by default in evm.c of u-boot.


    I tried to fix it because I understand that we have to confirm the above-mentioned functions, it is not set to PINMAX of GMII.

    evm.c

    static void cpsw_pad_config()
    {
    volatile u32 val = 0;

    /*configure pin mux for rmii_refclk,mdio_clk,mdio_d */
    val = PAD232_CNTRL;
    PAD232_CNTRL = (volatile unsigned int) (BIT(18) | BIT(0));
    val = PAD233_CNTRL;
    PAD233_CNTRL = (volatile unsigned int) (BIT(19) | BIT(17) | BIT(0));
    val = PAD234_CNTRL;
    PAD234_CNTRL = (volatile unsigned int) (BIT(19) | BIT(18) | BIT(17) |
    BIT(0));

    /*For PG1.0 we only support GMII Mode, setup gmii0/gmii1 pins here*/
    printf("get_cpu_rev() = %d\n", get_cpu_rev()); // TODO delete
    if ( (PG1_0 == get_cpu_rev()) || (PG3_0 == get_cpu_rev()) ) {                    <= Adding        (PG3_0 == 4)
    printf("GMII mode\n"); // TODO delete
    /* setup gmii0 pins, pins235-258 in function mode 1 */
    val = PAD235_CNTRL;
    PAD235_CNTRL = (volatile unsigned int) (BIT(19) | BIT(18) |
    BIT(0));

    :::::::

    }

    After you fix the above, I tried to run the ping. Connection is through the HUB.

    ===== console =====

    U-Boot 2010.06 (Aug 21 2014 - 21:00:16)

    TI8148-GP rev 3.0

    ARM clk: 720MHz
    DSP clk: 600MHz
    DDR clk: 400MHz
    L3 clk: 220MHz
    DSS clk: 200MHz
    IVA clk: 306MHz
    ISS clk: 400MHz

    I2C: ready
    DRAM: 2 GiB
    NAND: HW ECC BCH8 Selected
    256 MiB
    MMC: OMAP SD/MMC: 0
    .:;rrr;;.
    ,5#@@@@#####@@@@@@#2,
    ,A@@@hi;;;r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@@G;
    :ihM#@@@@@##hs,

    Net: get_cpu_rev() = 4                  <= output infomation
    GMII mode
    Detected MACID:84:7e:40:e3:f6:f4
    cpsw
    Hit any key to stop autoboot: 3 0
    TI8148_EVM#
    TI8148_EVM#ping 192.168.1.15
    Auto negotitation failed
    Using cpsw device
    link up on port 0, speed 100, full duplex
    host 192.168.1.15 is alive

    Regards,

    Hideki

     

     

  • I solved the problem ping.Setting CPGMAC_SL1 register (0x4A100704), where it was set to 1 (bit17) GIG_FORCE, I began to be successful ping.

    <U-BOOT>/driver/net/cpsw.c

    cpsw_slave_update_link()

    static void cpsw_slave_update_link(struct cpsw_slave *slave,
    struct cpsw_priv *priv, int *link)
    {
    char *name = priv->dev->name;
    int phy_id = slave->data->phy_id;
    int speed = 0, duplex = 0;
    unsigned short reg;
    u32 mac_control = 0;

    if (miiphy_read(name, phy_id, PHY_BMSR, &reg))
    return; /* could not read, assume no link */

    if (reg & PHY_BMSR_LS) { /* link up */
    speed = miiphy_speed(name, phy_id);
    duplex = miiphy_duplex(name, phy_id);

    *link = 1;
    mac_control = priv->data.mac_control;
    if (speed == 1000){
    mac_control |= BIT(7); /* GIGABITEN */
    mac_control |= BIT(17); /* GIG_FORCE */ // ADD
    }
    if (duplex == FULL){
    mac_control |= BIT(0); /* FULLDUPLEXEN */
    }
    }

    if (mac_control == slave->mac_control)
    return;

    if (mac_control) {
    printf("link up on port %d, speed %d, %s duplex\n",
    slave->slave_num, speed,
    (duplex == FULL) ? "full" : "half");
    } else {
    printf("link down on port %d\n", slave->slave_num);
    }

    __raw_writel(mac_control, &slave->sliver->mac_control);
    slave->mac_control = mac_control;
    }