UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor llyypp
Visitor
16,281 Views
Registered: ‎09-11-2012

zynq linux - dual emacps(gem) problem

 

Hello
I have been applying dual emacps(gem1, gem2) of zynq-7020 on Linux in my custom zynq board
But an error occurred in the kernel boot process
Eth0 was initialized But Eth1 was not initialized successfully
Error message is as follows:

Can you tell me how to fix this problem.

 

 ***********************************************************************************************************************************

## Starting application at 0x00008000 ...
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.3.0-14.2-build1-01491-g42fac65-dirty (hyun@hyun) (gcc version 4.6.1 (Sourcery CodeBench Lite 2011.09-50) ) #6 SMP PREEMPT Tue Sep 25 19:45:19 KST 2012
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: Xilinx Zynq Platform, model: Xilinx Zynq ZC702
Memory policy: ECC disabled, Data cache writealloc
PERCPU: Embedded 7 pages/cpu @c1489000 s5696 r8192 d14784 u32768
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129920
Kernel command line: console=ttyPS0,115200 root=/dev/ram rw initrd=0x800000,8M
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 506432k/506432k available, 17856k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc040294c   (4075 kB)
      .init : 0xc0403000 - 0xc0427640   ( 146 kB)
      .data : 0xc0428000 - 0xc0453820   ( 175 kB)
       .bss : 0xc0453844 - 0xc046da5c   ( 105 kB)
Preemptible hierarchical RCU implementation.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:128
[SHKIM][drivers/of/irq.c:419-of_irq_init()]111111
[SHKIM][drivers/of/irq.c:422-of_irq_init()]222222
[SHKIM][drivers/of/irq.c:450-of_irq_init()]
[SHKIM][drivers/of/irq.c:461-of_irq_init()]: match->compatible=arm,cortex-a9-gic
[SHKIM]of_irq_init: init arm,cortex-a9-gic @ c1484798, parent   (null)
xlnx,ps7-ttc-1.00.a #0 at 0xe0800000, irq=43
Console: colour dummy device 80x30
Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
smp_twd: clock not found: -2
Calibrating local timer... 333.49MHz.
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
Setting up static identity map for 0x2ebec8 - 0x2ebefc
CPU1: Booted secondary processor
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (2664.03 BogoMIPS).
devtmpfs: initialized
NET: Registered protocol family 16
L310 cache controller enabled
l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72360000, Cache size: 524288 B
registering platform device 'pl330' id 0
registering platform device 'arm-pmu' id 0
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
xslcr xslcr.0: at 0xF8000000 mapped to 0xE0808000
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
Switching to clocksource xttcpss_timer1
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 5, 196608 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
rootfs image is not initramfs (no cpio magic); looks like an initrd
Freeing initrd memory: 8192K
xscugtimer xscugtimer.0: ioremap fe00c200 to e080a200 with size 400
pl330 dev 0 probe success
JFFS2 version 2.2. (NAND) (SUMMARY)  �© 2001-2006 Red Hat, Inc.
msgmni has been set to 1005
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 82) is a xuartps
console [ttyPS0] enabled
xdevcfg f8007000.ps7-dev-cfg: ioremap f8007000 to e085e000 with size 1000
brd: module loaded
loop: module loaded
xqspips e000d000.ps7-qspi: cs1 >= max 1
xqspips e000d000.ps7-qspi: can't create new device for m25p80
xqspips e000d000.ps7-qspi: at 0xE000D000 mapped to 0xE0860000, irq=51
GEM: BASEADDRESS hw: e000b000 virt: e0862000
XEMACPS mii bus: probed
eth0, pdev->id -1, baseaddr 0xe000b000, irq 54
GEM: BASEADDRESS hw: e000c000 virt: e0864000
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:482 sysfs_add_one+0x68/0x88()
sysfs: cannot create duplicate filename '/class/mdio_bus/c0199c44'
Modules linked in:
[<c0012928>] (unwind_backtrace+0x0/0xe0) from [<c001e860>] (warn_slowpath_common+0x4c/0x64)
[<c001e860>] (warn_slowpath_common+0x4c/0x64) from [<c001e8f8>] (warn_slowpath_fmt+0x2c/0x3c)
[<c001e8f8>] (warn_slowpath_fmt+0x2c/0x3c) from [<c00dbcfc>] (sysfs_add_one+0x68/0x88)
[<c00dbcfc>] (sysfs_add_one+0x68/0x88) from [<c00dc498>] (sysfs_do_create_link+0x104/0x1f0)
[<c00dc498>] (sysfs_do_create_link+0x104/0x1f0) from [<c0193b00>] (device_add+0x21c/0x590)
[<c0193b00>] (device_add+0x21c/0x590) from [<c01cc630>] (mdiobus_register+0x80/0x160)
[<c01cc630>] (mdiobus_register+0x80/0x160) from [<c024d2a8>] (of_mdiobus_register+0x48/0x1a0)
[<c024d2a8>] (of_mdiobus_register+0x48/0x1a0) from [<c041630c>] (xemacps_probe+0x588/0x7fc)
[<c041630c>] (xemacps_probe+0x588/0x7fc) from [<c0196a6c>] (platform_drv_probe+0x14/0x18)
[<c0196a6c>] (platform_drv_probe+0x14/0x18) from [<c0195b74>] (driver_probe_device+0xc8/0x184)
[<c0195b74>] (driver_probe_device+0xc8/0x184) from [<c0195c90>] (__driver_attach+0x60/0x84)
[<c0195c90>] (__driver_attach+0x60/0x84) from [<c0194744>] (bus_for_each_dev+0x48/0x74)
[<c0194744>] (bus_for_each_dev+0x48/0x74) from [<c0195490>] (bus_add_driver+0x98/0x214)
[<c0195490>] (bus_add_driver+0x98/0x214) from [<c0196168>] (driver_register+0xa0/0x134)
[<c0196168>] (driver_register+0xa0/0x134) from [<c0196d04>] (platform_driver_probe+0x18/0x8c)
[<c0196d04>] (platform_driver_probe+0x18/0x8c) from [<c000858c>] (do_one_initcall+0x90/0x160)
[<c000858c>] (do_one_initcall+0x90/0x160) from [<c0403874>] (kernel_init+0xa4/0x170)
[<c0403874>] (kernel_init+0xa4/0x170) from [<c000dfcc>] (kernel_thread_exit+0x0/0x8)
---[ end trace 1b14d03f9442e7bd ]---
mii_bus c0199c44 failed to register
eth1: error in xemacps_mii_init
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
Xilinx PS USB Device Controller driver (Apr 01, 2011)
mousedev: PS/2 mouse device common for all mice
Linux video capture interface: v2.00
gspca_main: v2.14.0 registered
uvcvideo: Unable to create debugfs directory
usbcore: registered new interface driver uvcvideo
USB Video Class driver (1.1.1)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: Invalid maximum block size, assuming 512 bytes
mmc0: SDHCI controller on e0100000.ps7-sdio [e0100000.ps7-sdio] using ADMA
TCP cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
Registering SWP/SWPB emulation handler
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
RAMDISK: gzip image found at block 0
mmc0: new high speed SDHC card at address e624
mmcblk0: mmc0:e624 SU16G 14.8 GiB (ro)
mmcblk0: p1
EXT2-fs (ram0): warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem) on device 1:0.
devtmpfs: mounted
Freeing init memory: 144K
Starting rcS...
++ Mounting filesystem
++ Setting up mdev
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting dropbear (ssh) daemon
++ Mounting SD Card at /mnt
rcS Complete
zynq>
zynq> ifconfig eth0 up
GEM: lp->tx_bd ffdfe000 lp->tx_bd_dma 1f8cf000 lp->tx_skb df053000
GEM: lp->rx_bd ffdff000 lp->rx_bd_dma 1fbec000 lp->rx_skb df053400
GEM: MAC 0x00350a00, 0x00002201, 00:0a:35:00:01:22
GEM: phydev defdd000, phydev->phy_id 0x1410e40, phydev->addr 0x0                                    
eth0, phy_addr 0x0, phy_id 0x01410e40
eth0, attach [Marvell 88E1116R] phy driver
zynq>ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:01:22 
          UP BROADCAST 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)
          Interrupt:54 Base address:0xb000

zynq> ifconfig lo up
zynq> ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:01:22 
          UP BROADCAST 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)
          Interrupt:54 Base address:0xb000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

zynq> ifconfig eth1 up
ifconfig: SIOCGIFFLAGS: No such device
zynq> ifconfig eth1
ifconfig: eth1: error fetching interface information: Device not found
zynq>

 

************************************************************************************************************

 

And Could you check devicetree file..

 

************************************************************************************************************

/*
* Device Tree Generator version: 1.3
*
* (C) Copyright 2007-2008 Xilinx, Inc.
* (C) Copyright 2007-2009 Michal Simek
*
* Michal SIMEK <monstr@monstr.eu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* CAUTION: This file is automatically generated by libgen.
* Version: Xilinx EDK 14.2 EDK_P.28xd
*
* XPS project directory: device-tree_bsp_0
*/

