]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/pid/v2_0/cdl/hal_arm_pid.cdl
TX51 pre-release
[karo-tx-redboot.git] / packages / hal / arm / pid / v2_0 / cdl / hal_arm_pid.cdl
1 # ====================================================================
2 #
3 #      hal_arm_pid.cdl
4 #
5 #      PID 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):      bartv
44 # Original data:  gthomas
45 # Contributors:
46 # Date:           1999-06-13
47 #
48 #####DESCRIPTIONEND####
49 #
50 # ====================================================================
51
52 cdl_package CYGPKG_HAL_ARM_PID {
53     display       "ARM PID evaluation board"
54     parent        CYGPKG_HAL_ARM
55     define_header hal_arm_pid.h
56     include_dir   cyg/hal
57     hardware
58     description   "
59         The pid HAL package provides the support needed to run
60         eCos on an ARM PID evaluation board."
61
62     compile       hal_diag.c pid_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_ARM_THUMB_ARCH
68     implements    CYGINT_HAL_ARM_BIGENDIAN
69     implements    CYGINT_HAL_ARM_ARCH_ARM7
70     implements    CYGINT_HAL_ARM_ARCH_ARM9
71     implements    CYGINT_HAL_TESTS_NO_CACHES
72
73     define_proc {
74         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
75         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_pid.h>"
76         puts $::cdl_header ""
77         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"ARM 7TDMI\""
78         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"PID\""
79         puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
80         puts $::cdl_header ""
81
82         puts $::cdl_header "#define CYGPRI_KERNEL_TESTS_DHRYSTONE_PASSES 100000"
83     }
84
85
86     cdl_component CYG_HAL_STARTUP {
87         display       "Startup type"
88         flavor        data
89         legal_values  {"RAM" "ROM"}
90         default_value {"RAM"}
91         no_define
92         define -file system.h CYG_HAL_STARTUP
93         description   "
94             When targetting the PID eval board it is possible to build
95             the system for either RAM bootstrap or ROM bootstrap(s). Select
96             'ram' when building programs to load into RAM using onboard
97             debug software such as Angel or eCos GDB stubs.  Select 'rom'
98             when building a stand-alone application which will be put
99             into ROM."
100
101     }
102
103     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
104         display       "Diagnostic serial port baud rate"
105         flavor        data
106         legal_values  9600 19200 38400 115200
107         default_value 38400
108         description   "
109             This option selects the baud rate used for the diagnostic port.
110             Note: this should match the value chosen for the GDB port if the
111             diagnostic and GDB port are the same."
112     }
113
114     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
115         display       "GDB serial port baud rate"
116         flavor        data
117         legal_values  9600 19200 38400 115200
118         default_value 38400
119         description   "
120             This option controls the baud rate used for the GDB connection."
121     }
122
123     cdl_option CYGSEM_HAL_ARM_PID_ANGEL_BOOT {
124         display          "Support startup from Angel"
125         default_value    0
126         description      "
127             The Angel monitor can be used for some simple initial bootstrap
128             operations.  However, since Angel starts applications in user
129             mode, the eCos startup code must jump through certain hoops
130             to get started."
131     }
132
133     cdl_option CYGHWR_HAL_ARM_PID_DIAG_LEDS {
134         display          "Enable use of PPx LEDs"
135         default_value    0
136         description      "
137             The PID board has four LEDs labelled PP0-PP3. These can be
138             controlled by eCos if jumpers 9-16 on LK11 are
139             shorted. Note that this prevents the parallel port from
140             being used. See the PID board manual for details.
141             
142             Enabling this option causes eCos to flash the LEDs during
143             early board initialization. See vectors.S for
144             details. Before calling cyg_start, PP0 is switched on,
145             PP1-3 are switched off. The application code can use the
146             function hal_diag_led() to control the LEDs after this
147             point."
148    }
149
150
151     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
152         display      "Default console channel."
153         flavor       data
154         calculated   0
155     }
156
157     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
158         display      "Number of communication channels on the board"
159         flavor       data
160         calculated   2
161     }
162  
163     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
164         display          "Debug serial port"
165         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
166         flavor data
167         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
168         default_value    0
169         description      "
170             The PID board has two serial ports. This option
171             chooses which port will be used to connect to a host
172             running GDB."
173      }
174  
175      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
176          display          "Diagnostic serial port"
177          active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
178          flavor data
179          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
180          default_value    CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
181          description      "
182             The PID board has two serial ports.  This option
183             chooses which port will be used for diagnostic output."
184      }
185
186     # Real-time clock/counter specifics
187     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
188         display       "Real-time clock constants"
189         flavor        none
190     
191         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
192             display       "Real-time clock numerator"
193             flavor        data
194             default_value 1000000000
195         }
196         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
197             display       "Real-time clock denominator"
198             flavor        data
199             default_value 100
200         }
201         cdl_option CYGNUM_HAL_RTC_PERIOD {
202             display       "Real-time clock period"
203             flavor        data
204            default_value 12500
205         }
206     }
207
208     cdl_component CYGBLD_GLOBAL_OPTIONS {
209         display "Global build options"
210         flavor  none
211         parent  CYGPKG_NONE
212         description   "
213             Global build options including control over
214             compiler flags, linker flags and choice of toolchain."
215
216
217         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
218             display "Global command prefix"
219             flavor  data
220             no_define
221             default_value { "arm-elf" }
222             description "
223                 This option specifies the command prefix used when
224                 invoking the build tools."
225         }
226
227         cdl_option CYGBLD_GLOBAL_CFLAGS {
228             display "Global compiler flags"
229             flavor  data
230             no_define
231             default_value { (CYGHWR_THUMB ? "-mthumb " : ((CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") ? "-mcpu=arm9 " : "-mcpu=arm7tdmi ")) .
232                             (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") .
233                             (CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian " : "") .
234                             "-Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
235             description   "
236                 This option controls the global compiler flags which
237                 are used to compile all packages by default.
238                 Individual packages may define options which override
239                 these global flags."
240         }
241
242         cdl_option CYGBLD_GLOBAL_LDFLAGS {
243             display "Global linker flags"
244             flavor  data
245             no_define
246             default_value { (CYGHWR_THUMB ? "-mthumb " : ((CYGHWR_HAL_ARM_CPU_FAMILY == "ARM9") ? "-mcpu=arm9 " : "-mcpu=arm7tdmi ")) .
247                             (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") .
248                             (CYGHWR_HAL_ARM_BIGENDIAN ? "-mbig-endian " : "") .
249                             "-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 == "ROM" }
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_pid_ram" : \
335                                                 "arm_pid_rom" }
336
337         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
338             display "Memory layout linker script fragment"
339             flavor data
340             no_define
341             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
342             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_pid_ram.ldi>" : \
343                                                     "<pkgconf/mlt_arm_pid_rom.ldi>" }
344         }
345
346         cdl_option CYGHWR_MEMORY_LAYOUT_H {
347             display "Memory layout header file"
348             flavor data
349             no_define
350             define -file system.h CYGHWR_MEMORY_LAYOUT_H
351             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_pid_ram.h>" : \
352                                                     "<pkgconf/mlt_arm_pid_rom.h>" }
353         }
354     }
355
356
357     cdl_option CYGSEM_HAL_ROM_MONITOR {
358         display       "Behave as a ROM monitor"
359         flavor        bool
360         default_value 0
361         parent        CYGPKG_HAL_ROM_MONITOR
362         requires      { CYG_HAL_STARTUP == "ROM" }
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_component CYGPKG_CYGMON_HAL_OPTIONS {
372         display       "CygMon HAL options"
373         flavor        none
374         no_define
375         parent        CYGPKG_CYGMON
376         active_if     CYGPKG_CYGMON
377         description   "
378             This option also lists the target's requirements for a valid CygMon
379             configuration."
380
381
382         cdl_option CYGBLD_BUILD_CYGMON_BIN {
383             display       "Build CygMon ROM binary image"
384             active_if     CYGBLD_BUILD_CYGMON
385             default_value 1
386             no_define
387             description "This option enables the conversion of the CygMon ELF
388                          image to a binary image suitable for ROM programming."
389     
390             make -priority 325 {
391                 <PREFIX>/bin/cygmon.bin : <PREFIX>/bin/cygmon.elf
392                 $(OBJCOPY) --strip-debug --change-addresses=0xFC060000 $< $(@:.bin=.img) 
393                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
394                 $(OBJCOPY) -O binary $< $@
395             }
396         }
397     }
398
399     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
400          display       "Work with a ROM monitor"
401          flavor        booldata
402          legal_values  { "Generic" "GDB_stubs" }
403          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
404          parent        CYGPKG_HAL_ROM_MONITOR
405          requires      { CYG_HAL_STARTUP == "RAM" }
406          description   "
407              Support can be enabled for different varieties of ROM monitor.
408              This support changes various eCos semantics such as the encoding
409              of diagnostic output, or the overriding of hardware interrupt
410              vectors.
411              Firstly there is \"Generic\" support which prevents the HAL
412              from overriding the hardware vectors that it does not use, to
413              instead allow an installed ROM monitor to handle them. This is
414              the most basic support which is likely to be common to most
415              implementations of ROM monitor.
416              \"GDB_stubs\" provides support when GDB stubs are included in
417              the ROM monitor or boot ROM."
418      }
419
420     # custom rule to create a shell script to execute SID
421     make {
422         <PREFIX>/runsid : <PREFIX>/include/pkgconf/hal_arm_pid.h
423         @echo "arm-elf-sid CYGTST_SID_FLAGS \$$@" > $(notdir $@).tmp
424         $(CC) -E -P -c -xc -undef -imacros $< -o $@ $(notdir $@).tmp
425         @rm $(notdir $@).tmp
426     }
427
428     cdl_option CYGTST_SID_FLAGS {
429         display "SID execution flags"
430         flavor data
431         default_value { CYGHWR_HAL_ARM_BIGENDIAN ? "--board=pid7t -EB" : "--board=pid7t -EL" }
432     }
433
434     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
435         display       "Redboot HAL options"
436         flavor        none
437         no_define
438         parent        CYGPKG_REDBOOT
439         active_if     CYGPKG_REDBOOT
440         description   "
441             This option lists the target's requirements for a valid Redboot
442             configuration."
443
444         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
445             display       "Build Redboot ROM binary image"
446             active_if     CYGBLD_BUILD_REDBOOT
447             default_value 1
448             no_define
449             description "This option enables the conversion of the Redboot ELF
450                          image to a binary image suitable for ROM programming."
451     
452             make -priority 325 {
453                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
454                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img) 
455                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
456                 $(OBJCOPY) -O binary $< $@
457             }
458         }
459     }
460 }