X-Git-Url: http://rtime.felk.cvut.cz/gitweb/ortcan-www.git/blobdiff_plain/87950f09a6ab028aadc08c040045682bbd2341d5..HEAD:/lincan/index.mdwn diff --git a/lincan/index.mdwn b/lincan/index.mdwn index 4d3400d..c013d03 100644 --- a/lincan/index.mdwn +++ b/lincan/index.mdwn @@ -12,3 +12,76 @@ originally developed as part of OCERA framework. The CAN related components have been separated into its own OrtCAN repository. [[The list of supported hardware and boards|boards]] + +## LinCAN Quick Build Instructions + +There are more options to build LinCAN driver. +The first one is to use standalone driver +module build. The latest version of standalone LinCAN +sources can be obtained from GIT repository and build +by next commands + + git clone git://git.code.sf.net/p/ortcan/lincan + cd lincan + ./build-lincan.sh + +The other option is to build LinCAN driver as part +of the whole OrtCAN tree + + git clone git://git.code.sf.net/p/ortcan/ortcan-top + cd ortcan/ + git submodule update --init + make default-config + make + +The default configuration options should be overridden by user specified +options in toplevel "config.omk" file before final "make" invocation. +The choices 'y'/'n' can be specified to enable or disable build +of specified hardware/board support, it would be next line in "config.omk" +file for [[tscan1|boards/tscan1]] card for example + + CONFIG_OC_LINCAN_CARD_tscan1=y + +If the build should target other then actually running kernel then +*LINUX_DIR* option in "config.omk" file is used to specify location, +where kernel has been build. If a build for non-native architecture +is required then cross-compiler binaries have to be specified + + LINUX_DIR=/usr/src/linux-2.6-mpc5200-build + CC=powerpc-linux-gnu-gcc + CXX=powerpc-linux-gnu-g++ + AR=powerpc-linux-gnu-ar + LD=powerpc-linux-gnu-ld + +## LinCAN installation and use + +Driver can be load into kernel directly from build directory. +Example for pcm3680 PC/104 card + + insmod _compiled/modules/lincan.ko hw=pcm3680 io=0x200 irq=7,11 + +The board is non-plug and play and that is why all parameters has +to be specified. Only board hardware type (i.e. hw=pcican-q) and +zero/automatic I/O address are required (io=0) for PCI and other +PnP cards. The boar hardware identifiers and corresponding io locations +are separated by comma in the case of multiple boards used. + +The driver can be installed into system + + mkdir /lib/modules/$(uname -r)/extra + cp _compiled/modules/lincan.ko /lib/modules/$(uname -r)/extra + chown root:root /lib/modules/$(uname -r)/extra/lincan.ko + depmod -a + +and then load by modprobe + + modprobe lincan hw=pcm3680 io=0x200 irq=7,11 + +or setup to autoload after boot (configuration style for Debian based system) + + echo "lincan hw=pcm3680 io=0x200 irq=7,11" >/etc/modules + +Next line grants CAN driver access to the all regular system users +included in users group + + echo 'SUBSYSTEM=="can",GROUP="users",MODE="0660"' >/etc/udev/rules.d/10-lincan.rules