From 8bf274975cae173308f3e85a70cf17834071873b Mon Sep 17 00:00:00 2001 From: ppisa Date: Tue, 6 Jul 2004 23:15:34 +0000 Subject: [PATCH] README and TODO updated --- lincan/README | 101 ++++++++++++++++++++++++++++++++++------ lincan/TODO | 33 +++++++++---- lincan/include/canmsg.h | 5 +- lincan/src/ems_cpcpci.c | 9 +++- 4 files changed, 120 insertions(+), 28 deletions(-) diff --git a/lincan/README b/lincan/README index 6192994..1f0202d 100644 --- a/lincan/README +++ b/lincan/README @@ -1,4 +1,4 @@ - Linux CAN Driver (LinCAN) version 0.2 snapshot + Linux CAN Driver (LinCAN) version 0.3 Pavel Pisa OCERA team member @@ -56,17 +56,25 @@ lincan-0.2-pre heavily rewritten infrastructure of the driver based lincan-0.2 version tested on many bords and 2.2, 2.4, 2.6 Linux (Mar 2004) and RT-Linux enabled 2.4 Linux kernel +lincan-0.3 possible SMP and HT deadlock fixed, driver can take +(Jul 2004) advantage of CMPXCHG instruction if present on CPU, + added support for CPC-PCI and PCAN-PCI cards, + messages timestamping implemented + partially implemented support for Bosch C_CAN module, + requires more work and real hardware + The actual version of driver have been latest tested it with - PC104 Advantech PCM3680 dual channel board on 2.4 RT-Linux enabled kernel - PiKRON ISA card on 2.4.and 2.6 Linux kernels - BfaD DIMM PC card on 2.4 RT-Linux enabled kernel - KVASER pcican-q on 2.6 Linux kernel - MICROSPACE msmcan on 2.4 Linux and RT-Linux enabled kernel - - virtual board tested on all systems as well -It takes more time to test it with more cards and polish -support for 2.2 and 2.6 kernels, but these should be mainly -cosmetic changes (I hope ;-), infrastructure and original -support for more than 17 boards with more variants is in. + - Unicontrols PCAN ("unican"),PCAN-PCI ("unican-pci"), VCAN ("unican-vme") + - EMS CPC-PCI cards ("ems_cpcpci") + - virtual board tested on all systems as wel +It takes more time to test driver with more cards. +Infrastructure and support for more than 20 boards with more +variants is prepared in the sources. SOURCES AND URLs @@ -75,7 +83,7 @@ SOURCES AND URLs The LinCAN driver component page at OCERA web site (not updated to the new version yet) - http://www.ocera.org/download/components/WP7/lincan-0.1.html + http://www.ocera.org/download/components/WP7/lincan-0.2.html List of related communication components @@ -91,38 +99,92 @@ Web access into CVS http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ocera/ocera/components/comm/can/lincan/ -Experimental directory at maintainer (Pavel Pisa's) pages +Experimental directory at maintainer's (Pavel Pisa's) pages http://cmp.felk.cvut.cz/~pisa/can/ http://cmp.felk.cvut.cz/~pisa/can/lincan-YYMMDD.tar.gz Please send comments, bug-fixes and enhancements directly to -me (Pavel Pisa ) or to OCERA discussion +Pavel Pisa or to OCERA discussion forum and lists +Driver documentation can be found at + + http://cmp.felk.cvut.cz/~pisa/can/doc/lincandoc-0.2.pdf + +The anouncements of new version are published at FreshMeat page + + http://freshmeat.net/projects/lincan/ -COMPILATION -=========== + +COMPILATION of LinCAN releases +============================== Just type 'make' at the command line and driver module should compile -without errors for current running kernel. +without errors for current running kernel. More information can be found in driver documentation at http://cmp.felk.cvut.cz/~pisa/can/ - http://cmp.felk.cvut.cz/~pisa/can/lincan-X.Y.pdf + http://cmp.felk.cvut.cz/~pisa/can/lincandoc-X.Y.pdf + +Some releases use experimental OMK make system, which requires +recent GNU make program version 3.81beta1 and above. +Makefiles can be switched to old ones by script + + sh ./switch-omk2std + make + + +COMPILATION from CVS sources without full OCERA tree +==================================================== + +--------------------------------------------------------------------------- +Obtaining CVS sources of the CAN components only +--------------------------------------------------------------------------- + cvs -d:pserver:anonymous@cv...:/cvsroot/ocera login + cvs -z3 -d:pserver:anonymous@cv...:/cvsroot/ocera co + ocera/components/comm/can + +--------------------------------------------------------------------------- +Commands to build OCERA CVS CAN components outside OCERA tree +--------------------------------------------------------------------------- + cd ocera/components/comm/can + ./switch2standalone + make + +The selection of required features and options can be specified before make +command invocation. Lines containing required changes to config.omk-default +file should be stored in config.omk file. The config.omk is not altered by +OMK system and options defined there override values defined in +config.omk-default file. GNU make program version 3.81beta1 or newer is +required by OMK make-system. If this is problem, LinCAN driver can be +compiled with use of old style Makefiles as well. + +--------------------------------------------------------------------------- +Old style Makefiles compilation of the LinCAN driver only +--------------------------------------------------------------------------- + cd ocera/components/comm/can/lincan + ./switch2std + make + INSTALLATION ============ -Type 'make install'. The driver should be copied into actual kernel version +Type 'make install' for standard make system compilation. +The driver should be copied into actual kernel version modules directory "/lib/modules/x.y.z/kernel/drivers/char". +OMK system requires manual copy of files from "_compiled" tree +to its final destinations. + LOADING ======= To load the driver type: # insmod can.o hw='your hardware' irq='irq number' io='io address' -Example: # insmod can.o hw=pip5 irq=4 io=0x8000 +Examples: # insmod can.o hw=pip5 irq=4 io=0x8000 + # insmod can.o hw=virtual io=0 The hw argument can be one of: - pip5, for the pip5 computer by MPL @@ -143,6 +205,10 @@ The hw argument can be one of: - bfadcan for sja1000 CAN embedded card made by BFAD GmbH - pikronisa for ISA memory mapped sja1000 CAN card made by PiKRON Ltd. - msmcan for MICROSPACE IO space indexed i82527 +- unican for Unicontrols PCAN card +- unican-pci for Unicontrols PCAN-PCI card +- unican-vme for Unicontrols VCAN card +- ems_cpcpci for EMS CPC-PCI card - template, for yet unsupported hardware (you need to edit src/template.c) - virtual, CAN channel for testing of software and driver without CAN hardware @@ -157,6 +223,11 @@ options can be one of: - stdmask=, sets the standard mask of the device - extmask=, sets the extended mask of the device - mo15mask=, sets the mask for message object 15 (i82527 only) +- processlocal=, controls distribution of send messages to Rx FIFOs + 0, no local outgoing messages delivery to Rx FIFOs + 1, default off, but can be controlled by individual filter settings + 2, all FIFOs receive local messages There's still a lot of work to do, have a look at the TODO file for more information. + diff --git a/lincan/TODO b/lincan/TODO index 9406e94..a47a84f 100644 --- a/lincan/TODO +++ b/lincan/TODO @@ -1,14 +1,27 @@ -Things that still have to be done in version 0.7: -Written by Arnaud Westenberg email:arnaud@wanadoo.nl -This software is released under the GPL-License. -Version 0.7 6 Aug 2001 +Things that still not finished in LinCAN version 0.3: -+ Poll/select -+ Add proper comment to the code -+ Get rid of CLI and STI, they are not longer supported - in 2.5.xx kernels ++ Add proper comment to the code (many comments added, + but this is never ending story) + +- Error handling/reporting and statistics + Probably take concept from Ake Hedman's driver + -- Error handling/reporting - Proc directory -- Lot of ioctl's + Expose statistics through proc files + +- Lot of ioctl's and API compatibility + This is Achilles heel of all Linux CAN project's, + because there is no standard for CAN drivers IOCTLs + and messages format. + LinCAN has aim to be long term high quality CAN driver for Linux + with support for most of existing hardware, which should + be usable instead of many card and vendor specific + driver branches. + Actual LinCAN message format has been adjusted to be compatible + with Port.de standard. + Long term goal of API convergence should be negotiated with other + drivers maintainers. + One possible way is to add both Port.de and Ake's IOCTLs + to LinCAN. diff --git a/lincan/include/canmsg.h b/lincan/include/canmsg.h index 4c75efe..61f327a 100644 --- a/lincan/include/canmsg.h +++ b/lincan/include/canmsg.h @@ -67,12 +67,15 @@ struct canmsg_t { #ifndef PACKED #define PACKED __attribute__((packed)) #endif + +typedef unsigned long canmsg_tstamp_t ; + /* Old, deprecated version of canmsg_t structure */ struct canmsg_t { short flags; int cob; unsigned long id; - unsigned long timestamp; + canmsg_tstamp_t timestamp; unsigned int length; unsigned char data[CAN_MSG_LENGTH]; } PACKED; diff --git a/lincan/src/ems_cpcpci.c b/lincan/src/ems_cpcpci.c index 603595d..41441f3 100644 --- a/lincan/src/ems_cpcpci.c +++ b/lincan/src/ems_cpcpci.c @@ -30,8 +30,13 @@ /*PSB4610 PITA-2 bridge control registers*/ #define PITA2_ICR 0x00 /* Interrupt Control Register */ -#define PITA2_ICR_INT0 0x00000002 /* [RC] INT0 Active/Clear */ -#define PITA2_ICR_INT0_En 0x00020000 /* [RW] Enable INT0 */ +#define PITA2_ICR_INT0 0x00000002 /* [RC] INT0 Active/Clear */ +#define PITA2_ICR_GP0_INT 0x00000004 /* [RC] GP0 Interrupt */ + /* GP0_Int_En=1, GP0_Out_En=0 and low detected */ +#define PITA2_ICR_GP1_INT 0x00000008 /* [RC] GP1 Interrupt */ +#define PITA2_ICR_GP2_INT 0x00000010 /* [RC] GP2 Interrupt */ +#define PITA2_ICR_GP3_INT 0x00000020 /* [RC] GP2 Interrupt */ +#define PITA2_ICR_INT0_En 0x00020000 /* [RW] Enable INT0 */ #define PITA2_MISC 0x1C /* Miscellaneous Register */ #define PITA2_MISC_CONFIG 0x04000000 -- 2.39.2