cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
6,468 Views
Registered: ‎04-10-2017

xilinx zynq 7000 network driver

hi,
We are using a board that is based on Xilinx zynq 7000.
I'm trying to check which network driver we are actually
using (out of the 4 below) & which one is associated
with eth0 & which one is associated with wth1.
(see Kconfig file below).

Tried to find the answer in the various dts files & didn't get
far.

I'd like to force linux to use the following driver:XILINX_PS_EMAC
and attach it to interface eth0.
Can it be done? if yes, which component I need to configure
through petalinux for that?

Thanks,
Liran.

/components/linux-kernel/xlnx-4.4/drivers/net/ethernet/xilinx/Kconfig
if NET_VENDOR_XILINX

config XILINX_EMACLITE
        tristate "Xilinx 10/100 Ethernet Lite support"
        depends on (PPC32 || MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP )
        select PHYLIB
        ---help---
          This driver supports the 10/100 Ethernet Lite from Xilinx.

config XILINX_AXI_EMAC
        tristate "Xilinx 10/100/1000 AXI Ethernet support"
        depends on (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
        select PHYLIB
        ---help---
          This driver supports the 10/100/1000 Ethernet from Xilinx for the
          AXI bus interface used in Xilinx Virtex FPGAs.

config XILINX_AXI_EMAC_HWTSTAMP
        bool "Generate hardware packet timestamps"
        depends on XILINX_AXI_EMAC
        select PTP_1588_CLOCK
        default n
        ---help---
          Generate hardare packet timestamps. This is to facilitate IEE 1588.

config XILINX_LL_TEMAC
        tristate "Xilinx LL TEMAC (LocalLink Tri-mode Ethernet MAC) driver"
        depends on (PPC || MICROBLAZE)
        select PHYLIB
        ---help---
          This driver supports the Xilinx 10/100/1000 LocalLink TEMAC
          core used in Xilinx Spartan and Virtex FPGAs

config XILINX_PS_EMAC
        tristate "Xilinx Zynq tri-speed EMAC support"
        depends on ARCH_ZYNQ
        select PHYLIB
        ---help---
          This driver supports tri-speed EMAC.

config XILINX_PS_EMAC_HWTSTAMP
        bool "Generate hardware packet timestamps"
        depends on XILINX_PS_EMAC
        select PTP_1588_CLOCK
        default n
        ---help---
          Generate hardare packet timestamps. This is to facilitate IEE 1588.


endif # NET_VENDOR_XILINX

0 Kudos
11 Replies
Highlighted
Scholar
Scholar
6,453 Views
Registered: ‎05-28-2013

Re: xilinx zynq 7000 network driver

So there are two answers here...

 

Old answer:

XILINX_PS_EMAC is the standard driver for the built-in EMAC controllers on the Zynq, so this is the correct one to use. It is most likely being used for both eth0 and eth1 (that's how we have it), though your situation could differ, depending on how you have signals routed.

 

XILINX_PS_EMAC actually corresponds to the file xilinx_emacps.c, see drivers/net/ethernet/xilinx/Makefile. Next, looking at the file drivers/net/ethernet/xilinx/xilinx_emacps.c, near the end, you'll find its compatible string:

static struct of_device_id xemacps_of_match[] = {
	{ .compatible = "xlnx,ps7-ethernet-1.00.a", },
	{ /* end of table */}
};

In turn, that string will appear in your device tree (.dts) and selects the driver to be used for a given interface.

eth@e000b000 {
        compatible = "xlnx,ps7-ethernet-1.00.a";
        reg = <0xe000b000 0x1000>;
        interrupts = <0 22 4>;
        ....
}
eth@e000c000 {
        compatible = "xlnx,ps7-ethernet-1.00.a";
        reg = <0xe000c000 0x1000>;
        interrupts = <0 45 4>;
        ...
}

In the absence of any alias directives,  the first entry will be eth0 and the second one will be eth1.

 

New answer:

In recent versions of arch/arm/boot/dts/zynq-7000.dtsi file, the driver for both ethernet (now called gem0 and gem1) has switched from xlnx,ps7-ethernet to zynq-gem. This one is actually located in drivers/net/ethernet/cadence/macb.c (found by grepping for the compatible string).

0 Kudos
Highlighted
Explorer
Explorer
6,406 Views
Registered: ‎11-09-2015

Re: xilinx zynq 7000 network driver

hi @liranraz


I'd like to force linux to use the following driver:XILINX_PS_EMAC and attach it to interface eth0.
Can it be done?
*******************************************
the answer is yes.

there are two answers to your question.
To use XILINX_PS_EMAC you need 2 steps in recently version kernel.
1. configure the XILINX_PS_EMAC
you can use petaconfig -c kernel to configure this configuration.
tips: your can use / to search.

2. modify the driver's dts:zynq-7000.dtsi
subsystems/linux/configs/device-tree/zynq-7000.dtsi
take ethernet@e000c000 for example.

gem1: ethernet@e000c000 {
compatible = "xlnx,ps7-ethernet-1.00.a";
reg = <0xe000c000 0x1000>;
status = "disabled";
interrupts = <0 45 4>;
clocks = <&clkc 14>, <&clkc 31>;
clock-names = "ref_clk", "aper_clk";
local-mac-address = [00 0a 35 00 00 00];
xlnx,has-mdio = <0x1>;
#address-cells = <1>;
#size-cells = <0>;
};
/*
gem0: ethernet@e000c000 {
compatible = "cdns,gem";
reg = <0xe000c000 0x1000>;
status = "disabled";
interrupts = <0 22 4>;
clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
clock-names = "pclk", "hclk", "tx_clk";
#address-cells = <1>;
#size-cells = <0>;
};
*/

After those two steps,you can use XILINX_PS_EMAC driver work for ethernet@e000c000.

*****************************************************************************
attach it to interface eth0

there are 3 conditions on that question:
           a) If your system have only one ps_emac. It will attach as eth0.
           b)If your system have 2 ps_emac.
