cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
markalbers
Observer
Observer
306 Views
Registered: ‎02-06-2015

Linux AXI Ethernet DMA internal error

I have a RISC-V rocket system with Linux running on a VCU118 evaluation board. 

Now I want to put the board's integrated Ethernet (RJ45) into operation using an AXI Ethernet Subsystem with AXI DMA. A block desing can be found attached.

Here is my devicetree concerning AXI Ethernet and DMA:

 

L21: dma@60010000 {
			compatible = "xlnx,eth-dma";
			interrupt-parent = <&L3>;
			interrupts = <2 3>;
			reg = <0x60010000 0x1000>;
			axistream-connected = <&L22>;
			axistream-control-connected = <&L22>;
		};
		L22: ethernet@60040000 {
			compatible = "xlnx,axi-ethernet-1.00.a";
			interrupt-parent = <&L3>;
			interrupts = <4 5>;
			reg = <0x60040000 0x40000>;
			axistream-connected = <&L21>;
			axistream-control-connected = <&L21>;
			clock-frequency = <100000000>;
			clocks = <&L0>;
			local-mac-address = [00 0a 35 00 00 00];
			device_type = "network";
			phy-handle = <&phy1>;
			phy-mode = "sgmii";
			L22_mdio: mdio {
				#address-cells = <1>;
				#size-cells = <0>;
				phy1: phy@3 {
					device_type = "ethernet-phy";
					reg = <3>;
				};
			};
		};

 

Added this to the Linux configuration to integrate the driver: 

 

CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_XILINX=y
CONFIG_XILINX_AXI_EMAC=y
CONFIG_XILINX_PHY=y

 

The driver also seems to load correctly and recognize the hardware, here is an excerpt from the Linux boot:

 

[    7.904402] libphy: Fixed MDIO Bus: probed
[    7.920844] libphy: Xilinx Axi Ethernet MDIO: probed

 

If I now activate the interface eth0 the driver loads, but then throws the following errors:

 

# ip link set eth0 up             
[   43.019499] xilinx_axienet 60040000.ethernet eth0: PHY [axienet-60040000:03] driver [Generic PHY] (irq=POLL)
[   43.019922] xilinx_axienet 60040000.ethernet eth0: configuring for phy/sgmii link mode
[   43.021166] net eth0: DMA Rx error 0x184509
[   43.021395] net eth0: Current BD is at: 0x0802a78c2
# [   47.120154] xilinx_axienet 60040000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   47.120551] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   47.130915] net eth0: DMA Tx error 0x184019
[   47.131149] net eth0: Current BD is at: 0xf753c802
[   47.359013] net eth0: DMA Tx error 0x184109
[   47.359243] net eth0: Current BD is at: 0xf755d802
[   47.694788] net eth0: DMA Tx error 0x184019
[   47.695013] net eth0: Current BD is at: 0xf753c802
[   48.367064] net eth0: DMA Tx error 0x184019
[   48.367292] net eth0: Current BD is at: 0xf753c802
[   49.326784] net eth0: DMA Tx error 0x184109
[   49.327016] net eth0: Current BD is at: 0xf753c802
[   52.238758] net eth0: DMA Tx error 0x184019
[   52.238983] net eth0: Current BD is at: 0xf755d402
[   59.662759] net eth0: DMA Tx error 0x184019
[   59.662985] net eth0: Current BD is at: 0xf755de02

 

The error states that the DMA has triggered an internal error. What surprises me here are the descriptor addresses. Actually they should be 32-bit word aligned. I looked into the driver and at least at the point where the descriptor chains are initialized, all addresses are still 32-bit word aligned. 

Afterwards, however, some functions (netdev_alloc_skb_ip_align,dma_map_single) come into play, which I have not really understood yet and which do not generate more aligned addresses. I guess that this is not the real problem, but I am not sure.

Maybe someone here can put me on the right track to solve the problem. Thank you!

 

 

blockdesign.png
0 Kudos
3 Replies
nanz
Moderator
Moderator
214 Views
Registered: ‎08-25-2009

HI @markalbers ,

Have you disabled AXI DAM Linux driver? This needs to be done when AXI Ethernet driver is used as it already includes DMA. If at the same time, DAM Linux driver is also enabled, there will be an issue. 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842485/Linux+AXI+Ethernet+driver

  • The driver doesn't use dma engine framework and contains DMA programming sequence i.e doesn't use separate DMA driver. Hence compatibility string of axidma node (DTS) is set to a dummy device-tree property compatible = "xlnx,eth-dma";

-------------------------------------------------------------------------------------------

Don’t forget to reply, kudo, and accept as solution.

If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs and our Versal Ethernet Sticky Note.

-------------------------------------------------------------------------------------------
0 Kudos
markalbers
Observer
Observer
189 Views
Registered: ‎02-06-2015

Hi @nanz ,

Thanks. AXI DMA driver is not enabled. I think the modified compatibility string in device-tree should be enough anyway, right?

0 Kudos
nanz
Moderator
Moderator
161 Views
Registered: ‎08-25-2009

HI @markalbers ,

Ok, thanks for the confirmation. The DTS seems fine. 

I am curious if you have tried with baremetal driver and LWIP first before running in Linux? Is this design working with standalone driver? This will give us some clues if it's related to Linux. 


-------------------------------------------------------------------------------------------

Don’t forget to reply, kudo, and accept as solution.

If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs and our Versal Ethernet Sticky Note.

-------------------------------------------------------------------------------------------
0 Kudos