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.

Enabling Ethernet in u-boot 2016-05 on AM335x

We use TLK105RHBR Ethernet PHY.
The Ethernet PHY is connected to CPU via GMII1_XXX signals and uses external
clock (25MHz) which also connected to CPU as reference clock. PHY address is 1.
We are trying to enable Ethernet in u-boot 2016-05, but it does not work.

we have done following changes:

board.c"
//Before
 if (board_is_bone() || board_is_bone_lt() ||
            board_is_idk()) {
                writel(MII_MODE_ENABLE, &cdev->miisel);
                cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
                                PHY_INTERFACE_MODE_MII;
        } else if (board_is_icev2()) {
                writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
                cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
                cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII;
                cpsw_slaves[0].phy_addr = 1;
                cpsw_slaves[1].phy_addr = 3;
        } else {
                writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel);
                cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
                                PHY_INTERFACE_MODE_RGMII;
        }

        ...

//After
 if (board_is_bone() || board_is_bone_lt() ||
            board_is_idk() || board_is_costom()) {
                writel(MII_MODE_ENABLE, &cdev->miisel);
                cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
                                PHY_INTERFACE_MODE_MII;
                cpsw_slaves[0].phy_addr = 1;
        } else if (board_is_icev2()) {
                writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
                cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
                cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII;
                cpsw_slaves[0].phy_addr = 1;
                cpsw_slaves[1].phy_addr = 3;
        } else {
                writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel);
                cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
                                PHY_INTERFACE_MODE_RGMII;
        }

        ...
pinmux.c:
//Added

 if (board_is_costum()) {
       configure_module_pin_mux(mii1_pin_mux);
       configure_module_pin_mux(mmc0_no_wp_pin_mux);
       configure_module_pin_mux(nand_pin_mux);
       configure_module_pin_mux(i2c1_pin_mux);
 }

In DTS file the  Ethernet configured following way:

&am33xx_pinmux {
    pinctrl-names = "default";
    ...
        cpsw_default: cpsw_default {
        pinctrl-single,pins = <
            /* Slave 1 */
            0x110 ( PIN_INPUT | MUX_MODE0 )     /* (J15) gmii1_rxer.gmii1_rxer */
            0x114 ( PIN_OUTPUT | MUX_MODE0 )    /* (J16) gmii1_txen.gmii1_txen */
            0x118 ( PIN_INPUT | MUX_MODE0 )     /* (J17) gmii1_rxdv.gmii1_rxdv */
            0x12c ( PIN_INPUT | MUX_MODE0 )     /* (K18) gmii1_txclk.gmii1_txclk */
            0x130 ( PIN_INPUT | MUX_MODE0 )     /* (L18) gmii1_rxclk.gmii1_rxclk */
            0x128 ( PIN_OUTPUT | MUX_MODE0 )    /* (K17) gmii1_txd0.gmii1_txd0 */
            0x124 ( PIN_OUTPUT | MUX_MODE0 )    /* (K16) gmii1_txd1.gmii1_txd1 */
            0x120 ( PIN_OUTPUT | MUX_MODE0 )    /* (K15) gmii1_txd2.gmii1_txd2 */
            0x11c ( PIN_OUTPUT | MUX_MODE0 )    /* (J18) gmii1_txd3.gmii1_txd3 */
            0x140 ( PIN_INPUT | MUX_MODE0 )     /* (M16) gmii1_rxd0.gmii1_rxd0 */
            0x13c ( PIN_INPUT | MUX_MODE0 )     /* (L15) gmii1_rxd1.gmii1_rxd1 */
            0x138 ( PIN_INPUT | MUX_MODE0 )     /* (L16) gmii1_rxd2.gmii1_rxd2 */
            0x134 ( PIN_INPUT | MUX_MODE0 )     /* (L17) gmii1_rxd3.gmii1_rxd3 */
        >;
    };

    cpsw_sleep: cpsw_sleep {
        pinctrl-single,pins = <
            /* Slave 1 reset value */
            0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (J15) gmii1_rxer.gmii1_rxer */
            0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (J16) gmii1_txen.gmii1_txen */
            0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (J17) gmii1_rxdv.gmii1_rxdv */
            0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (K18) gmii1_txclk.gmii1_txclk */
            0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (L18) gmii1_rxclk.gmii1_rxclk */
            0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (K17) gmii1_txd0.gmii1_txd0 */
            0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (K16) gmii1_txd1.gmii1_txd1 */
            0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (K15) gmii1_txd2.gmii1_txd2 */
            0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (J18) gmii1_txd3.gmii1_txd3 */
            0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (M16) gmii1_rxd0.gmii1_rxd0 */
            0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (L15) gmii1_rxd1.gmii1_rxd1 */
            0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (L16) gmii1_rxd2.gmii1_rxd2 */
            0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* (L17) gmii1_rxd3.gmii1_rxd3 */
        >;
    };
                                        
    davinci_mdio_default: davinci_mdio_default {
        pinctrl-single,pins = <
            /* MDIO */
            0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)    /* (M17) mdio_data.mdio_data */
            0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)                   /* (M18) mdio_clk.mdio_clk */
        >;
    };

    davinci_mdio_sleep: davinci_mdio_sleep {
        pinctrl-single,pins = <
            /* MDIO reset value */
            0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
            0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
        >;
    };
    ....
}
...
    &mac {
        active_slave = <1>;
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&cpsw_default>;
        pinctrl-1 = <&cpsw_sleep>;

        status = "okay";
    };

    &davinci_mdio {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&davinci_mdio_default>;
        pinctrl-1 = <&davinci_mdio_sleep>;

        status = "okay";
    };

    &cpsw_emac0 {
        phy_id = <&davinci_mdio>, <0>;
        phy-mode = "mii";
    };

    &cpsw_emac1 {
        phy_id = <&davinci_mdio>, <1>;
        phy-mode = "mii";
    };

