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 sean8051
Visitor
18,106 Views
Registered: ‎04-05-2013

KC705 Base TRD drivers in 64-bit Linux

Jump to solution

From what I can tell the Linux drivers for the Base Targeted Reference Design for the KC705 board only come with support for 32-bit Fedora. Attempting to compile it on a 64-bit Linux machine prints out hundreds of warnings about casts to and from (64-bit) pointers and unsigned 32-bit integers. Loading and probing the device drivers causes the kernel module for the device driver to be killed since it tries to dereference an invalid pointer due to the upper bits being lost.

 

My primary goal for getting this working is to perform any kind of communication between user-space software and hardwre behind a PCIe endpoint. If there is code available which does this or something close I'd appreciate being directed to it. If I'm stuck with this TRD what guidance would you give someone trying to port it.

0 Kudos
1 Solution

Accepted Solutions
Newbie rgummal
Newbie
26,614 Views
Registered: ‎08-21-2012

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution
0 Kudos
11 Replies
Highlighted
Visitor tcam_bestsys
Visitor
17,691 Views
Registered: ‎10-24-2013

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

Hello,
The post been a while back but maybe someone got stuck with the same problem.
I am currentlly working with the KC705 and the TRD Drivers in terms of my BA Thesis. I managed to succesfully port the driver and the monitor application to 64bit. There were not much of modification needed, though I spent realy much time understanding the driver and its details.

So first you have to clear all the cast violations. Every time they are casting from pointer to (int) or (unsigend int) you have to change it to cast to (unsigned long). Also vice versa you have to make shure the address stays 64 bit and didn't get cut or altered on the way through different casts.

Keep in mind that the DMA operations with the kernel datatype "dma_adr_t" stays 32bit since PCI and DMA operations are  still 32bit. (The compiler still complains when casting "dam_adr_t" to u32 but that should be ok.)

The next step involves changing the macros found in "xdma_bd.h". The "Dma_mBdSetId" and "Dma_mBdGetId" need to be changed because the driver recreates the virtual address from this fields. Just look at the "Dma_mBdSetUserData" and "Dma_mBdGetUserData" since this macros do it right with spliting and shifting.

So this are the basic changes have to be made. I tested it on 64bit Ubuntu and it works.

0 Kudos
Visitor xspai
Visitor
17,648 Views
Registered: ‎11-04-2013

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

Hello,

Is it possible to get a tar ball of your  changes made to  k7_pcie_dma_ddr3_base/linux_driver directory?

I'm faced with the same challenge in porting it to Centos 6.4.   I'm surprised xilinx doesn't already provide it as

nobody uses 32-bit linux anymore.

Thanks!

0 Kudos
Visitor tcam_bestsys
Visitor
17,618 Views
Registered: ‎10-24-2013

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

Unfortunately I don't know wether the Xilinx Licence permits this. My changes are not well commented and also I've to check back with my boss.

But I recently discoverd that Xilinx has a new (and little bit hidden) TRD Kit. The "KC705 Connectivity Kit" which has 64bit drivers who seemed to be based on the ones from the Evalutation Kit. (As far I can tell from looking at it briefly)

http://www.xilinx.com/support/index.html/content/xilinx/en/supportNav/boards_and_kits/kintex-7_boards_and_kits/kintex-7_fpga_connectivity_kit.html

Just expand "2013.2" and click on "Target Reference Designs". There you can download the TRD Files with the newer driver.

Hope that is helping a little bit.
rgds

0 Kudos
Visitor xspai
Visitor
17,586 Views
Registered: ‎11-04-2013

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

I tried the connectivity example which seems to support 64-bit driver however I ran into the following issue.

 

$ dirs
~/xilinx/k7_connectivity_trd_v1_5
$ ls
configure_kc705  design  doc  linux_driver_app  quickstart.sh  readme.txt
$ quickstart.sh
***** Driver 64 bit*****
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface sun.font.FontManager, but class was expected
    at com.xilinx.laf.XNimbusDefaults.<init>(XNimbusDefaults.java:138)
    at com.xilinx.laf.NimbusLookAndFeel.<init>(NimbusLookAndFeel.java:98)
    at com.xilinx.kintex7.LandingPage.main(LandingPage.java:442)

My java version is:

$ java -version
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (rhel-2.3.4.1.el6_3-x86_64)
OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)

 

According to the following post, I perhaps need JDK 1.5.

http://forums.xilinx.com/t5/Xilinx-Boards-and-Kits/Zynq-ZC706-TRD-Demo-Host-PC-Software-Problem/td-p/306319

 

