1 # ====================================================================
5 # GPS4020 board HAL package configuration data
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
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.
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
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.
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.
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.
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####
45 # Original data: gthomas
49 #####DESCRIPTIONEND####
51 # ====================================================================
53 cdl_package CYGPKG_HAL_ARM_GPS4020 {
54 display "GPS4020 evaluation board"
56 define_header hal_arm_gps4020.h
60 The gps4020 HAL package provides the support needed to run
61 eCos on a ARM GPS4020-1 eval board."
63 compile hal_diag.c gps4020_misc.c
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
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 \"\""
80 cdl_component CYG_HAL_STARTUP {
81 display "Startup type"
84 legal_values {"RAM" "ROM"}
86 define -file system.h CYG_HAL_STARTUP
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
96 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
97 display "Number of communication channels on the board"
102 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
103 display "Debug serial port"
104 active_if CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
106 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
109 The GPS4020 board has only one serial port. This option
110 chooses which port will be used to connect to a host
114 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
115 display "Diagnostic serial port"
116 active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
118 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
121 The GPS4020 board has only one serial port. This option
122 chooses which port will be used for diagnostic output."
125 # Real-time clock/counter specifics
126 cdl_component CYGNUM_HAL_RTC_CONSTANTS {
127 display "Real-time clock constants"
130 cdl_option CYGNUM_HAL_RTC_NUMERATOR {
131 display "Real-time clock numerator"
133 default_value 1000000000
135 cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
136 display "Real-time clock denominator"
140 cdl_option CYGNUM_HAL_RTC_PERIOD {
141 display "Real-time clock period"
143 default_value ((CYGNUM_HAL_RTC_NUMERATOR/1000)/CYGNUM_HAL_RTC_DENOMINATOR)
147 cdl_component CYGBLD_GLOBAL_OPTIONS {
148 display "Global build options"
152 Global build options including control over
153 compiler flags, linker flags and choice of toolchain."
156 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
157 display "Global command prefix"
160 default_value { "arm-elf" }
162 This option specifies the command prefix used when
163 invoking the build tools."
166 cdl_option CYGBLD_GLOBAL_CFLAGS {
167 display "Global compiler flags"
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" }
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."
177 cdl_option CYGBLD_GLOBAL_LDFLAGS {
178 display "Global linker flags"
181 default_value { "-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib" }
183 This option controls the global linker flags. Individual
184 packages may define options which override these global flags."
187 cdl_option CYGBLD_BUILD_GDB_STUBS {
188 display "Build GDB stub ROM image"
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
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."
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
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 $@
234 cdl_option CYGSEM_HAL_ROM_MONITOR {
235 display "Behave as a ROM monitor"
238 parent CYGPKG_HAL_ROM_MONITOR
239 requires { CYG_HAL_STARTUP == "ROM" }
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."
248 cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
249 display "Work with a ROM monitor"
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" }
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
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."
269 cdl_component CYGHWR_MEMORY_LAYOUT {
270 display "Memory layout"
273 calculated { CYG_HAL_STARTUP == "RAM" ? "arm_gps4020_ram" : \
274 CYG_HAL_STARTUP == "ROM" ? "arm_gps4020_rom" : \
277 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
278 display "Memory layout linker script fragment"
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>" : \
287 cdl_option CYGHWR_MEMORY_LAYOUT_H {
288 display "Memory layout header file"
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>" : \
298 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
299 display "Redboot HAL options"
302 parent CYGPKG_REDBOOT
303 active_if CYGPKG_REDBOOT
305 This option lists the target's requirements for a valid Redboot
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}
313 requires { !CYGBLD_BUILD_REDBOOT_WITH_EXEC }
315 cdl_option CYGBLD_BUILD_REDBOOT_BIN {
316 display "Build Redboot ROM binary image"
317 active_if CYGBLD_BUILD_REDBOOT
320 description "This option enables the conversion of the Redboot ELF
321 image to the various relocated SREC images needed
325 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
326 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
327 $(OBJCOPY) -O binary $< $@