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.

Unable to make EMAC0 port working in RMII with DM8148

Other Parts Discussed in Thread: PMP

Hi,

   I've been working for some time on trying to make EMAC0 port working with an external PHY in RMII mode.  My design is very similar to the DM8148 evm, but we had to replace the MII PHY that was on EMAC0, used on to the eval board, by a National (DP82848) which is only 10/100 and connect in RMII mode due to a lack of pin.

   The MDIO port seems to work as I detect correctly the PHY at boot-up with a valid speed/link in both U-Boot and the Kernel.  However, i'm unable to get an IP from my DHCP server nor ping my board by setting an IP manually.  Using a scope on RxD0/1, TxD0/1, CRSDV, REFCLK and TxEN close to the micro show me activity on those lines.  My Refclk is at 50MHz which i think is ok for RMII.

   My pinmux is as followed :

MDIO (pin H28) = Fct 1
MDCLK (pin P24) = Fct 1
RefClk (pin J27) = Fct 1
TxEN (pin R23) = Fct 3
TxD0 (pin G28) = Fct 3
TxD1 (pin P23) = Fct 3
CRSDV (pin H27) = Fct 3
RxER (pin J26) = Fct 3
RxD0 (pin R23) = Fct 3
RxD1 (pin R25) = Fct 3

   I also change the GMII_SEL register (addr = 0x48140650) to "0x5" for RMII mode.

   The behavior is the same in the kernel and in U-Boot which mean the PHY is detected but I can't ping nor communicate using this connection even if pulses that looks ok are observed to both Tx and Rx pins of the micro.  My assumption is that I missed something possibly related with the GigE or MII mode previously set on the evm but I can't find it...  I'm pretty confident about my hardware and think that something is badly set in the code.

   I tried different things in the CPSW structures of the "linux/devices.c" file of the kernel without any success (add rmii_en = 1 ; put gigabit_en = 0 ; phy_if = 4 ; ...)

 Any idea...?   Is someone could point me to the changes that should have been made to use a 10/100 RMII PHY instead of the one already connected on EMAC0 of the DM8148 evm...?  I would like to have this work in both U-Boot and the Kernel...

Regards!

