1 # ====================================================================
5 # HAL configuration data
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 ## Copyright (C) 2002 Gary Thomas
14 ## eCos is free software; you can redistribute it and/or modify it under
15 ## the terms of the GNU General Public License as published by the Free
16 ## Software Foundation; either version 2 or (at your option) any later version.
18 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
19 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 ## You should have received a copy of the GNU General Public License along
24 ## with eCos; if not, write to the Free Software Foundation, Inc.,
25 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 ## As a special exception, if other files instantiate templates or use macros
28 ## or inline functions from this file, or you compile this file and link it
29 ## with other works to produce a work based on this file, this file does not
30 ## by itself cause the resulting work to be covered by the GNU General Public
31 ## License. However the source code for this file must still be made available
32 ## in accordance with section (3) of the GNU General Public License.
34 ## This exception does not invalidate any other reasons why a work based on
35 ## this file might be covered by the GNU General Public License.
37 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
38 ## at http://sources.redhat.com/ecos/ecos-license/
39 ## -------------------------------------------
40 #####ECOSGPLCOPYRIGHTEND####
41 # ====================================================================
42 ######DESCRIPTIONBEGIN####
45 # Original data: nickg,jskov,jlarmour
46 # Contributors: dmoseley
49 #####DESCRIPTIONEND####
51 # ====================================================================
53 cdl_package CYGPKG_HAL {
57 The eCos HAL package provide a porting layer for
58 higher-level parts of the system such as the kernel and the
59 C library. Each installation should have HAL packages for
60 one or more architectures, and for each architecture there
61 may be one or more supported platforms. It is necessary to
62 select one target architecture and one platform for that
63 architecture. There are also a number of configuration
64 options that are common to all HAL packages."
65 doc ref/the-ecos-hardware-abstraction-layer.html
68 compile -library=libextras.a dummy.c
73 <PREFIX>/lib/extras.o: <PREFIX>/lib/libextras.a
74 $(CC) $(CFLAGS) -nostdlib -Wl,-r -Wl,--whole-archive -o $@ $<
78 cdl_component CYGPKG_HAL_COMMON {
79 display "Platform-independent HAL options"
82 A number of configuration options are common to most or all
83 HAL packages, for example options controlling how much state
84 should be saved during a context switch. The implementations
85 of these options will vary from architecture to architecture."
90 cdl_component CYGPKG_HAL_COMMON_INTERRUPTS {
91 display "HAL interrupt handling"
94 A number of configuration options related to interrupt
95 handling are common to most or all HAL packages, even though
96 the implementations will vary from architecture to
102 cdl_component CYGPKG_HAL_COMMON_CONTEXT {
103 display "HAL context switch support"
106 A number of configuration options related to thread contexts
107 are common to most or all HAL packages, even though the
108 implementations will vary from architecture to architecture."
110 cdl_option CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM {
111 display "Use minimum thread context"
112 parent CYGPKG_HAL_COMMON_CONTEXT
115 The thread context switch code can exploit the calling
116 conventions defined for a given architecture to reduce the
117 amount of state that has to be saved during a context
118 switch. Generally this improves performance and reduces
119 code size. However it can make source-level debugging more
124 cdl_component CYGPKG_HAL_CACHE_CONTROL {
125 display "Explicit control over cache behaviour"
129 These options let the default behaviour of the caches
130 be easily configurable."
132 cdl_component CYGSEM_HAL_ENABLE_DCACHE_ON_STARTUP {
133 display "Enable DATA cache on startup"
136 Enabling this option will cause the data cache to be enabled
137 as soon as practicable when eCos starts up. One would choose
138 to disable this if the data cache cannot safely be turned on,
139 such as a case where the cache(s) require additional platform
141 cdl_option CYGSEM_HAL_DCACHE_STARTUP_MODE {
142 display "DATA cache mode on startup"
144 legal_values { "COPYBACK" "WRITETHRU" }
145 default_value { "COPYBACK" }
147 This option controls the mode the cache will be set to
148 when enabled on startup."
152 cdl_option CYGSEM_HAL_ENABLE_ICACHE_ON_STARTUP {
153 display "Enable INSTRUCTION cache on startup"
156 Enabling this option will cause the instruction cache to be enabled
157 as soon as practicable when eCos starts up. One would choose
158 to disable this if the instruction cache cannot safely be turned on,
159 such as a case where the cache(s) require additional platform
164 cdl_component CYGPKG_HAL_DEBUG {
165 display "Source-level debugging support"
168 If the source level debugger gdb is to be used for debugging
169 application code then it may be necessary to configure in support
170 for this in the HAL."
175 cdl_component CYGPKG_HAL_ROM_MONITOR {
176 display "ROM monitor support"
180 Support for ROM monitors can be built in to your application.
181 It may also be relevant to build your application as a ROM monitor
182 itself. Such options are contained here if relevant for your chosen
183 platform. The options and ROM monitors available to choose are
188 cdl_interface CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT {
189 display "Target has virtual vector support"
194 cdl_interface CYGINT_HAL_VIRTUAL_VECTOR_COMM_BAUD_SUPPORT {
195 display "Target supports baud rate control via vectors"
198 Whether this target supports the __COMMCTL_GETBAUD
199 and __COMMCTL_SETBAUD virtual vector comm control operations."
202 cdl_component CYGSEM_HAL_VIRTUAL_VECTOR_SUPPORT {
203 display "Enable use of virtual vector calling interface"
204 active_if CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
207 Virtual vector support allows the HAL to let the ROM
208 monitor handle certain operations. The virtual vector table
209 defines a calling interface between applications running in
210 RAM and the ROM monitor."
211 compile hal_if.c hal_misc.c
214 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_INHERIT_CONSOLE {
215 display "Inherit console settings from ROM monitor"
216 active_if CYGSEM_HAL_USE_ROM_MONITOR
217 default_value { !CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_COMMS }
219 When this option is set, the application will inherit
220 the console as set up by the ROM monitor. This means
221 that the application will use whatever channel and
222 mangling style was used by the ROM monitor when
223 the application was launched."
226 cdl_option CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE {
227 display "Debug channel is configurable"
228 calculated { CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_COMMS }
230 This option is a configuration hint - it is enabled
231 when the HAL initialization code will make use
232 of the debug channel configuration option."
235 cdl_option CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE {
236 display "Console channel is configurable"
237 calculated { !CYGSEM_HAL_VIRTUAL_VECTOR_INHERIT_CONSOLE \
238 && !CYGDBG_HAL_DIAG_TO_DEBUG_CHAN }
240 This option is a configuration hint - it is enabled
241 when the HAL initialization code will make use
242 of the console channel configuration option."
246 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE {
247 display "Initialize whole of virtual vector table"
248 default_value { CYG_HAL_STARTUP != "RAM" || !CYGSEM_HAL_USE_ROM_MONITOR }
249 requires CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_RESET
250 requires CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DELAY_US
251 requires CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_CACHE
252 requires CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DATA
253 requires CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_COMMS
255 This option will cause the whole of the virtual
256 vector table to be initialized with dummy values on
257 startup. When this option is enabled, all the
258 options below must also be enabled - or the
259 table would be empty when the application
262 On targets where older ROM monitors without
263 virtual vector support may still be in use, it is
264 necessary for RAM applictions to initialize the
265 table (since all HAL diagnostics and debug IO
266 happens via the table)."
269 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DEFAULT {
270 display "Claim virtual vector table entries by default"
271 active_if !CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE
274 By default most virtual vectors will be claimed by
275 RAM startup configurations, meaning that the RAM
276 application will provide the services. The
277 exception is COMMS support (HAL
278 diagnostics/debugging IO) which is left in the
279 control of the ROM monitor.
281 The reasoning behind this is to get as much of the
282 code exercised during regular development so it
283 is known to be working the few times a new ROM
284 monitor or a ROM production configuration is used
285 - COMMS are excluded only by necessity in order to
286 avoid breaking an existing debugger connections
287 (there may be ways around this).
289 For production RAM configurations this option can
290 be switched off, causing the appliction to rely on
291 the ROM monitor for these services, thus
294 Individual vectors may also be left unclaimed,
295 controlled by the below options (meaning that the
296 associated service provided by the ROM monitor
300 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_RESET {
301 display "Claim reset virtual vectors"
302 default_value { CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE \
303 || CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DEFAULT }
305 This option will cause the reset and kill_by_reset
306 virtual vectors to be claimed."
309 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_VERSION {
310 display "Claim version virtual vectors"
311 default_value { CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE }
313 This option will cause the version
314 virtual vectors to be claimed."
317 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DELAY_US {
318 display "Claim delay_us virtual vector"
319 default_value { CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE \
320 || CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DEFAULT }
322 This option will cause the delay_us
323 virtual vector to be claimed."
326 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_CACHE {
327 display "Claim cache virtual vectors"
328 default_value { CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE \
329 || CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DEFAULT }
331 This option will cause the cache virtual vectors
335 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DATA {
336 display "Claim data virtual vectors"
337 default_value { CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE \
338 || CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DEFAULT }
340 This option will cause the data virtual vectors
341 to be claimed. At present there is only one, used
342 by the RedBoot ethernet driver to share diag output."
345 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_COMMS {
346 display "Claim comms virtual vectors"
347 default_value { CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE \
348 || CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS }
350 This option will cause the communication tables
351 that are part of the virtual vectors mechanism to
352 be claimed. Note that doing this may cause an
353 existing ROM monitor communication connection to
354 be closed. For this reason, the option is disabled
355 per default for normal application
359 cdl_option CYGSEM_HAL_VIRTUAL_VECTOR_DIAG {
360 display "Do diagnostic IO via virtual vector table"
363 All HAL IO happens via the virtual vector table / comm
364 tables when those tables are supported by the HAL.
366 If so desired, the low-level IO functions can
367 still be provided by the RAM application by
368 enabling the CLAIM_COMMS option."
372 cdl_option CYGBLD_BUILD_COMMON_GDB_STUBS {
373 display "Build common GDB stub ROM image"
375 parent CYGBLD_GLOBAL_OPTIONS
376 requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
379 Unless a target board has specific requirements to the
380 stub implementation, it can use a simple common stub.
381 This option, which gets enabled by platform HALs as
382 appropriate, controls the building of the common stub."
385 <PREFIX>/bin/gdb_module.img : <PACKAGE>/src/stubrom/stubrom.c <PREFIX>/lib/extras.o <PREFIX>/lib/libtarget.a <PREFIX>/lib/target.ld <PREFIX>/lib/vectors.o
386 @sh -c "mkdir -p src/stubrom $(dir $@)"
387 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o src/stubrom/gdb_module.o $<
388 @echo $@ ": \\" > $(notdir $@).deps
389 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
390 @tail -n +2 deps.tmp >> $(notdir $@).deps
391 @echo >> $(notdir $@).deps
393 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ src/stubrom/gdb_module.o
400 # Does platform need special I/O initializations?
401 cdl_interface CYGINT_HAL_PLF_IF_INIT {
402 display "Platform defined I/O channels."
404 Platforms which provide additional I/O channels can implement
405 this interface, indicating that the function plf_if_init()
409 # Does platform provide IDE I/O macros?
410 cdl_interface CYGINT_HAL_PLF_IF_IDE {
411 display "Platform IDE I/O support."
413 Platforms which provide IDE controllers can implement
414 this interface, indicating that IDE I/O macros are
417 cdl_option CYGPKG_HAL_GDB_FILEIO {
418 display "File I/O operations via GDB"
420 active_if CYGSEM_REDBOOT_BSP_SYSCALLS
421 requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
423 description "This option enables support for various file I/O
424 operations using the GDB remote protocol to communicate
425 with GDB. The operations are then performed on the
426 debugging host by proxy. These operations are only
427 currently available by using a system call interface
428 to RedBoot. This may change in the future."
432 puts $::cdl_header "/***** proc output start *****/"
433 puts $::cdl_header "#include <pkgconf/system.h>"
435 puts $::cdl_header "#include CYGBLD_HAL_TARGET_H"
436 puts $::cdl_header "#ifdef CYGBLD_HAL_VARIANT_H"
437 puts $::cdl_header "#include CYGBLD_HAL_VARIANT_H"
438 puts $::cdl_header "#endif"
439 puts $::cdl_header "#include CYGBLD_HAL_PLATFORM_H"
441 puts $::cdl_header "/****** proc output end ******/"
445 cdl_option CYGPKG_HAL_BUILD_COMPILER_TESTS {
446 display "Build Compiler sanity checking tests"
448 Enabling this option causes compiler tests to be built."
451 cdl_component CYGPKG_HAL_TESTS {
452 display "Common HAL tests"
455 calculated { "tests/context tests/basic"
456 . ((!CYGINT_HAL_TESTS_NO_CACHES) ? " tests/cache" : "")
457 . ((CYGPKG_HAL_BUILD_COMPILER_TESTS) ? " tests/cpp1 tests/vaargs" : "")
458 . ((!CYGVAR_KERNEL_COUNTERS_CLOCK) ? " tests/intr" : "") }
460 This option specifies the set of tests for the common HAL."
463 cdl_interface CYGINT_HAL_TESTS_NO_CACHES {
464 display "Interface for cache presence"
467 Some architectures and/or platforms do not have caches. By
468 implementing this interface, these can disable the various
469 cache-related tests."