]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/arm/integrator/v2_0/cdl/hal_arm_integrator.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / integrator / v2_0 / cdl / hal_arm_integrator.cdl
1 # ====================================================================
2 #
3 #      hal_arm_integrator.cdl
4 #
5 #      INTEGRATOR board 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):      David A Rusling
44 # Original data:  gthomas
45 # Contributors:   Philippe Robin
46 # Date:           November 7, 2000
47 #
48 #####DESCRIPTIONEND####
49 #
50 # ====================================================================
51
52 cdl_package CYGPKG_HAL_ARM_INTEGRATOR {
53     display       "ARM INTEGRATOR evaluation board"
54     parent        CYGPKG_HAL_ARM
55     define_header hal_arm_integrator.h
56     include_dir   cyg/hal
57     hardware
58     description   "
59         The integrator HAL package provides the support needed to run
60         eCos on an ARM INTEGRATOR evaluation board."
61
62     compile       hal_diag.c integrator_misc.c 
63
64     implements    CYGINT_HAL_DEBUG_GDB_STUBS
65     implements    CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
66     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
67     implements    CYGINT_HAL_TESTS_NO_CACHES
68
69     define_proc {
70         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
71         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_integrator.h>"
72         puts $::cdl_header ""
73         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"INTEGRATOR\""
74         puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
75         puts $::cdl_header ""
76     }
77
78     cdl_component CYGPKG_HAL_ARM_INTEGRATOR_ARM7 {
79         display "ARM 7 specialization"
80         active_if  !CYGPKG_HAL_ARM_ARM9
81         calculated !CYGPKG_HAL_ARM_ARM9
82
83         implements    CYGINT_HAL_ARM_ARCH_ARM7
84         
85         define_proc {
86             puts $::cdl_header "#define HAL_PLATFORM_CPU    \"ARM 7TDMI\""
87         }
88     }
89
90     cdl_component CYGPKG_HAL_ARM_INTEGRATOR_ARM9 {
91         display "ARM 9 specialization"
92         active_if  CYGPKG_HAL_ARM_ARM9
93         calculated CYGPKG_HAL_ARM_ARM9
94         
95         requires    CYGPKG_HAL_ARM_ARM9_ARM966E
96         
97         define_proc {
98             puts $::cdl_header "#define HAL_PLATFORM_CPU    \"ARM 9\""
99         }
100         
101     }
102     
103     cdl_component CYG_HAL_STARTUP {
104         display       "Startup type"
105         flavor        data
106         legal_values  {"RAM" "ROM" "ROMRAM"}
107         default_value {"RAM"}
108         no_define
109         define -file system.h CYG_HAL_STARTUP
110         description   "
111             When targetting the INTEGRATOR eval board it is possible to build
112             the system for either RAM bootstrap or ROM bootstrap(s). Select
113             'ram' when building programs to load into RAM using onboard
114             debug software such as Angel or eCos GDB stubs.  Select 'rom'
115             when building a stand-alone application which will be put
116             into ROM."
117
118     }
119
120     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
121         display      "Default console channel."
122         flavor       data
123         calculated   0
124     }
125
126     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
127         display       "Diagnostic serial port baud rate"
128         flavor        data
129         legal_values  9600 19200 38400 115200
130         default_value 38400
131         description   "
132             This option selects the baud rate used for the diagnostic port.
133             Note: this should match the value chosen for the GDB port if the
134             diagnostic and GDB port are the same."
135     }
136
137     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
138         display       "GDB serial port baud rate"
139         flavor        data
140         legal_values  9600 19200 38400 115200
141         default_value 38400
142         description   "
143             This option controls the baud rate used for the GDB connection."
144     }
145
146     cdl_option CYGHWR_HAL_ARM_INTEGRATOR_DIAG_LEDS {
147         display          "Enable use of PPx LEDs"
148         default_value    1
149         description      "
150             Enabling this option causes eCos to flash the LEDs during
151             early board initialization. See vectors.S for
152             details. Before calling cyg_start, PP0 is switched on,
153             PP1-3 are switched off. The application code can use the
154             function hal_diag_led() to control the LEDs after this
155             point."
156    }
157
158     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
159         display      "Number of communication channels on the board"
160         flavor       data
161         calculated   2
162     }
163
164     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
165         display          "Debug serial port"
166         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
167         flavor           data
168         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
169         default_value    0
170         description      "
171             The INTEGRATOR board has two serial ports. This option
172             chooses which port will be used to connect to a host
173             running GDB."
174      }
175
176      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
177          display          "Diagnostic serial port"
178          active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
179          flavor data
180          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
181          default_value    CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
182          description      "
183             The INTEGRATOR board has two serial ports.  This option
184             chooses which port will be used for diagnostic output."
185      }
186
187     # Real-time clock/counter specifics
188     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
189         display       "Real-time clock constants"
190         flavor        none
191     
192         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
193             display       "Real-time clock numerator"
194             flavor        data
195             default_value 1000000000
196         }
197         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
198             display       "Real-time clock denominator"
199             flavor        data
200             default_value 100
201         }
202         cdl_option CYGNUM_HAL_RTC_PERIOD {
203             display       "Real-time clock period"
204             flavor        data
205            default_value 12500
206         }
207     }
208
209     cdl_component CYGBLD_GLOBAL_OPTIONS {
210         display "Global build options"
211         flavor  none
212         parent  CYGPKG_NONE
213         description   "
214             Global build options including control over
215             compiler flags, linker flags and choice of toolchain."
216
217
218         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
219             display "Global command prefix"
220             flavor  data
221             no_define
222             default_value { "arm-elf" }
223             description "
224                 This option specifies the command prefix used when
225                 invoking the build tools."
226         }
227
228         cdl_option CYGBLD_GLOBAL_CFLAGS {
229             display "Global compiler flags"
230             flavor  data
231             no_define
232             default_value { 
233                 CYGPKG_HAL_ARM_INTEGRATOR_ARM9 ? "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" :
234                  "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -fno-schedule-insns -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority"
235              }
236                  
237             description   "
238                 This option controls the global compiler flags which are used to
239                 compile all packages by default. Individual packages may define
240                 options which override these global flags."
241         }
242
243         cdl_option CYGBLD_GLOBAL_LDFLAGS {
244             display "Global linker flags"
245             flavor  data
246             no_define
247             default_value {
248                 CYGPKG_HAL_ARM_INTEGRATOR_ARM9 ? "-Wl,-Map,map -mcpu=arm9 -g -nostdlib -Wl,--gc-sections -Wl,-static" :
249                 "-Wl,-Map,map -mcpu=arm7tdmi -g -nostdlib -Wl,--gc-sections -Wl,-static" }
250             description   "
251                 This option controls the global linker flags. Individual
252                 packages may define options which override these global flags."
253         }
254
255         cdl_option CYGBLD_BUILD_GDB_STUBS {
256             display "Build GDB stub ROM image"
257             default_value 0
258             requires CYGBLD_BUILD_COMMON_GDB_STUBS
259             requires { CYG_HAL_STARTUP != "RAM" }
260             requires CYGSEM_HAL_ROM_MONITOR
261             requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
262             requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
263             requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
264             requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
265             requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
266             no_define
267             description "
268                 This option enables the building of the GDB stubs for the
269                 board. The address of the ELF headers in the image are
270                 adjusted to ensure loading at an address in memory used
271                 by the flash tool."
272
273             make -priority 320 {
274                 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
275                 @mv $< $(<:.img=.elf)
276                 $(OBJCOPY) --strip-debug --change-addresses=0xFC060000 $(<:.img=.elf) $<
277                 $(OBJCOPY) -O binary $(<:.img=.elf) $@
278             }
279         }
280
281         cdl_option CYGBLD_BUILD_FLASH_TOOL {
282             display "Build flash programming tool"
283             default_value 0
284             requires { CYG_HAL_STARTUP == "RAM" }
285             requires CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == 1
286             requires CYGPKG_LIBC
287             requires CYGPKG_KERNEL
288             no_define
289             description "This option enables the building of the flash programming tool for copying the GDB stubs into flash memory."
290             make -priority 320 {
291                 <PREFIX>/bin/prog_flash.img : <PACKAGE>/src/prog_flash.c
292                 @sh -c "mkdir -p src $(dir $@)"
293                 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o src/prog_flash.o $<
294                 @echo $@ ": \\" > $(notdir $@).deps
295                 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
296                 @tail -n +2 deps.tmp >> $(notdir $@).deps
297                 @echo >> $(notdir $@).deps
298                 @rm deps.tmp
299                 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ src/prog_flash.o
300             }
301         }
302
303         cdl_option CYGBLD_BUILD_FLASH_TOOL_BE {
304             display "Build flash programming tool for BE images on LE boards"
305             default_value 0
306             requires { CYG_HAL_STARTUP == "RAM" }
307             requires CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == 1
308             requires CYGPKG_LIBC
309             requires CYGPKG_KERNEL
310             no_define
311             description "This option enables the building of the flash
312                          programming tool for copying the GDB stubs
313                          into flash memory. The tool built by enabling
314                          this option must be used when programming BE
315                          images on LE boards."
316             make -priority 320 {
317                 <PREFIX>/bin/prog_flash_BE_image_LE_system.img : <PACKAGE>/src/prog_flash.c
318                 @sh -c "mkdir -p src $(dir $@)"
319                 $(CC) -DBE_IMAGE -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o src/prog_flash_be.o $<
320                 @echo $@ ": \\" > $(notdir $@).deps
321                 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
322                 @tail -n +2 deps.tmp >> $(notdir $@).deps
323                 @echo >> $(notdir $@).deps
324                 @rm deps.tmp
325                 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ src/prog_flash_be.o
326             }
327         }
328     }
329
330     cdl_component CYGHWR_MEMORY_LAYOUT {
331         display "Memory layout"
332         flavor data
333         no_define
334         calculated { CYG_HAL_STARTUP == "RAM"    ? "arm_integrator_ram" : \
335                      CYG_HAL_STARTUP == "ROMRAM" ? "arm_integrator_romram" : \
336                                                    "arm_integrator_rom" }
337
338         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
339             display "Memory layout linker script fragment"
340             flavor data
341             no_define
342             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
343             calculated { CYG_HAL_STARTUP == "RAM"    ? "<pkgconf/mlt_arm_integrator_ram.ldi>" : \
344                          CYG_HAL_STARTUP == "ROMRAM" ? "<pkgconf/mlt_arm_integrator_romram.ldi>" : \
345                                                        "<pkgconf/mlt_arm_integrator_rom.ldi>" }
346         }
347
348         cdl_option CYGHWR_MEMORY_LAYOUT_H {
349             display "Memory layout header file"
350             flavor data
351             no_define
352             define -file system.h CYGHWR_MEMORY_LAYOUT_H
353             calculated { CYG_HAL_STARTUP == "RAM"    ? "<pkgconf/mlt_arm_integrator_ram.h>" : \
354                          CYG_HAL_STARTUP == "ROMRAM" ? "<pkgconf/mlt_arm_integrator_romram.h>" : \
355                                                        "<pkgconf/mlt_arm_integrator_rom.h>" }
356         }
357     }
358
359
360     cdl_option CYGSEM_HAL_ROM_MONITOR {
361         display       "Behave as a ROM monitor"
362         flavor        bool
363         default_value 0
364         parent        CYGPKG_HAL_ROM_MONITOR
365         requires      { CYG_HAL_STARTUP != "RAM" }
366         description   "
367             Enable this option if this program is to be used as a ROM monitor,
368             i.e. applications will be loaded into RAM on the board, and this
369             ROM monitor may process exceptions or interrupts generated from the
370             application. This enables features such as utilizing a separate
371             interrupt stack when exceptions are generated."
372     }
373
374     cdl_component CYGPKG_CYGMON_HAL_OPTIONS {
375         display       "CygMon HAL options"
376         flavor        none
377         no_define
378         parent        CYGPKG_CYGMON
379         active_if     CYGPKG_CYGMON
380         description   "
381             This option also lists the target's requirements for a valid CygMon
382             configuration."
383
384         cdl_option CYGBLD_BUILD_CYGMON_BIN {
385             display       "Build CygMon ROM binary image"
386             active_if     CYGBLD_BUILD_CYGMON
387             default_value 1
388             no_define
389             description "This option enables the conversion of the CygMon ELF
390                          image to a binary image suitable for ROM programming."
391     
392             make -priority 325 {
393                 <PREFIX>/bin/cygmon.bin : <PREFIX>/bin/cygmon.elf
394                 $(OBJCOPY) --strip-debug --change-addresses=0xFC060000 $< $(@:.bin=.img) 
395                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
396                 $(OBJCOPY) -O binary $< $@
397             }
398         }
399     }
400
401     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
402          display       "Work with a ROM monitor"
403          flavor        booldata
404          legal_values  { "Generic" "GDB_stubs" }
405          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
406          parent        CYGPKG_HAL_ROM_MONITOR
407          requires      { CYG_HAL_STARTUP == "RAM" }
408          description   "
409              Support can be enabled for different varieties of ROM monitor.
410              This support changes various eCos semantics such as the encoding
411              of diagnostic output, or the overriding of hardware interrupt
412              vectors.
413              Firstly there is \"Generic\" support which prevents the HAL
414              from overriding the hardware vectors that it does not use, to
415              instead allow an installed ROM monitor to handle them. This is
416              the most basic support which is likely to be common to most
417              implementations of ROM monitor.
418              \"GDB_stubs\" provides support when GDB stubs are included in
419              the ROM monitor or boot ROM."
420      }
421
422     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
423         display       "Redboot HAL options"
424         flavor        none
425         no_define
426         parent        CYGPKG_REDBOOT
427         active_if     CYGPKG_REDBOOT
428         description   "
429             This option lists the target's requirements for a valid Redboot
430             configuration."
431     
432         requires      { !CYGPKG_REDBOOT_FLASH || (CYGBLD_REDBOOT_MIN_IMAGE_SIZE == 0x40000) }
433         requires      { !CYGOPT_REDBOOT_FIS_REDBOOT_BACKUP }
434
435         cdl_option CYGBLD_BUILD_REDBOOT_BIN_ROM {
436             display       "Build Redboot ROM startup ROM binary image"
437             active_if     { CYGBLD_BUILD_REDBOOT && CYG_HAL_STARTUP == "ROM" }
438             default_value 1
439             no_define
440             description "This option enables the conversion of the Redboot ELF
441                          image to S-Record and binary image suitable for ROM
442                          programming."
443     
444             make -priority 325 {
445                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
446                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img) 
447                 $(OBJCOPY) -O srec --gap-fill 0 $< $(@:.bin=.srec)
448                 $(OBJCOPY) -O binary $< $@
449             }
450         }
451
452         cdl_option CYGBLD_BUILD_REDBOOT_BIN_ROMRAM {
453             display       "Build Redboot ROMRAM startup ROM binary image"
454             active_if     { CYGBLD_BUILD_REDBOOT && CYG_HAL_STARTUP == "ROMRAM" }
455             default_value 1
456             no_define
457             description "This option enables the conversion of the Redboot ELF
458                          image to S-Record and binary images suitable for ROM
459                          programming."
460     
461             make -priority 325 {
462                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
463                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img) 
464                 $(OBJCOPY) -O srec --adjust-vma 0x24000000 --gap-fill 0 $< $(@:.bin=.srec)
465                 $(OBJCOPY) -O binary $< $@
466             }
467         }
468
469
470     }
471 }