/dts-v1/;
/ {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "xlnx,zynq-zc702";
    interrupt-parent = <&gic>;
    model = "Xilinx Zynq ZC702";
    aliases {
        serial0 = &ps7_uart_1;
    } ;
    chosen {
        bootargs = "console=ttyPS0,115200 root=/dev/ram rw initrd=0x800000,8M";
        linux,stdout-path = "/amba@0/uart@E0001000";
    } ;
    cpus {
        #address-cells = <1>;
        #cpus = <0x2>;
        #size-cells = <0>;
        ps7_cortexa9_0: cpu@0 {
            clock-frequency = <666666688>;
            compatible = "xlnx,ps7-cortexa9-1.00.a";
            d-cache-line-size = <0x20>;
            d-cache-size = <0x8000>;
            device_type = "cpu";
            i-cache-line-size = <0x20>;
            i-cache-size = <0x8000>;
            model = "ps7_cortexa9,1.00.a";
            reg = <0>;
            timebase-frequency = <333333344>;
            xlnx,cpu-1x-clk-freq-hz = <0x69f6bcb>;
            xlnx,cpu-clk-freq-hz = <0x27bc86c0>;
        } ;
        ps7_cortexa9_1: cpu@1 {
            clock-frequency = <666666688>;
            compatible = "xlnx,ps7-cortexa9-1.00.a";
            d-cache-line-size = <0x20>;
            d-cache-size = <0x8000>;
            device_type = "cpu";
            i-cache-line-size = <0x20>;
            i-cache-size = <0x8000>;
            model = "ps7_cortexa9,1.00.a";
            reg = <1>;
            timebase-frequency = <333333344>;
            xlnx,cpu-1x-clk-freq-hz = <0x69f6bcb>;
            xlnx,cpu-clk-freq-hz = <0x27bc86c0>;
        } ;
    } ;
    ps7_ddr_0: memory@0 {
        device_type = "memory";
        reg = < 0x0 0x20000000 >;
    } ;
    ps7_axi_interconnect_0: axi@0 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "xlnx,ps7-axi-interconnect-1.00.a", "simple-bus";
        ranges ;
        gic: interrupt-controller@f8f01000 {
            #interrupt-cells = < 3 >;
            compatible = "arm,cortex-a9-gic";
            interrupt-controller ;
            reg = < 0xf8f01000 0x1000  >,< 0xf8f00100 0x100  >;
            linux,phandle = <0x1>;
            phandle = <0x1>;
        } ;
        pl310: pl310-controller@f8f02000 {
            arm,data-latency = < 3 2 2 >;
            arm,tag-latency = < 2 2 2 >;
            cache-level = < 2 >;
            cache-unified ;
            compatible = "arm,pl310-cache";
            interrupts = < 0 34 4 >;
            reg = < 0xf8f02000 0x1000 >;
        } ;
        ps7_ddrc_0: ps7-ddrc@f8006000 {
            compatible = "xlnx,ps7-ddrc-1.00.a";
            interrupt-parent = <&gic>;
            reg = < 0xf8006000 0x1000 >;
            xlnx,has-ecc = <0x0>;
        } ;
        ps7_dev_cfg_0: ps7-dev-cfg@f8007000 {
            compatible = "xlnx,ps7-dev-cfg-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = < 0 8 0 >;
            reg = < 0xf8007000 0x1000 >;
        } ;
        ps7_ethernet_0: ps7-ethernet0@e000b000 {
            compatible = "xlnx,ps7-ethernet-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = < 0 22 0 >;
            phy-handle = <&phy0>;
            reg = < 0xe000b000 0x1000 >;
            xlnx,ptp-enet-clock = <111111115>;
            xlnx,slcr-div0-1000Mbps = <8>;
            xlnx,slcr-div0-100Mbps = <8>;
            xlnx,slcr-div0-10Mbps = <8>;
            xlnx,slcr-div1-1000Mbps = <1>;
            xlnx,slcr-div1-100Mbps = <5>;
            xlnx,slcr-div1-10Mbps = <50>;
            mdio {
                #address-cells = <1>;
                #size-cells = <0>;
                phy0: phy@0 {
                    compatible = "marvell,88e1116r";
                    device_type = "ethernet-phy";
                    reg = <0>;
                } ;
            } ;
        } ;
        ps7_ethernet_1: ps7-ethernet1@e000c000 {
            compatible = "xlnx,ps7-ethernet-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = < 0 45 0 >;
            phy-handle = <&phy1>;
            reg = < 0xe000c000 0x1000 >;
            xlnx,ptp-enet-clock = <111111115>;
            xlnx,slcr-div0-1000Mbps = <8>;
            xlnx,slcr-div0-100Mbps = <8>;
            xlnx,slcr-div0-10Mbps = <8>;
            xlnx,slcr-div1-1000Mbps = <1>;
            xlnx,slcr-div1-100Mbps = <5>;
            xlnx,slcr-div1-10Mbps = <50>;
            mdio {
                #address-cells = <1>;
                #size-cells = <0>;
                phy1: phy@1 {
                    compatible = "marvell,88e1116r";
                    device_type = "ethernet-phy";
                    reg = <1>;
                } ;
            } ;
        } ;
        ps7_iop_bus_config_0: ps7-iop-bus-config@e0200000 {
            compatible = "xlnx,ps7-iop-bus-config-1.00.a";
            interrupt-parent = <&gic>;
            reg = < 0xe0200000 0x1000 >;
        } ;
        ps7_qspi_0: ps7-qspi@e000d000 {
            bus-num = <0>;
            compatible = "xlnx,ps7-qspi-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = < 0 19 0 >;
            is-dual = <0>;
            num-chip-select = <1>;
            reg = < 0xe000d000 0x1000 >;
            speed-hz = <200000000>;
            xlnx,fb-clk = <0x1>;
            xlnx,qspi-clk-freq-hz = <0xbebc200>;
            xlnx,qspi-mode = <0x0>;
        } ;
        ps7_qspi_linear_0: ps7-qspi-linear@fc000000 {
            compatible = "xlnx,ps7-qspi-linear-1.00.a";
            interrupt-parent = <&gic>;
            reg = < 0xfc000000 0x1000000 >;
            xlnx,qspi-clk-freq-hz = <0xe4e1c0>;
        } ;
        ps7_scutimer_0: ps7-scutimer@f8f00600 {
            clock-frequency = <333333344>;
            compatible = "xlnx,ps7-scutimer-1.00.a";
            interrupt-parent = <&gic>;
            reg = < 0xf8f00600 0x20 >;
        } ;
        ps7_scuwdt_0: ps7-scuwdt@f8f00620 {
            clock-frequency = <333333344>;
            compatible = "xlnx,ps7-scuwdt-1.00.a";
            interrupt-parent = <&gic>;
            reg = < 0xf8f00620 0xe0 >;
        } ;
        ps7_sd_0: ps7-sdio@e0100000 {
            clock-frequency = <125000000>;
            compatible = "xlnx,ps7-sdio-1.00.a", "xlnx,ps7-sdhci-1.00.a", "generic-sdhci";
            interrupt-parent = <&gic>;
            interrupts = < 0 24 0 >;
            reg = < 0xe0100000 0x1000 >;
            xlnx,has-cd = <0x0>;
            xlnx,has-power = <0x0>;
            xlnx,has-wp = <0x0>;
            xlnx,sdio-clk-freq-hz = <0x7735940>;
        } ;
        ps7_ttc_0: ps7-ttc@f8001000 {
            clock-frequency-timer0 = <111111112>;
            clock-frequency-timer1 = <111111112>;
            clock-frequency-timer2 = <111111112>;
            compatible = "xlnx,ps7-ttc-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = < 0 10 0  >,< 0 11 0  >,< 0 12 0  >;
            reg = < 0xf8001000 0x1000 >;
        } ;
        ps7_uart_1: serial@e0001000 {
            clock = <50000000>;
            compatible = "xlnx,ps7-uart-1.00.a", "xlnx,xuartps";
            device_type = "serial";
            interrupt-parent = <&gic>;
            interrupts = < 0 50 0 >;
            reg = < 0xe0001000 0x1000 >;
            xlnx,has-modem = <0x0>;
            xlnx,uart-clk-freq-hz = <0x2faf080>;
        } ;
        ps7_wdt_0: ps7-wdt@f8005000 {
            clock-frequency = <111111112>;
            compatible = "xlnx,ps7-wdt-1.00.a";
            interrupt-parent = <&gic>;
            interrupts = < 0 9 0 >;
            reg = < 0xf8005000 0x1000 >;
            xlnx,wdt-clk-freq-hz = <0x69f6bc8>;
        } ;
        xadc: xadc@f8007100 {
            compatible = "xlnx,ps7-xadc-1.00.a";
            interrupts = < 0 7 0 >;
            reg = < 0xf8007100 0x20 >;
        } ;
    } ;
} ;

 

0 Kudos
47 Replies
Scholar austin
Scholar
16,269 Views
Registered: ‎02-27-2008

Re: zynq linux - dual emacps(gem) problem

I see that the tools think they are using the ZC702.


It has one ethernet interface (I believe).

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Newbie redone
Newbie
16,261 Views
Registered: ‎09-15-2012

Re: zynq linux - dual emacps(gem) problem

custom?

0 Kudos
Xilinx Employee
Xilinx Employee
16,255 Views
Registered: ‎09-04-2012

Re: zynq linux - dual emacps(gem) problem

I just tested a dual Ethernet setup and it worked correctly.

It looks like there might be a problem with your MDIO setup. Make sure that the address you specify in the dts file is correct for the second Ethernet PHY.

Your DTS setup for the second Ethernet looks correct.

0 Kudos
Highlighted
Visitor llyypp
Visitor
16,246 Views
Registered: ‎09-11-2012

Re: zynq linux - dual emacps(gem) problem

Thanks..

But I don't know how to fix specified address for ethernet phy in dts file.

Do you konw sum parameters for ethernet phy in dts file.

0 Kudos
Xilinx Employee
Xilinx Employee
16,241 Views
Registered: ‎09-04-2012

Re: zynq linux - dual emacps(gem) problem

In your DTS file you have indicated a PHY address of "1" for the PHY connected to ETH1. For example, if it was 7, it would look like:

 