After booting u-boot I can read PHY registers see results below:

=> mii dump 1 0
0.     (3100)                 -- PHY control register --
  (8000:0000) 0.15    =     0    reset
  (4000:0000) 0.14    =     0    loopback
  (2040:2000) 0. 6,13 =   b01    speed selection = 100 Mbps
  (1000:1000) 0.12    =     1    A/N enable
  (0800:0000) 0.11    =     0    power-down
  (0400:0000) 0.10    =     0    isolate
  (0200:0000) 0. 9    =     0    restart A/N
  (0100:0100) 0. 8    =     1    duplex = full
  (0080:0000) 0. 7    =     0    collision test enable
  (003f:0000) 0. 5- 0 =     0    (reserved)


=> mii dump 1 1
1.     (786d)                 -- PHY status register --
  (8000:0000) 1.15    =     0    100BASE-T4 able
  (4000:4000) 1.14    =     1    100BASE-X  full duplex able
  (2000:2000) 1.13    =     1    100BASE-X  half duplex able
  (1000:1000) 1.12    =     1    10 Mbps    full duplex able
  (0800:0800) 1.11    =     1    10 Mbps    half duplex able
  (0400:0000) 1.10    =     0    100BASE-T2 full duplex able
  (0200:0000) 1. 9    =     0    100BASE-T2 half duplex able
  (0100:0000) 1. 8    =     0    extended status
  (0080:0000) 1. 7    =     0    (reserved)
  (0040:0040) 1. 6    =     1    MF preamble suppression
  (0020:0020) 1. 5    =     1    A/N complete
  (0010:0000) 1. 4    =     0    remote fault
  (0008:0008) 1. 3    =     1    A/N able
  (0004:0004) 1. 2    =     1    link status
  (0002:0000) 1. 1    =     0    jabber detect
  (0001:0001) 1. 0    =     1    extended capabilities


=> mii dump 1 2
2.     (2000)                 -- PHY ID 1 register --
  (ffff:2000) 2.15- 0 =  8192    OUI portion


=> mii dump 1 3
3.     (a211)                 -- PHY ID 2 register --
  (fc00:a000) 3.15-10 =    40    OUI portion
  (03f0:0210) 3. 9- 4 =    33    manufacturer part number
  (000f:0001) 3. 3- 0 =     1    manufacturer rev. number


