]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/devs/can/arm/lpc2xxx/v2_0/cdl/can_lpc2xxx.cdl
Initial revision
[karo-tx-redboot.git] / packages / devs / can / arm / lpc2xxx / v2_0 / cdl / can_lpc2xxx.cdl
1 # ====================================================================
2 #
3 #      can_lpc2xxx.cdl
4 #
5 #      eCos LPC2xxx CAN module configuration data
6 #
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 2003, 2004 eCosCentric Limited
12 ##
13 ## eCos is free software; you can redistribute it and/or modify it under
14 ## the terms of the GNU General Public License as published by the Free
15 ## Software Foundation; either version 2 or (at your option) any later version.
16 ##
17 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20 ## for more details.
21 ##
22 ## You should have received a copy of the GNU General Public License along
23 ## with eCos; if not, write to the Free Software Foundation, Inc.,
24 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25 ##
26 ## As a special exception, if other files instantiate templates or use macros
27 ## or inline functions from this file, or you compile this file and link it
28 ## with other works to produce a work based on this file, this file does not
29 ## by itself cause the resulting work to be covered by the GNU General Public
30 ## License. However the source code for this file must still be made available
31 ## in accordance with section (3) of the GNU General Public License.
32 ##
33 ## This exception does not invalidate any other reasons why a work based on
34 ## this file might be covered by the GNU General Public License.
35 ## -------------------------------------------
36 #####ECOSGPLCOPYRIGHTEND####
37 # ====================================================================
38 ######DESCRIPTIONBEGIN####
39 #
40 # Author(s):      Uwe Kindler
41 # Contributors:
42 # Date:           2007-02-10
43 #
44 #####DESCRIPTIONEND####
45 # ====================================================================
46
47
48 cdl_package CYGPKG_DEVS_CAN_LPC2XXX {
49     display       "Philips LPC2xxx CAN device drivers"
50     parent        CYGPKG_IO_CAN_DEVICES
51     active_if     CYGPKG_IO_CAN
52     active_if     CYGPKG_HAL_ARM_LPC2XXX || CYGPKG_HAL_ARM_LPC24XX
53     requires      CYGPKG_ERROR
54     
55     implements    CYGINT_IO_CAN_STD_CAN_ID
56     implements    CYGINT_IO_CAN_EXT_CAN_ID
57             
58     include_dir   cyg/io
59     description   "
60            This option enables the CAN device drivers for the
61            Philips LPC2XXX."
62     compile       -library=libextras.a   can_lpc2xxx.c
63     define_proc {
64         puts $::cdl_system_header "/***** CAN driver proc output start *****/"
65         puts $::cdl_system_header "#define CYGDAT_IO_CAN_DEVICE_HEADER <pkgconf/devs_can_lpc2xxx.h>"
66         puts $::cdl_system_header "/*****  CAN driver proc output end  *****/"
67     }
68     
69     cdl_component CYGOPT_DEVS_CAN_LPC2XXX_RUNTIME_ACCFILT {
70         display    "Acceptance filter runtime configuration"
71         flavor      bool
72         implements  CYGINT_IO_CAN_RUNTIME_MBOX_CFG
73         description "
74             The LPC2xxx CAN module supports a global acceptance
75             filter. Enabling this option provides support for runtime
76             configuration of this acceptance filter.  If each CAN
77             channel should receive all CAN messages and individual
78             message filtering is not required then disable this option
79             to eliminate almost the complete acceptance filter code
80             and to decrease code size. If this option is disabled the
81             option CYGOPT_IO_CAN_RUNTIME_MBOX_CFG is not available and
82             the configuration key CYG_IO_SET_CONFIG_CAN_MSGBUF is not
83             supported by this driver."
84
85             cdl_option CYGOPT_DEVS_CAN_LPC2XXX_EXTENDED_CFG_KEYS {
86                 display       "Extended acceptance filtering"
87                 flavor        bool
88                 default_value 0
89                 description   "
90                     The common CAN I/O layer supports setup of single
91                     message filters for reception of single CAN
92                     messages. The global LPC2xxx acceptance filter
93                     supports not only single message filters but also
94                     message groups.  A message group is defined by a
95                     lower bound CAN identifier and an upper bound CAN
96                     identifier. The acceptance filter will accept all
97                     messages within this range of CAN identifiers. The
98                     acceptance filter supports a number of message
99                     groups for each CAN channel. The support of
100                     message filter groups is not conform to the
101                     standard API of the CAN I/O layer and should only
102                     be used for application where portability is not
103                     important."
104              }
105              
106          cdl_option CYGOPT_DEVS_CAN_LPC2XXX_LUT_ERR_SUPP {
107              display                 "LUT Error Support"
108              flavor                  bool
109              default_value   0
110              description "   
111                  The CAN module contains a look-up table for
112                  acceptance filtering of incoming CAN messages. The
113                  look-up table indicates errors in the LUT error
114                  registers. If this option is enabled, additional
115                  error check code is executed if an interrupt is
116                  serviced. Normally the acceptance filter code should
117                  fill the look-up table properly and no LUT error
118                  should ever occur. You need to decide if LUT error
119                  checking is required for your application because it
120                  adds some bytes of code and slows down the ISR/DSR
121                  handling a little bit because of the additional code
122                  that need to be executed."
123          }
124     }
125      
126     
127     cdl_option CYGOPT_DEVS_CAN_LPC2XXX_USE_SELF_RECEPTION {
128         display                 "Use Self Reception Request command"
129         flavor                  bool
130         active_if               CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
131         default_value   0
132         description "   
133             Enable this option for using work-around of problem with
134             receiving messages while arbitration is lost. If this work
135             around is used each transmitted CAN message will be
136             received. This will produce additional RX interrupts an
137             requires additional time for processing these interrupts
138             and for filtering of received messages.
139
140             The errata sheet tells the following about this issue:
141             Introduction: The CAN module can lose arbitration to
142             another CAN node during an attempt to transmit a CAN
143             message. The message of the CAN node the arbitration was
144             lost to is supposed to be received correctly by the CAN
145             module.
146
147             Problem: Messages might not be received correctly if
148             during a CAN Transmission the CAN bus arbitration is lost
149             to another CAN node.
150
151             Work-around: Use the Self Reception Request command
152             instead of the Transmission Request command. However, it
153             has to be taken into account that now all transmitted
154             messages may be received if not prevented by appropriate
155             Acceptance Filter settings.  (Don't set up Acceptance
156             Filter Message Identifiers for the messages you are
157             transmitting yourself.)."  
158     }
159
160     cdl_option CYGOPT_DEVS_CAN_LPC2XXX_ALIE {
161          display         "Arbitration lost interrupt enable"
162          flavor          bool
163          default_value   0
164          description "   
165              If the CAN controller loses arbitration while attempting to 
166              transmit a message, an interrupt can be triggered. Normally
167              this is no real error condition and it is not necessary to
168              propagate these events to upper layers. But you can enable
169              this option if you want to check for arbitration lost events."     
170      }
171        
172     cdl_option CYGDBG_DEVS_CAN_LPC2XXX_DEBUG {
173         display "Support printing debug information"
174             default_value 0
175             description "
176                 Check this box to turn ON debug options for LPC2XXXX 
177                 CAN device driver."
178     } 
179     
180     # Support up to 4 on-chip CAN modules. The number may vary between
181     # processor variants so it is easy to update this here
182     for { set ::channel 0 } { $::channel < 4 } { incr ::channel } {
183     
184         cdl_interface CYGINT_DEVS_CAN_LPC2XXX_CAN[set ::channel] {
185             display     "Platform provides CAN [set ::channel]"
186             flavor      bool
187             description "
188                 This interface will be implemented if the specific LPC2xxx
189                 processor being used has on-chip CAN [set ::channel], and if
190                 that CAN module is accessible on the target hardware."
191         }
192     
193         cdl_component CYGPKG_DEVS_CAN_LPC2XXX_CAN[set ::channel] {
194             display     "Allow access to the on-chip CAN [set ::channel] via a CAN driver"
195             flavor      bool
196             active_if       CYGINT_DEVS_CAN_LPC2XXX_CAN[set ::channel]
197             implements      CYGINT_IO_CAN_CHANNELS
198             default_value   1
199             description "
200                 If the application needs to access the on-chip CAN
201                 module [set ::channel] via an eCos CAN driver then
202                 this option should be enabled."
203
204             cdl_option CYGPKG_DEVS_CAN_LPC2XXX_CAN[set ::channel]_NAME {
205                 display     "Device name for CAN module [set ::channel]"
206                 flavor      data
207                 default_value   [format {"\"/dev/can%d\""} $::channel]
208                 description "
209                     This option controls the name that an eCos application
210                     should use to access this device via cyg_io_lookup(),
211                     open(), or similar calls."
212             }
213
214         
215             cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_KBAUD {
216                 display     "Default baud rate for CAN module [set ::channel]"
217                 flavor      data
218                 default_value   100
219                 legal_values    { 10 20 50 100 125 250 500 800 1000 "AUTO"}
220                 description "
221                     This option determines the initial baud rate in
222                     KBaud for CAN module [set ::channel]"
223             }
224
225             cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_QUEUESIZE_TX {
226                 display     "Size of TX Queue for the CAN module [set ::channel] driver"
227                 flavor      data
228                 default_value   32
229                 legal_values    1 to 1024
230                 description "
231                     The CAN device driver will run in interrupt mode
232                     and will perform buffering of outgoing data. This
233                     option controls the number of CAN messages the TX
234                     queue can store."
235             }
236             
237             cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_QUEUESIZE_RX {
238                 display     "Size of RX Queue for the CAN module [set ::channel] driver"
239                 flavor      data
240                 default_value   64
241                 legal_values    8 to 4096
242                 description "
243                     The CAN device driver will run in interrupt mode
244                     and will perform buffering of incoming data. This
245                     option controls the number of CAN events the RX
246                     queue can store."
247             }
248                        
249             cdl_option CYGOPT_DEVS_CAN_LPC2XXX_CAN[set ::channel]_ACCFILT_STARTUP_CFG {
250                 display       "Acceptance filter startup configuration"
251                 flavor        data
252                 legal_values  {"RX_ALL" "RX_NONE"}
253                 default_value {"RX_ALL"}
254                 active_if   CYGOPT_DEVS_CAN_LPC2XXX_RUNTIME_ACCFILT
255                 description   "
256                     Normally the acceptance filter will be configured
257                     at startup time to receive all available CAN
258                     messages. The application can setup single message
259                     filters during runtime later. If RX_NONE is
260                     selected then the acceptance filter for this
261                     channel is configured to receive no CAN message
262                     identifier."
263              }
264
265                 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_RX_INT_PRIORITY {
266                     display       "Priority level of CAN module [set ::channel] receive interrupt"
267                     flavor        data
268                     active_if     CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
269                     default_value 16
270                     legal_values  0 to 16
271                     description   "
272                         This option sets CAN module [set ::channel]
273                         device receive interrupt priority level.  We
274                         support up to 17 interrupt levels. Interrupts
275                         0 - 15 are vectored interrupt
276                         requests. Priority 16 indicates a non vectored
277                         IRQ. Vectored IRQs have the higher priority
278                         then non vectored IRQs and slot 0 has the
279                         highest priority and slot 15 has the lowest."
280                 }
281
282                 cdl_option CYGNUM_DEVS_CAN_LPC2XXX_CAN[set ::channel]_TX_INT_PRIORITY {
283                     display       "Priority level of CAN module [set ::channel] transmit interrupt"
284                     flavor        data
285                     active_if     CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
286                     default_value 16
287                     legal_values  0 to 16
288                     description   "
289                         This option sets CAN module [set ::channel]
290                         device transmit interrupt priority level.  We
291                         support up to 17 interrupt levels. Interrupts
292                         0 - 15 are vectored interrupt
293                         requests. Priority 16 indicates a non vectored
294                         IRQ. Vectored IRQs have the higher priority
295                         then non vectored IRQs and slot 0 has the
296                         highest priority and slot 15 has the lowest."
297             } 
298         } 
299     } 
300     
301     cdl_option CYGNUM_DEVS_CAN_LPC2XXX_ERR_INT_PRIORITY {
302         display       "Priority level of CAN error interrupt"
303         flavor        data
304         active_if     CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION < 4
305         default_value 16
306         legal_values  0 to 16
307         description   "
308             This option sets CAN device error interrupt priority level.
309             We support up to 17 interrupt levels. Interrupts 0 - 15
310             are vectored interrupt requests. Priority 16 indicates a
311             non vectored IRQ. Vectored IRQs have the higher priority
312             then non vectored IRQs and slot 0 has the highest priority
313             and slot 15 has the lowest."
314     }
315     
316     cdl_option CYGNUM_DEVS_CAN_LPC2XXX_INT_PRIORITY {
317         display       "Priority level of all CAN interrupts"
318         flavor        data
319         active_if     CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION >= 4
320         default_value 15
321         legal_values  0 to 15
322         description   "
323             The LPC24xx family uses one single interrupt vector for
324             all CAN interrupts of all CAN channels. This if very 
325             different from former LPC2xxx variants where each CAN
326             channels has its own interrupt vectors for transmit
327             and receive interrupts. There are 16 priority 
328             levels, corresponding to the values 0 through  15 decimal, 
329             of which 15 is the lowest priority. The reset value of 
330             these interrupt priority registers defaults all interrupts 
331             to the lowest priority 15, allowing a single write to 
332             elevate the priority of an individual interrupt."
333     }
334     
335     cdl_option CYGPKG_DEVS_CAN_LPC2XXX_TESTS {
336         display "CAN LPC2xxx device driver tests"
337         flavor  data
338         no_define
339         calculated { "tests/can_busload tests/can_rx_tx" }
340         description   "
341             This option specifies the set of tests for the LPC2xxx 
342             CAN device driver."
343     }
344     
345     cdl_option CYGBLD_DEVS_CAN_LPC2XXX_EXTRA_TESTS {
346         display "Build extra CAN tests"
347         default_value 0
348         no_define
349         description "
350             This option enables the building of some extra tests which
351             can be used when testing / debugging the LPC2xxx CAN driver. These
352             are not built by default since they do not use the dedicated
353             testing infrastructure. All tests require a properly configured
354             CAN network with a second CAN node that can send and receive
355             CAN messages."
356     
357         make -priority 320 {
358             <PREFIX>/bin/can_multichan_rx : <PACKAGE>/tests/can_multichan_rx.c
359             @sh -c "mkdir -p tests $(dir $@)"
360             $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_multichan_rx.o $<
361             @echo $@ ": \\" > $(notdir $@).deps
362             @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
363             @tail -n +2 deps.tmp >> $(notdir $@).deps
364             @echo >> $(notdir $@).deps
365             @rm deps.tmp
366             $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_multichan_rx.o
367         }
368         
369         make -priority 320 {
370             <PREFIX>/bin/can_multichan_tx : <PACKAGE>/tests/can_multichan_tx.c
371             @sh -c "mkdir -p tests $(dir $@)"
372             $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_multichan_tx.o $<
373             @echo $@ ": \\" > $(notdir $@).deps
374             @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
375             @tail -n +2 deps.tmp >> $(notdir $@).deps
376             @echo >> $(notdir $@).deps
377             @rm deps.tmp
378             $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_multichan_tx.o
379         }
380                 
381         make -priority 320 {
382             <PREFIX>/bin/can_baudrates : <PACKAGE>/tests/can_baudrates.c
383             @sh -c "mkdir -p tests $(dir $@)"
384             $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_baudrates.o $<
385             @echo $@ ": \\" > $(notdir $@).deps
386             @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
387             @tail -n +2 deps.tmp >> $(notdir $@).deps
388             @echo >> $(notdir $@).deps
389             @rm deps.tmp
390             $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_baudrates.o
391         }
392         
393         make -priority 320 {
394             <PREFIX>/bin/can_extended_cfg : <PACKAGE>/tests/can_extended_cfg.c
395             @sh -c "mkdir -p tests $(dir $@)"
396             $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/can_extended_cfg.o $<
397             @echo $@ ": \\" > $(notdir $@).deps
398             @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
399             @tail -n +2 deps.tmp >> $(notdir $@).deps
400             @echo >> $(notdir $@).deps
401             @rm deps.tmp
402             $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/can_extended_cfg.o
403         }
404     } 
405 }