OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [i386/] [pc/] [current/] [cdl/] [hal_i386_pc.cdl] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.