=> mii dump 1 4
4.     (01e1)                 -- Autonegotiation advertisement register --
  (8000:0000) 4.15    =     0    next page able
  (4000:0000) 4.14    =     0    (reserved)
  (2000:0000) 4.13    =     0    remote fault
  (1000:0000) 4.12    =     0    (reserved)
  (0800:0000) 4.11    =     0    asymmetric pause
  (0400:0000) 4.10    =     0    pause enable
  (0200:0000) 4. 9    =     0    100BASE-T4 able
  (0100:0100) 4. 8    =     1    100BASE-TX full duplex able
  (0080:0080) 4. 7    =     1    100BASE-TX able
  (0040:0040) 4. 6    =     1    10BASE-T   full duplex able
  (0020:0020) 4. 5    =     1    10BASE-T   able
  (001f:0001) 4. 4- 0 =     1    selector = IEEE 802.3


=> mii dump 1 5
5.     (cde1)                 -- Autonegotiation partner abilities register --
  (8000:8000) 5.15    =     1    next page able
  (4000:4000) 5.14    =     1    acknowledge
  (2000:0000) 5.13    =     0    remote fault
  (1000:0000) 5.12    =     0    (reserved)
  (0800:0800) 5.11    =     1    asymmetric pause able
  (0400:0400) 5.10    =     1    pause able
  (0200:0000) 5. 9    =     0    100BASE-T4 able
  (0100:0100) 5. 8    =     1    100BASE-X full duplex able
  (0080:0080) 5. 7    =     1    100BASE-TX able
  (0040:0040) 5. 6    =     1    10BASE-T full duplex able
  (0020:0020) 5. 5    =     1    10BASE-T able
  (001f:0001) 5. 4- 0 =     1    selector = IEEE 802.3

But when we are doing ping or dhcp device can't connect to HOST.
Also we have tried to see packets with network sniffer and I do not see any ping
packets from device.

