]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/gps4020/v2_0/cdl/hal_arm_gps4020.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / gps4020 / v2_0 / cdl / hal_arm_gps4020.cdl
1 # ====================================================================
2 #
3 #      hal_arm_gps4020.cdl
4 #
5 #      GPS4020 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 ## Copyright (C) 2003 Gary Thomas
13 ##
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.
17 ##
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
21 ## for more details.
22 ##
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.
26 ##
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.
33 ##
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.
36 ##
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####
43 #
44 # Author(s):      bartv
45 # Original data:  gthomas
46 # Contributors:
47 # Date:           1999-06-13
48 #
49 #####DESCRIPTIONEND####
50 #
51 # ====================================================================
52
53 cdl_package CYGPKG_HAL_ARM_GPS4020 {
54     display       "GPS4020 evaluation board"
55     parent        CYGPKG_HAL_ARM
56     define_header hal_arm_gps4020.h
57     include_dir   cyg/hal
58     hardware
59     description   "
60         The gps4020 HAL package provides the support needed to run
61         eCos on a ARM GPS4020-1 eval board."
62
63     compile       hal_diag.c gps4020_misc.c
64
65     implements    CYGINT_HAL_DEBUG_GDB_STUBS
66     implements    CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
67     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
68     implements    CYGINT_HAL_ARM_ARCH_ARM7
69     implements    CYGINT_HAL_TESTS_NO_CACHES
70
71     define_proc {
72         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
73         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_gps4020.h>"
74         puts $::cdl_header "#define CYGPRI_KERNEL_TESTS_DHRYSTONE_PASSES 100000"
75         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"ARM7TDMI\""
76         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"GPS-4020\""
77         puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
78     }
79
80     cdl_component CYG_HAL_STARTUP {
81         display       "Startup type"
82         flavor        data
83         default_value {"RAM"}
84         legal_values  {"RAM" "ROM"}
85         no_define
86         define -file system.h CYG_HAL_STARTUP
87         description   "
88             When targetting the GPS4020-1 eval board it is possible to build
89             the system for either RAM bootstrap or ROM bootstrap(s). Select
90             'ram' when building programs to load into RAM using onboard
91             debug software such as Angel or eCos GDB stubs.  Select 'rom'
92             when building a stand-alone application which will be put
93             into ROM."
94     }
95
96     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
97         display      "Number of communication channels on the board"
98         flavor       data
99         calculated   1
100     }
101  
102     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
103         display          "Debug serial port"
104         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
105         flavor data
106         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
107         default_value    0
108         description      "
109             The GPS4020 board has only one serial port. This option
110             chooses which port will be used to connect to a host
111             running GDB."
112      }
113  
114      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
115          display          "Diagnostic serial port"
116          active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
117          flavor data
118          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
119          default_value    0
120          description      "
121             The GPS4020 board has only one serial port.  This option
122             chooses which port will be used for diagnostic output."
123      }
124
125     # Real-time clock/counter specifics
126     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
127         display       "Real-time clock constants"
128         flavor        none
129     
130         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
131             display       "Real-time clock numerator"
132             flavor        data
133             default_value 1000000000
134         }
135         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
136             display       "Real-time clock denominator"
137             flavor        data
138             default_value 100
139         }
140         cdl_option CYGNUM_HAL_RTC_PERIOD {
141             display       "Real-time clock period"
142             flavor        data
143             default_value ((CYGNUM_HAL_RTC_NUMERATOR/1000)/CYGNUM_HAL_RTC_DENOMINATOR)
144         }
145     }
146
147     cdl_component CYGBLD_GLOBAL_OPTIONS {
148         display "Global build options"
149         flavor  none
150         parent  CYGPKG_NONE
151         description   "
152             Global build options including control over
153             compiler flags, linker flags and choice of toolchain."
154
155
156         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
157             display "Global command prefix"
158             flavor  data
159             no_define
160             default_value { "arm-elf" }
161             description "
162                 This option specifies the command prefix used when
163                 invoking the build tools."
164         }
165
166         cdl_option CYGBLD_GLOBAL_CFLAGS {
167             display "Global compiler flags"
168             flavor  data
169             no_define
170             default_value { "-mcpu=arm7tdmi -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
171             description   "
172                 This option controls the global compiler flags which are used to
173                 compile all packages by default. Individual packages may define
174                 options which override these global flags."
175         }
176
177         cdl_option CYGBLD_GLOBAL_LDFLAGS {
178             display "Global linker flags"
179             flavor  data
180             no_define
181             default_value { "-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib" }
182             description   "
183                 This option controls the global linker flags. Individual
184                 packages may define options which override these global flags."
185         }
186
187         cdl_option CYGBLD_BUILD_GDB_STUBS {
188             display "Build GDB stub ROM image"
189             default_value 0
190             requires { CYG_HAL_STARTUP == "ROM" }
191             requires CYGSEM_HAL_ROM_MONITOR
192             requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
193             requires ! CYGBLD_BUILD_COMMON_GDB_STUBS
194             requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
195             requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
196             requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
197             requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
198             no_define
199             description "
200                 This option enables the building of the GDB stubs for the
201                 board. This is a bit convoluted as it involves prepending
202                 the image with a special header used by the GPS4020 firmware
203                 to keep track of multiple ROM images. This header includes
204                 a checksum making it necessary to build twice."
205
206             make -priority 320 {
207                 <PREFIX>/bin/gdb_module.bin : <PACKAGE>/src/gdb_module.c
208                 @sh -c "mkdir -p src $(dir $@)"
209                 # First build version with no checksum.
210                 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o src/gdb_module_ncs.o $<
211                 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o src/gdb_module_ncs.tmp src/gdb_module_ncs.o
212                 $(OBJCOPY) --strip-debug --change-addresses=0xFBFF4000 src/gdb_module_ncs.tmp src/gdb_module_ncs.img
213                 $(OBJCOPY) -O binary src/gdb_module_ncs.img src/gdb_module_ncs.bin
214                 @rm src/gdb_module_ncs.tmp src/gdb_module_ncs.img
215                 # Prepare dependency file
216                 @echo $@ ": \\" > $(notdir $@).deps
217                 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
218                 @tail -n +2 deps.tmp >> $(notdir $@).deps
219                 @echo >> $(notdir $@).deps
220                 @rm deps.tmp
221                 # Then build version with checksum from previously built image.
222                 @cp $(dir $<)flash_cksum.tcl src/
223                 $(CC) -c -DCHECKSUM=`src/flash_cksum.tcl src/gdb_module_ncs.bin` $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -o src/gdb_module.o $<
224                 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o src/gdb_module.tmp src/gdb_module.o
225                 $(OBJCOPY) --strip-debug --change-addresses=0xFBFF4000 src/gdb_module.tmp $(@:.bin=.img)
226                 $(OBJCOPY) -O binary $(@:.bin=.img) src/gdb_module.bin
227                 uuencode src/gdb_module.bin gdb_module.bin | tr '`' ' ' > $(@:.bin=.img.UU)
228                 @rm src/gdb_module.tmp src/gdb_module_ncs.bin
229                 @mv src/gdb_module.bin $@
230             }
231         }
232     }
233
234     cdl_option CYGSEM_HAL_ROM_MONITOR {
235         display       "Behave as a ROM monitor"
236         flavor        bool
237         default_value 0
238         parent        CYGPKG_HAL_ROM_MONITOR
239         requires      { CYG_HAL_STARTUP == "ROM" }
240         description   "
241             Enable this option if this program is to be used as a ROM monitor,
242             i.e. applications will be loaded into RAM on the board, and this
243             ROM monitor may process exceptions or interrupts generated from the
244             application. This enables features such as utilizing a separate
245             interrupt stack when exceptions are generated."
246     }
247
248     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
249          display       "Work with a ROM monitor"
250          flavor        booldata
251          legal_values  { "Generic" "GDB_stubs" }
252          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
253          parent        CYGPKG_HAL_ROM_MONITOR
254          requires      { CYG_HAL_STARTUP == "RAM" }
255          description   "
256              Support can be enabled for different varieties of ROM monitor.
257              This support changes various eCos semantics such as the encoding
258              of diagnostic output, or the overriding of hardware interrupt
259              vectors.
260              Firstly there is \"Generic\" support which prevents the HAL
261              from overriding the hardware vectors that it does not use, to
262              instead allow an installed ROM monitor to handle them. This is
263              the most basic support which is likely to be common to most
264              implementations of ROM monitor.
265              \"GDB_stubs\" provides support when GDB stubs are included in
266              the ROM monitor or boot ROM."
267      }
268
269     cdl_component CYGHWR_MEMORY_LAYOUT {
270         display "Memory layout"
271         flavor data
272         no_define
273         calculated { CYG_HAL_STARTUP == "RAM" ? "arm_gps4020_ram" : \
274                      CYG_HAL_STARTUP == "ROM" ? "arm_gps4020_rom" : \
275                                                 "??" }
276
277         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
278             display "Memory layout linker script fragment"
279             flavor data
280             no_define
281             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
282             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_gps4020_ram.ldi>" : \
283                          CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_gps4020_rom.ldi>" : \
284                                                     "<pkgconf/BAD>" }
285         }
286
287         cdl_option CYGHWR_MEMORY_LAYOUT_H {
288             display "Memory layout header file"
289             flavor data
290             no_define
291             define -file system.h CYGHWR_MEMORY_LAYOUT_H
292             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_gps4020_ram.h>" : \
293                          CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_gps4020_rom.h>" : \
294                                                     "<pkxgconf/BAD>" }
295         }
296     }
297
298     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
299         display       "Redboot HAL options"
300         flavor        none
301         no_define
302         parent        CYGPKG_REDBOOT
303         active_if     CYGPKG_REDBOOT
304         description   "
305             This option lists the target's requirements for a valid Redboot
306             configuration."
307
308         # The backup image is not needed, since ROMRAM is the normal
309         # RedBoot startup type.
310         requires {!CYGPKG_REDBOOT_FLASH || CYGOPT_REDBOOT_FIS_REDBOOT_BACKUP == 0}
311
312         # RedBoot details
313         requires { !CYGBLD_BUILD_REDBOOT_WITH_EXEC }
314
315         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
316             display       "Build Redboot ROM binary image"
317             active_if     CYGBLD_BUILD_REDBOOT
318             default_value 1
319             no_define
320             description "This option enables the conversion of the Redboot ELF
321                          image to the various relocated SREC images needed
322                          for flash updating."
323
324             make -priority 325 {
325                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
326                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
327                 $(OBJCOPY) -O binary $< $@
328             }
329         }
330     }
331
332 }