phy1: phy@7 {
                    compatible = "marvell,88e1116r";
                    device_type = "ethernet-phy";
                    reg = <7>;

 

You need to look at your schematics to know what address was selected for PHY1.

0 Kudos
15,861 Views
Registered: ‎01-05-2013

Re: zynq linux - dual emacps(gem) problem

 Was there a solution found for this problem? I am seeing the same issue. The problem is seen when eth1 tries to register the mdio bus. For some reason it tries to re-register the mdio bus for eth0. The code in the driver function mii_init finds the correct PHY reference so it would appear that somewhere else in the driver it is hardcoded that there is only eth0 as with the eval board. The call to of_parse_phandle takes and index of 0 but changing that does not have any impact. Our device tree looks almost identical to the one provided in the initial report. The only difference is our PHY address values.

 

 We are using the 14.2 TRD Linux code so if there were any patches after the original report of this stack trace on the eth1 MDIO bus registration I should have them.

 

 Our eth0 port works fine. If I remove the call to of_mdio_register, the setup of eth1 completes and can be seen when ifconfig is run but the device is not usable. It crashes violently if I try to bring eth1 up.

 

 If you want more information let me know

0 Kudos
Visitor jyy5208058
Visitor
15,799 Views
Registered: ‎11-29-2012

Re: zynq linux - dual emacps(gem) problem

Hello llyypp:

 

I have same question with you. Did you solve it?

 

I am not sure if this is the problem of device tree.

0 Kudos
15,267 Views
Registered: ‎04-06-2013

Re: zynq linux - dual emacps(gem) problem

We are currently designing a custom zynq board with dual ethernet interfaces. Any further updates on this issue? Has anyone solved it?

0 Kudos
15,215 Views
Registered: ‎04-06-2013

Re: zynq linux - dual emacps(gem) problem

Hi cch,

 

We are facing the same issue. I have specified the correct phy addresses in the device tree , but still the error persists. Can you please post the ethernet part of your device tree here.

 

Thanks

Rohit

 

0 Kudos
Xilinx Employee
Xilinx Employee
12,949 Views
Registered: ‎09-04-2012

Re: zynq linux - dual emacps(gem) problem

I just tested the same project with the 14.5 tag and it works correctly.

It is a lot easier now that the PHY support has been added to the tree.

 

I included my DTS file.

 

It is a standard ZC702 with an FMC card for the second Ethernet port. I used GMII through the EMIOs to connect to the FMC.

0 Kudos
Xilinx Employee
Xilinx Employee
12,945 Views
Registered: ‎09-04-2012

Re: zynq linux - dual emacps(gem) problem

The DTS file didn't make it. Copied below.

 

/dts-v1/;

/ {
 model = "Xilinx Zynq ZC702";
 compatible = "xlnx,zynq-zc702";
 #address-cells = <0x1>;
 #size-cells = <0x1>;
 interrupt-parent = <0x1>;

 memory {
  device_type = "memory";
  reg = <0x00000000 0x40000000>;
 };
 chosen {
  bootargs = "console=ttyPS0,115200 root=/dev/ram rw ip=192.168.1.10:::255.255.255.0:ZC702:eth0 earlyprintk";
  linux,stdout-path = "/amba@0/uart@E0001000";
 };

 pmu {
  compatible = "arm,cortex-a9-pmu";
  interrupts = <0 5 4>, <0 6 4>;
  interrupt-parent = <&gic>;
 };

 amba@0 {
  compatible = "simple-bus";
  #address-cells = <0x1>;
  #size-cells = <0x1>;
  ranges;

  gic: intc@f8f01000 {
   interrupt-controller;
   compatible = "arm,cortex-a9-gic";
   #interrupt-cells = <3>;
   reg = <0xf8f01000 0x1000>,
         <0xf8f00100 0x0100>;
  };

  pl310@f8f02000 {
   compatible = "arm,pl310-cache";
   cache-unified;
   cache-level = <2>;
   reg = <0xf8f02000 0x1000>;
   arm,data-latency = <3 2 2>;
   arm,tag-latency = <2 2 2>;
  };

  ps7_ddrc_0: ps7-ddrc@f8006000 {
   compatible = "xlnx,ps7-ddrc-1.00.a", "xlnx,ps7-ddrc";
   reg = <0xf8006000 0x1000>;
   xlnx,has-ecc = <0x0>;
  } ;

  ps7_ocm_0: ps7-ocm@0xfffc0000 {
   compatible = "xlnx,ps7-ocm";
   reg = <0xfffc0000 0x40000>; /* 256k */
  };

  uart@e0001000 {
   compatible = "xlnx,ps7-uart-1.00.a";
   reg = <0xe0001000 0x1000>;
   interrupts = <0 50 4>;
   interrupt-parent = <&gic>;
   clock = <50000000>;
  };

  slcr: slcr@f8000000 {
   compatible = "xlnx,zynq-slcr";
   reg = <0xF8000000 0x1000>;
   clocks {
    #address-cells = <1>;
    #size-cells = <0>;
    armpll: armpll {
     #clock-cells = <0>;
     clock-output-names = "armpll";
     clocks = <&ps_clk>;
     compatible = "xlnx,zynq-pll";
     lockbit = <0>;
     reg = < 0x100 0x110 0x10c >;
    } ;
    ddrpll: ddrpll {
     #clock-cells = <0>;
     clock-output-names = "ddrpll";
     clocks = <&ps_clk>;
     compatible = "xlnx,zynq-pll";
     lockbit = <1>;
     reg = < 0x104 0x114 0x10c >;
    } ;
    iopll: iopll {
     #clock-cells = <0>;
     clock-output-names = "iopll";
     clocks = <&ps_clk>;
     compatible = "xlnx,zynq-pll";
     lockbit = <2>;
     reg = < 0x108 0x118 0x10c >;
    } ;
    ps_clk: ps_clk {
     #clock-cells = <0>;
     clock-frequency = <33333333>;
     clock-output-names = "ps_clk";
     compatible = "fixed-clock";
    } ;
   } ;
  };

  timer@0xf8001000 {
   compatible = "xlnx,ps7-ttc-1.00.a";
   reg = <0xf8001000 0x1000>;
   interrupts = <0 10 4>,<0 11 4>,<0 12 4>;
   interrupt-parent = <&gic>;
  };

  timer@f8f00600 {
   compatible = "arm,cortex-a9-twd-timer";
   reg = <0xf8f00600 0x20>;
   interrupts = <1 13 0x301>;
   interrupt-parent = <&gic>;
  };

  swdt@f8005000 {
   device_type = "watchdog";
   compatible = "xlnx,ps7-wdt-1.00.a";
   reg = <0xf8005000 0x100>;
   interrupts = <0 9 4>;
   interrupt-parent = <&gic>;
   reset = <0>;
   timeout = <10>;
  };

  scuwdt@f8f00620 {
   device_type = "watchdog";
   compatible = "arm,mpcore_wdt";
   reg = <0xf8f00620 0x20>;
   clock-frequency = <333333333>;
   reset = <1>;
  };

  eth@e000b000 {
   compatible = "xlnx,ps7-ethernet-1.00.a";
   reg = <0xe000b000 0x1000>;
   interrupts = <0 22 4>;
   interrupt-parent = <&gic>;
   phy-handle = <&phy0>;
   phy-mode = "rgmii-id";
   xlnx,ptp-enet-clock = <111111111>;
   xlnx,slcr-div0-1000Mbps = <8>;
   xlnx,slcr-div0-100Mbps = <8>;
   xlnx,slcr-div0-10Mbps = <8>;
   xlnx,slcr-div1-1000Mbps = <1>;
   xlnx,slcr-div1-100Mbps = <5>;
   xlnx,slcr-div1-10Mbps = <50>;
   #address-cells = <0x1>;
   #size-cells = <0x0>;
   mdio {
    #address-cells = <1>;
    #size-cells = <0>;
    phy0: phy@7 {
     compatible = "marvell,88e1116r";
     device_type = "ethernet-phy";
     reg = <7>;
    };
   };
  };

  eth@e000c000 {
   compatible = "xlnx,ps7-ethernet-1.00.a";
   reg = <0xe000c000 0x1000>;
   interrupts = <0 45 4>;
   interrupt-parent = <&gic>;
   phy-handle = <&phy1>;
   phy-mode = "gmii";
   xlnx,ptp-enet-clock = <111111111>;
   xlnx,slcr-div0-1000Mbps = <8>;
   xlnx,slcr-div0-100Mbps = <8>;
   xlnx,slcr-div0-10Mbps = <8>;
   xlnx,slcr-div1-1000Mbps = <1>;
   xlnx,slcr-div1-100Mbps = <5>;
   xlnx,slcr-div1-10Mbps = <50>;
   #address-cells = <0x1>;
   #size-cells = <0x0>;
   mdio {
    #address-cells = <1>;
    #size-cells = <0>;
    phy1: phy@1 {
     compatible = "marvell,88e1116r";
     device_type = "ethernet-phy";
     reg = <1>;
    };
   };
  };


  i2c0: i2c@e0004000 {
   compatible = "xlnx,ps7-i2c-1.00.a";
   reg = <0xE0004000 0x1000>;
   interrupts = <0 25 4>;
   interrupt-parent = <&gic>;
   bus-id = <0>;
   input-clk = <111111111>;
   i2c-clk = <100000>;

   #address-cells = <1>;
   #size-cells = <0>;
   i2cswitch@74 {
    compatible = "nxp,pca9548";
    #address-cells = <1>;
    #size-cells = <0>;
    reg = <0x74>;

    i2c@0 {
     #address-cells = <1>;
     #size-cells = <0>;
     reg = <0>;
     osc@5d {
      compatible = "si570";
      reg = <0x5d>;
      factory-fout = <156250000>;
      initial-fout = <148500000>;
     };
    };

    i2c@2 {
     #address-cells = <1>;
     #size-cells = <0>;
     reg = <2>;
     eeprom@54 {
      compatible = "at,24c08";
      reg = <0x54>;
     };
    };

    i2c@3 {
     #address-cells = <1>;
     #size-cells = <0>;
     reg = <3>;
     gpio@21 {
      compatible = "ti,tca6416";
      reg = <0x21>;
      gpio-controller;
      #gpio-cells = <2>;
     };
    };

    i2c@4 {
     #address-cells = <1>;
     #size-cells = <0>;
     reg = <4>;
     rtc@54 {
      compatible = "nxp,pcf8563";
      reg = <0x51>;
     };
    };

    i2c@7 {
     #address-cells = <1>;
     #size-cells = <0>;
     reg = <7>;
     hwmon@52 {
      compatible = "pmbus,ucd9248";
      reg = <52>;
     };
     hwmon@53 {
      compatible = "pmbus,ucd9248";
      reg = <53>;
     };
     hwmon@54 {
      compatible = "pmbus,ucd9248";
      reg = <54>;
     };
    };
   };
  };

  sdhci@e0100000 {
   compatible = "xlnx,ps7-sdhci-1.00.a";
   reg = <0xe0100000 0x1000>;
   xlnx,has-cd = <0x1>;
   interrupts = <0 24 4>;
   interrupt-parent = <&gic>;
   clock-frequency = <33333000>;
  };

  usb@e0002000 {
   compatible = "xlnx,ps7-usb-1.00.a";
   reg = <0xe0002000 0x1000>;
   interrupts = <0 21 4>;
   interrupt-parent = <&gic>;
   dr_mode = "host";
   phy_type = "ulpi";
  };

  gpio@e000a000 {
   compatible = "xlnx,ps7-gpio-1.00.a";
   reg = <0xe000a000 0x1000>;
   interrupts = <0 20 4>;
   interrupt-parent = <&gic>;
  };

  qspi0: spi@e000d000 {
   compatible = "xlnx,ps7-qspi-1.00.a";
   reg = <0xE000D000 0x1000>;
   interrupts = <0 19 4>;
   interrupt-parent = <&gic>;
   speed-hz = <200000000>;
   bus-num = <1>;
   num-chip-select = <1>;
   #address-cells = <1>;
   #size-cells = <0>;
   is-dual = <0>;
   flash@0 {
    compatible = "n25q128";
    reg = <0x0>;
    spi-max-frequency = <50000000>;
    #address-cells = <1>;
    #size-cells = <1>;
    partition@qspi-fsbl-uboot {
     label = "qspi-fsbl-uboot";
     reg = <0x0 0x100000>;
    };
    partition@qspi-linux {
     label = "qspi-linux";
     reg = <0x100000 0x500000>;
    };
    partition@qspi-device-tree {
     label = "qspi-device-tree";
     reg = <0x600000 0x20000>;
    };
    partition@qspi-rootfs {
     label = "qspi-rootfs";
     reg = <0x620000 0x5E0000>;
    };
    partition@qspi-bitstream {
     label = "qspi-bitstream";
     reg = <0xC00000 0x400000>;
    };
   };
  };

  devcfg@f8007000 {
   compatible = "xlnx,ps7-dev-cfg-1.00.a";
   reg = <0xf8007000 0x100>;
   interrupts = <0 8 4>;
   interrupt-parent = <&gic>;
  };

  xadc@f8007100 {
   compatible = "xlnx,ps7-xadc-1.00.a";
   reg = <0xf8007100 0x20>;
   interrupts = <0 7 4>;
   interrupt-parent = <&gic>;
  };
  ps7_dma_s: ps7-dma@f8003000 {
   #dma-cells = <1>;
   #dma-channels = <8>;
   #dma-requests = <4>;
   arm,primecell-periphid = <0x41330>;
   compatible = "xlnx,ps7-dma-1.00.a", "arm,primecell", "arm,pl330";
   interrupt-parent = <&gic>;
   interrupts = < 0 13 4 0 14 4 0 15 4 0 16 4 0 17 4 0 40 4 0 41 4 0 42 4 0 43 4 >;
   reg = < 0xf8003000 0x1000 >;
  } ;
 };
};

0 Kudos
Newbie uwojak
Newbie
12,798 Views
Registered: ‎06-28-2013

Re: zynq linux - dual emacps(gem) problem

Hallo,

 

did you solve the issue ?

We have a custom board with two eth devices to and we changed xilinx_emacps.c.
In the original version the grandparents name of the phy is used for registering the device which fails for the second device.

The patch uses the parents name.

 

If you have a proper solution using the DTS file I would gladly use it.

 

 

 

diff --git a/drivers/net/ethernet/xilinx/xilinx_emacps.c b/drivers/net/ethernet/xilinx/xilinx_emacps.c
index 076488f..ec3e7a1 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emacps.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emacps.c
@@ -877,8 +877,8 @@ static int xemacps_mii_init(struct net_local *lp)
 
     for (i = 0; i < PHY_MAX_ADDR; i++)
         lp->mii_bus->irq[i] = PHY_POLL;
-    npp = of_get_parent(np);
-    of_address_to_resource(npp, 0, &res);
+// !!!uw!!!    npp = of_get_parent(np);
+    of_address_to_resource(np, 0, &res);
     snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%.8llx",
          (unsigned long long)res.start);
     if (of_mdiobus_register(lp->mii_bus, np))

