1 # ====================================================================
5 # eCos MCF52xx FlexCAN configuration data
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 2003, 2004 eCosCentric Limited
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.
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
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.
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.
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####
40 # Author(s): Uwe Kindler
44 #####DESCRIPTIONEND####
45 # ====================================================================
48 cdl_package CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN {
49 display "CAN driver for FlexCAN module of coldfire mcf52xx family"
51 parent CYGPKG_IO_CAN_DEVICES
52 active_if CYGPKG_IO_CAN
53 active_if CYGPKG_HAL_M68K_MCF52xx
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
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 *****/"
67 # Support up to two on-chip FlexCAN modules. The number varies between
69 for { set ::flexcan 0 } { $::flexcan < 2 } { incr ::flexcan } {
71 cdl_interface CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan] {
72 display "Platform provides FlexCAN [set ::flexcan]"
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."
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"
83 active_if CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
85 implements CYGINT_IO_CAN_TIMESTAMP
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."
91 cdl_option CYGDAT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_NAME {
92 display "Device name for FlexCAN [set ::flexcan]"
94 default_value [format {"\"/dev/can%d\""} $::flexcan]
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."
102 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_KBAUD {
103 display "Default baud rate for FlexCAN [set ::flexcan]"
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]"
110 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_QUEUESIZE_TX {
111 display "Size of TX Queue for the FlexCAN [set ::flexcan] driver"
114 legal_values 16 to 512
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."
121 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_QUEUESIZE_RX {
122 display "Size of RX Queue for the FlexCAN [set ::flexcan] driver"
125 legal_values 16 to 512
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."
132 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_RXMASK_GLOBAL {
133 display "Receive mask for message buffers 0 - 13"
135 default_value 0x1FFFFFFF
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."
146 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_RXMASK_14 {
147 display "Receive mask for message buffer 14"
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."
159 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_RXMASK_15 {
160 display "Receive mask for message buffer 15"
162 default_value 0x1FFFFFFF
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)."
170 cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_WAKEINT {
171 display "Wake interrupt priority"
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
178 Interrupt priority for wake interrupt."
181 cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_ERRINT {
182 display "Error interrupt priority"
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
189 Interrupt priority for error interrupt."
192 cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_BOFFINT {
193 display "Bus off interrupt priority"
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
200 Interrupt priority for bus off interrupt."
203 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_DEFAULT_RX_MBOX {
204 display "Default receive message buffer"
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."
214 cdl_option CYGNUM_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_DEFAULT_TX_MBOX {
215 display "Default transmit message buffer"
220 By default one message buffer will be used for message transmission.
221 This option selects one of the 16 FlexCAN message buffers for
225 cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOXCFG {
226 display "Message buffer configuration"
228 active_if CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
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."
235 cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX14_CFG {
236 display "Message buffer 14 configuration"
238 active_if CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
240 Configuration of FlexCAN message buffer 14."
242 cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_MBOX14 {
243 display "Interrupt priority."
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
250 Interrupt priority for message buffer 14"
253 cdl_option CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX14_IS_TX {
254 display "Use for transmit"
256 active_if CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
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."
266 cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX15_CFG {
267 display "Message buffer 15 configuration"
269 active_if CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
271 Configuration of FlexCAN message buffer 15."
273 cdl_option CYGNUM_DEVS_CAN_MCF52xx_ISR_PRIORITY_FLEXCAN[set ::flexcan]_MBOX15 {
274 display "Interrupt priority."
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
281 Interrupt priority for message buffer 15"
284 cdl_option CYGOPT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]_MBOX15_IS_TX {
285 display "Use for transmit"
287 active_if CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan]
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."
300 cdl_option CYGBLD_DEVS_CAN_MCF52xx_FLEXCAN_EXTRA_TESTS {
301 display "Build extra FlexCAN tests"
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
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
321 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/flexcan_load.o
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
333 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/flexcan_remote.o
339 cdl_component CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN_OPTIONS {
340 display "FlexCAN device driver build options"
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."
347 cdl_option CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN_CFLAGS_ADD {
348 display "Additional compiler flags"
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."
358 cdl_option CYGPKG_DEVS_CAN_MCF52xx_FLEXCAN_CFLAGS_REMOVE {
359 display "Suppressed compiler flags"
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."