If you want one ethernet use xilinx ps_emac driver,the other one use cadence emab driver.
You need modify drivers/net/ethernet/Makefile,make sure xilinx folder at the top order.

obj-$(CONFIG_NET_VENDOR_AURORA) += aurora/
obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/   // high then cadence
obj-$(CONFIG_NET_CADENCE) += cadence/
obj-$(CONFIG_NET_BFIN) += adi/

 

If you want two ps_emac use the same driver.You should make sure the port which you want attach to eth0 at top order in dts.

eg: ethernet@e000c000 attach eth0 ethernet@e000b000 attach eth1
gem1: ethernet@e000c000 {
                       ...
};
gen0:ethernet@e000b000 {
                       ...
};

ethernet@e000b000 attach eth0 ethernet@e000c000 attach eth1
gem1: ethernet@e000b000 {
                       ...
};
gen0:ethernet@e000c000 {
                       ...
};

 

c) If your system have more then one kind Ethernet,for example:ps_emac, axi_ethernet,ethernetlite.
if you want ps_emac attach to eth0,you should modify drivers/net/ethernet/xilinx/Makefile make sure xilinx_emacps at top order.

#
# Makefile for the Xilink network device drivers.
#
obj-$(CONFIG_XILINX_PS_EMAC) += xilinx_emacps.o   //high then others
ll_temac-objs := ll_temac_main.o ll_temac_mdio.o
obj-$(CONFIG_XILINX_LL_TEMAC) += ll_temac.o
obj-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o
xilinx_emac-objs := xilinx_axienet_main.o xilinx_axienet_mdio.o
obj-$(CONFIG_XILINX_AXI_EMAC) += xilinx_emac.o


BRs,

0 Kudos
Highlighted
Visitor
Visitor
6,388 Views
Registered: ‎04-10-2017

Re: xilinx zynq 7000 network driver

hi,

Thanks for the replies.