0 Kudos
Visitor byip
Visitor
12,671 Views
Registered: ‎07-24-2013

Re: zynq linux - dual emacps(gem) problem

We are having problems with using dual emacps also.  We are using RGMII on both interfaces.  We got the 1st interface to work but are having problem with the second interface. 

 

We tried the patch posted here to see if that corrects it.  But using the patch, we see lots of startup Linux boot warnings such as "sysfs: cannot create duplicate filename 'class/mdio_bus/00000000'.  When we tried to configure the second interface, we unexpectedly got "SIOCSIFADDR: No such device". 

 

Were there possibly other associated changes made to other files along with this patch that may not have been posted here?  Also, was the change made to Open Source Linux or Petalinux?  To which version?  Thanks.

0 Kudos
Scholar rfs613
Scholar
12,654 Views
Registered: ‎05-28-2013

Re: zynq linux - dual emacps(gem) problem

I had the same error as you... Check that you applied the patch correctly... note the argument  "npp" changed to "np" in the function call of_address_to_resource().  I've used this successfully with Xilinx 14.5 (Linux 3.8) and Xilinx 14.6 (Linux 3.9) kernels.

0 Kudos
Visitor byip
Visitor
12,586 Views
Registered: ‎07-24-2013

Re: zynq linux - dual emacps(gem) problem

 
rfs613:
 

We are using the latest PetaLinux release 2013.04, which has kernel 3.6. 

 

To try what you did with kernel 3.8 and 3.9, I did a build with latest kernel 3.9, Xilinx 14.6, with the patch.  We still have no luck with kernel 3.9 with the patch.  In our case, we are using RGMII for both Ethernet controllers. 

 

Are you using the same type of MII for both controllers, or mix? 

 

Below is the error we are still getting with kernel 3.9, with the patch, using RGMII on both controllers.  The DTS information is listed below also.

 

device: 'eth0': device_add
device: '00000000': device_add
libphy: XEMACPS mii bus: probed
device: '00000000:10': device_add
bus: 'mdio_bus': add device 00000000:10
bus: 'mdio_bus': driver_probe_device: matched device 00000000:10 with driver Broadcom BCM5461
bus: 'mdio_bus': really_probe: probing driver Broadcom BCM5461 with device 00000000:10
driver: '00000000:10': driver_bound: bound to device 'Broadcom BCM5461'
bus: 'mdio_bus': really_probe: bound device 00000000:10 to driver Broadcom BCM5461
xemacps e000b000.ps7-ethernet: invalid address, use assigned
xemacps e000b000.ps7-ethernet: MAC updated 22:29:cf:0a:07:ca
xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
driver: 'e000b000.ps7-ethernet': driver_bound: bound to device 'xemacps'
bus: 'platform': really_probe: bound device e000b000.ps7-ethernet to driver xemacps
bus: 'platform': driver_probe_device: matched device e000c000.ps7-ethernet with driver xemacps
bus: 'platform': really_probe: probing driver xemacps with device e000c000.ps7-ethernet
device: 'eth1': device_add
device: '00000000': device_add
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x80/0xa0()
sysfs: cannot create duplicate filename '/class/mdio_bus/00000000'
Modules linked in:
Backtrace:
[<c0010b70>] (dump_backtrace+0x0/0x10c) from [<c0325e64>] (dump_stack+0x18/0x1c)
 r6:c00e8c78 r5:00000009 r4:ef063c60 r3:60000113
[<c0325e4c>] (dump_stack+0x0/0x1c) from [<c001b1c4>] (warn_slowpath_common+0x54/0x74)
[<c001b170>] (warn_slowpath_common+0x0/0x74) from [<c001b288>] (warn_slowpath_fmt+0x38/0x40)
 r8:00000000 r7:ef063cb0 r6:ef2fbb88 r5:ffffffef r4:ef2e0000
r3:00000009
[<c001b250>] (warn_slowpath_fmt+0x0/0x40) from [<c00e8c78>] (sysfs_add_one+0x80/0xa0)
 r3:ef2e0000 r2:c03daf72
[<c00e8bf8>] (sysfs_add_one+0x0/0xa0) from [<c00e98e4>] (sysfs_do_create_link_sd+0x104/0x1dc)
 r7:ef2f9050 r6:ef218608 r5:ef2fbb88 r4:ef2fbc88
[<c00e97e0>] (sysfs_do_create_link_sd+0x0/0x1dc) from [<c00e99ec>] (sysfs_create_link+0x30/0x40)
[<c00e99bc>] (sysfs_create_link+0x0/0x40) from [<c01c531c>] (device_add+0x248/0x5d8)
[<c01c50d4>] (device_add+0x0/0x5d8) from [<c01c56c8>] (device_register+0x1c/0x20)
[<c01c56ac>] (device_register+0x0/0x20) from [<c02272f0>] (mdiobus_register+0x84/0x160)
 r4:ef2f9000 r3:00000000
[<c022726c>] (mdiobus_register+0x0/0x160) from [<c0262874>] (of_mdiobus_register+0x3c/0x1b8)
 r8:c1b02de8 r7:ef0fa010 r6:ef2f8800 r5:ef2f8c8c r4:ef2f9000
r3:00000080
[<c0262838>] (of_mdiobus_register+0x0/0x1b8) from [<c022ba38>] (xemacps_probe+0x398/0x744)
[<c022b6a0>] (xemacps_probe+0x0/0x744) from [<c01c8cf4>] (platform_drv_probe+0x1c/0x20)
[<c01c8cd8>] (platform_drv_probe+0x0/0x20) from [<c01c7b34>] (driver_probe_device+0xfc/0x2ac)
[<c01c7a38>] (driver_probe_device+0x0/0x2ac) from [<c01c7d54>] (__driver_attach+0x70/0x94)
 r6:c12d6804 r5:ef0fa044 r4:ef0fa010
[<c01c7ce4>] (__driver_attach+0x0/0x94) from [<c01c606c>] (bus_for_each_dev+0x5c/0x98)
 r6:c12d6804 r5:ef063e70 r4:00000000 r3:00000000
[<c01c6010>] (bus_for_each_dev+0x0/0x98) from [<c01c75e0>] (driver_attach+0x20/0x28)
 r7:00000000 r6:ef2f3740 r5:c12ccb20 r4:c12d6804
[<c01c75c0>] (driver_attach+0x0/0x28) from [<c01c716c>] (bus_add_driver+0xe8/0x238)
[<c01c7084>] (bus_add_driver+0x0/0x238) from [<c01c8058>] (driver_register+0xa4/0x134)
 r8:00000066 r7:c12df280 r6:c044ba70 r5:c0446a08 r4:c12d6804