Sebastien

 

 

 

 

 

  • Sebastien

    Can you provide the logs for kernel and uboot?

    with regards

    Mugunthan V N

  • Hi,

    I saw 2 small mistakes in the pinout you wrote, which are probably only in the text...

    1. MDIO pin should be P24 and MDCLK H28 and not the other way around as you wrote.

    2. RxD0 pin should be L23 and not R23 (I'm sure you couldn't connect this pin as RxD0 since you also wrote it as TxEN...)

     

    Try checking the registers in your PHY, to see if you have Link, and if the paramaters of Speed, Duplex etc. are all set to what you need.

     

    Itamar K.

  • Hi,

      Sorry for the typo, the MDIO, MDCLK and RxD0 pins are as you specified.  I did not check to the PHY register as the code already did so...  Below is the log when I boot my kernel.  You'll notice that a valid 100/FULL link is detected which is what I expected to.

     

    U-Boot 2010.06 (Nov 17 2011 - 13:13:05)

    TI8148-GP rev 2.1

    ARM clk: 600MHz
    DDR clk: 400MHz

    RAM Configuration:
    Bank #0: 80000000 1 GiB
    Bank #1: c0000000 1 GiB
    Using default environment

    The 2nd stage U-Boot will now be auto-loaded
    Please do not interrupt the countdown till TI8148_EVM prompt if 2nd stage is already flashed
    Hit any key to stop autoboot:  0
    mmc1 is available
    reading u-boot.bin

    189908 bytes read
    ## Starting application at 0x80800000 ...


    U-Boot 2010.06 (Dec 22 2011 - 12:02:52)

    TI8148-GP rev 2.1

    ARM clk: 600MHz
    DDR clk: 400MHz

    I2C:   ready
    DRAM:  2 GiB
    NAND:  NAND: Unable to find NAND settings in GPMC Configuration - quitting
    0 MiB
    *** Warning - bad CRC or NAND, using default environment

    Net:   <ethaddr> not set. Reading from E-fuse
    Detected MACID:40:5f:c2:62:8b:f8
    cpsw
    Hit any key to stop autoboot:  0
    mmc1 is available
    reading boot.scr

    206 bytes read
    Running bootscript from MMC/SD to set the ENV...
    ## Executing script at 80900000
    reading uImage

    2457588 bytes read
    ## Booting kernel from Legacy Image at 81000000 ...
       Image Name:   Linux-2.6.37
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    2457524 Bytes = 2.3 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    Linux version 2.6.37 (root@ubuntu) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #1 Fri Dec 23 06:23:00 PST 2011
    CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7f
    CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
    Machine: ti8148evm
    bootconsole [earlycon0] enabled
    reserved size = 52428800 at 0
    FB: Reserving 52428800 bytes SDRAM for VRAM
    Memory policy: ECC disabled, Data cache writeback
    OMAP chip is TI8148 2.0
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 19712
    Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 rw mem=128M earlyprintk
    PID hash table entries: 512 (order: -1, 2048 bytes)
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 78MB = 78MB total
    Memory: 73460k/73460k available, 57612k reserved, 0K highmem
    Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
        DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
        vmalloc : 0xc8800000 - 0xf8000000   ( 760 MB)
        lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
        modules : 0xbf000000 - 0xc0000000   (  16 MB)
          .init : 0xc0008000 - 0xc0037000   ( 188 kB)
          .text : 0xc0037000 - 0xc04a6000   (4540 kB)
          .data : 0xc04a6000 - 0xc04e9280   ( 269 kB)
    SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    NR_IRQS:375
    IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    Total of 128 interrupts on 1 active controller
    GPMC revision 6.0
    Trying to install interrupt handler for IRQ368
    Trying to install interrupt handler for IRQ369
    Trying to install interrupt handler for IRQ370
    Trying to install interrupt handler for IRQ371
    Trying to install interrupt handler for IRQ372
    Trying to install interrupt handler for IRQ373
    Trying to install interrupt handler for IRQ374
    Trying to install type control for IRQ375
    Trying to set irq flags for IRQ375
    OMAP clockevent source: GPTIMER1 at 20000000 Hz
    Console: colour dummy device 80x30
    Calibrating delay loop... 599.65 BogoMIPS (lpj=2998272)
    pid_max: default: 32768 minimum: 301
    Security Framework initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    devtmpfs: initialized
    omap_voltage_early_init: voltage driver support not added
    regulator: core version 0.5
    regulator: dummy:
    NET: Registered protocol family 16
    OMAP GPIO hardware version 0.1
    OMAP GPIO hardware version 0.1
    OMAP GPIO hardware version 0.1
    OMAP GPIO hardware version 0.1
    omap_mux_init: Add partition: #1: core, flags: 4
    registered ti814x_vpss device
    pm_dbg_init: only OMAP3 supported
    Registered ti81xx_fb device
    bio: create slab <bio-0> at 0
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    omap_i2c omap_i2c.1: bus 1 rev4.0 at 100 kHz
    pcf857x: probe of 1-0021 failed with error -121
    i2c i2c-1: Failed to register i2c client PCF_8575 at 0x21 (-16)
    i2c i2c-1: Can't create device at 0x21
    Advanced Linux Sound Architecture Driver Version 1.0.23.
    Switching to clocksource gp timer
    musb-hdrc: version 6.0, host, debug=0
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    TCP: Hash tables configured (established 4096 bind 4096)
    TCP reno registered
    UDP hash table entries: 256 (order: 0, 4096 bytes)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    NetWinder Floating Point Emulator V0.97 (double precision)
    PMU: registered new PMU device of type 0
    omap-iommu omap-iommu.0: ducati registered
    omap-iommu omap-iommu.1: sys registered
    JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    msgmni has been set to 143
    io scheduler noop registered
    io scheduler deadline registered
    io scheduler cfq registered (default)
    Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
    omap_uart.0: ttyO0 at MMIO 0x48020000 (irq = 72) is a OMAP UART0
    console [ttyO0] enabled, bootconsole disabled
    console [ttyO0] enabled, bootconsole disabled
    omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
    omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
    omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
    brd: module loaded
    loop: module loaded
    ahci ahci.0: forcing PORTS_IMPL to 0x1
    ahci ahci.0: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl platform mode
    ahci ahci.0: flags: ncq sntf pm led clo only pmp pio slum part ccc apst
    scsi0 : ahci_platform
    ata1: SATA max UDMA/133 mmio [mem 0x4a140000-0x4a150fff] port 0x100 irq 16
    omap2-nand driver initializing
    davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    davinci_mdio davinci_mdio.0: detected phy mask fffffffd
    davinci_mdio.0: probed
    davinci_mdio davinci_mdio.0: phy[1]: device 0:01, driver unknown
    usbcore: registered new interface driver cdc_ether
    usbcore: registered new interface driver dm9601
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    mice: PS/2 mouse device common for all mice
    qt602240_ts 1-004a: __qt602240_read_reg: i2c transfer failed
    qt602240_ts: probe of 1-004a failed with error -5
    i2c /dev entries driver
    Linux video capture interface: v2.00
    usbcore: registered new interface driver uvcvideo
    USB Video Class driver (v1.0.0)
    OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    usbcore: registered new interface driver snd-usb-audio
    asoc: tlv320aic3x-hifi <-> davinci-mcasp.2 mapping ok
    ALSA device list:
      #0: TI81XX EVM
    TCP cubic registered
    NET: Registered protocol family 17
    Registering the dns_resolver key type
    VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    omap_voltage_late_init: Voltage driver support not added
    Detected MACID=0:0:0:0:0:0
    mmc0: new high speed SD card at address b368
    mmcblk0: mmc0:b368 CACTU 1.91 GiB
     mmcblk0: p1 p2
    ata1: SATA link down (SStatus 0 SControl 300)
    EXT3-fs: barriers not enabled
    kjournald starting.  Commit interval 5 seconds
    EXT3-fs (mmcblk0p2): warning: maximal mount count reached, running e2fsck is recommended
    EXT3-fs (mmcblk0p2): using internal journal
    EXT3-fs (mmcblk0p2): recovery complete
    EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
    VFS: Mounted root (ext3 filesystem) on device 179:2.
    devtmpfs: mounted
    Freeing init memory: 188K
    INIT: version 2.86 booting
    Please wait: booting...
    Error opening /dev/fb0: No such file or directory
    Starting udev
    udevd (73): /proc/73/oom_adj is deprecated, please use /proc/73/oom_score_adj instead.
    udev: starting version 141
    Remounting root file system...
    Caching udev devnodes
    Populating dev cachemv: cannot rename '/tmp/devices': No such file or directory
    NET: Registered protocol family 10
    ALSA: Restoring mixer settings...
    No state is present for card EVM
    Found hardware: "" "" "" "" ""
    Hardware is initialized using a generic method
    Configuring network interfaces... No state is present for card EVM

    CPSW phy found : id is : 0x20005c90
    ADDRCONF(NETDEV_UP): eth0: link is not ready
    udhcpc (v1.13.2) started
    Sending discover...
    PHY: 0:01 - Link is Up - 100/Full
    ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    Sending discover...
    Sending discover...
    No lease, forking to background
    done.
    Setting up IP spoofing protection: rp_filter.
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    Fri Aug 19 04:54:00 UTC 2011
    hwclock: can't open '/dev/misc/rtc': No such file or directory
    INIT: Entering runlevel: 5
    Starting system message bus: dbus.
    Starting telnet daemon.
    Starting syslogd/klogd: done
    Starting thttpd.

     _____                    _____           _         _
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|
                  |___|                    |___|

    Arago Project http://arago-project.org dm814x-evm ttyO0

    Arago 2011.05 dm814x-evm ttyO0

    dm814x-evm login:

     

     I'm back from vacation since this morning so if you guys have any ideas for me please let me know.

    Regards!

    Seb

     

     

     

  • Sebastien

    Can you clarify the following?

    • Which PSP version is used?
    • Which EMAC (EMAC0/EMAC1) is connected to the Phy?
    • Can you provice the ALE dump by using the following command?
      • cat /sys/devices/platform/cpsw.0/net/eth0/ale_table

    with regards

    Mugunthan V N

  • Hi,

       Thanks for your fast answer.

    1- I'm using version 5_02_00_57 of the PSP

    2- My PHY is connected on EMAC0

    3- Here's the result of the cat command :

    root@dm814x-evm:~# cat /sys/devices/platform/cpsw.0/net/eth0/ale_table
    index 0, raw: 00000000 1000bac2 d4d5aa55, type: addr(1), addr: ba:c2:d4:d5:aa:55, uctype: persistant(0), port: 0
    index 1, raw: 0000000c d000ffff ffffffff, type: addr(1), addr: ff:ff:ff:ff:ff:ff, mcstate: f(3), port mask: 3, no super

    Regards!

    Seb

     

  • Sebastien

    From software, all the possible things are proper. Can you double check the pin mux, clocks and internal delay is required for the phy?

    Can you check ss there any errata in the phy?

    Can you try using ethernet (dhcp or tftp) in uboot which will be easier to debug?

    with regards

    Mugunthan V N