#
# Copyright (c) 2010 Wojciech A. Koszek <wkoszek@FreeBSD.org>
# BSD 2-clause license
#
# This is devd.conf(5) file for FreeBSD devd(8) daemon. It provides rules
# describing actions necessary to load firmware for Xilinx USB programmers.
# It is assumed that Xilinx tools got installed under /compat/linux/opt/...
# (default installer's location)
#
# Those devices appear in the system as ugen(4) instances only. Once fxload(8)
# reprograms those, they reappear as different devices.
#
# All configuration variables were taken from:
#
#	/compat/linux/opt/Xilinx/11.1/common/bin/lin/xusbdfwu.rules
#
# and adopted accordingly for FreeBSD infrastructure.
#

options {
	set X "/compat/linux/opt/Xilinx/11.1/common/bin/lin";
	set F "/usr/local/sbin/fxload -v -t fx2";
};

attach 100 {
	device-name "^ugen";
	match "vendor" "0x03fd";
	match "product" "0x0007";
	action "$F -I $X/xusbdfwu.hex -D vid=$vendor,pid=$product";
};

attach 100 {
	device-name "^ugen";
	match "vendor" "0x03fd";
	match "product" "0x0009";
	action "$F -I $X/xusb_xup.hex -D vid=$vendor,pid=$product";
};

attach 100 {
	device-name "^ugen";
	match "vendor" "0x03fd";
	match "product" "0x000d";
	action "$F -I $X/xusbdfwu.hex -D vid=$vendor,pid=$product";
};

attach 100 {
	device-name "^ugen";
	match "vendor" "0x03fd";
	match "product" "0x000f";
	action "$F -I $X/xusb_xlp.hex -D vid=$vendor,pid=$product";
};

attach 100 {
	device-name "^ugen";
	match "vendor" "0x03fd";
	match "product" "0x0013";
	action "$F -I $X/xusb_xp2.hex -D vid=$vendor,pid=$product";
};

attach 100 {
	device-name "^ugen";
	match "vendor" "0x03fd";
	match "product" "0x0015";
	action "$F -I $X/xusb_xse.hex -D vid=$vendor,pid=$product";
};