[<c01c7fb4>] (driver_register+0x0/0x134) from [<c01c8e68>] (platform_driver_register+0x4c/0x60)
[<c01c8e1c>] (platform_driver_register+0x0/0x60) from [<c043c7a4>] (xemacps_driver_init+0x14/0x1c)
[<c043c790>] (xemacps_driver_init+0x0/0x1c) from [<c000865c>] (do_one_initcall+0x9c/0x16c)
[<c00085c0>] (do_one_initcall+0x0/0x16c) from [<c04279a0>] (kernel_init_freeable+0x108/0x1d0)
[<c0427898>] (kernel_init_freeable+0x0/0x1d0) from [<c0321634>] (kernel_init+0x10/0xec)
[<c0321624>] (kernel_init+0x0/0xec) from [<c000db98>] (ret_from_fork+0x14/0x3c)
 r4:00000000 r3:00000000
---[ end trace f4461e56af174eb9 ]---
libphy: mii_bus 00000000 failed to register
xemacps e000c000.ps7-ethernet: error in xemacps_mii_init
xemacps: probe of e000c000.ps7-ethernet rejects match -6

 

 

  ps7_ethernet_0: ps7-ethernet@e000b000 {
   #address-cells = <1>;
   #size-cells = <0>;
   compatible = "xlnx,ps7-ethernet-1.00.a";
   interrupt-parent = <&ps7_scugic_0>;
   interrupts = < 0 22 1 >;
   local-mac-address = [ 00 0a 35 00 75 89 ];
   phy-handle = <&phy0>;
   phy-mode = "rgmii-id";
   reg = < 0xe000b000 0x1000 >;
   xlnx,enet-slcr-1000mbps-div0 = <0xa>;
   xlnx,enet-slcr-1000mbps-div1 = <0x1>;
   xlnx,enet-slcr-100mbps-div0 = <0xa>;
   xlnx,enet-slcr-100mbps-div1 = <0x5>;
   xlnx,enet-slcr-10mbps-div0 = <0xa>;
   xlnx,enet-slcr-10mbps-div1 = <0x32>;
   xlnx,ptp-enet-clock = <120833336>;
   mdio {
    #address-cells = <1>;
    #size-cells = <0>;
    phy0: phy@16 {
     compatible = "broadcom,bcm5461";
     device_type = "ethernet-phy";
     reg = <16>;
    } ;
   } ;
  } ;
  ps7_ethernet_1: ps7-ethernet@e000c000 {
   #address-cells = <1>;
   #size-cells = <0>;
   compatible = "xlnx,ps7-ethernet-1.00.a";
   interrupt-parent = <&ps7_scugic_0>;
   interrupts = < 0 45 1 >;
   local-mac-address = [ 00 0a 35 00 00 01 ];
   phy-handle = <&phy1>;
   phy-mode = "rgmii-id";
   reg = < 0xe000c000 0x1000 >;
   xlnx,enet-slcr-1000mbps-div0 = <0xa>;
   xlnx,enet-slcr-1000mbps-div1 = <0x1>;
   xlnx,enet-slcr-100mbps-div0 = <0xa>;
   xlnx,enet-slcr-100mbps-div1 = <0x5>;
   xlnx,enet-slcr-10mbps-div0 = <0xa>;
   xlnx,enet-slcr-10mbps-div1 = <0x32>;
   xlnx,ptp-enet-clock = <120833336>;
   mdio {
    #address-cells = <1>;
    #size-cells = <0>;
    phy1: phy@17 {
     compatible = "broadcom,bcm5461";
     device_type = "ethernet-phy";
     reg = <17>;
    } ;
   } ;
  } ;

 

 

0 Kudos
Scholar rfs613
Scholar
12,574 Views
Registered: ‎05-28-2013

Re: zynq linux - dual emacps(gem) problem

I'm also using RGMII for both Ethernet controllers.

 

Looking at your log, it is trying to use the same address 00000000 when registering the sysfs portion of driver:

 

device: 'eth0': device_add
device: '00000000': device_add
[...]
device: 'eth1': device_add
device: '00000000': device_add

 

These should really be the base address of the device 0xe000b000 and 0xe000c000. Or at least two different values, like 0 and 1. This means that the res.start in the snprintf() isn't picking up the correct value. You might want to print out np, npp, etc to see if you can figure out why res.start isn't coming out. Alternatively you could hack in a static int that gets incremented on each call, to get a uniq value. Not a good solution, but may get you further along.

 

I'm knee deep in some other stuff right now, but once I sort that out, I'll try your exact DTS syntax to see how it works for me.

0 Kudos
Visitor byip
Visitor
12,560 Views
Registered: ‎07-24-2013

Re: zynq linux - dual emacps(gem) problem

Thanks rfs613 for the info.  I'll take a look at the suggestions you identified.

 

The address issue of 0 that you highlighted only surfaces when the patch is added.  Without the patch, the addresses are fine.  Below are the messages on the build without the patch.

 

bus: 'platform': driver_probe_device: matched device e000b000.ps7-ethernet with driver xemacps
bus: 'platform': really_probe: probing driver xemacps with device e000b000.ps7-ethernet
device: 'eth0': device_add
device: 'e000b000': device_add
libphy: XEMACPS mii bus: probed
device: 'e000b000:10': device_add
bus: 'mdio_bus': add device e000b000:10
bus: 'mdio_bus': driver_probe_device: matched device e000b000:10 with driver Broadcom BCM5461
bus: 'mdio_bus': really_probe: probing driver Broadcom BCM5461 with device e000b000:10
driver: 'e000b000:10': driver_bound: bound to device 'Broadcom BCM5461'
bus: 'mdio_bus': really_probe: bound device e000b000:10 to driver Broadcom BCM5461
xemacps e000b000.ps7-ethernet: invalid address, use assigned
xemacps e000b000.ps7-ethernet: MAC updated c6:e0:1b:92:74:08
xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
driver: 'e000b000.ps7-ethernet': driver_bound: bound to device 'xemacps'
bus: 'platform': really_probe: bound device e000b000.ps7-ethernet to driver xemacps
bus: 'platform': driver_probe_device: matched device e000c000.ps7-ethernet with driver xemacps
bus: 'platform': really_probe: probing driver xemacps with device e000c000.ps7-ethernet
device: 'eth1': device_add
device: 'e000c000': device_add
libphy: XEMACPS mii bus: probed
device: 'e000c000:11': device_add
bus: 'mdio_bus': add device e000c000:11
xemacps e000c000.ps7-ethernet: invalid address, use assigned
xemacps e000c000.ps7-ethernet: MAC updated be:c2:bc:b0:72:6b
xemacps e000c000.ps7-ethernet: pdev->id -1, baseaddr 0xe000c000, irq 77
driver: 'e000c000.ps7-ethernet': driver_bound: bound to device 'xemacps'
bus: 'platform': really_probe: bound device e000c000.ps7-ethernet to driver xemacps

 

0 Kudos
Scholar rfs613
Scholar
12,555 Views
Registered: ‎05-28-2013

Re: zynq linux - dual emacps(gem) problem

Hmm, okay, so without the patch, it looks like both devices are being registered correctly. So in which way is it failing, do you get to the login prompt, does ifconfig -a show you both ethernet interfaces?

 

-R

0 Kudos
Visitor byip
Visitor
12,546 Views
Registered: ‎07-24-2013

Re: zynq linux - dual emacps(gem) problem

The good news is that Xilinx has been able to reproduce and confirm the problem with getting the second Ethernet Controller to work using the latest PetaLinux 2013.04 version.

 

I was hoping the change from kernel 3.6 to kernel 3.9, along with the patch, would correct the problem, as has been described in this thread.

 

On eth0, when we connect/disconnect the network cable, we would see the corresponding link/up down messages.

 

On eth1, when we connect/disconnect the network cable, we do not see the link up/down messages.

 

If we used XPS to switch MDIO from GEM 0 to GEM 1, then we get the inverse, eth1 working and eth0 not working.  The working ethernet controller is following the MDIO.

 

Below are additional debug messages capture in case anyone sees anything.  Of note is that for eth0, the Broadcom PHY is attached but for eth1, it is instead attached to the generic PHY.  For phy_id, eth0 has some real value whereas for eth1, it is 0.

 

libphy: XEMACPS mii bus: probed
xemacps e000b000.ps7-ethernet: invalid address, use assigned
xemacps e000b000.ps7-ethernet: MAC updated 12:be:11:e4:8c:7c
xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
libphy: XEMACPS mii bus: probed
xemacps e000c000.ps7-ethernet: invalid address, use assigned
xemacps e000c000.ps7-ethernet: MAC updated 12:bb:9d:d2:01:3b
xemacps e000c000.ps7-ethernet: pdev->id -1, baseaddr 0xe000c000, irq 77

 