My vivado version is but apparently there is still no support 1.7.

$ vivado -version
Vivado v2013.3 (64-bit)
SW Build 329390 on Wed Oct 16 18:26:55 MDT 2013
IP Build 192953 on Wed Oct 16 08:44:02 MDT 2013
Copyright 1986-1999, 2001-2013 Xilinx, Inc. All Rights Reserved.

I haven't played with Java installation much so any suggestions are welcome.

 

Thanks!

 

0 Kudos
17,523 Views
Registered: ‎11-27-2013

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

I suspect Xilinx's left hand and right hand aren't talking to each other here.  The Linux driver files say they are licensed under the terms of the GPL version 2.1, which would not only allow you to publish modifications, but actually require you to if you are shipping or selling a product based on them.

 

However, the click-through license around the TRD as a whole basically says you won't share, break confidence, or modify the code for any purpose except programming a Xilinx device.

 

The GPL is totally incompatible with that, which rather makes a mockery of the GPL clause.  I hope that using the GPL represents some real open source aims by Xilinx, and not because they've re-used someone else's GPL code (in which case they are probably in breach).  This is a classic example where the community (you) have code that could benefit everyone including Xilinx, but you don't feel free to contribute.  In that case, they really need to do a bit more to spell out what the GPL licensing means.

 

 

 

 

 

0 Kudos
Explorer
Explorer
17,487 Views
Registered: ‎06-22-2011

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

 

In the TRD, pointer to buffer descriptor is 32-bit, so the BD ring must reside in the lower 4G memory space.

In a 64-bit system with 8G or 16G system memory, how is it assured?

 

The DMA core fetch BD from system memory with 32-bit address.

 

 

Xiang Chao

 

0 Kudos
Explorer
Explorer
17,469 Views
Registered: ‎06-22-2011

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

JDK-1.6 will be fine.

 

0 Kudos
Explorer
Explorer
17,467 Views
Registered: ‎06-22-2011

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

I have a K7 board, and ported the KC705 TRD to it. In linux 32bit, with the gui program in KC705 TRD, the throughput of both Tx and Rx were about 11~12gbps at the same time. 

 

To use my design in linux 64 bit, i used the software with K7 connectivity kit TRD. But the result is much pooer than 32-bit linux. It looks like the sum of Tx and Rx is about 10Gbps. When Tx and Rx are both enabled, the speed are about 5Gbps for each. When I disabled one of them, the result of the other reached about 10Gbps. In my view, since the Tx and Rx of PCIe are independent, who can explain the result?

 

Thanks

 

Xiang Chao

0 Kudos
Newbie rgummal
Newbie
26,615 Views
Registered: ‎08-21-2012

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution
0 Kudos
Observer jamey.hicks
Observer
8,438 Views
Registered: ‎05-02-2014

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

I just tried the version in the 2013.4 KC705 Base Technical Reference Design.

 

It does have 64-bit support but still compiles with many warnings. For the most part, the warnings seem innocuous (but should be fixed).

 

There is at least one place where a pointer is truncated to 32-bits. I added a printk so that if the pointer is bigger than 32-bits I will know about it.

 

I had to remove __devinit etc because that is no longer used in Linux 3.8.

 

I had to add the following line to the xrawdata0 and xrawdata1 Makefiles because the kernel I'm using was compiled with CONFIG_MODVERSIONS:

    

KBUILD_EXTRA_SYMBOLS := $(src)/../xdma/Module.symvers

 

 

0 Kudos
Observer saban
Observer
7,553 Views
Registered: ‎08-20-2015

Re: KC705 Base TRD drivers in 64-bit Linux

Jump to solution

Hi jamey.hicks,

 

I tried to compile Linux Driver by using KC705 reference design also.

I got same errors on Ubuntu 14.04 LTS 64-bit.

Reference design driver code still incorrect , at least for Ubuntu 14.04 LTS 64-bit.

 

If Anybody gives same error, he can do these:

1. In driver/xdma/xdma_base.c file replace all of __dev prefixes with __( for example __devinit --> __init, __devexit --> __exit)

    After doing that, driver code will be compiled without error.

2. In driver/xrawdata0/Makefile and driver/xrawdata1/Makefile add this line to end of file:

    KBUILD_EXTRA_SYMBOLS := $(src)/../xdma/Module.symvers

    If you get xrawdata0.ko and xrawdata1.ko could not be loaded, add this lines to related files.

 

Thank you jamey.hicks

 

0 Kudos