=================================================
Sheldon Instruments
February 2009.
=================================================
Getting Started under Linux.
-------------------------------------------------

Instructions for Creating Binaries.

1) When the SI-DSP card is plugged into a system and before any SI software is installed, the SI-DSP card may be verified to be properly powered and recognized by Linux.  The 'lspci' command may be invoked in order to view all recognized PCI devices.  After running the 'lspci' command, the SI-DSP fields should appear somewhere in the list as follows:

Bridge: Unknown device 80bb:1043 (rev 0b)

NOTE:
a) The SI-DSP fields should appear as <SI_VID>:<SI_DID>, where SI_VID is 0x80BB and the SI_DID varies according to the board you have. Please refer to the '\si_support\Docs\Drivers\SI_VID_DID.rtf' document for more details.
b) If no SI fields appear, then a more fundamental problem exists such as a lack of 3.3V available to the system or a damaged board.

2) Get all target source code (utilities and driver) to properly compile and create the binaries of interest.  Execute the 'make' command to create the following required binaries to test the system:
	a) driver binary named siplx.ko
	b) FPGA Loader utility named PLX_FPGALoad.out
	c) Sample command utility named SISample.out

NOTE: Before compilation, on some systems be sure that the 'Makefile' appears with a capital 'M'.

-------------------------------------------------
Instructions for Installing Driver.
-------------------------------------------------

1) Install the driver using the following command:
/sbin/insmod <path>/siplx.ko SI_DID=0xNNNN

where 'NNNN' is the SI Device ID identified in the first step above.

2) In order to check if the driver has been properly installed, use the following command:
cat /proc/devices

After listing, annotate the driver's major number which should appear as follows:
MMM siplx

where 'MMM' is the major number and is found inside of the '/proc/devices' file.

3) In order to allow for the application to access the driver and for the specific case that a single SI-DSP card is installed, execute the following command:
mknod /dev/siplx0 c 249 0.

NOTE:
When a driver is installed in Linux, it is assigend a major and minor number. Please refer to Linux for more details.

-------------------------------------------------
Load FPGA.
-------------------------------------------------

1) Go to folder '../../fpgaload_plx'.

2) Copy all required files (*.bit, *.txt, etc) to this folder.

3) Execute FPGA Loader with the board number and .txt file as parameter, as:

./PLX_FPGALoad.out 0 sidsp_bitconfig.txt

NOTE: check if the 'sidsp_bitconfig.txt' file uses absolute or relative paths.  If absolute, make sure paths are accesible and bit files are located in the correct folders.

4) A feedback message appears indicating status.

-------------------------------------------------
Invoke SISample Utility
-------------------------------------------------

1) Invoke SISample.out utlity as follows:

./sisample.out

2) Once the utility has been nvoked, a command line menu appears. Please refer to the '\si_support\gettingstarted\gettingstarted.pdf' for more details.

-------------------------------------------------
Creating a Script to Load the Driver and Bitload on Startup
-------------------------------------------------

# Simple SI script file
# This script file assumes that your SI_DID does not change and that the
# dynamically assigned character device major number (248 in this example)
# does not change either.
# Assuming your system does not change and the script is run every time the
# system is booted, the character device major number should remain the same.
#
# If it is intended to have this run on start up, this file should be placed
# in an appropriate location so that it will run with root permissions.
# insmod requires you to be the root user.  One place to start looking
# may be '/etc/init.d/rcS.sh' or the like.  The location of your startup
# script will differ with all different Linux distributions and versions.
#
# Finally, do not forget that this file needs to be an executable file.
# Try the following command: 'chmod +x si_launch'

# Change to the driver directory, insert the kernel object, and create a
# new device file for the board.

cd /home/si/sidev/siddk/siddk_plx/drivers/linux/0206
/sbin/insmod siplx.ko SI_DID=0x1062
/sbin/mknod /dev/siplx0 c 248 0

# Change to the fpga loader directory, and run the fpga load utility

cd /home/si/sidev/siddk/siddk_plx/apps/sihw_plx/Rev1/fpgaload_plx/linux
./PLX_FPGALoad.out 0 sidsp_bitconfig.txt