bus: 'mdio_bus': add driver Broadcom BCM5411
bus: 'mdio_bus': add driver Broadcom BCM5421
bus: 'mdio_bus': add driver Broadcom BCM5461
bus: 'mdio_bus': add driver Broadcom BCM5464
bus: 'mdio_bus': add driver Broadcom BCM5481
bus: 'mdio_bus': add driver Broadcom BCM5482
bus: 'mdio_bus': add driver Broadcom BCM50610
bus: 'mdio_bus': add driver Broadcom BCM50610M
bus: 'mdio_bus': add driver Broadcom BCM57780
bus: 'mdio_bus': add driver Broadcom BCMAC131
bus: 'mdio_bus': add driver Broadcom BCM5241
bus: 'platform': add driver xilinx_emaclite
bus: 'platform': add driver xemacps
bus: 'platform': driver_probe_device: matched device e000b000.ps7-ethernet with driver xemacps
bus: 'platform': really_probe: probing driver xemacps with device e000b000.ps7-ethernet
xemacps e000b000.ps7-ethernet: BASEADDRESS hw: e000b000 virt: f0058000
device: 'eth0': device_add
device: 'e000b000': device_add
libphy: XEMACPS mii bus: probed
device: 'e000b000:10': device_add
bus: 'mdio_bus': add device e000b000:10
bus: 'mdio_bus': driver_probe_device: matched device e000b000:10 with driver Broadcom BCM5461
bus: 'mdio_bus': really_probe: probing driver Broadcom BCM5461 with device e000b000:10
driver: 'e000b000:10': driver_bound: bound to device 'Broadcom BCM5461'
bus: 'mdio_bus': really_probe: bound device e000b000:10 to driver Broadcom BCM5461
xemacps e000b000.ps7-ethernet: invalid address, use assigned
xemacps e000b000.ps7-ethernet: MAC updated 12:be:11:e4:8c:7c
xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
driver: 'e000b000.ps7-ethernet': driver_bound: bound to device 'xemacps'
bus: 'platform': really_probe: bound device e000b000.ps7-ethernet to driver xemacps
bus: 'platform': driver_probe_device: matched device e000c000.ps7-ethernet with driver xemacps
bus: 'platform': really_probe: probing driver xemacps with device e000c000.ps7-ethernet
xemacps e000c000.ps7-ethernet: BASEADDRESS hw: e000c000 virt: f005a000
device: 'eth1': device_add
device: 'e000c001': device_add
libphy: XEMACPS mii bus: probed
device: 'e000c001:11': device_add
bus: 'mdio_bus': add device e000c001:11
xemacps e000c000.ps7-ethernet: invalid address, use assigned
xemacps e000c000.ps7-ethernet: MAC updated 12:bb:9d:d2:01:3b
xemacps e000c000.ps7-ethernet: pdev->id -1, baseaddr 0xe000c000, irq 77
driver: 'e000c000.ps7-ethernet': driver_bound: bound to device 'xemacps'
bus: 'platform': really_probe: bound device e000c000.ps7-ethernet to driver xemacps

 

xemacps e000b000.ps7-ethernet: open
xemacps e000b000.ps7-ethernet: RX ring 2048 bytes at 0x2f38d000 mapped f0087000
xemacps e000b000.ps7-ethernet: TX ring 2048 bytes at 0x2f389000 mapped f0089000
xemacps e000b000.ps7-ethernet: lp->tx_bd f0089000 lp->tx_bd_dma 2f389000 lp->tx_skb ef25b000
xemacps e000b000.ps7-ethernet: lp->rx_bd f0087000 lp->rx_bd_dma 2f38d000 lp->rx_skb ef268000
xemacps e000b000.ps7-ethernet: MAC 0xe411be12, 0x00007c8c, 12:be:11:e4:8c:7c
xemacps e000b000.ps7-ethernet: GEM: phydev ef30d400, phydev->phy_id 0x2060c1, phydev->addr 0x10
xemacps e000b000.ps7-ethernet: phy_addr 0x10, phy_id 0x002060c1
xemacps e000b000.ps7-ethernet: attach [Broadcom BCM5461] phy driver
xemacps e000b000.ps7-ethernet: TX status 0x21
xemacps e000b000.ps7-ethernet: TX status 0x21
xemacps e000b000.ps7-ethernet: TX status 0x21
xemacps e000b000.ps7-ethernet: Set clk to 125000000 Hz
xemacps e000b000.ps7-ethernet: link up (1000/FULL)
xemacps e000b000.ps7-ethernet: link down
xemacps e000c000.ps7-ethernet: open
xemacps e000c000.ps7-ethernet: RX ring 2048 bytes at 0x2f38c000 mapped f008b000
xemacps e000c000.ps7-ethernet: TX ring 2048 bytes at 0x2f2de000 mapped f008d000
xemacps e000c000.ps7-ethernet: lp->tx_bd f008d000 lp->tx_bd_dma 2f2de000 lp->tx_skb ef383000
xemacps e000c000.ps7-ethernet: lp->rx_bd f008b000 lp->rx_bd_dma 2f38c000 lp->rx_skb ee892000
xemacps e000c000.ps7-ethernet: MAC 0xd29dbb12, 0x00003b01, 12:bb:9d:d2:01:3b
driver: 'e000c001:11': driver_bound: bound to device 'Generic PHY'
xemacps e000c000.ps7-ethernet: GEM: phydev ef311400, phydev->phy_id 0x0, phydev->addr 0x11
xemacps e000c000.ps7-ethernet: phy_addr 0x11, phy_id 0x00000000
xemacps e000c000.ps7-ethernet: attach [Generic PHY] phy driver
xemacps e000c000.ps7-ethernet: TX status 0x21
xemacps e000c000.ps7-ethernet: TX status 0x21
xemacps e000c000.ps7-ethernet: TX status 0x21

 

 

0 Kudos
Visitor byip
Visitor
12,684 Views
Registered: ‎07-24-2013

Re: zynq linux - dual emacps(gem) problem

rfs613, can you post your DTS syntax used for your two RGMII Ethernet controllers?  Thanks.

0 Kudos
Scholar rfs613
Scholar
12,682 Views
Registered: ‎05-28-2013

Re: zynq linux - dual emacps(gem) problem

Are you using a single MDIO for both PHY devices? That's what we are doing. In that case, you'd want to group the entries like so (this is my config):

 

                eth@e000b000 {
                        compatible = "xlnx,ps7-ethernet-1.00.a";
                        reg = <0xe000b000 0x1000>;
                        interrupts = <0 22 4>;
                        interrupt-parent = <&gic>;
                        phy-handle = <&phy0>;
                        phy-mode = "rgmii";
                        xlnx,ptp-enet-clock = <111111111>;
                        xlnx,slcr-div0-1000Mbps = <8>;
                        xlnx,slcr-div0-100Mbps = <8>;
                        xlnx,slcr-div0-10Mbps = <8>;
                        xlnx,slcr-div1-1000Mbps = <1>;
                        xlnx,slcr-div1-100Mbps = <5>;
                        xlnx,slcr-div1-10Mbps = <50>;
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;


                        mdio {
                                #address-cells = <1>;
                                #size-cells = <0>;

                                phy0: phy@0 {
                                        compatible = "marvell,88e1116r";
                                        device_type = "ethernet-phy";
                                        reg = <0>;

 

                                phy1: phy@1 {
                                        compatible = "marvell,88e1116r";
                                        device_type = "ethernet-phy";
                                        reg = <1>;
                                };
                        };
                };

                eth@e000c000 {
                        compatible = "xlnx,ps7-ethernet-1.00.a";
                        reg = <0xe000c000 0x1000>;
                        interrupts = <0 45 4>;
                        interrupt-parent = <&gic>;
                        phy-handle = <&phy1>;
                        phy-mode = "rgmii";
                        xlnx,ptp-enet-clock = <111111111>;
                        xlnx,slcr-div0-1000Mbps = <8>;
                        xlnx,slcr-div0-100Mbps = <8>;
                        xlnx,slcr-div0-10Mbps = <8>;
                        xlnx,slcr-div1-1000Mbps = <1>;
                        xlnx,slcr-div1-100Mbps = <5>;
                        xlnx,slcr-div1-10Mbps = <50>;
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                };

Cheers,

-R

0 Kudos
Visitor peterm37
Visitor
12,588 Views
Registered: ‎07-02-2012

Re: zynq linux - dual emacps(gem) problem

With the stock kernel, this still blew up for us  with a duplicate name error:

sysfs: cannot create duplicate filename '/class/mdio_bus/xxx

 

Fixed as follows:

diff --git a/drivers/net/ethernet/xilinx/xilinx_emacps.c b/drivers/net/ethernet/
index 076488f..cd1c93c 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emacps.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emacps.c
@@ -849,12 +849,19 @@ static int xemacps_mii_probe(struct net_device *ndev)
  * @lp: local device instance pointer
  * return 0 on success, negative value if error
  **/
+
 static int xemacps_mii_init(struct net_local *lp)
 {
        int rc = -ENXIO, i;
        struct resource res;
        struct device_node *np = of_get_parent(lp->phy_node);
        struct device_node *npp;
+       struct device* dev = &lp->pdev->dev;
+
+       if ((lp->mii_bus = of_mdio_find_bus(np))){
+               dev_info(dev, "re-using mdio bus");
+               return 0;
+       }

 

Scholar austin
Scholar
12,586 Views
Registered: ‎02-27-2008

Re: zynq linux - dual emacps(gem) problem

p,

 

So this fixes (resolves) everything?  I am just checking to be sure you have now suceeded.

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
0 Kudos
Visitor peterm37
Visitor
12,583 Views
Registered: ‎07-02-2012

Re: zynq linux - dual emacps(gem) problem

Yes, well it's working for our custom 7020 board.

 

But I'd guess that every unit with 2xGEM, shared MDIO would need it.

 

0 Kudos
Visitor l0p0c
Visitor
12,516 Views
Registered: ‎09-13-2013

Re: zynq linux - dual emacps(gem) problem

Hello,

 

I patch the kernel as this:

 

 

/**
 * xemacps_mii_init - Initialize and register mii bus to network device
 * @lp: local device instance pointer
 * return 0 on success, negative value if error
 **/
static int xemacps_mii_init(struct net_local *lp)
{
        int rc = -ENXIO, i;
        struct resource res;
        struct device_node *np = of_get_parent(lp->phy_node);
        struct device_node *npp;
#define PATCH
#if defined(PATCH)
        struct device* dev = &lp->pdev->dev;

        if ((lp->mii_bus = of_mdio_find_bus(np))){
                dev_info(dev, "re-using mdio bus");
                return 0;
        }
#endif

        lp->mii_bus = mdiobus_alloc();
        if (lp->mii_bus == NULL) {
                rc = -ENOMEM;
                goto err_out;
        }

        lp->mii_bus->name  = "XEMACPS mii bus";
        lp->mii_bus->read  = &xemacps_mdio_read;
        lp->mii_bus->write = &xemacps_mdio_write;
        lp->mii_bus->reset = &xemacps_mdio_reset;
        lp->mii_bus->priv = lp;
        lp->mii_bus->parent = &lp->ndev->dev;

        lp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
        if (!lp->mii_bus->irq) {
                rc = -ENOMEM;
                goto err_out_free_mdiobus;
        }

        for (i = 0; i < PHY_MAX_ADDR; i++)
                lp->mii_bus->irq[i] = PHY_POLL;
#if !defined(PATCH)
        npp = of_get_parent(np);
        of_address_to_resource(npp, 0, &res);
#else
        of_address_to_resource(np, 0, &res);
#endif
        snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%.8llx",
                 (unsigned long long)res.start);
        if (of_mdiobus_register(lp->mii_bus, np))

 

And my dts is:

 

                ps7_ethernet_0: ps7-ethernet@e000b000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "xlnx,ps7-ethernet-1.00.a";
                        interrupt-parent = <&ps7_scugic_0>;
                        interrupts = < 0 22 4 >;
                        local-mac-address = [ 00 0a 0c 0c 0d 0e ];
                        phy-handle = <&phy0>;
                        phy-mode = "sgmii";
                        reg = < 0xe000b000 0x1000 >;
                        xlnx,enet-clk-freq-hz = <0x7735940>;
                        xlnx,enet-reset = <0xffffffff>;
                        xlnx,enet-slcr-1000mbps-div0 = <0x8>;
                        xlnx,enet-slcr-1000mbps-div1 = <0x1>;
                        xlnx,enet-slcr-100mbps-div0 = <0x8>;
                        xlnx,enet-slcr-100mbps-div1 = <0x5>;
                        xlnx,enet-slcr-10mbps-div0 = <0x8>;
                        xlnx,enet-slcr-10mbps-div1 = <0x32>;
                        xlnx,eth-mode = <0x1>;
                        xlnx,has-mdio = <0x1>;
                        xlnx,ptp-enet-clock = <111111115>;
                        mdio {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                phy0: phy@0 {
                                        compatible = "marvell,88e1510";
                                        device_type = "ethernet-phy";
                                        reg = <0>;
                                        marvell,reg-init = <18 20 0xfff8 0x4>;
                                } ;

                                phy1: phy@1 {
                                        compatible = "marvell,88e1510";
                                        device_type = "ethernet-phy";
                                        reg = <1>;
                                        marvell,reg-init = <18 20 0xfff8 0x4>;
                                } ;

                        } ;
                } ;
                ps7_ethernet_1: ps7-ethernet@e000c000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "xlnx,ps7-ethernet-1.00.a";
                        interrupt-parent = <&ps7_scugic_0>;
                        interrupts = < 0 45 4 >;
                        local-mac-address = [ 00 0a 0c 0c 0d 0f ];
                        phy-handle = <&phy1>;
                        phy-mode = "rgmii-id";
                        reg = < 0xe000c000 0x1000 >;
                        xlnx,enet-clk-freq-hz = <0x7735940>;
                        xlnx,enet-reset = <0xffffffff>;
                        xlnx,enet-slcr-1000mbps-div0 = <0x8>;
                        xlnx,enet-slcr-1000mbps-div1 = <0x1>;
                        xlnx,enet-slcr-100mbps-div0 = <0x8>;
                        xlnx,enet-slcr-100mbps-div1 = <0x5>;
                        xlnx,enet-slcr-10mbps-div0 = <0x8>;
                        xlnx,enet-slcr-10mbps-div1 = <0x32>;
                        xlnx,eth-mode = <0x1>;
                        xlnx,has-mdio = <0x0>;
                        xlnx,ptp-enet-clock = <111111115>;
                } ;
 

