реклама на сайте
подробности

 
 
> PCIe под Linux, Где бы взять драйвер и тестовую программу
Jack_of_Shadows
сообщение Dec 22 2012, 09:18
Сообщение #1


Участник
*

Группа: Участник
Сообщений: 46
Регистрация: 29-10-10
Пользователь №: 60 513



Имеется плата на Virtex-5 с прошивкой XAPP1052 - Bus Master. Плата опознается в системе, и дальше хотелось бы начать с ней работать - погонять данные, посмотреть скорость. ОС Ubuntu 12.04 x64 (есть также Windows 7, но конечной целью все же стоит работа с PCIe под линуксом).
С xapp1052 идут примеры драйвера и тестовой проги, однако пока при попытке запуска скрипта по инструкции выдает ошибки:

Код
root@user-PH67A-D3-B3:~/xbmd# ./run_bmd.csh
gtk-builder-convert xbmd_app.glade xbmd_app.xml
WARNING: duplicate id "menuitem"
WARNING: duplicate id "new_menu_item"
Wrote xbmd_app.xml
make -C /lib/modules/3.2.0-23-generic/build M=/root/xbmd  modules
make[1]: Entering directory `/usr/src/linux-headers-3.2.0-23-generic'
  CC [M]  /root/xbmd/xbmd.o
/root/xbmd/xbmd.c: In function ‘XPCIe_Write’:
/root/xbmd/xbmd.c:208:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
/root/xbmd/xbmd.c:210:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
/root/xbmd/xbmd.c: In function ‘XPCIe_Read’:
/root/xbmd/xbmd.c:237:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
/root/xbmd/xbmd.c: At top level:
/root/xbmd/xbmd.c:430:5: error: unknown field ‘ioctl’ specified in initializer
/root/xbmd/xbmd.c:430:5: warning: initialization from incompatible pointer type [enabled by default]
/root/xbmd/xbmd.c:430:5: warning: (near initialization for ‘XPCIe_Intf.aio_read’) [enabled by default]
/root/xbmd/xbmd.c: In function ‘XPCIe_init’:
/root/xbmd/xbmd.c:441:3: error: implicit declaration of function ‘pci_find_device’ [-Werror=implicit-function-declaration]
/root/xbmd/xbmd.c:441:8: warning: assignment makes pointer from integer without a cast [enabled by default]
/root/xbmd/xbmd.c:479:64: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/root/xbmd/xbmd.c:507:3: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type [enabled by default]
include/linux/interrupt.h:134:1: note: expected ‘irq_handler_t’ but argument is of type ‘void (*)(int,  void *, struct pt_regs *)’
/root/xbmd/xbmd.c:531:70: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/root/xbmd/xbmd.c:540:71: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/root/xbmd/xbmd.c: In function ‘XPCIe_ReadMem’:
/root/xbmd/xbmd.c:715:24: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
/root/xbmd/xbmd.c:729:7: warning: return makes pointer from integer without a cast [enabled by default]
/root/xbmd/xbmd.c: In function ‘XPCIe_WriteMem’:
/root/xbmd/xbmd.c:769:23: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
cc1: some warnings being treated as errors
make[2]: *** [/root/xbmd/xbmd.o] Error 1
make[1]: *** [_module_/root/xbmd] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-23-generic'
make: *** [all] Error 2
crw-r--r-- 1 root root 241, 1 Dec 22 12:27 /dev/xbmd
+ /sbin/insmod xbmd.ko
insmod: can't read 'xbmd.ko': No such file or directory


были ли у кого-нибудь успешные попытки запуска программ из данного аппноута? Есть ли какие-нибудь еще варианты примеров, с которых можно было бы начать изучение PC-части интерфейса по линуксом? Или проще самому почитать и пробовать писать с нуля свои драйвер и прогу?
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов (1 - 3)
Kuzmi4
сообщение Dec 23 2012, 09:13
Сообщение #2


Гуру
******

Группа: Свой
Сообщений: 3 304
Регистрация: 13-02-07
Из: 55°55′5″ 37°52′16″
Пользователь №: 25 329



Касательно "какие-нибудь еще варианты примеров":
Мы тут давеча делали PCI Express controller for Xilinx HARD core for Virtex5, Virtex6, Spartan6 - PCIe_DS_DMA
кроме HDL там так же есть дрова и пример проги в репозитарии.
Go to the top of the page
 
+Quote Post
Jack_of_Shadows
сообщение Dec 27 2012, 07:21
Сообщение #3


Участник
*

Группа: Участник
Сообщений: 46
Регистрация: 29-10-10
Пользователь №: 60 513



Kuzmi4, благодарю, буду смотреть, как с регистрацией разберусь.
Если кто еще столкнется с проблемой запуска дефолтного драйвера от xapp1052, решение нашлось на форуме xilinx (для Linux):
в файле xbmd.c заменить 3 строчки:

Код
ioctl:      XPCIe_Ioctl
...
int XPCIe_Ioctl(struct inode *inode,
                struct file *filp,
                unsigned int cmd,
                unsigned long arg)
...
gDev = pci_find_device (PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_XILINX_PCIE, gDev);

на
Код
unlocked_ioctl:      XPCIe_Ioctl
...
int XPCIe_Ioctl(struct file *filp,
                unsigned int cmd,
                unsigned long arg)
...
gDev = pci_get_device (PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_XILINX_PCIE, gDev);


под win7 получилось перекомпилить драйвер в WDK и исправить соответствубщий .inf файл под 64 бита, но после установки драйвера при запуске тестовой проги вылетает BSOD. Об этом опять же на форуме xilinx говорилось, решения вроде как найти не удалось
Go to the top of the page
 
+Quote Post
toshas
сообщение Apr 20 2013, 07:05
Сообщение #4


Местный
***

Группа: Свой
Сообщений: 372
Регистрация: 14-02-06
Пользователь №: 14 339



Такое решение для xapp1052 под Win x64 не помогает ?
http://social.msdn.microsoft.com/Forums/en...7-3a3ceaca663f/
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 22:44
Рейтинг@Mail.ru


Страница сгенерированна за 0.01384 секунд с 7
ELECTRONIX ©2004-2016