I followed your suggestions & changed the following dts file: zynq-7000.dtsi
accordingly.


I need:
eth0 to use the xilinx_emacps netweork driver (instead of the cadence driver)
I wanted to keep eth1 using the cadence network driver.

(eth0 is linked to a broadcom PHY we are using - works with
the cadence driver. eth1 is linked to a ethernet over usb device
provided by xilinx).


Here are my changes (I commented out the previous gem0 cadence configuration
as a reference):


/* Using cadence
                gem0: ethernet@e000b000 {
                        compatible = "cdns,zynq-gem", "cdns,gem";
                        reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                        clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                };
*/

/* Using xilinx_emacps */
                gem0: ethernet@e000b000 {
                        compatible = "xlnx,ps7-ethernet-1.00.a";
                        reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                        clocks = <&clkc 13>, <&clkc 30>;
                        clock-names = "ref_clk", "aper_clk";
                        local-mac-address = [00 0a 35 00 1e 53];
                        xlnx,has-mdio = <0x1>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                };
/* Using cadence */
                gem1: ethernet@e000c000 {
                        compatible = "cdns,zynq-gem", "cdns,gem";
                        reg = <0xe000c000 0x1000>;
                        status = "disabled";
                        interrupts = <0 45 4>;
                        clocks = <&clkc 31>, <&clkc 31>, <&clkc 14>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <1>;
                        #size-cells = <0>;
                };


I've also updated the 2 makefiles & moved:
obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/
& +obj-$(CONFIG_XILINX_PS_EMAC) += xilinx_emacps.o
to the top of their respective makefiles

When I tried the load with the changes above on target the
kernel "paniced" & didn't come up to the login prompt,
going through the kernel messages (below) it seems like
it's part of the eth0 as emacps driver initialization
that has some corruption.

Any help with this would be appreciated.
(I can provide more configuration files or logs
if needed).

Thanks,
Liran.