But linux can't detect the phy1. Linux startup info about phy:

 

 

libphy: XEMACPS mii bus: probed
xemacps e000b000.ps7-ethernet: pdev->id -1, baseaddr 0xe000b000, irq 54
xemacps e000c000.ps7-ethernet: re-using mdio bus
xemacps e000c000.ps7-ethernet: invalid address, use assigned
xemacps e000c000.ps7-ethernet: MAC updated 1a:33:36:2a:b3:26
xemacps e000c000.ps7-ethernet: pdev->id -1, baseaddr 0xe000c000, irq 77

 

My hardware is a single mdio for both phy. Why not my system ok? Please help me.

 

Thanks.
 

0 Kudos
Visitor joazinho
Visitor
12,346 Views
Registered: ‎10-31-2013

Re: zynq linux - dual emacps(gem) problem

Hi everyone, well I think our problems are nearly related..

on our custom board identical to zedboard we use National Semiconductor PHY (dp83865) device.. we also changed the zynqzed.dts to use the natsemi drivers. we changed the kenel to include the national semiconducter PHY device drivers. but we cant see them once we have booted and the ethernet is not pinging, even from the u-boot.elf. we have used the digilent build source tree for u-boot and the zImage.

 

 

zed-boot>
zed-boot> go 0x8000
## Starting application at 0x00008000 ...
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Linux version 3.6.0-digilent-13.01-00002-g06b3889-dirty (root@MMUDUMBE-LNB1) (gcc version 4.7.2 (Sourcery CodeBench Lite 2012.09-104) ) #1 SMP PREEMPT Wed Oct 30 14:30:07 SAST 2013
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: Xilinx Zynq Platform, model: Xilinx Zynq ZedBoard
[ 0.000000] Memory policy: ECC disabled, Data cache writealloc
[ 0.000000] On node 0 totalpages: 131072
[ 0.000000] free_area_init_node: node 0, pgdat c048c940, node_mem_map c1001000
[ 0.000000] Normal zone: 1024 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 130048 pages, LIFO batch:31
[ 0.000000] PERCPU: Embedded 7 pages/cpu @c1406000 s6976 r8192 d13504 u32768
[ 0.000000] pcpu-alloc: s6976 r8192 d13504 u32768 alloc=8*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
[ 0.000000] Kernel command line: console=ttyPS0,115200 root=/dev/ram rw initrd=0x800000,8M earlyprintk maxcpus=2 debug ip=192.168.1.10
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 512MB = 512MB total
[ 0.000000] Memory: 506736k/506736k available, 17552k 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 : 0xe0800000 - 0xfd000000 ( 456 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc042e494 (4250 kB)
[ 0.000000] .init : 0xc042f000 - 0xc0454b40 ( 151 kB)
[ 0.000000] .data &colon; 0xc0456000 - 0xc048e4a0 ( 226 kB)
[ 0.000000] .bss : 0xc048e4c4 - 0xc04a4c70 ( 90 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Dump stacks of tasks blocking RCU-preempt GP.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] NR_IRQS:512
[ 0.000000] Zynq clock init
[ 0.000000] xlnx,ps7-ttc-1.00.a #0 at 0xe0800000, irq=43
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: at arch/arm/kernel/smp_twd.c:389 time_init+0x20/0x30()
[ 0.000000] twd_local_timer_of_register failed (-19)
[ 0.000000] Modules linked in:
[ 0.000000] [<c001343c>] (unwind_backtrace+0x0/0xe0) from [<c001f69c>] (warn_slowpath_common+0x4c/0x64)
[ 0.000000] [<c001f69c>] (warn_slowpath_common+0x4c/0x64) from [<c001f734>] (warn_slowpath_fmt+0x2c/0x3c)
[ 0.000000] [<c001f734>] (warn_slowpath_fmt+0x2c/0x3c) from [<c0432f40>] (time_init+0x20/0x30)
[ 0.000000] [<c0432f40>] (time_init+0x20/0x30) from [<c042f6b8>] (start_kernel+0x1b0/0x2f4)
[ 0.000000] [<c042f6b8>] (start_kernel+0x1b0/0x2f4) from [<00008044>] (0x8044)
[ 0.000000] ---[ end trace 1b75b31a2719ed1c ]---
[ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.090000] Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
[ 0.090000] pid_max: default: 32768 minimum: 301
[ 0.090000] Mount-cache hash table entries: 512
[ 0.090000] CPU: Testing write buffer coherency: ok
[ 0.090000] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.090000] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
[ 0.090000] Setting up static identity map for 0x2f8488 - 0x2f84bc
[ 0.090000] L310 cache controller enabled
[ 0.090000] l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72060000, Cache size: 524288 B
[ 0.130000] Map SLCR registers
[ 0.130000] CPU1: Booted secondary processor
[ 0.220000] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.220000] Brought up 2 CPUs
[ 0.220000] SMP: Total of 2 processors activated (2664.03 BogoMIPS).
[ 0.220000] devtmpfs: initialized
[ 0.220000] NET: Registered protocol family 16
[ 0.220000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.220000] xgpiops e000a000.gpio: gpio at 0xe000a000 mapped to 0xe084a000
[ 0.220000] registering platform device 'pl330' id 0
[ 0.220000] registering platform device 'arm-pmu' id 0
[ 0.220000] registering platform device 'zynq-dvfs' id 0
[ 0.220000] ------------[ cut here ]------------
[ 0.220000] WARNING: at arch/arm/kernel/hw_breakpoint.c:240 enable_monitor_mode+0x30/0xb4()
[ 0.220000] halting debug mode enabled. Unable to access hardware resources.
[ 0.220000] Modules linked in:
[ 0.220000] [<c001343c>] (unwind_backtrace+0x0/0xe0) from [<c001f69c>] (warn_slowpath_common+0x4c/0x64)
[ 0.220000] [<c001f69c>] (warn_slowpath_common+0x4c/0x64) from [<c001f734>] (warn_slowpath_fmt+0x2c/0x3c)
[ 0.220000] [<c001f734>] (warn_slowpath_fmt+0x2c/0x3c) from [<c0014048>] (enable_monitor_mode+0x30/0xb4)
[ 0.220000] [<c0014048>] (enable_monitor_mode+0x30/0xb4) from [<c0014130>] (reset_ctrl_regs+0x64/0x13c)
[ 0.220000] [<c0014130>] (reset_ctrl_regs+0x64/0x13c) from [<c0055e84>] (generic_smp_call_function_single_interrupt+0xe8/0x124)
[ 0.220000] [<c0055e84>] (generic_smp_call_function_single_interrupt+0xe8/0x124) from [<c0012798>] (handle_IPI+0x64/0xb0)
[ 0.220000] [<c0012798>] (handle_IPI+0x64/0xb0) from [<c0008460>] (gic_handle_irq+0x58/0x60)
[ 0.220000] [<c0008460>] (gic_handle_irq+0x58/0x60) from [<c000d740>] (__irq_svc+0x40/0x70)
[ 0.220000] Exception stack(0xd8069f98 to 0xd8069fe0)
[ 0.220000] 9f80: c140eb18 00000000
[ 0.220000] 9fa0: 00000003 00000000 d8068000 c02fba9c c048e5c8 c048e8a0 0000406a 413fc090
[ 0.220000] 9fc0: 00000000 00000000 00000000 d8069fe0 c000e660 c000e664 60000013 ffffffff
[ 0.220000] [<c000d740>] (__irq_svc+0x40/0x70) from [<c000e664>] (default_idle+0x24/0x2c)
[ 0.220000] [<c000e664>] (default_idle+0x24/0x2c) from [<c000e844>] (cpu_idle+0x84/0xcc)
[ 0.220000] [<c000e844>] (cpu_idle+0x84/0xcc) from [<002f02f4>] (0x2f02f4)
[ 0.220000] ---[ end trace 1b75b31a2719ed1d ]---
[ 0.220000] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.220000] hw-breakpoint: halting debug mode enabled. Assuming maximum watchpoint size of 4 bytes.
[ 0.250000] xslcr xslcr.0: at 0xF8000000 mapped to 0xF8000000
[ 0.260000] bio: create slab <bio-0> at 0
[ 0.260000] SCSI subsystem initialized
[ 0.260000] usbcore: registered new interface driver usbfs
[ 0.260000] usbcore: registered new interface driver hub
[ 0.260000] usbcore: registered new device driver usb
[ 0.260000] Advanced Linux Sound Architecture Driver Version 1.0.25.
[ 0.260000] Switching to clocksource xttcpss_timer1
[ 0.270000] Clockevents: could not switch to one-shot mode:
[ 0.270000] Clockevents: could not switch to one-shot mode: dummy_timer is not functional.
[ 0.270000] Could not switch to high resolution mode on CPU 1
[ 0.270000] dummy_timer is not functional.
[ 0.270000] Could not switch to high resolution mode on CPU 0
[ 0.280000] NET: Registered protocol family 2
[ 0.280000] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.280000] TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.280000] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.280000] TCP: reno registered
[ 0.280000] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.280000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.280000] NET: Registered protocol family 1
[ 0.280000] Trying to unpack rootfs image as initramfs...
[ 0.280000] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.320000] Freeing initrd memory: 8192K
[ 0.320000] pl330 dev 0 probe success
[ 0.320000] msgmni has been set to 1005
[ 0.320000] io scheduler noop registered
[ 0.320000] io scheduler deadline registered
[ 0.320000] io scheduler cfq registered (default)
[ 0.320000] xuartps e0001000.uart: failed to get alias id, errno -19
[ 0.320000] e0001000.uart: ttyPS0 at MMIO 0xe0001000 (irq = 82) is a xuartps
[ 1.030000] console [ttyPS0] enabled
[ 1.030000] xdevcfg f8007000.devcfg: ioremap f8007000 to e0850000 with size 100
[ 1.040000] [drm] Initialized drm 1.1.0 20060810
[ 1.060000] brd: module loaded
[ 1.060000] loop: module loaded
[ 1.070000] libphy: XEMACPS mii bus: probed
[ 1.080000] xemacps e000b000.eth: Could not find MAC address in device tree, use default
[ 1.080000] xemacps e000b000.eth: pdev->id -1, baseaddr 0xe000b000, irq 54
[ 1.090000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.100000] usb_hcd_xusbps_probe: No OTG assigned!
[ 1.100000] usb_hcd_xusbps_probe: OTG now assigned!
[ 1.110000] xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller
[ 1.110000] xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1
[ 1.150000] xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000
[ 1.170000] xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00
[ 1.180000] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 1.180000] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1.190000] usb usb1: Product: Xilinx PS USB EHCI Host Controller
[ 1.200000] usb usb1: Manufacturer: Linux 3.6.0-digilent-13.01-00002-g06b3889-dirty ehci_hcd
[ 1.200000] usb usb1: SerialNumber: xusbps-ehci.0
[ 1.210000] hub 1-0:1.0: USB hub found
[ 1.210000] hub 1-0:1.0: 1 port detected
[ 1.220000] Initializing USB Mass Storage driver...
[ 1.220000] usbcore: registered new interface driver usb-storage
[ 1.230000] USB Mass Storage support registered.
[ 1.230000] mousedev: PS/2 mouse device common for all mice
[ 1.240000] xwdtps f8005000.swdt: Xilinx Watchdog Timer at 0xe0858000 with timeout 10s
[ 1.250000] sdhci: Secure Digital Host Controller Interface driver
[ 1.250000] sdhci: Copyright(c) Pierre Ossman
[ 1.260000] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.270000] Registered led device: mmc0::
[ 1.320000] mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
[ 1.340000] usbcore: registered new interface driver usbhid
[ 1.350000] usbhid: USB HID core driver
[ 1.350000] TCP: cubic registered
[ 1.360000] NET: Registered protocol family 17
[ 1.360000] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[ 1.370000] Registering SWP/SWPB emulation handler
[ 1.370000] registered taskstats version 1
[ 1.380000] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 1.410000] IP-Config: Guessing netmask 255.255.255.0
[ 1.410000] IP-Config: Complete:
[ 1.410000] device=eth0, addr=192.168.1.10, mask=255.255.255.0, gw=255.255.255.255
[ 1.420000] host=192.168.1.10, domain=, nis-domain=(none)
[ 1.430000] bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
[ 1.430000] ALSA device list:
[ 1.440000] No soundcards found.
[ 1.440000] RAMDISK: gzip image found at block 0
[ 1.710000] EXT4-fs (ram0): couldn't mount as ext3 due to feature incompatibilities
[ 1.770000] EXT4-fs (ram0): mounting ext2 file system using the ext4 subsystem
[ 1.770000] EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
[ 1.780000] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 1.790000] devtmpfs: mounted
[ 1.790000] Freeing init memory: 148K
Starting rcS...
++ Mounting filesystem
++ Setting up mdev
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting dropbear (ssh) daemon
rcS Complete

 

