]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/io/serial/v2_0/cdl/io_serial.cdl
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / io / serial / v2_0 / cdl / io_serial.cdl
1 # ====================================================================
2 #
3 #      io_serial.cdl
4 #
5 #      eCos IO configuration data
6 #
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
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 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 ## at http://sources.redhat.com/ecos/ecos-license/
38 ## -------------------------------------------
39 #####ECOSGPLCOPYRIGHTEND####
40 # ====================================================================
41 ######DESCRIPTIONBEGIN####
42 #
43 # Author(s):      jskov
44 # Original data:  gthomas
45 # Contributors:
46 # Date:           1999-07-07
47 #
48 #####DESCRIPTIONEND####
49 #
50 # ====================================================================
51
52 cdl_package CYGPKG_IO_SERIAL {
53     display       "Serial device drivers"
54     parent        CYGPKG_IO
55     active_if     CYGPKG_IO
56     requires      CYGPKG_ERROR
57     include_dir   cyg/io
58     description   "
59         This option enables drivers for basic I/O services on
60         serial devices."
61     doc           ref/io.html
62
63     compile       -library=libextras.a common/serial.c
64  
65     define_proc {
66         puts $::cdl_header "/***** proc output start *****/"
67         puts $::cdl_header "#include <pkgconf/system.h>"
68         puts $::cdl_header "#ifdef CYGDAT_IO_SERIAL_DEVICE_HEADER"
69         puts $::cdl_header "# include CYGDAT_IO_SERIAL_DEVICE_HEADER"
70         puts $::cdl_header "#endif "
71         puts $::cdl_header "/****** proc output end ******/"
72     }
73
74     cdl_option CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING {
75         display       "Support non-blocking read and write calls"
76         default_value 0
77         description   "
78             This option enables extra code in the generic serial driver
79             which allows clients to switch read() and write() call
80             semantics from blocking to non-blocking."
81     }
82
83     cdl_interface CYGINT_IO_SERIAL_BLOCK_TRANSFER {
84         display       "Driver requires block transfer callback functions"
85         description   "
86             Some low-level drivers can be optimized to transfer blocks
87             of data instead of a single character at a time. These usually
88             rely on a hardware FIFO of some sort."
89     }
90
91     cdl_interface CYGINT_IO_SERIAL_LINE_STATUS_HW {
92         display "Serial driver supports line status"
93     }
94
95     cdl_option CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS {
96         display       "Support line status callbacks"
97         requires      { CYGINT_IO_SERIAL_LINE_STATUS_HW > 0 }
98         default_value { 0 != CYGINT_IO_SERIAL_LINE_STATUS_HW }
99         description "
100             This option indicates that if the serial driver supports it,
101             serial line status and modem status information should be
102             propagated to higher layers via callbacks."
103     }
104
105     cdl_component CYGPKG_IO_SERIAL_FLOW_CONTROL {
106         display           "Flow control"
107         description       "
108                 This component contains options related to flow control."
109         flavor            bool
110         requires          (CYGOPT_IO_SERIAL_FLOW_CONTROL_SOFTWARE || \
111                            CYGOPT_IO_SERIAL_FLOW_CONTROL_HW)
112         default_value     0
113
114         cdl_component CYGOPT_IO_SERIAL_FLOW_CONTROL_SOFTWARE {
115                 display       "Software flow control"
116                 default_value 1
117                 description   "
118                         This component enables support of software flow control."
119
120                 cdl_option CYGDAT_IO_SERIAL_FLOW_CONTROL_XON_CHAR {
121                     display       "Start character"
122                     flavor        data
123                     default_value 17
124                     legal_values  0 to 255
125                     description   "
126                         This option specifies the ascii character used to
127                         indicate that transmission should start."
128                 }
129
130                 cdl_option CYGDAT_IO_SERIAL_FLOW_CONTROL_XOFF_CHAR {
131                     display       "Stop character"
132                     flavor        data
133                     default_value 19
134                     legal_values  0 to 255
135                     description   "
136                         This option specifies the ascii character used to
137                         indicate that transmission should stop."
138                 }
139         }
140
141         cdl_option CYGOPT_IO_SERIAL_FLOW_CONTROL_HW {
142                 display       "Hardware flow control"
143                 active_if     { CYGINT_IO_SERIAL_FLOW_CONTROL_HW > 0 }
144                 requires      { CYGINT_IO_SERIAL_FLOW_CONTROL_HW > 0 }
145                 requires      CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS
146                 default_value { CYGINT_IO_SERIAL_FLOW_CONTROL_HW > 0 ? \
147                                 CYGOPT_IO_SERIAL_SUPPORT_LINE_STATUS : 0 }
148                 description   "
149                         If the hardware supports it, this option allows hardware
150                         flow control to be enabled. This may be in the form of
151                         either or both of RTS/CTS, or DSR/DTR flow control."
152         }
153
154         cdl_interface CYGINT_IO_SERIAL_FLOW_CONTROL_HW {
155                 display "Serial h/w supports hardware flow control"
156         }
157
158         cdl_option CYGDAT_IO_SERIAL_FLOW_CONTROL_DEFAULT {
159                 display       "Default flow control method"
160                 flavor        data
161                 legal_values  { "NONE" "XONXOFF" "RTSCTS" "DSRDTR" }
162                 default_value { "NONE" }
163                 description   "This option allows a default flow control method
164                                to be defined. Combinations of flow control methods
165                                may also be set, but this is only possible by
166                                using the cyg_io_set_config() API in source code."
167         }
168
169         cdl_option CYGNUM_IO_SERIAL_FLOW_CONTROL_LOW_WATER_PERCENT {
170                 display       "Rx flow control low water mark"
171                 flavor        data
172                 legal_values  1 to 100
173                 default_value 33
174                 description   "This sets the water mark used for determining
175                                when to disable flow control, expressed
176                                as a percentage of the buffer size. When the
177                                receive buffer size is lower than this percentage,
178                                if the transmitter had previously been throttled, it
179                                will now be informed it can restart."
180         }
181
182         cdl_option CYGNUM_IO_SERIAL_FLOW_CONTROL_HIGH_WATER_PERCENT {
183                 display       "Rx flow control high water mark"
184                 flavor        data
185                 legal_values  1 to 100
186                 default_value 66
187                 requires      { CYGNUM_IO_SERIAL_FLOW_CONTROL_HIGH_WATER_PERCENT >= \
188                                 CYGNUM_IO_SERIAL_FLOW_CONTROL_LOW_WATER_PERCENT }
189                 description   "This sets the water mark used for determining
190                                when to enable flow control, expressed
191                                as a percentage of the buffer size. When the
192                                receive buffer size exceeds this percentage,
193                                signals are sent to the transmitter to tell it
194                                to throttle tranmission."
195         }
196
197     }
198
199     cdl_component CYGPKG_IO_SERIAL_TTY {
200         display       "TTY-mode serial device drivers"
201         flavor        bool
202         default_value 1
203         description   "
204             This option enables a simple terminal-like device driver 
205             that can be used for serial devices that interact with humans,
206             such as a system console."
207         
208         script        tty.cdl
209         compile       -library=libextras.a common/tty.c
210     }
211
212     cdl_component CYGPKG_IO_SERIAL_TERMIOS {
213         display       "Termios compatible TTY drivers"
214         flavor        bool
215         requires      CYGPKG_ISOINFRA
216         requires      CYGPKG_IO_FILEIO
217         requires      CYGINT_ISO_ERRNO_CODES
218         requires      CYGINT_ISO_ERRNO
219         requires      CYGINT_ISO_MALLOC
220         default_value { 0 != CYGPKG_ISOINFRA && 0 != CYGPKG_IO_FILEIO && \
221                         0 != CYGINT_ISO_ERRNO_CODES && \
222                         0 != CYGINT_ISO_ERRNO }
223         implements    CYGINT_ISO_TERMIOS
224         description   "
225             This option enables terminal drivers compatible with
226             POSIX termios."
227         
228         script        termios.cdl
229         compile       common/termios.c
230     }
231
232     cdl_component CYGPKG_IO_SERIAL_DEVICES {
233         display       "Hardware serial device drivers"
234         flavor        bool
235         default_value 0
236         description   "
237             This option enables the hardware device drivers
238             for the current platform."
239     }
240
241     cdl_option CYGBLD_IO_SERIAL_EXTRA_TESTS {
242         display "Build extra serial tests"
243         default_value 0
244         no_define
245         description "
246             This option enables the building of some extra tests which
247             can be used when testing / debugging serial drivers. These
248             are not built by default since they do not use the dedicated
249             testing infrastructure."
250
251         make -priority 320 {
252             <PREFIX>/bin/serial_echo : <PACKAGE>/tests/serial_echo.c
253             @sh -c "mkdir -p tests $(dir $@)"
254             $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o tests/serial_echo.o $<
255             @echo $@ ": \\" > $(notdir $@).deps
256             @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
257             @tail -n +2 deps.tmp >> $(notdir $@).deps
258             @echo >> $(notdir $@).deps
259             @rm deps.tmp
260             $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ tests/serial_echo.o
261         }
262     }
263
264     cdl_component CYGPKG_IO_SERIAL_OPTIONS {
265         display "Serial device driver build options"
266         flavor  none
267         description   "
268             Package specific build options including control over
269             compiler flags used only in building this package,
270             and details of which tests are built."
271
272
273         cdl_option CYGPKG_IO_SERIAL_CFLAGS_ADD {
274             display "Additional compiler flags"
275             flavor  data
276             no_define
277             default_value { "" }
278             description   "
279                 This option modifies the set of compiler flags for
280                 building the serial device drivers. These flags are used in addition
281                 to the set of global flags."
282         }
283
284         cdl_option CYGPKG_IO_SERIAL_CFLAGS_REMOVE {
285             display "Suppressed compiler flags"
286             flavor  data
287             no_define
288             default_value { "" }
289             description   "
290                 This option modifies the set of compiler flags for
291                 building the serial device drivers. These flags are removed from
292                 the set of global flags if present."
293         }
294
295         cdl_option CYGPKG_IO_SERIAL_TESTS {
296             display "Serial device driver tests"
297             flavor  data
298             no_define
299             calculated { CYGPKG_IO_SERIAL_DEVICES ? "tests/serial1 tests/serial2 tests/serial3 tests/serial4 tests/serial5 tests/tty1 tests/tty2 tests/flow1 tests/flow2" : "" }
300             description   "
301                 This option specifies the set of tests for the serial device drivers."
302         }
303     }
304
305     cdl_option CYGPKG_IO_SERIAL_SELECT_SUPPORT {
306         display "Enable serial device select support"
307         flavor bool
308         active_if CYGPKG_IO_FILEIO
309         requires  { CYGFUN_IO_FILEIO_SELECT == 1 }
310         default_value 1
311         description "
312             This option enables support for the select() API function on all
313             serial devices."
314     }
315
316     # These could be regular define_proc outputs, but keeping them as
317     # CDL interfaces allow us to possibly skip building/running some
318     # tests.
319     cdl_component CYGPKG_IO_SERIAL_TEST_SPECS {
320         display "Serial testing specification"
321         flavor     bool
322         calculated 1
323         no_define
324        
325         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_9600 {
326             display "Skip 9600 baud testing"
327         }
328
329         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_14400 {
330             display "Skip 14400 baud testing"
331         }
332
333         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_19200 {
334             display "Skip 19200 baud testing"
335         }
336
337         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_38400 {
338             display "Skip 38400 baud testing"
339         }
340
341         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_57600 {
342             display "Skip 57600 baud testing"
343         }
344
345         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_115200 {
346             display "Skip 115200 baud testing"
347         }
348
349         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_PARITY_EVEN {
350             display "Skip even-parity testing"
351         }
352
353         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_PARITY_ODD {
354             display "Skip odd-parity testing"
355         }
356
357         cdl_interface CYGINT_IO_SERIAL_TEST_SKIP_STOP_2 {
358             display "Skip 2-stop bit testing"
359         }
360     }
361 }
362
363 # EOF io_serial.cdl