1 [[!meta title="LinCAN (CAN bus driver)"]]
3 LinCAN is a Linux kernel module that implements a CAN driver capable
4 of working with multiple cards, even with different chips and IO methods.
5 Each communication object can be accessed from multiple applications concurrently.
6 It supports RT-Linux, 2.2, 2.4, and 2.6 with fully implemented select,
7 poll, fasync, O_NONBLOCK, and O_SYNC semantics and multithreaded
8 read/write capabilities. It works with the common Intel i82527,
9 Philips 82c200, and Philips SJA1000 (in standard and PeliCAN mode)
10 CAN controllers. It is part of a set of CAN/CANopen related components
11 originally developed as part of OCERA framework. The CAN related components
12 have been separated into its own OrtCAN repository.
14 [[The list of supported hardware and boards|boards]]
16 ## LinCAN Quick Build Instructions
18 There are more options to build LinCAN driver.
19 The first one is to use standalone driver
20 module build. The latest version of standalone LinCAN
21 sources can be obtained from GIT repository and build
24 git clone git://git.code.sf.net/p/ortcan/lincan
28 The other option is to build LinCAN driver as part
29 of the whole OrtCAN tree
31 git clone git://git.code.sf.net/p/ortcan/ortcan-top
33 git submodule update --init
37 The default configuration options should be overridden by user specified
38 options in toplevel "config.omk" file before final "make" invocation.
39 The choices 'y'/'n' can be specified to enable or disable build
40 of specified hardware/board support, it would be next line in "config.omk"
41 file for [[tscan1|boards/tscan1]] card for example
43 CONFIG_OC_LINCAN_CARD_tscan1=y
45 If the build should target other then actually running kernel then
46 *LINUX_DIR* option in "config.omk" file is used to specify location,
47 where kernel has been build. If a build for non-native architecture
48 is required then cross-compiler binaries have to be specified
50 LINUX_DIR=/usr/src/linux-2.6-mpc5200-build
51 CC=powerpc-linux-gnu-gcc
52 CXX=powerpc-linux-gnu-g++
53 AR=powerpc-linux-gnu-ar
54 LD=powerpc-linux-gnu-ld
56 ## LinCAN installation and use
58 Driver can be load into kernel directly from build directory.
59 Example for pcm3680 PC/104 card
61 insmod _compiled/modules/lincan.ko hw=pcm3680 io=0x200 irq=7,11
63 The board is non-plug and play and that is why all parameters has
64 to be specified. Only board hardware type (i.e. hw=pcican-q) and
65 zero/automatic I/O address are required (io=0) for PCI and other
66 PnP cards. The boar hardware identifiers and corresponding io locations
67 are separated by comma in the case of multiple boards used.
69 The driver can be installed into system
71 mkdir /lib/modules/$(uname -r)/extra
72 cp _compiled/modules/lincan.ko /lib/modules/$(uname -r)/extra
73 chown root:root /lib/modules/$(uname -r)/extra/lincan.ko
76 and then load by modprobe
78 modprobe lincan hw=pcm3680 io=0x200 irq=7,11
80 or setup to autoload after boot (configuration style for Debian based system)
82 echo "lincan hw=pcm3680 io=0x200 irq=7,11" >/etc/modules
84 Next line grants CAN driver access to the all regular system users
85 included in users group
87 echo 'SUBSYSTEM=="can",GROUP="users",MODE="0660"' >/etc/udev/rules.d/10-lincan.rules