========================================================more  ============

[ 18.390000] xemacps e000b000.eth: Set clk to 24999999 Hz
[ 18.390000] xemacps e000b000.eth: link up (100/FULL)
zynq> ifconfig eth0 down
zynq> ifconfig eth0 up
zynq> [ 142.570000] xemacps e000b000.eth: Set clk to 24999999 Hz
[ 142.570000] xemacps e000b000.eth: link up (100/FULL)

zynq> ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:01:22
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:19 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)
Interrupt:54 Base address:0xb000

zynq> ping :192.168.1.50
ping: bad port spec ':192.168.1.50'
zynq> ping 192.168.1.50
PING 192.168.1.50 (192.168.1.50): 56 data bytes
^C
--- 192.168.1.50 ping statistics ---
39 packets transmitted, 0 packets received, 100% packet loss
zynq> ping 192.168.1.50
PING 192.168.1.50 (192.168.1.50): 56 data bytes
[ 250.580000] xemacps e000b000.eth: link down
[ 288.580000] xemacps e000b000.eth: Set clk to 124999998 Hz
[ 288.580000] xemacps e000b000.eth: link up (1000/FULL)

 

but no results...please help

0 Kudos
Observer altanbileg
Observer
12,335 Views
Registered: ‎07-29-2013

Re: zynq linux - dual emacps(gem) problem

Hi joazinho. I used dp83865 PHY. I had same problem that couldn`t ping. But i solved it. 

The solution was set RGMII 3com mode for dp83865 PHY. If you use RGMII HP mode try it.

0 Kudos
Visitor joazinho
Visitor
12,307 Views
Registered: ‎10-31-2013

Re: zynq linux - dual emacps(gem) problem

Hi altanbileg, thank you so much for the help. its up and pinging  :) . we so grateful for the help, much appreciated...

 

 

 

0 Kudos
Explorer
Explorer
12,026 Views
Registered: ‎07-09-2012

Re: zynq linux - dual emacps(gem) problem

Hello,

 

We too have developed a zynq board with dual NICs and they didn't work  correctly.  We applied the kernel patch from message 26 of this thread and now have the kernel (3.10) recognizing when the 2nd enet cable is plugged in and unplugged. When we enable eth1 using the ifconfig command, everything appears normal yet still, all ethernet traffic is always routed over the first NIC.  I can ping and connect to the IP address of eth1.  But when I look at the ifconfig statistics, all packets are being counted on eth0, i.e. the eth1 packet count is always 0.  

 

In summary here is what we have

1. The hardware detects plugging/unplugging the 2nd NIC.

2. Nothing ever gets tranferred over the 2nd NIC however.

3. Both eth0 and eth1connections are made over NIC 1.

4. No packet count is ever incremented for eth1.

5. All packets are counted on eth0.

 

Below is the DTS section and ifconfig output.

 

Any thoughts on how to get the 2nd NIC working?  I guess this could a hardware issue rather than s/w.

 

Thanks for any suggestions.

 

- Dave

 

ps7_ethernet_1: ps7-ethernet@e000c000 {
#address-cells = <1>;
#size-cells = <0>;
clock-names = "ref_clk", "aper_clk";
clocks = <&clkc 14>, <&clkc 31>;
compatible = "xlnx,ps7-ethernet-1.00.a";
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0 45 1>;
local-mac-address = [00 0a 35 00 00 01];
phy-handle = <&phy1>;
phy-mode = "rgmii-id";
reg = <0xe000c000 0x1000>;
xlnx,eth-mode = <0x1>;
xlnx,has-mdio = <0x0>;
xlnx,ptp-enet-clock = <111111115>;
} ;
ps7_gpio_0: ps7-gpio@e000a000 {
#gpio-cells = <2>;
clocks = <&clkc 42>;
compatible = "xlnx,ps7-gpio-1.00.a";
emio-gpio-width = <64>;
gpio-controller ;
gpio-mask-high = <0x0>;
gpio-mask-low = <0x5600>;
interrupt-parent = <&ps7_scugic_0>;
interrupts = <0 20 4>;
reg = <0xe000a000 0x1000>;
} ;

 

 

ifconfig reports

 

eth0 Link encap:Ethernet HWaddr 00:0A:35:00:01:22
inet addr:192.168.1.77 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4645 errors:0 dropped:0 overruns:0 frame:0
TX packets:2038 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4904 (4.7 KiB) TX bytes:2277 (2.2 KiB)
Interrupt:54 Base address:0xb000

 

eth1 Link encap:Ethernet HWaddr 00:80:01:02:03:04
inet addr:192.168.1.78 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING 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)
Interrupt:77 Base address:0xc000

0 Kudos