...
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0000000.serial: ttyPS0 at MMIO 0xe0000000 (irq = 145, base_baud = 6249999) is a xuartps
¦console [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e086a000
[drm] Initialized drm 1.1.0 20060810
brd: module loaded
loop: module loaded
m25p80 spi0.0: found n25q00, expected n25q128a13
m25p80 spi0.0: n25q00 (131072 Kbytes)
6 ofpart partitions found on MTD device spi0.0
Creating 6 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "boot"
0x000000040000-0x000001160000 : "fpga"
0x000001160000-0x000001400000 : "uboot"
0x000001400000-0x000002400000 : "kernel"
0x000002400000-0x000002420000 : "bootenv"
0x000002420000-0x000008000000 : "spare"
xemacps_probe invoked
xemacps e000b000.ethernet: pdev->id -1, baseaddr 0xe000b000, irq 147
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
phy_init:710: registered phy char device ok, major:246
phy_init: eth base address sp e0942000 pl e0944000
fpga_init: gpio chip found
Unable to handle kernel paging request at virtual address dd868d40
pgd = c0004000
[dd868d40] *pgd=1d81141e(bad)
Internal error: Oops - BUG: 8000000d [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.4.0k3-xilinx #6
Hardware name: Xilinx Zynq Platform
task: de42c9c0 ti: de44a000 task.ti: de44a000
PC is at 0xdd868d40
LR is at fpga_init+0xa8/0x114
pc : [<dd868d40>]    lr : [<c02f8944>]    psr: 60000013
sp : de44bee8  ip : 00000000  fp : 00000000
r10: c06ae83c  r9 : c0b96980  r8 : 00000000
r7 : c0b654a0  r6 : c0b654a0  r5 : c0b70788  r4 : c0bbf918
r3 : dd868d40  r2 : 00000003  r1 : 00000044  r0 : c0bbf918
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
Control: 18c5387d  Table: 0000404a  DAC: 00000051
Process swapper/0 (pid: 1, stack limit = 0xde44a210)
Stack: (0xde44bee8 to 0xde44c000)
bee0:                   c0bbf918 dd846000 c0b654a0 c069b214 c0b85608 debef000
bf00: 00000026 dd868b00 c069b140 c00097a4 c0b9f510 00000000 00000000 c010da0c
bf20: c05ce700 de495e00 defffe56 00000000 00000000 c0038af0 c06575b8 00000006
bf40: 00000006 c06583a0 000000b1 c06583a0 c0b6850c 00000006 c06ae830 000000b2
bf60: 00000006 c06ae834 000000b2 c06b8c94 c0b96980 c0681d54 00000006 00000006
bf80: 00000000 c06814f8 00000000 c04965a0 00000000 00000000 00000000 00000000
bfa0: 00000000 c04965a8 00000000 c000ee38 00000000 00000000 00000000 00000000
bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffacb76b bcfa2dcb
[<c02f8944>] (fpga_init) from [<c069b214>] (phy_init+0xd4/0x1a8)
[<c069b214>] (phy_init) from [<c00097a4>] (do_one_initcall+0x104/0x188)
[<c00097a4>] (do_one_initcall) from [<c0681d54>] (kernel_init_freeable+0x118/0x1e0)
[<c0681d54>] (kernel_init_freeable) from [<c04965a8>] (kernel_init+0x8/0xe4)
[<c04965a8>] (kernel_init) from [<c000ee38>] (ret_from_fork+0x14/0x3c)
Code: 00000000 00000000 00000000 00000000 (de40dd00)
---[ end trace 5c24d226814922fc ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G      D         4.4.0k3-xilinx #6
Hardware name: Xilinx Zynq Platform

0 Kudos
Highlighted
Explorer
Explorer
6,377 Views
Registered: ‎11-09-2015

Re: xilinx zynq 7000 network driver

hi

   According to your dmesg, ethernet@e000b000 has probe as  xemacps.

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

xemacps_probe invoked
xemacps e000b000.ethernet: pdev->id -1, baseaddr 0xe000b000, irq 147      // ethernet@e000b000 has probe as  xemacps.
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
phy_init:710: registered phy char device ok, major:246
phy_init: eth base address sp e0942000 pl e0944000
fpga_init: gpio chip found

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

but i don't know what is this phy,and the fpga?

can you come up to the login prompt before your makefile change?

 

BTW,you don't need  make this “obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/” at the top position of the makefile,just make sure  “obj-$(CONFIG_NET_CADENCE) += cadence/”is lower then "obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/". The drivers probe order  depend on the position at makefile. After your makefile change, may be  your driver‘s dependency has been probe later then  your driver,then your driver will probe fail.

 

BRs,

 

 

0 Kudos
Highlighted
Visitor
Visitor
6,360 Views
Registered: ‎04-10-2017

Re: xilinx zynq 7000 network driver

hi,

Here is the kernel startup sequence log, when gem0 is configured as cadence:

 

6 ofpart partitions found on MTD device spi0.0
Creating 6 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "boot"
0x000000040000-0x000001160000 : "fpga"
0x000001160000-0x000001400000 : "uboot"
0x000001400000-0x000002400000 : "kernel"
0x000002400000-0x000002420000 : "bootenv"
0x000002420000-0x000008000000 : "spare"
libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 147 (00:0a:35:00:1e:53)
macb e000b000.ethernet eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
phy_init:710: registered phy char device ok, major:246
phy_init: eth base address sp e0942000 pl e0944000
fpga_init: gpio chip found
FPGA id: 0x01004401
Broadcomm reset status: 0x00000003
phy_prtad_scan: phy ports address: 0x1 - 0x2
phy_fw_download: turn on broadcast mode
phy_fw_download: halt the system
phy_fw_download: upload firmware
phy_fw_download: reset processor
phy_fw_download: verify processor is running
phy_fw_download: verify firmware crc: ok
Trimode Eth mac filter data: 0x35001e53
Trimode Eth mac filter data: 0x0000000a
usbcore: registered new interface driver asix
usbcore: registered new interface driver ax88179_178a
usbcore: registered new interface driver cdc_ether
usbcore: registered new interface driver net1080
usbcore: registered new interface driver cdc_subset
usbcore: registered new interface driver zaurus
usbcore: registered new interface driver cdc_ncm
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
e0002000.usb supply vbus not found, using dummy regulator
ULPI transceiver vendor/product ID 0x0779/0x2500
ULPI integrity check: passed.
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 141
cdns-i2c e0005000.i2c: 400 kHz mmio e0005000 irq 142
pca954x 0-0074: probe failed
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 17
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 4988K (c0685000 - c0b64000)
INIT: version 2.88 booting
usb 1-1: new high-speed USB device number 2 using ci_hdrc
bootlogd: cannot allocate pseudo tty: No such file or directory
Creating /dev/flash/* device nodes

0 Kudos
Highlighted
Explorer
Explorer
6,338 Views
Registered: ‎11-09-2015

Re: xilinx zynq 7000 network driver

may be you using the wrong device-tree? make sure your device node gem0 using xilinx’s.

                gem0: ethernet@e000b000 {
                        compatible = "xlnx,ps7-ethernet-1.00.a";
                        reg = <0xe000b000 0x1000>;
                        status = "disabled";
                        interrupts = <0 22 4>;
                        clocks = <&clkc 13>, <&clkc 30>;
                        clock-names = "ref_clk", "aper_clk";
                        local-mac-address = [00 0a 35 00 00 00];
                        xlnx,has-mdio = <0x1>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                };

 

0 Kudos
Highlighted
Visitor
Visitor
6,223 Views
Registered: ‎04-10-2017

Re: xilinx zynq 7000 network driver

hi,

 

The exception that occurred in the kernel seems to be related to

the PHY driver code (broadcom PHY) that wouldn't work with

the emacps driver. (the PHY driver code was written by us, I still

need to figure out what the root cause for that).

 

The reason we want to use the emacps network driver instead of the

cadence driver is that emacps supports the IEEE1588 (PTP) protocol.

http://www.wiki.xilinx.com/Zynq+Emacps+Linux+Driver

 

Reading now through the cadence macb linux driver on xilinx wiki page:

http://www.wiki.xilinx.com/Macb+Driver

I'm not sure, does the IEEE1588 protocol is supported by the cadence/macb driver?

(this could be an alternative way of doing it, since our PHY code works OK with this driver).

 

Thanks,

Liran.

0 Kudos
Highlighted
Explorer
Explorer
6,139 Views
Registered: ‎11-09-2015

Re: xilinx zynq 7000 network driver

hi

    try use Generic PHY. unconfig your broadcom PHY drvier.

here is my dts:

 

 ethernet@e000b000 {
                        compatible = "xlnx,ps7-ethernet-1.00.a";
                        reg = <0xe000b000 0x1000>;
                        status = "okay";
                        interrupts = <0x0 0x16 0x4>;
                        clocks = <0x1 0xd 0x1 0x1e>;
                        clock-names = "ref_clk", "aper_clk";
                        local-mac-address = [00 0a 35 00 00 00];
                        xlnx,has-mdio = <0x1>;
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        phy-mode = "rgmii-id";
                        phy-handle = <0x4>;

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

                                phy@0x19 {
                                        reg = <0x19>;
                                        linux,phandle = <0x4>;
                                        phandle = <0x4>;
                                };
                        };
                };

                ethernet@e000c000 {
                        compatible = "cdns,gem";
                        reg = <0xe000c000 0x1000>;
                        status = "okay";
                        interrupts = <0x0 0x2d 0x4>;
                        clocks = <0x1 0x1f 0x1 0x1f 0x1 0xe>;
                        clock-names = "pclk", "hclk", "tx_clk";
                        #address-cells = <0x1>;
                        #size-cells = <0x0>;
                        phy-mode = "mii";
                        phy-handle = <0x5>;

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

                                phy@0x10 {
                                        reg = <0x0>;
                                        linux,phandle = <0x5>;
                                        phandle = <0x5>;
                                };
                        };
                };

the dmesg:

[ 1.102805] libphy: XEMACPS mii bus: probed
[ 1.107644] xemacps e000b000.ethernet: pdev->id -1, baseaddr 0xe000b000, irq 148
[ 1.115514] xilinx_axienet 41000000.ethernet: TX_CSUM 0
[ 1.120666] xilinx_axienet 41000000.ethernet: RX_CSUM 0
[ 1.126112] libphy: Xilinx Axi Ethernet MDIO: probed
[ 1.132470] xilinx_axienet 41040000.ethernet: TX_CSUM 0
[ 1.137618] xilinx_axienet 41040000.ethernet: RX_CSUM 0
[ 1.143058] libphy: Xilinx Axi Ethernet MDIO: probed
[ 1.149523] macb e000c000.ethernet (unnamed net_device) (uninitialized): invalid hw address, using random
[ 1.159916] libphy: MACB_mii_bus: probed
[ 1.163766] mdio_bus e000c000.etherne: /amba/ethernet@e000c000/mdio has invalid PHY address
[ 1.172134] mdio_bus e000c000.etherne: scan phy mdio at address 0
[ 1.178646] mdio_bus e000c000.etherne: scan phy mdio at address 1
[ 1.184725] mdio_bus e000c000.etherne: scan phy mdio at address 2
[ 1.191140] mdio_bus e000c000.etherne: scan phy mdio at address 3
[ 1.197251] mdio_bus e000c000.etherne: scan phy mdio at address 4
[ 1.203325] mdio_bus e000c000.etherne: scan phy mdio at address 5
[ 1.209398] mdio_bus e000c000.etherne: scan phy mdio at address 6
[ 1.215477] mdio_bus e000c000.etherne: scan phy mdio at address 7
[ 1.221550] mdio_bus e000c000.etherne: scan phy mdio at address 8
[ 1.227628] mdio_bus e000c000.etherne: scan phy mdio at address 9
[ 1.233704] mdio_bus e000c000.etherne: scan phy mdio at address 10
[ 1.239865] mdio_bus e000c000.etherne: scan phy mdio at address 11
[ 1.246029] mdio_bus e000c000.etherne: scan phy mdio at address 12
[ 1.252192] mdio_bus e000c000.etherne: scan phy mdio at address 13
[ 1.258353] mdio_bus e000c000.etherne: scan phy mdio at address 14
[ 1.264518] mdio_bus e000c000.etherne: scan phy mdio at address 15
[ 1.270678] mdio_bus e000c000.etherne: scan phy mdio at address 16
[ 1.276844] mdio_bus e000c000.etherne: scan phy mdio at address 17
[ 1.283006] mdio_bus e000c000.etherne: scan phy mdio at address 18
[ 1.289167] mdio_bus e000c000.etherne: scan phy mdio at address 19
[ 1.295332] mdio_bus e000c000.etherne: scan phy mdio at address 20
[ 1.301492] mdio_bus e000c000.etherne: scan phy mdio at address 21
[ 1.307658] mdio_bus e000c000.etherne: scan phy mdio at address 22
[ 1.313821] mdio_bus e000c000.etherne: scan phy mdio at address 23
[ 1.319980] mdio_bus e000c000.etherne: scan phy mdio at address 24
[ 1.326145] mdio_bus e000c000.etherne: scan phy mdio at address 25
[ 1.332308] mdio_bus e000c000.etherne: scan phy mdio at address 26
[ 1.338469] mdio_bus e000c000.etherne: scan phy mdio at address 27
[ 1.344633] mdio_bus e000c000.etherne: scan phy mdio at address 28
[ 1.350794] mdio_bus e000c000.etherne: scan phy mdio at address 29
[ 1.356959] mdio_bus e000c000.etherne: scan phy mdio at address 30
[ 1.363122] mdio_bus e000c000.etherne: scan phy mdio at address 31
[ 1.442136] macb e000c000.ethernet eth3: Cadence GEM rev 0x00020118 at 0xe000c000 irq 149 (2a:22:ee:ce:1b:11)
[ 1.451977] macb e000c000.ethernet eth3: attached PHY driver [Generic PHY] (mii_bus:phy_addr=e000c000.etherne:00, irq=-1)
[ 1.463421] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

 

we have 4 ethernet  on our customer board,2ps(e000b000 using xemacps,e000b000 using macb) 2axi_ethernet.

 

eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:01:22  
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:181 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:16108 (15.7 KiB)  TX bytes:0 (0.0 B)
          Interrupt:148 Base address:0xb000 

eth1      Link encap:Ethernet  HWaddr 00:0A:35:00:00:00  
          inet addr:192.168.10.100  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST  MTU:1500  Metric:1
          RX packets:15 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:1200 (1.1 KiB)  TX bytes:0 (0.0 B)

eth2      Link encap:Ethernet  HWaddr 00:0A:35:00:00:01  
          inet addr:192.168.100.100  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST  MTU:1500  Metric:1
          RX packets:13 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:1080 (1.0 KiB)  TX bytes:0 (0.0 B)

eth3      Link encap:Ethernet  HWaddr 2A:22:EE:CE:1B:11  
          inet addr:192.168.0.100  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:18 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:1278 (1.2 KiB)  TX bytes:0 (0.0 B)
          Interrupt:149 Base address:0xc000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  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)
0 Kudos
Highlighted
Visitor
Visitor
6,029 Views
Registered: ‎04-10-2017

Re: xilinx zynq 7000 network driver

hi,

I tried copying the generic phy driver into the device tree under the emacps ethernet driver,

(solved the exception that was generated from the broadcom phy driver).

that didn't help, I can't see any interrupts coming in under the registered IRQ (147) in /proc/interrupts

(and the eth0 (gem0) i/f doesn't work, comes up, but I can't ping any other device on the local network).

 

Don't I have to attach our broadcom PHY driver to the emacps driver some how?

So that all the phy related calls from xilinx_emacps.c (phy_start, phy_mii_ioctl, phy_disconnect)

will actually invoke the corresponded functions in the broadcom driver?

 

If yes, how do I do that?

Thanks,

Liran.

 

0 Kudos
Highlighted
Visitor
Visitor
3,663 Views
Registered: ‎04-10-2017

Re: xilinx zynq 7000 network driver

hi, again,

The XEMACPS_NWCFG_OFFSET register was not set correctly.

(worked around by faking duplex/link/speed fields that are not set

correctly in phydev structure under the lp - net_local structure).

 

Now when the register is set properly I can receive packets from the network.

 

I can't see anything being sent though. I put a kernel debug message in:

xemacps_start_xmit()

Apparently this function is never being invoked, I am trying to ping from the card

to get this function going.

 

What can block the IP stack from invoking this start transmit function of the driver?

 

Thanks,

Liran.

 

 

 

0 Kudos
Highlighted
Visitor
Visitor
3,650 Views
Registered: ‎04-10-2017

Re: xilinx zynq 7000 network driver

hi,

Another piece of information.

The emacps driver that doesn't transmit anything, shows the following

dump for ifconfig (no RUNNING status):

emacps:
eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:1E:53
          inet addr:10.10.10.4  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:518 errors:0 dropped:35 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:33366 (32.5 KiB)  TX bytes:0 (0.0 B)
          Interrupt:147 Base address:0xb000

While the load with the cadence/macb driver (working) has the following ifconfig

dump (with the RUNNING status):


macb:
eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:1E:53
          inet addr:10.10.10.4  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:334 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:644 (644.0 B)  TX bytes:14028 (13.6 KiB)
          Interrupt:147 Base address:0xb000

 

What kind of failure - in which function in emacps driver?

can prevent the IP stack from moving the interface into RUNNING state?

 

Thanks,

Liran.

 

0 Kudos