Please  help to understand what we are doing wrong. 

  • Hi Vladimir,

    Have a look at the following threads:
    e2e.ti.com/.../260419
    e2e.ti.com/.../513709

    Do you get any debug messages, when doint ping ? Can you share the console output?

    Best Regards,
    Yordan
  • Hi Vladimir,

    Could you share your u-boot environment variables because it is possible to miss some important setting.

    BR
    Tsvetolin Shulev
  • Dear Yordan,
    Thank you for your reply.

    The console log is:

    U-Boot SPL 2016.05-gb4e185a8c3 (Oct 17 2016 - 12:39:03)
    Trying to boot from MMC1
    reading args
    spl_load_image_fat_os: error reading image args, err - -1
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img


    U-Boot 2016.05-gb4e185a8c3 (Oct 17 2016 - 12:39:03 +0400)

    Watchdog enabled
    I2C: ready
    DRAM: 256 MiB
    NAND: 256 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    Could not get board ID.
    Warning: ethernet@4a100000 MAC addresses don't match:
    Address in SROM is d0:ff:50:23:8d:b6
    Address in environment is d0:ff:50:23:8d:b5
    eth0: ethernet@4a100000
    Warning: usb_ether MAC addresses don't match:
    Address in SROM is de:ad:be:ef:00:01
    Address in environment is d0:ff:50:23:8d:b6
    , eth1: usb_ether
    Press SPACE to abort autoboot in 2 seconds
    => setenv ipaddr 192.168.10.10
    => ping 192.168.10.1
    link up on port 1, speed 100, full duplex
    Using ethernet@4a100000 device
    ping failed; host 192.168.10.1 is not alive



    Also I have added following debug print in driver/net/cpsw.c file:

    static int _cpsw_send(struct cpsw_priv *priv, void *packet, int length)
    {
    void *buffer;
    int len;
    int timeout = CPDMA_TIMEOUT;

    printf("DEBUG: _cpsw_send() -------------\n"); ///<-- Addedc debug print

    As result when I doing ping I see this message in console,
    but I can't see ARP (any) packets from my device to PC using Wireshark network sniffer application.


    After that I have checked with oscilloscope MII RX/TX clocks , MII RX/TX data lines,
    and MII TX EN signal results is following:

    MII_RXCLK - 25Mhz clock
    MII_TXCLK - 25Mhz clock
    MII_RXDx - there are some data activity (it means data is coming from PHY to CPU)
    MII_TXDx - there is no any data activity when I doing ping or dhcp command.
    MII_TXEN - always is 0

    So I think CPU not transmitting data to PHY via MII interface.

    With Regards
    Vladimir Zhukov
  • Dear Cvetolin,
    Thanks for your reply.

    The environment variables are:

    => printenv
    arch=arm
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    baudrate=115200
    board=am335x
    boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
    boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};elsebootefi ${kernel_addr_r} ${fdtcontroladdr};fi
    boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
    boot_fdt=try
    boot_net_usb_start=usb start
    boot_prefixes=/ /boot/
    boot_script_dhcp=boot.scr.uimg
    boot_scripts=boot.scr.uimg boot.scr
    boot_targets=mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp
    bootcmd=run findfdt; run init_console; run envboot; run distro_bootcmd
    bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi
    bootcmd_legacy_mmc0=setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
    bootcmd_legacy_mmc1=setenv mmcdev 1; setenv bootpart 1:2 ; run mmcboot
    bootcmd_mmc0=setenv devnum 0; run mmc_boot
    bootcmd_mmc1=setenv devnum 1; run mmc_boot
    bootcmd_nand=run nandboot
    bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootfile=zImage
    bootm_size=0x10000000
    bootpart=0:2
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    console=ttyO0,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc raw 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x100;u-boot.img.raw raw 0x300 0x400;spl-os-args.raw raw 0x80 0x80;spl-os-image.raw raw 0x900 0x2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
    dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    efi_dtb_prefixes=/ /dtb/ /dtb/current/
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
    eth1addr=d0:ff:50:23:8d:b6
    ethact=ethernet@4a100000
    ethaddr=d0:ff:50:23:8d:b5
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=8ffa4b30
    fdtfile=undefined
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = JLINKLTE; then setenv fdtfile jlinklte.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name = A335_ICE; then setenv fdtfile am335x-icev2.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
    finduuid=part uuid mmc 0:2 uuid
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_console=if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;else setenv console ttyO0,115200n8;fi;
    ipaddr=192.168.10.10
    kernel_addr_r=0x82000000
    load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};run envboot; if run loadimage; then run mmcloados;fi;fi;
    mmcdev=0
    mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcrootfstype=ext4 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
    netloadfdt=tftp ${fdtaddr} ${fdtfile}
    netloadimage=tftp ${loadaddr} ${bootfile}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
    pxefile_addr_r=0x80100000
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    ramdisk_addr_r=0x88080000
    ramroot=/dev/ram0 rw
    ramrootfstype=ext2
    rdaddr=0x88080000
    rootpath=/export/rootfs
    scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
    scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
    scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
    scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
    scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
    scriptaddr=0x80000000
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial@44e09000
    stdin=serial@44e09000
    stdout=serial@44e09000
    usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
    usbnet_devaddr=de:ad:be:ef:00:01
    vendor=ti
    ver=U-Boot 2016.05-gb4e185a8c3 (Oct 17 2016 - 12:39:03 +0400)

    Environment size: 8187/131068 bytes


    With Regard
    Vladimir Zhukov
  • Vladimir,

    Try to execute the steps described at:
    www.emcraft.com/.../using-dhcp
    Start ethernet capture before step 5. Post the output of step 5. Attach the ethernet capture if there is some packets.

    BR
    Tsvetolin Shulev
  • I Have done and as result I do not see any packets coming from devices side to PC via Wireshark sniffer (but I mast see DHCP, ARP,ICMP and TFTPpackets).
    below see log for console and Wireshark:

    U-BOOT:

    =>dhcp
    link up on port 1, speed 100, full duplex
    BOOTP broadcast 1
    BOOTP broadcast 2
    BOOTP broadcast 3
    BOOTP broadcast 4
    BOOTP broadcast 5
    BOOTP broadcast 6
    BOOTP broadcast 7
    BOOTP broadcast 8
    BOOTP broadcast 9
    BOOTP broadcast 10
    BOOTP broadcast 11
    BOOTP broadcast 12
    BOOTP broadcast 14
    BOOTP broadcast 15
    BOOTP broadcast 16
    BOOTP broadcast 17
    BOOTP broadcast 18
    BOOTP broadcast 19
    BOOTP broadcast 20
    BOOTP broadcast 21
    BOOTP broadcast 22
    BOOTP broadcast 23
    BOOTP broadcast 24
    BOOTP broadcast 25
    BOOTP broadcast 26
    BOOTP broadcast 27
    BOOTP broadcast 28
    BOOTP broadcast 29
    Retry time exceeded; starting again
    =>

    Wireshark:

    1 0.000000000 192.168.10.20 239.255.255.250 SSDP 175 M-SEARCH * HTTP/1.1

    Frame 1: 175 bytes on wire (1400 bits), 175 bytes captured (1400 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 239.255.255.250
    User Datagram Protocol, Src Port: 52743 (52743), Dst Port: 1900 (1900)
    Hypertext Transfer Protocol

    2 0.915395951 192.168.10.20 224.0.0.251 MDNS 83 Standard query 0x0000 PTR _sleep-proxy._udp.local, "QM" question

    Frame 2: 83 bytes on wire (664 bits), 83 bytes captured (664 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv4mcast_fb (01:00:5e:00:00:fb)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 224.0.0.251
    User Datagram Protocol, Src Port: 5353 (5353), Dst Port: 5353 (5353)
    Multicast Domain Name System (query)

    3 3.000052799 192.168.10.20 239.255.255.250 SSDP 175 M-SEARCH * HTTP/1.1

    Frame 3: 175 bytes on wire (1400 bits), 175 bytes captured (1400 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 239.255.255.250
    User Datagram Protocol, Src Port: 52743 (52743), Dst Port: 1900 (1900)
    Hypertext Transfer Protocol

    4 3.676368644 192.168.10.20 224.0.0.251 MDNS 479 Standard query response 0x0000 SRV, cache flush 0 0 2343 Armen-PC.local TXT, cache flush PTR _ni-logos._tcp.local PTR Armen-PC._ni-logos._tcp.local SRV, cache flush 0 0 445 Armen-PC.local TXT, cache flush PTR _smb._tcp.local PTR Armen-PC._smb._tcp.local A, cache flush 192.168.10.20 PTR, cache flush Armen-PC.local AAAA, cache flush fe80::3542:389f:3a1d:edd6 PTR, cache flush Armen-PC.local NSEC, cache flush Armen-PC._ni-logos._tcp.local NSEC, cache flush Armen-PC._smb._tcp.local NSEC, cache flush Armen-PC.local

    Frame 4: 479 bytes on wire (3832 bits), 479 bytes captured (3832 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv4mcast_fb (01:00:5e:00:00:fb)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 224.0.0.251
    User Datagram Protocol, Src Port: 5353 (5353), Dst Port: 5353 (5353)
    Multicast Domain Name System (response)

    5 13.355992170 fe80::3542:389f:3a1d:edd6 ff02::1:2 DHCPv6 150 Solicit XID: 0x7515a CID: 0001000119cc940ed43d7eb193ec

    Frame 5: 150 bytes on wire (1200 bits), 150 bytes captured (1200 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
    Internet Protocol Version 6, Src: fe80::3542:389f:3a1d:edd6, Dst: ff02::1:2
    User Datagram Protocol, Src Port: 546 (546), Dst Port: 547 (547)
    DHCPv6

    6 15.957703561 192.168.10.20 192.168.10.255 DB-LSP-DISC 186 Dropbox LAN sync Discovery Protocol

    Frame 6: 186 bytes on wire (1488 bits), 186 bytes captured (1488 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 192.168.10.255
    User Datagram Protocol, Src Port: 17500 (17500), Dst Port: 17500 (17500)
    Dropbox LAN sync Discovery Protocol

    7 19.689946625 192.168.10.20 224.0.0.251 MDNS 479 Standard query response 0x0000 SRV, cache flush 0 0 2343 Armen-PC.local TXT, cache flush PTR _ni-logos._tcp.local PTR Armen-PC._ni-logos._tcp.local SRV, cache flush 0 0 445 Armen-PC.local TXT, cache flush PTR _smb._tcp.local PTR Armen-PC._smb._tcp.local A, cache flush 192.168.10.20 PTR, cache flush Armen-PC.local AAAA, cache flush fe80::3542:389f:3a1d:edd6 PTR, cache flush Armen-PC.local NSEC, cache flush Armen-PC._ni-logos._tcp.local NSEC, cache flush Armen-PC._smb._tcp.local NSEC, cache flush Armen-PC.local

    Frame 7: 479 bytes on wire (3832 bits), 479 bytes captured (3832 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv4mcast_fb (01:00:5e:00:00:fb)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 224.0.0.251
    User Datagram Protocol, Src Port: 5353 (5353), Dst Port: 5353 (5353)
    Multicast Domain Name System (response)

    8 27.983156236 192.168.10.20 224.0.0.251 MDNS 83 Standard query 0x0000 PTR _sleep-proxy._udp.local, "QM" question

    Frame 8: 83 bytes on wire (664 bits), 83 bytes captured (664 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv4mcast_fb (01:00:5e:00:00:fb)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 224.0.0.251
    User Datagram Protocol, Src Port: 5353 (5353), Dst Port: 5353 (5353)
    Multicast Domain Name System (query)

    9 45.355536522 fe80::3542:389f:3a1d:edd6 ff02::1:2 DHCPv6 150 Solicit XID: 0x7515a CID: 0001000119cc940ed43d7eb193ec

    Frame 9: 150 bytes on wire (1200 bits), 150 bytes captured (1200 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv6mcast_01:00:02 (33:33:00:01:00:02)
    Internet Protocol Version 6, Src: fe80::3542:389f:3a1d:edd6, Dst: ff02::1:2
    User Datagram Protocol, Src Port: 546 (546), Dst Port: 547 (547)
    DHCPv6

    10 46.142599962 192.168.10.20 192.168.10.255 DB-LSP-DISC 186 Dropbox LAN sync Discovery Protocol

    Frame 10: 186 bytes on wire (1488 bits), 186 bytes captured (1488 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 192.168.10.255
    User Datagram Protocol, Src Port: 17500 (17500), Dst Port: 17500 (17500)
    Dropbox LAN sync Discovery Protocol

    11 51.695454584 192.168.10.20 224.0.0.251 MDNS 479 Standard query response 0x0000 SRV, cache flush 0 0 2343 Armen-PC.local TXT, cache flush PTR _ni-logos._tcp.local PTR Armen-PC._ni-logos._tcp.local SRV, cache flush 0 0 445 Armen-PC.local TXT, cache flush PTR _smb._tcp.local PTR Armen-PC._smb._tcp.local A, cache flush 192.168.10.20 PTR, cache flush Armen-PC.local AAAA, cache flush fe80::3542:389f:3a1d:edd6 PTR, cache flush Armen-PC.local NSEC, cache flush Armen-PC._ni-logos._tcp.local NSEC, cache flush Armen-PC._smb._tcp.local NSEC, cache flush Armen-PC.local

    Frame 11: 479 bytes on wire (3832 bits), 479 bytes captured (3832 bits) on interface 0
    Ethernet II, Src: Tp-LinkT_08:42:22 (10:fe:ed:08:42:22), Dst: IPv4mcast_fb (01:00:5e:00:00:fb)
    Internet Protocol Version 4, Src: 192.168.10.20, Dst: 224.0.0.251
    User Datagram Protocol, Src Port: 5353 (5353), Dst Port: 5353 (5353)
    Multicast Domain Name System (response)


    But when I making U-Boot for AM335x-EVM board and trying to this board I see on AM335x-EVM board DHCP working fine (in Wireshark I see DHCP,ARP,ICMP and TFTP packets.
  • I have resolved problem. The problem was in dts file.
    I have done following changes on dts, which helped to solve the problem:

    //Before
    &mac {
    active_slave = <1>;
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_default>;
    pinctrl-1 = <&cpsw_sleep>;

    status = "okay";
    };

    &davinci_mdio {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&davinci_mdio_default>;
    pinctrl-1 = <&davinci_mdio_sleep>;

    status = "okay";
    };

    &cpsw_emac0 {
    phy_id = <&davinci_mdio>, <0>;
    phy-mode = "mii";
    };

    &cpsw_emac1 {
    phy_id = <&davinci_mdio>, <1>;
    phy-mode = "mii";
    };

    //After

    &mac {
    active_slave = <0>; // -> select EMAC0.
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&cpsw_default>;
    pinctrl-1 = <&cpsw_sleep>;

    status = "okay";
    };

    &davinci_mdio {
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&davinci_mdio_default>;
    pinctrl-1 = <&davinci_mdio_sleep>;

    status = "okay";
    };

    &cpsw_emac0 {
    phy_id = <&davinci_mdio>, <1>; // -> select PHY address 1.
    phy-mode = "mii";
    };

    With Regards
    Vladimir Zhukov