]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/devs/can/m68k/mcf52xx/v2_0/cdl/can_mcf52xx.cdl
Initial revision
[karo-tx-redboot.git] / packages / devs / can / m68k / mcf52xx / v2_0 / cdl / can_mcf52xx.cdl
1 # ====================================================================
2 #
3 #      can_mcf52xx.cdl
4 #
5 #      eCos MCF52xx FlexCAN 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:           2005-05-17
43 #
44 #####DESCRIPTIONEND####
45 # ====================================================================
46
47
48 cdl_package CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN {
49     display       "CAN driver for FlexCAN module of coldfire mcf52xx family"
50
51     parent        CYGPKG_IO_CAN_DEVICES
52     active_if     CYGPKG_IO_CAN
53     active_if     CYGPKG_HAL_M68K_MCF52xx
54
55     requires      CYGPKG_ERROR
56
57     description   "
58            This package provides a generic CAN device driver for the on-chip
59            FlexCAN modules in MCF52xx ColdFire processors."
60     compile       -library=libextras.a   can_mcf52xx.c
61     define_proc {
62         puts $::cdl_system_header "/***** CAN driver proc output start *****/"
63         puts $::cdl_system_header "#define CYGDAT_IO_CAN_DEVICE_HEADER <pkgconf/devs_can_mcf52xx_flexcan.h>"
64         puts $::cdl_system_header "/*****  CAN driver proc output end  *****/"
65     }
66     
67     # Support up to two on-chip FlexCAN modules. The number varies between
68     # processor variants
69     for { set ::flexcan 0 } { $::flexcan < 2 } { incr ::flexcan } {
70     
71         cdl_interface CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan] {
72             display     "Platform provides FlexCAN [set ::flexcan]"
73             flavor      bool
74             description "
75                 This interface will be implemented if the specific coldfire
76                 processor being used has an on-chip FlexCAN[set ::flexcan], and if
77                 that FlexCAN is accessible on the target hardware."
78         }
79     
80         cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan] {
81             display     "Allow access to the on-chip FlexCAN[set ::flexcan] via a CAN driver"
82             flavor      bool
83             active_if       CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
84             default_value   1
85             implements      CYGINT_IO_CAN_TIMESTAMP
86             
87             description "
88                 If the application needs to access the on-chip FlexCAN[set ::flexcan]
89                 via an eCos CAN driver then this option should be enabled."
90
91             cdl_option CYGDAT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_NAME {
92                 display     "Device name for FlexCAN [set ::flexcan]"
93                 flavor      data
94                 default_value   [format {"\"/dev/can%d\""} $::flexcan]
95                 description "
96                     This option controls the name that an eCos application
97                     should use to access this device via cyg_io_lookup(),
98                     open(), or similar calls."
99             }
100
101         
102             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_KBAUD {
103                 display     "Default baud rate for FlexCAN [set ::flexcan]"
104                 flavor      data
105                 default_value   100
106                 legal_values    { 10 20 50 100 125 250 500 800 1000 }
107                 description "This option determines the initial baud rate in KBaud for FlexCAN [set ::flexcan]"
108             }
109
110             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_QUEUESIZE_TX {
111                 display     "Size of TX Queue for the FlexCAN [set ::flexcan] driver"
112                 flavor      data
113                 default_value   32
114                 legal_values    16 to 512
115                 description "
116                     The CAN device driver will run in interrupt mode and will
117                     perform buffering of outgoing data. This option controls the number
118                     of CAN messages the TX queue can store."
119             }
120             
121             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_QUEUESIZE_RX {
122                 display     "Size of RX Queue for the FlexCAN [set ::flexcan] driver"
123                 flavor      data
124                 default_value   32
125                 legal_values    16 to 512
126                 description "
127                     The CAN device driver will run in interrupt mode and will
128                     perform buffering of incoming data. This option controls the number
129                     of CAN events the RX queue can store."
130             }
131             
132             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_RXMASK_GLOBAL {
133                 display     "Receive mask for message buffers 0 - 13"
134                 flavor      data
135                 default_value   0x1FFFFFFF
136                 description "
137                     The global RX-mask is composed of 4 bytes. The mask bits are
138                     applied to all Rx-Identifiers excluding Rx-buffers 14-15, that 
139                     have their specific Rx-mask. (0 corresponding incoming ID bit is 
140                     \"don\92t care\". 1 corresponding ID bit is checked against the incoming 
141                     ID bit, to see if a match exists). By default the message buffers
142                     should only receive messages that exactly match the configured
143                     message buffer CAN identifier - that means alle bits are 1."
144             }
145             
146             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_RXMASK_14 {
147                 display     "Receive mask for message buffer 14"
148                 flavor      data
149                 default_value   0x0
150                 description "
151                     The RX-mask for message buffer 14 is composed of 4 bytes. The mask
152                     bits are applied to message buffer 14. (0 corresponding incoming ID 
153                     bit is \"don\92t care\". 1 corresponding ID bit is checked against the 
154                     incoming ID bit, to see if a match exists). Message buffer 14 is
155                     the receive message buffer and should receive all available CAN
156                     messages - all bits are 0."
157             }
158             
159             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_RXMASK_15 {
160                 display     "Receive mask for message buffer 15"
161                 flavor      data
162                 default_value   0x1FFFFFFF
163                 description "
164                     The RX-mask for message buffer 15 is composed of 4 bytes. The mask
165                     bits are applied to message buffer 15. (0 corresponding incoming ID 
166                     bit is \"don\92t care\". 1 corresponding ID bit is checked against the 
167                     incoming ID bit, to see if a match exists)."
168             }
169             
170             cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_WAKEINT {
171                 display     "Wake interrupt priority"
172                 flavor      data
173                 default_value   is_loaded(CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_WAKEINT) ? \
174                                 CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_WAKEINT : \
175                                 CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN
176                 legal_values   CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN to CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MAX
177                 description "
178                     Interrupt priority for wake interrupt."
179             }
180             
181             cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_ERRINT {
182                 display     "Error interrupt priority"
183                 flavor      data
184                 default_value   is_loaded(CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_ERRINT) ? \
185                                 CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_ERRINT : \
186                                 CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN
187                 legal_values   CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN to CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MAX
188                 description "
189                     Interrupt priority for error interrupt."
190             }
191             
192             cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_BOFFINT {
193                 display     "Bus off interrupt priority"
194                 flavor      data
195                 default_value   is_loaded(CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_BOFFINT) ? \
196                                 CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_BOFFINT : \
197                                 CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN
198                 legal_values   CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN to CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MAX
199                 description "
200                     Interrupt priority for bus off interrupt."
201             }
202             
203             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_DEFAULT_RX_MBOX {
204                 display "Default receive message buffer"
205                 flavor  data
206                 calculated    14
207                 legal_values  0 to 15
208                 description "
209                     By default one message buffer will be used for reception of
210                     all CAN messages. This option selects one of the 16 message
211                     buffers for reception."
212             }
213             
214             cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_DEFAULT_TX_MBOX {
215                 display "Default transmit message buffer"
216                 flavor  data
217                 calculated    15
218                 legal_values  0 to 15
219                 description "
220                     By default one message buffer will be used for message transmission.
221                     This option selects one of the 16 FlexCAN message buffers for
222                     transmission."
223             }
224             
225             cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOXCFG {
226                 display     "Message buffer configuration"
227                 flavor       none
228                 active_if       CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
229                 description "
230                     The FlexCAN module contains 16 flexible message buffers of 0-8 bytes 
231                     data length, each configurable as Rx or Tx, all supporting standard and 
232                     extended messages. At the moment a fixed configuration is used for
233                     TX and RX message buffers but in future this may be configurable."
234                 
235                 cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX14_CFG {
236                     display "Message buffer 14 configuration"
237                     flavor  none
238                     active_if       CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
239                     description "
240                        Configuration of FlexCAN message buffer 14."
241                    
242                     cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_MBOX14 {
243                         display     "Interrupt priority."
244                         flavor      data
245                         default_value   is_loaded(CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_MBOX14) ? \
246                                     CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_MBOX14 : \
247                                     CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN
248                         legal_values   CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN to CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MAX
249                         description "
250                             Interrupt priority for message buffer 14"
251                     }
252                     
253                     cdl_option CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX14_IS_TX {
254                         display "Use for transmit"
255                         flavor  bool
256                         active_if       CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
257                         calculated      0
258                         description "
259                             This option controls if this message buffer is used for sending
260                             or receiving messages. Currently this option is not configurable
261                             and message box 14 is used for reception of CAN messages."
262                         
263                     }
264                 }
265                 
266                 cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX15_CFG {
267                     display "Message buffer 15 configuration"
268                     flavor  none
269                     active_if       CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
270                     description "
271                        Configuration of FlexCAN message buffer 15."
272                    
273                     cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_MBOX15 {
274                         display     "Interrupt priority."
275                         flavor      data
276                         default_value   is_loaded(CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_MBOX15) ? \
277                                     CYGNUM_HAL_M68K_MCF52xx_ISR_DEFAULT_PRIORITY_FLEXCAN[set ::flexcan]_MBOX15 : \
278                                     CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN
279                         legal_values   CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MIN to CYGNUM_HAL_M68K_MCF52xx_ISR_PRIORITY_MAX
280                         description "
281                             Interrupt priority for message buffer 15"
282                     }
283                     
284                     cdl_option CYGOPT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX15_IS_TX {
285                         display "Use for transmit"
286                         flavor  bool
287                         active_if       CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
288                         calculated      1
289                         description "
290                             This option controls if this message buffer is used for sending
291                             or receiving messages. Currently this option is not configurable
292                             and message box 15 is used for transmission of CAN messages."
293                         
294                     }
295                 }
296             } 
297         }    
298     }
299     
300     cdl_option CYGBLD_DEVS_CAN_MCF52xx_FLEXCAN_EXTRA_TESTS {
301         display "Build extra FlexCAN tests"
302         default_value 0
303         no_define
304         description "
305             This option enables the building of some extra tests which
306             can be used when testing / debugging FlexCAN drivers. These
307             are not built by default since they do not use the dedicated
308             testing infrastructure. All tests require a properly configured
309             CAN network with a second CAN node that can send and receive
310             CAN messages."
311
312         make -priority 320 {
313             <PREFIX>/bin/flexcan_load : <PACKAGE>/tests/flexcan_load.c
314             @sh -c "mkdir -p tests $(dir $@)"
315             $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/flexcan_load.o $<
316             @echo $@ ": \\" > $(notdir $@).deps
317             @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
318             @tail -n +2 deps.tmp >> $(notdir $@).deps
319             @echo >> $(notdir $@).deps
320             @rm deps.tmp
321             $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/flexcan_load.o
322         }
323         
324         make -priority 320 {
325             <PREFIX>/bin/flexcan_remote : <PACKAGE>/tests/flexcan_remote.c
326             @sh -c "mkdir -p tests $(dir $@)"
327             $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/flexcan_remote.o $<
328             @echo $@ ": \\" > $(notdir $@).deps
329             @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
330             @tail -n +2 deps.tmp >> $(notdir $@).deps
331             @echo >> $(notdir $@).deps
332             @rm deps.tmp
333             $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/flexcan_remote.o
334         }
335     }
336
337
338
339     cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN_OPTIONS {
340         display "FlexCAN device driver build options"
341         flavor  none
342         description   "
343         Package specific build options including control over
344         compiler flags used only in building this package,
345         and details of which tests are built."
346
347         cdl_option CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN_CFLAGS_ADD {
348             display "Additional compiler flags"
349             flavor  data
350             no_define
351             default_value { "" }
352             description   "
353                 This option modifies the set of compiler flags for
354                 building these CAN device drivers. These flags are
355                 used in addition to the set of global flags."
356         }
357
358         cdl_option CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN_CFLAGS_REMOVE {
359             display "Suppressed compiler flags"
360             flavor  data
361             no_define
362             default_value { "" }
363             description   "
364                 This option modifies the set of compiler flags for
365                 building these CAN device drivers. These flags are
366                 removed from the set of global flags if present."
367         }
368     }
369 }