You are here: Foswiki>FESA Web>HowTo>DriverForCTRCards (15 Oct 2009, TobiasHoffmann)Edit Attach
-- TobiasHoffmann - 15 Oct 2009

CTR Drivers: Preparation and Installation

For the three available CTR cards (CTRV, CTRP, CTRI) adequate drivers have to be prepared. This for the used kernel and platform (ppc4, L865, etc). In addition the drivers have to be started and initialized at boot time. For the time being the concept of handling the drivers and driver source code is missing and should be discussed. It is assumed, that the GSI timing cable (SIS, UNI, ESR) is connected to a timing converter (VME, stand-alone), which has a cable to the CTR card.

Use of a CTRI card in a Linux PC

The CTR depends on several things from the coht directory. These are:
  • user-space library
  • driver-space library
  • installation program

So what we need to do -- is to make sure that they are compiled. Driver-space library should be compiled exactly for the kernel version you are going to use. User-space lib and installation prog doesn't depend on the kernel version.

They all are located in /acc/src/dsc/drivers/coht/utils

  • driver/ -- driver lib
  • user/ -- user lib
  • install/ -- installation routine

CTR compilation for local kernel Example

Compilation for a CTRP on a local SLC5 machine (Can be also Redhat5). One should provide KVER of the current machine `uname -r` Kernel src files can be found in [/usr/src/kernels], when they are properly installed.

e.g. KVER=2.6.18-164.el5 and KSRC=/usr/src/kernels Now we should compile driver utils library To do this: -> cd coht/cdcm -> make utils CPU=L865 KSRC=/usr/src/kernels KVER=2.6.18-164.el5

Compile CTRP: -> cd coht/ctr/driver_pci -> make CPU=L865 KSRC=/usr/src/kernels KVER=2.6.18-164.el5

Deliver it: -> make deliver lab CPU=L865 KSRC=/usr/src/kernels KVER=2.6.18-164.el5

Deliver process at GSI works not as good as at CERN, this has to be discussed.

CTR compilation for FEC kernels Example (MEN A20): We should compile driver utils library To do this: -> cd coht/cdcm -> make utils CPU=L865 <-- will compile for KVER = 2.6.24.7-rt27 If you want to compile for the other kernel: -> make utils CPU=L865 KVER=

Compile CTRP: -> cd coht/ctr/driver_pci -> make CPU=L865 <-- will compile for KVER = 2.6.24.7-rt27 If you want to compile for the other kernel: -> make CPU=L865 KVER=

Deliver it: -> make deliver {lab, oper, oplhc, mcr} CPU=L865 If you want to deliver for the other kernel version: -> make deliver {lab, oper, oplhc} CPU=L865 KVER=

All compiled objects can be found in ctr/object_ctrp dir If you want to install the driver without delivery -- this directory is where you should do it.

Here you will see symlinks to compiled drivers. To install them you should use our installation program that is in /coht/utils/install/instprog.L865

-> cd object_ctrp/ -> ../../utils/install/instprog.L865 -fall -sCTRP -nctr

you can use instprog.L865 -h to get all options possible

Startup at boot time

The driver and startup directorty for the moment for a CTRI card is here:

/acc/src/dsc/drivers/coht/ctr/object_ctrp

Here you find tools to programm the timing module (Counters, clocks, triggers etc) and the startup script ctrpinstall. This script should be called from a boot init script, e.g. rc.local.

Quick check that it works, is calling ctrptest programm and entering ctm which shows all events. Or call reh which shows actuel timing signals on the cable.
Topic revision: r1 - 15 Oct 2009, TobiasHoffmann
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback