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.

AM335x Ethernet can't ping from U-Boot

Other Parts Discussed in Thread: TLK106, AM3352, TPS65910

I have a custom board that uses the AM3352 and has two Ethernet ports, one with sn SMSC LAN8720Ai phy and the other with a TI TLK106 phy.  I believe I've modified the pinmux settings for RMII correctly.

After setting an IP address in U-Boot and performing a ping to a host I know is up, I'm not getting a response, but do get output indicating something is occurring:

U-Boot# setenv ipaddr 192.168.98.200
U-Boot# ping 192.168.98.14
entered cpsw_control line 649
link up on port 0, speed 100, full duplex
Using cpsw device
entered cpsw_control line 649
ping failed; host 192.168.98.14 is not alive

Can anyone suggest how to debug this?  Hardware is brand new and untested apart from being able to boot u-Boot and the kernel.  Wireshark indicates no outbound traffic from the board.

  • Hello Sean,

    How are you sourcing the 50MHz RMII clock?

    Did you perform a timing analysis of the RMII interfaces prior to board fab?

  • Ah yes been told by the hardware guys that the board is not currently wired up for the 50MHz clock.

    There is a 25MHz crystal that goes to the LAN8720A(i) phy chip.  There is an MDIO_CLK signal that comes from the CPU and goes to the phy chip, I assume that's the pin we want the 50Mhz signal on?  If yes, what type of config. beyond what's being done on the BeagleBone or SK EVM is needed to get the 50Mhz signal?

  • The MDIO clock (MDC) is sourced by the AM335x; no external clock source is needed for this interface.  MDIO is a bussed interface so both PHYs share the same clock and data signals. 

    The LAN8720a can derive a 50Mhz clock from an attached 25MHz crystal, which can then be used to source the AM335x's 50MHz RMIIx_REFLCK input via its REFCLKO pin. The TLK106 does not have this capability and as such a 50MHz reference clock must be supplied. It may be possible to also use the LAN8720a 50MHz output (REFCLKO) as an input to both the TLK106 and the associated AM335x MAC reference clock input, but SMSC does not publish the jitter specifications for this output clock so you may run into jitter and/or timing issues due to the associated increase in trace length and device loads. Extra care would need to be taken to ensure that trace lengths are reasonable and that a timing analysis reveals no problem with this solution.

    Given the two PHYs that you have chosen to use on your board, the easiest solution would be to use a single discrete LVCMOS 50MHz, 50ppm, low jitter oscillator to source the reference clocks to both AM335x RMII_REFCLK pins and both PHYs. 


  • I checked the 50MHz and 25MHz clock signals and they looked OK.  My schematic for eth0 at http://resplendid.com/eth0.png.

    What needs to be configured in the software to get RMII to work?  I believe I have my pinmux settings correct (see below), perhaps I am missing something?

    /* Module pin mux for rmii1 */
    static struct pinmux_config rmii1_pin_mux[] = {
            {"mii1_crs.rmii1_crs_dv", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mii1_rxerr.mii1_rxerr", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mii1_txen.mii1_txen", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
            {"mii1_txd1.mii1_txd1", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
            {"mii1_txd0.mii1_txd0", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
            {"mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"rmii1_refclk.rmii1_refclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
            {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP},
            {NULL, 0},
    };

  • From a quick glance, the pin mux looks correct. Look around in u-boot for the gmii_sel register. This selects whether you are using mii/rmii/rgmii. Only beaglebone < A3 use RMII; all others use MII.

    Steve K.

  • Have you selected RMII mode by setting the respective GMIIx_SEL bits in the GMII_SEL register to "01"? 

    Have you selected RMII reference clock input mode by setting the respective MIIx_IO_CLK_EN bit in the GMII_SEL register to "1"?

    Regards,
    Paul

  • I have the gmii_sel register set to 0xc5, is that right?

  • You have bits 4 and 5 set to "0" which the TRM shows to be a reserved value for these bits, but this should not cause an issue since these only affect RGMII mode.  However, I would recommend you change the value to 0xF5 to be consistent with the TRM.

    Regards,
    Paul

  • Yes tried F5, no difference.  Are there any type of registers that can be read to further probe what's going on?

  • Do you have access to a logic analyzer that can be connected to the RMII signals?

    If so, it may be helpful if you can monitor the RMII signals with a logic analyzer while sending and receiving known data packets to confirm the data transferred between the PHY and AM335x matches the expected data.

    Regards,
    Paul

  • i could rig something up on Monday.  How can I create the known data packets?

  • Please post a higher resolution schematic, preferably in PDF format. I'd also like to see the entire PHY->MAC interface.

  • Sure, see http://resplendid.com/sundac_n.pdf

  • I took a quick look at ETH0 and don't see anything obviously wrong from a schematic perspective. I did note that the MODE pins of the 8720 are only pulled up with 10K resistors. The AM335x is actively pulling these pins low after POR is complete...the PHY may not correctly latch the desired mode of '111' to enable auto negotiation depending on when it is latching them in relation to our POR. 1.5-2K resistors would be a better choice.

    In your first post, u-boot indicated that the link was up @ 100Mbit/Full...do the PHY link lights corroborate this? 

  • Yes LEDs do indicate an active 100MB link.  Does the fact that U-Boot displays this message mean that at least some communication between the CPU and the PHY is occurring?

  • Looking at the source at Arago u-boot-am33x.git, in addition to the gmii_sel setting, the phy_if fields is also changed.

    arch/arm/cpu/armv7/am33xx/board.c

      59 /* MII mode defines */
      60 #define MII_MODE_ENABLE         0x0
      61 #define RGMII_MODE_ENABLE       0xA
    ...
     675         if (board_is_bone()) {
     676                 writel(MII_MODE_ENABLE, &cdev->miisel);
     677                 cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
     678                                 PHY_INTERFACE_MODE_MII;
     679         } else {
     680                 writel(RGMII_MODE_ENABLE, &cdev->miisel);
     681                 cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
     682                                 PHY_INTERFACE_MODE_RGMII;
     683         }

    A search around the forum for cpsw_slaves I found this thread:

    http://e2e.ti.com/support/arm/sitara_arm/f/791/t/243088.aspx
    lan8720 PHY on XAM3359 through RMII

  • I have never used these tools, but was told they could be used to generate/analyze Ethernet packets.

    Ethernet Traffic generator:
    http://code.google.com/p/ostinato/

    Ethernet Packet capture:
    http://sourceforge.net/projects/wireshark/

    Regards,
    Paul

  • I think I've gotten the lower level PHY interfacing working, I had two lines in the cpsw init that were commented out.  I now can an eth0 interface when i boot to Linux.  The problem now is that DHCP requests never seem to get a response, and neither do pings.  I've run tcpdump on my board and it shows the outgoing packets correctly (as does Wireshark on another PC), but indicates nothing is ever received.  My pinmux settings are:

    static struct pinmux_config rmii1_pin_mux[] = {
            {"mii1_crs.rmii1_crs_dv", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mii1_rxerr.rmii1_rxerr", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mii1_txen.rmii1_txen", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA},
            {"mii1_txd1.rmii1_txd1", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
            {"mii1_txd0.rmii1_txd0", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
            {"mii1_rxd1.rmii1_rxd1", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mii1_rxd0.rmii1_rxd0", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN},
            {"rmii1_refclk.rmii1_refclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN},
            {"mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
            {"mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP},
            {NULL, 0},
    };

    Once booted Linux I see:

    root@arm:~# ifconfig
    eth0      Link encap:Ethernet  HWaddr bc:6a:29:57:3e:dc
              UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    Running dhcp gives:

    root@arm:~# /etc/init.d/networking restart
    Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces ... (warning).
    Reconfiguring network interfaces...Internet Systems Consortium DHCP Client 4.2.2
    Copyright 2004-2011 Internet Systems Consortium.
    All rights reserved.
    For info, please visit https://www.isc.org/software/dhcp/

    Listening on LPF/eth0/bc:6a:29:57:3e:dc
    Sending on   LPF/eth0/bc:6a:29:57:3e:dc
    Sending on   Socket/fallback
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 21
    DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
    No DHCPOFFERS received.
    Unable to obtain a lease on first try.  Exiting.
    Failed to bring up eth0.
    done.

    My dmesg output is:


    root@arm:~# dmesg
    [    0.000000] Linux version 3.2.0suned_01 (smachin@Ubuntu12) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #23 PREEMPT Tue Apr 30 13:10:07 PDT 2013
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: am335xevm_sundac
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] On node 0 totalpages: 65536
    [    0.000000] free_area_init_node: node 0, pgdat c06cc050, node_mem_map c0b1e000
    [    0.000000]   Normal zone: 512 pages used for memmap
    [    0.000000]   Normal zone: 0 pages reserved
    [    0.000000]   Normal zone: 65024 pages, LIFO batch:15
    [    0.000000] AM335X ES1.0 (neon )
    [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
    [    0.000000] pcpu-alloc: [0] 0
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext3 rootwait ip=none
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 256MB = 256MB total
    [    0.000000] Memory: 248460k/248460k available, 13684k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc04d1000   (4900 kB)
    [    0.000000]       .init : 0xc04d1000 - 0xc0506000   ( 212 kB)
    [    0.000000]       .data : 0xc0506000 - 0xc06cc900   (1819 kB)
    [    0.000000]        .bss : 0xc06cc924 - 0xc0b1dedc   (4422 kB)
    [    0.000000] NR_IRQS:396
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [    0.000000] Total of 128 interrupts on 1 active controller
    [    0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
    [    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz
    [    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms
    [    0.000000] Console: colour dummy device 80x30
    [    0.000000] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
    [    0.000000] ... MAX_LOCKDEP_SUBCLASSES:  8
    [    0.000000] ... MAX_LOCK_DEPTH:          48
    [    0.000000] ... MAX_LOCKDEP_KEYS:        8191
    [    0.000000] ... CLASSHASH_SIZE:          4096
    [    0.000000] ... MAX_LOCKDEP_ENTRIES:     16384
    [    0.000000] ... MAX_LOCKDEP_CHAINS:      32768
    [    0.000000] ... CHAINHASH_SIZE:          16384
    [    0.000000]  memory used by lock dependency info: 3935 kB
    [    0.000000]  per task-struct memory footprint: 2304 bytes
    [    0.000244] Calibrating delay loop... 718.02 BogoMIPS (lpj=3590144)
    [    0.118988] pid_max: default: 32768 minimum: 301
    [    0.119049] Security Framework initialized
    [    0.119110] Mount-cache hash table entries: 512
    [    0.120697] CPU: Testing write buffer coherency: ok
    [    0.150970] omap_hwmod: gfx: failed to hardreset
    [    0.167266] omap_hwmod: pruss: failed to hardreset
    [    0.171112] print_constraints: dummy:
    [    0.172698] NET: Registered protocol family 16
    [    0.181640] OMAP GPIO hardware version 0.1
    [    0.194519] entered am335x_evm_init
    [    0.195495] omap_mux_init: Add partition: #1: core, flags: 0
    [    0.200378] entered omap_serial_board_init
    [    0.208770]  omap_i2c.1: alias fck already exists
    [    0.212860]  omap2_mcspi.1: alias fck already exists
    [    0.213989]  omap2_mcspi.2: alias fck already exists
    [    0.219573]  edma.0: alias fck already exists
    [    0.219604]  edma.0: alias fck already exists
    [    0.219635]  edma.0: alias fck already exists
    [    0.317138] bio: create slab <bio-0> at 0
    [    0.331420] SCSI subsystem initialized
    [    0.341125] usbcore: registered new interface driver usbfs
    [    0.343475] usbcore: registered new interface driver hub
    [    0.344970] usbcore: registered new device driver usb
    [    0.345581] musb-ti81xx musb-ti81xx: musb0, board_mode=0x13, plat_mode=0x3
    [    0.347442] musb-ti81xx musb-ti81xx: musb1, board_mode=0x13, plat_mode=0x1
    [    0.355224] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
    [    0.365112] tps65910 1-002d: JTAGREVNUM 0x0
    [    0.371032] print_constraints: VRTC:
    [    0.373382] print_constraints: VIO: at 1500 mV
    [    0.377838] print_constraints: VDD1: 600 <--> 1500 mV at 1262 mV normal
    [    0.382019] print_constraints: VDD2: 600 <--> 1500 mV at 1137 mV normal
    [    0.384460] print_constraints: VDD3: 5000 mV
    [    0.387786] print_constraints: VDIG1: at 1800 mV
    [    0.390930] print_constraints: VDIG2: at 1800 mV
    [    0.393829] print_constraints: VPLL: at 1800 mV
    [    0.397186] print_constraints: VDAC: at 1800 mV
    [    0.400878] print_constraints: VAUX1: at 1800 mV
    [    0.403747] print_constraints: VAUX2: at 3300 mV
    [    0.407104] print_constraints: VAUX33: at 3300 mV
    [    0.410278] print_constraints: VMMC: at 3300 mV
    [    0.413696] tps65910 1-002d: No interrupt support, no core IRQ
    [    0.429443] Switching to clocksource gp timer
    [    0.570678] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
    [    0.571044] musb-hdrc musb-hdrc.0: dma type: pio
    [    0.572875] MUSB0 controller's USBSS revision = 4ea20800
    [    0.572937] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    0.572967] musb-hdrc: MHDRC RTL version 2.0
    [    0.572967] musb-hdrc: setup fifo_mode 4
    [    0.572998] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    0.573028] musb-hdrc.0: bulk split disabled
    [    0.573028] musb-hdrc.0: bulk combine disabled
    [    0.576721] musb-hdrc musb-hdrc.0: USB OTG mode controller at d083c000 using PIO, IRQ 18
    [    0.577331] musb-hdrc musb-hdrc.1: dma type: pio
    [    0.581085] MUSB1 controller's USBSS revision = 4ea20800
    [    0.581146] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [    0.581176] musb-hdrc: MHDRC RTL version 2.0
    [    0.581207] musb-hdrc: setup fifo_mode 4
    [    0.581237] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [    0.581237] musb-hdrc.1: bulk split disabled
    [    0.581237] musb-hdrc.1: bulk combine disabled
    [    0.581329] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [    0.581817] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
    [    0.582550] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    0.582580] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    0.582580] usb usb1: Product: MUSB HDRC host driver
    [    0.582611] usb usb1: Manufacturer: Linux 3.2.0suned_01 musb-hcd
    [    0.582611] usb usb1: SerialNumber: musb-hdrc.1
    [    0.588928] hub 1-0:1.0: USB hub found
    [    0.589019] hub 1-0:1.0: 1 port detected
    [    0.594268] musb-hdrc musb-hdrc.1: USB Host mode controller at d083e800 using PIO, IRQ 19
    [    0.595672] NET: Registered protocol family 2
    [    0.597198] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.599304] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    [    0.599578] TCP bind hash table entries: 8192 (order: 6, 360448 bytes)
    [    0.601745] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.601806] TCP reno registered
    [    0.601837] UDP hash table entries: 128 (order: 1, 12288 bytes)
    [    0.601989] UDP-Lite hash table entries: 128 (order: 1, 12288 bytes)
    [    0.602661] NET: Registered protocol family 1
    [    0.603546] NetWinder Floating Point Emulator V0.97 (extended precision)
    [    0.643157] JFFS2 version 2.2. (NAND) (SUMMARY)  \xffffffc2\xffffffa9 2001-2006 Red Hat, Inc.
    [    0.644409] msgmni has been set to 485
    [    0.663391] alg: No test for stdrng (krng)
    [    0.664215] io scheduler noop registered
    [    0.664215] io scheduler deadline registered
    [    0.664245] io scheduler cfq registered (default)
    [    0.674407] Could not set LED4 to fully on
    [    0.688507] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
    [    1.343231] console [ttyO0] enabled
    [    1.349456] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    [    1.358764] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    [    1.370300] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
    [    1.380523] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
    [    1.391937] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
    [    1.407440] omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00
    [    1.537689] brd: module loaded
    [    1.616577] loop: module loaded
    [    1.622253] i2c-core: driver [tsl2550] using legacy suspend method
    [    1.628692] i2c-core: driver [tsl2550] using legacy resume method
    [    1.635437] at24 1-0051: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
    [    1.700103] No daughter card found
    [    1.703765] at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
    [    1.713287] board is a SunDAC, emulating eeprom read
    [    1.718475] Board name: SUNDAC
    [    1.721679] Board version: 00A1
    [    1.724975] The board is a SunDAC.
    [    1.734466]  omap_hsmmc.0: alias fck already exists
    [    1.751220] registered am33xx_sr device
    [    1.777130] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.785736] omap2-nand driver initializing
    [    1.792694] OneNAND driver initializing
    [    1.870147] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    [    1.876617] davinci_mdio davinci_mdio.0: detected phy mask 7ffffffe
    [    1.892242] davinci_mdio.0: probed
    [    1.895812] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver SMSC LAN8710/LAN8720
    [    1.904571] davinci_mdio davinci_mdio.0: phy[31]: device 0:1f, driver unknown
    [    1.913269] usbcore: registered new interface driver cdc_ether
    [    1.921813] usbcore: registered new interface driver cdc_eem
    [    1.928588] usbcore: registered new interface driver dm9601
    [    1.934631] cdc_ncm: 04-Aug-2011
    [    1.938568] usbcore: registered new interface driver cdc_ncm
    [    1.944671] Initializing USB Mass Storage driver...
    [    1.952362] usbcore: registered new interface driver usb-storage
    [    1.958648] USB Mass Storage support registered.
    [    1.970733] mousedev: PS/2 mouse device common for all mice
    [    1.988891] omap_rtc am33xx-rtc: rtc core: registered am33xx-rtc as rtc0
    [    1.996215] am33xx-rtc: already running
    [    2.000854] i2c /dev entries driver
    [    2.019012] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    2.039459] cpuidle: using governor ladder
    [    2.050537] cpuidle: using governor menu
    [    2.066711] omap4_aes_mod_init: loading AM33X AES driver
    [    2.072967] omap4-aes omap4-aes: AM33X AES hw accel rev: 3.02
    [    2.081359] omap4_aes_probe: probe() done
    [    2.086334] omap4_sham_mod_init: loading AM33X SHA/MD5 driver
    [    2.094726] omap4-sham omap4-sham: AM33X SHA/MD5 hw accel rev: 4.03
    [    2.132598] omap4_sham_probe: probe() done
    [    2.146484] usbcore: registered new interface driver usbhid
    [    2.152770] usbhid: USB HID core driver
    [    2.156829] mmc0: host does not support reading read-only switch. assuming write-enable.
    [    2.165466] nf_conntrack version 0.5.0 (3882 buckets, 15528 max)
    [    2.173217] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    2.179016] mmc0: new high speed SDHC card at address b368
    [    2.185119] TCP cubic registered
    [    2.188507] NET: Registered protocol family 17
    [    2.198974] mmcblk0: mmc0:b368       3.73 GiB
    [    2.203887] Registering the dns_resolver key type
    [    2.209167] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    2.225494] ThumbEE CPU extension supported.
    [    2.230010] mux: Failed to setup hwmod io irq -22
    [    2.235992]  mmcblk0: p1 p2
    [    2.263793] Power Management for AM33XX family
    [    2.268829] Compensating OPP0 for 0mV Orig nvalue:0x998f80 New nvalue:0x998f80
    [    2.277862] Compensating OPP1 for 0mV Orig nvalue:0x998f80 New nvalue:0x998f80
    [    2.287902] Compensating OPP0 for 0mV Orig nvalue:0x999f8d New nvalue:0x999f8d
    [    2.295593] Compensating OPP1 for 0mV Orig nvalue:0x9a86eb New nvalue:0x9a86eb
    [    2.303253] Compensating OPP2 for 0mV Orig nvalue:0xaaebcd New nvalue:0xaaebcd
    [    2.310913] Compensating OPP3 for 0mV Orig nvalue:0xaac9b0 New nvalue:0xaac9b0
    [    2.318695] create_regulator: VDD1: Failed to create debugfs directory
    [    2.334350] smartreflex smartreflex: am33xx_sr_probe: Driver initialized
    [    2.346008] clock: disabling unused clocks to save power
    [    2.366088] Detected MACID=bc:6a:29:57:3e:dc
    [    2.380310] cpsw: Detected MACID = bc:6a:29:57:3e:dd
    [    2.397766] omap_rtc am33xx-rtc: setting system clock to 2000-01-01 00:24:29 UTC (946686269)
    [    2.413238] EXT4-fs (mmcblk0p2): mounting ext3 file system using the ext4 subsystem
    [    2.441497] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    2.450531] VFS: Mounted root (ext3 filesystem) readonly on device 179:2.
    [    2.458007] Freeing init memory: 212K
    [    9.997192] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
    [   18.548217] net eth0: CPSW phy found : id is : 0x7c0f1
    [   21.541961] PHY: 0:00 - Link is Up - 100/Full
    root@arm:~#

  • I repeated the above tests on a second board, on this board the first ethernet port is showing up as eth2, not eth0.  Not sure how that affects the problem of not being able to receive?  Still can't receive on eth0.

  • As an additional data point eth0 seems to work correctly in U-Boot (I can ping another host), but still not receiving anything when booted to Linux.  I've attached my relevant design files.

  • Could you post another ifconfig after the the completion of the dhcp request? Are the packet or error counts showing anything?

  • Just now I was able to get eth0 to work, if

    1. I set it to a static address
    2. I run /etc/init.d/network restart after bootup

    After restarting the network a 2nd time it all comes to life.  Does anyone know why DHCP is not working and why a 2nd restart of the interface is required when static?

  • It would be a good idea to dump the PHY registers after boot to ensure that the PHY is latching the correct modes/address after POR. Once you are sure the PHY configuration is correct, compare it with the MAC config to ensure both are on the same page (so to speak).

  • Sure, how do I dump the phy registers?  I'm using Debian Wheezy.

  • I am assuming that Debian the file syste that you are using.

    Do you have network based rules defined here in your /etc/udev/rules.d ? Specifically this one 70-persistent-net.rules? This file has caused some issues in the past about the interface being able to be enabled. Specifically showing up as eth2 for example.

  • Yes I do have that .rules file, it's contents are below.  My main problem now is that I have to bring up eth0 a second time after booting for it to be recognized, and performance is pretty slow (10s of KB/sec download).  Also how do you dump the PHY registers?

    # This file was automatically generated by the /lib/udev/write_net_rules
    # program, run by the persistent-net-generator.rules rules file.
    #
    # You can modify it, as long as you keep each rule on a single
    # line, and change only the value of the NAME= key.

    # Unknown net device (/devices/platform/omap/cpsw/net/eth0) (cpsw)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="bc:6a:29:57:3e:dd
    c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

    # Unknown net device (/devices/platform/omap/cpsw/net/eth1) (cpsw)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="bc:6a:29:57:3e:dd
    d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

  • you can use the devmem2 utility which allows you read physical addresses from linux, but that may not be in the file system that you are using.

    In the file system that ships with the SDK we do not use the net persistent rules. Is it possible to use the file system that comes with SDK? 

  • We must use Debian as all our software was developed against it, and it's a good distribution anyway :)

    Should I try removing the net persistent rules?

  • Yes, as well as the script that generates it. This is an experiment to try, the behaviour could be different since you are using a different file system.

  • Also my network performance is pretty slow, 10s of kb/sec on downloads.

    ethtool shows my interface us running at 10Mbs, but our LAN here is at least 100Mbps.

    root@arm:~# ethtool eth0
    Settings for eth0:
            Supported ports: [ TP MII ]
            Supported link modes:   10baseT/Half 10baseT/Full
            Supported pause frame use: Symmetric Receive-only
            Supports auto-negotiation: Yes
            Advertised link modes:  10baseT/Half 10baseT/Full
            Advertised pause frame use: Symmetric Receive-only
            Advertised auto-negotiation: Yes
            Speed: 10Mb/s
            Duplex: Full
            Port: MII
            PHYAD: 0
            Transceiver: external
            Auto-negotiation: on
            Current message level: 0x00000000 (0)

            Link detected: yes


    Also a read of the status register (offset 1 see Phy ref. manual 4.2.2) returns 111100000101101 in binary, indicates that the phy was not able to operate in 100MBps mode.


  • I can show what I have in a hope it will help in some way:


    /* Module pin mux for rmii1 */
    static struct pinmux_config rmii1_pin_mux[] = {
    { "mii1_crs.rmii1_crs_dv", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN },
    { "mii1_rxerr.mii1_rxerr", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN },
    { "mii1_txen.mii1_txen", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT },
    { "mii1_txd1.mii1_txd1", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT },
    { "mii1_txd0.mii1_txd0", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT },
    { "mii1_rxd1.mii1_rxd1", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN },
    { "mii1_rxd0.mii1_rxd0", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLDOWN },
    { "rmii1_refclk.rmii1_refclk", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLDOWN },
    { "mdio_data.mdio_data", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP },
    { "mdio_clk.mdio_clk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT_PULLUP },
    { NULL, 0 },
    };


    root@x335x:~# ethtool eth0
    Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: external
    Auto-negotiation: on
    Current message level: 0x00000000 (0)

    Link detected: yes


    I use external 50MHz good quality refclk source. There are known issues about RMII refclk. Maybe you are lucky with LAN8720 use? (It is known to function but nobody ever guaranteed that). Could you try 50MHz oscillator instead?

  • This post was resolved in the following thread.
     
    [AM335x] Board Porting - BeagleBone MII to 2xRMII
  • Hello,

    I am facing the same problem than you.
    Could you please specify which lines you changed and in the function I can find them?

    Best regards
    Angel