]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/i386/pc/v2_0/cdl/hal_i386_pc.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / i386 / pc / v2_0 / cdl / hal_i386_pc.cdl
1 # ====================================================================
2 #
3 #      hal_i386_pc.cdl
4 #
5 #      PC/i386 target HAL package 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:  jskov
45 # Contributors:
46 # Date:           1999-11-01
47 #
48 #####DESCRIPTIONEND####
49 #
50 # ====================================================================
51
52 cdl_package CYGPKG_HAL_I386_PC {
53     display  "i386 PC Target"
54     parent        CYGPKG_HAL_I386
55     define_header hal_i386_pc.h
56     include_dir   cyg/hal
57     description   "
58            The i386 PC Target HAL package provides the 
59            support needed to run eCos binaries on an i386 PC."
60
61     compile       hal_diag.c plf_misc.c plf_stub.c
62
63     implements    CYGINT_HAL_DEBUG_GDB_STUBS
64     implements    CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
65     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
66     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_GUARANTEED
67
68     define_proc {
69         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_i386.h>"
70         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_i386_pc.h>"
71         puts $::cdl_header ""
72         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"I386\""
73         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"PC\""
74         puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
75         puts $::cdl_header "#include <pkgconf/hal_i386_pcmb.h>"
76         puts $::cdl_header ""
77     }
78
79     cdl_component CYGPKG_HAL_I386_PC_MEMSIZE {
80         display       "How to discover the size of available RAM."
81         flavor        data
82         legal_values  {"BIOS" "HARDCODE"}
83         default_value {"BIOS"}
84         description   "It is possible for the HAL to discover the 
85                        size of RAM In several ways. Currently this
86                         can be done by querying the BIOS or by 
87                         hardcoding the values into the executable."
88  
89         cdl_option CYGNUM_HAL_I386_PC_MEMSIZE_BASE {
90             display       "Amount of Base RAM available."
91             flavor        data
92             default_value 0x000F0000
93             active_if     { CYGPKG_HAL_I386_PC_MEMSIZE == "HARDCODE" }
94         }
95  
96         cdl_option CYGNUM_HAL_I386_PC_MEMSIZE_EXTENDED {
97             display       "Amount of Extended RAM available."
98             flavor        data
99             default_value 0x00100000
100             active_if     { CYGPKG_HAL_I386_PC_MEMSIZE == "HARDCODE" }
101         }
102     }
103
104     cdl_component CYG_HAL_STARTUP {
105         display       "Startup type"
106         flavor        data
107         legal_values  {"RAM" "FLOPPY" "ROM" "GRUB"}
108         default_value {"RAM"}
109         no_define
110         define -file system.h CYG_HAL_STARTUP
111         description   "
112             It is possible to configure eCos for the PC target to build for:
113             RAM startup (generally when being run under an existing
114             Monitor program like RedBoot); FLOPPY startup (for writing
115             to a floppy disk, which can then be used for booting
116             on PCs with a standard BIOS), GRUB startup (for being booted
117             by the GRUB bootloader) ROM startup (for writing
118             straight to a boot ROM/Flash). ROM startup is experimental
119             at this time."
120     }
121
122     cdl_option CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK {
123         display    "Enable initial breakpoint"
124         parent     CYGPKG_HAL_DEBUG
125         active_if  CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
126         default_value { !CYGPKG_REDBOOT }
127         description "
128                 This option causes an application that has GDB stubs built in
129                 to take a breakpoint immediately before calling cyg_start().
130                 This gives the developer a chance to set any breakpoints or
131                 inspect the system state before it proceeds."
132     }
133
134     cdl_option CYGBLD_BUILD_I386_ROMBOOT {
135         display       "Build ROM bootstrap code"
136         calculated    { CYG_HAL_STARTUP == "ROM" }
137
138         make {
139             <PREFIX>/lib/romboot.ld: <PACKAGE>/src/romboot.ld
140             cp $< $@
141         }
142         
143         make {
144             <PREFIX>/bin/romboot.elf : <PACKAGE>/src/romboot.S
145             @sh -c "mkdir -p $(dir $@)"
146             $(CC) -Wp,-MD,romboot.tmp $(INCLUDE_PATH) -nostdlib -Wl,-static -T$(PREFIX)/lib/romboot.ld -o $@ $<
147             @echo $@ ": \\" > $(notdir $@).deps
148             @tail -n +2 romboot.tmp >> $(notdir $@).deps
149             @echo >> $(notdir $@).deps
150             @rm romboot.tmp
151         }
152     }
153
154     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
155         display       "Diagnostic serial port baud rate"
156         flavor        data
157         legal_values  9600 19200 38400 57600 115200
158         default_value 38400
159         description   "
160             This option selects the baud rate used for the diagnostic port.
161             Note: this should match the value chosen for the GDB port if the
162             diagnostic and GDB port are the same."
163     }
164
165     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
166         display       "GDB serial port baud rate"
167         flavor        data
168         legal_values  9600 19200 38400 57600 115200
169         default_value 38400
170         description   "
171             This option controls the baud rate used for the GDB connection."
172     }
173
174     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
175         display         "Number of communication channels on the board"
176         flavor          data
177         legal_values    1 to 3
178         default_value   { CYGSEM_HAL_I386_PC_DIAG_SCREEN ? 3 : 2 }
179         description     "
180             This define the number of serial ports that will be used by the HAL.
181             Ports 0 and 1 equate to COM1 and COM2 and port 2 is the PC screen and
182             keyboard."
183     }
184  
185     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
186         display          "Debug serial port"
187         flavor data
188         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
189         default_value    0
190         description      "
191             On PCs with two serial ports, this option
192             chooses which port will be used to connect to a host
193             running GDB."
194      }
195
196      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
197           display       "Default console channel."
198           flavor        data
199           legal_values  0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
200           default_value 0
201      }
202  
203      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
204          display          "Diagnostic serial port"
205          flavor data
206          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
207          default_value    CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
208          description      "
209             On PCs with two serial ports, this option
210             chooses which port will be used for diagnostic output.
211             Selecting port 2 will cause the PC screen to be used."
212      }
213
214      cdl_option CYGSEM_HAL_I386_PC_DIAG_SCREEN {
215          display       "Output to PC screen"
216          flavor        bool
217          default_value 1
218          implements CYGINT_HAL_I386_PCMB_SCREEN_SUPPORT
219          description "This option enables use of the PC screen and keyboard as a
220                      third virtual serial device."
221      }
222      
223     cdl_component CYGBLD_GLOBAL_OPTIONS {
224         display "Global build options"
225         flavor  none
226         parent  CYGPKG_NONE
227         description   "
228             Global build options including control over
229             compiler flags, linker flags and choice of toolchain."
230
231
232         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
233             display "Global command prefix"
234             flavor  data
235             no_define
236             default_value { "i386-elf" }
237             description "
238                 This option specifies the command prefix used when
239                 invoking the build tools. If your host operating system
240                 is Linux you can set this to empty to use your native tools.
241                 If so, your native gcc must be gcc-2.95.2 or later, and
242                 \"ld -v\" must report a version more recent than 2.9.1."
243         }
244
245         cdl_option CYGBLD_GLOBAL_CFLAGS {
246             display "Global compiler flags"
247             flavor  data
248             no_define
249             default_value { "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
250             description   "
251                 This option controls the global compiler flags which
252                 are used to compile all packages by
253                 default. Individual packages may define
254                 options which override these global flags."
255         }
256
257         cdl_option CYGBLD_GLOBAL_LDFLAGS {
258             display "Global linker flags"
259             flavor  data
260             no_define
261             default_value { "-g -nostdlib -Wl,--gc-sections -Wl,-static" }
262             description   "
263                 This option controls the global linker flags. Individual
264                 packages may define options which override these global flags."
265         }
266
267         cdl_option CYGBLD_BUILD_GDB_STUBS {
268             display "Build GDB stub loader image"
269             default_value 0
270             requires { CYG_HAL_STARTUP == "FLOPPY" || CYG_HAL_STARTUP == "GRUB" }
271             requires CYGSEM_HAL_ROM_MONITOR
272             requires CYGBLD_BUILD_COMMON_GDB_STUBS
273             requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
274             requires ! CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
275             requires ! CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT
276             requires ! CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
277             requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
278             requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
279             no_define
280             description "
281                 This option enables the building of the GDB stubs for the
282                 board. The common HAL controls takes care of most of the
283                 build process, but the final conversion from ELF image to
284                 binary data is handled by the platform CDL, allowing
285                 relocation of the data if necessary."
286
287             make -priority 320 {
288                 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
289                 $(OBJCOPY) -O binary $< $@
290             }
291         }
292     }
293
294      cdl_option CYGHWR_HAL_I386_PC_LOAD_HIGH {
295          display       "Load into higher memory (2MB)"
296          flavor        bool
297          default_value 0
298          requires { CYG_HAL_STARTUP == "RAM" || CYG_HAL_STARTUP == "GRUB" }
299
300          no_define
301          description "This option enables building RAM applications
302                       which have a start address outside of the area
303                       used by redboot_GRUB."
304      }
305      
306     cdl_component CYGHWR_MEMORY_LAYOUT {
307         display "Memory layout"
308         flavor data
309         no_define
310         calculated { CYG_HAL_STARTUP == "RAM"  ?  \
311                          (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
312                                                  "i386_pc_ram_hi" : \
313                                                  "i386_pc_ram") : \
314                      CYG_HAL_STARTUP == "ROM"  ? "i386_pc_rom" : \
315                      CYG_HAL_STARTUP == "GRUB" ? \
316                          (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
317                                                  "i386_pc_grub_hi" : \
318                                                  "i386_pc_grub") : \
319                                                  "i386_pc_floppy" }
320
321         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
322             display "Memory layout linker script fragment"
323             flavor data
324             no_define
325             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
326             calculated { CYG_HAL_STARTUP == "RAM"  ? \
327                              (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
328                                                      "<pkgconf/mlt_i386_pc_ram_hi.ldi>" : \
329                                                      "<pkgconf/mlt_i386_pc_ram.ldi>") : \
330                          CYG_HAL_STARTUP == "ROM"  ? "<pkgconf/mlt_i386_pc_rom.ldi>" : \
331                          CYG_HAL_STARTUP == "GRUB" ? \
332                              (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
333                                                      "<pkgconf/mlt_i386_pc_grub_hi.ldi>" : \
334                                                      "<pkgconf/mlt_i386_pc_grub.ldi>") : \
335                                                      "<pkgconf/mlt_i386_pc_floppy.ldi>" }
336         }
337
338         cdl_option CYGHWR_MEMORY_LAYOUT_H {
339             display "Memory layout header file"
340             flavor data
341             no_define
342             define -file system.h CYGHWR_MEMORY_LAYOUT_H
343             calculated { CYG_HAL_STARTUP == "RAM"  ? \
344                              (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
345                                                      "<pkgconf/mlt_i386_pc_ram_hi.h>" : \
346                                                      "<pkgconf/mlt_i386_pc_ram.h>") : \
347                          CYG_HAL_STARTUP == "ROM"  ? "<pkgconf/mlt_i386_pc_rom.h>" : \
348                          CYG_HAL_STARTUP == "GRUB" ? \
349                              (CYGHWR_HAL_I386_PC_LOAD_HIGH ? \
350                                                      "<pkgconf/mlt_i386_pc_grub_hi.h>" : \
351                                                      "<pkgconf/mlt_i386_pc_grub.h>") : \
352                                                        "<pkgconf/mlt_i386_pc_floppy.h>" }
353         }
354     }
355
356     cdl_option CYGSEM_HAL_ROM_MONITOR {
357         display       "Behave as a ROM monitor"
358         flavor        bool
359         default_value 0
360         
361         parent        CYGPKG_HAL_ROM_MONITOR
362         requires      { CYG_HAL_STARTUP == "FLOPPY" || CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "GRUB" }
363         requires      { !CYGHWR_HAL_I386_FPU_SWITCH_LAZY }
364         description   "
365             Enable this option if this program is to be used as a ROM monitor,
366             i.e. applications will be loaded into RAM on the board, and this
367             ROM monitor may process exceptions or interrupts generated from the
368             application. This enables features such as utilizing a separate
369             interrupt stack when exceptions are generated."
370     }
371
372     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
373          display       "Work with a ROM monitor"
374          flavor        booldata
375          legal_values  { "Generic" "GDB_stubs" }
376          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
377          parent        CYGPKG_HAL_ROM_MONITOR
378          requires      { CYG_HAL_STARTUP == "RAM" }
379          description   "
380              Support can be enabled for different varieties of ROM monitor.
381              This support changes various eCos semantics such as the encoding
382              of diagnostic output, or the overriding of hardware interrupt
383              vectors.
384              Firstly there is \"Generic\" support which prevents the HAL
385              from overriding the hardware vectors that it does not use, to
386              instead allow an installed ROM monitor to handle them. This is
387              the most basic support which is likely to be common to most
388              implementations of ROM monitor.
389              \"GDB_stubs\" provides support when GDB stubs are included in
390              the ROM monitor or boot ROM."
391      }
392
393     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
394         display       "Redboot HAL options"
395         flavor        none
396         no_define
397         parent        CYGPKG_REDBOOT
398         active_if     CYGPKG_REDBOOT
399         description   "
400             This option lists the target's requirements for a valid Redboot
401             configuration."
402     
403         cdl_component CYGBLD_BUILD_REDBOOT_BIN {
404             display       "Build RedBoot binary image"
405             no_define
406             default_value 1
407
408             cdl_option CYGBLD_BUILD_REDBOOT_BIN_FLOPPY {
409                 display       "Build Redboot FLOPPY binary image"
410                 active_if     CYGBLD_BUILD_REDBOOT
411                 active_if     { CYG_HAL_STARTUP == "FLOPPY" }
412                 calculated    1
413                 no_define
414                 description "This option enables the conversion of the Redboot 
415                              ELF image to a binary image suitable for
416                              copying to a floppy disk."
417         
418                 make -priority 325 {
419                     <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
420                     $(OBJCOPY) -O binary $< $@
421                 }
422             }
423     
424             cdl_option CYGBLD_BUILD_REDBOOT_BIN_ROM {
425                 display       "Build Redboot ROM binary image"
426                 active_if     CYGBLD_BUILD_REDBOOT
427                 active_if     { CYG_HAL_STARTUP == "ROM" }
428                 calculated    1
429                 no_define
430                 description "This option enables the conversion of the Redboot
431                              ELF image to a binary image suitable for ROM
432                              programming."
433                 
434                 make -priority 325 {
435                     <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
436                     $(OBJCOPY) -O binary $< $(@:.bin=.img)
437                     $(OBJCOPY) -O binary $(PREFIX)/bin/romboot.elf $(PREFIX)/bin/romboot.img
438                     dd if=/dev/zero of=$@ bs=1024 count=64 conv=sync
439                     dd if=$(@:.bin=.img) of=$@ bs=512 conv=notrunc,sync
440                     dd if=$(PREFIX)/bin/romboot.img of=$@ bs=256 count=1 seek=255 conv=notrunc
441                 }
442             }
443         }            
444     }     
445 }
446