1 # ====================================================================
5 # Evaluator7T (AEB2) 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.
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.
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
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.
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.
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.
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####
44 # Contributors: gthomas, jskov
47 #####DESCRIPTIONEND####
49 # ====================================================================
51 cdl_package CYGPKG_HAL_ARM_E7T {
52 display "ARM Evaluator7T (AEB2) evaluation board"
54 define_header hal_arm_e7t.h
58 The E7T HAL package provides the support needed to run
59 eCos on an ARM E7T eval board."
61 compile hal_diag.c e7t_misc.c
63 implements CYGINT_HAL_DEBUG_GDB_STUBS
64 implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
65 implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
66 implements CYGINT_HAL_ARM_ARCH_ARM7
67 implements CYGINT_HAL_ARM_THUMB_ARCH
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_e7t.h>"
74 cdl_component CYG_HAL_STARTUP {
75 display "Startup type"
78 legal_values {"RAM" "ROM"}
80 define -file system.h CYG_HAL_STARTUP
82 When targetting the E7T eval board it is possible to build
83 the system for either RAM bootstrap or ROM bootstrap(s). Select
84 'ram' when building programs to load into RAM using onboard
85 debug software such as Angel or eCos GDB stubs. Select 'rom'
86 when building a stand-alone application which will be put
90 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
91 display "Number of communication channels on the board"
96 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
97 display "Debug serial port"
98 active_if CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
100 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
103 The E7T board has two serial ports. This option
104 chooses which port will be used to connect to a host
108 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
109 display "Diagnostic serial port"
110 active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
112 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
115 The E7T board has two serial ports. This option
116 chooses which port will be used for diagnostic output."
119 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CHANNELS_DEFAULT_BAUD {
120 display "Console/GDB serial port baud rate"
122 legal_values 9600 19200 38400 57600 115200
125 This option controls the default baud rate used for the
126 Console/GDB connection."
129 # Real-time clock/counter specifics
130 cdl_option CYGNUM_HAL_ARM_E7T_CLOCK_SPEED {
131 display "CPU clock speed"
136 cdl_component CYGNUM_HAL_RTC_CONSTANTS {
137 display "Real-time clock constants"
140 cdl_option CYGNUM_HAL_RTC_NUMERATOR {
141 display "Real-time clock numerator"
143 default_value 1000000000
145 cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
146 display "Real-time clock denominator"
150 cdl_option CYGNUM_HAL_RTC_PERIOD {
151 display "Real-time clock period"
153 default_value (CYGNUM_HAL_ARM_E7T_CLOCK_SPEED / CYGNUM_HAL_RTC_DENOMINATOR)
157 cdl_component CYGBLD_GLOBAL_OPTIONS {
158 display "Global build options"
162 Global build options including control over
163 compiler flags, linker flags and choice of toolchain."
166 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
167 display "Global command prefix"
170 default_value { "arm-elf" }
172 This option specifies the command prefix used when
173 invoking the build tools."
176 cdl_option CYGBLD_GLOBAL_CFLAGS {
177 display "Global compiler flags"
180 default_value { "-mcpu=arm7tdmi -mno-short-load-words -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
182 This option controls the global compiler flags which are used to
183 compile all packages by default. Individual packages may define
184 options which override these global flags."
187 cdl_option CYGBLD_GLOBAL_LDFLAGS {
188 display "Global linker flags"
191 default_value { "-mcpu=arm7tdmi -mno-short-load-words -Wl,--gc-sections -Wl,-static -g -nostdlib" }
193 This option controls the global linker flags. Individual
194 packages may define options which override these global flags."
198 cdl_component CYGHWR_MEMORY_LAYOUT {
199 display "Memory layout"
202 calculated { (CYG_HAL_STARTUP == "RAM") ? "arm_e7t_ram" : "arm_e7t_rom" }
204 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
205 display "Memory layout linker script fragment"
208 define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
209 calculated { (CYG_HAL_STARTUP == "RAM") ? "<pkgconf/mlt_arm_e7t_ram.ldi>" :
210 "<pkgconf/mlt_arm_e7t_rom.ldi>" }
213 cdl_option CYGHWR_MEMORY_LAYOUT_H {
214 display "Memory layout header file"
217 define -file system.h CYGHWR_MEMORY_LAYOUT_H
218 calculated { (CYG_HAL_STARTUP == "RAM") ? "<pkgconf/mlt_arm_e7t_ram.h>" : \
219 "<pkgconf/mlt_arm_e7t_rom.h>" }
223 cdl_option CYGSEM_HAL_ROM_MONITOR {
224 display "Behave as a ROM monitor"
227 parent CYGPKG_HAL_ROM_MONITOR
228 requires { CYG_HAL_STARTUP == "ROM" }
230 Enable this option if this program is to be used as a ROM monitor,
231 i.e. applications will be loaded into RAM on the board, and this
232 ROM monitor may process exceptions or interrupts generated from the
233 application. This enables features such as utilizing a separate
234 interrupt stack when exceptions are generated."
237 cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
238 display "Work with a ROM monitor"
240 legal_values { "Generic" "GDB_stubs" }
241 default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
242 parent CYGPKG_HAL_ROM_MONITOR
243 requires { CYG_HAL_STARTUP == "RAM" }
245 Support can be enabled for different varieties of ROM monitor.
246 This support changes various eCos semantics such as the encoding
247 of diagnostic output, or the overriding of hardware interrupt
249 Firstly there is \"Generic\" support which prevents the HAL
250 from overriding the hardware vectors that it does not use, to
251 instead allow an installed ROM monitor to handle them. This is
252 the most basic support which is likely to be common to most
253 implementations of ROM monitor.
254 \"GDB_stubs\" provides support when GDB stubs are included in
255 the ROM monitor or boot ROM."
258 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
259 display "Redboot HAL options"
262 parent CYGPKG_REDBOOT
263 active_if CYGPKG_REDBOOT
265 This option lists the target's requirements for a valid Redboot
268 cdl_option CYGBLD_BUILD_REDBOOT_BIN {
269 display "Build Redboot ROM binary image"
270 active_if CYGBLD_BUILD_REDBOOT
273 description "This option enables the conversion of the Redboot ELF
274 image to a binary image suitable for ROM programming."
277 <PREFIX>/bin/redboot.bin : <PACKAGE>/src/redboot_module.c $(PREFIX)/lib/target.ld $(PREFIX)/lib/vectors.o $(PREFIX)/lib/libtarget.a $(PREFIX)/lib/libextras.a
278 @sh -c "mkdir -p src $(dir $@)"
279 # First build version with no checksum.
280 $(CC) -c $(INCLUDE_PATH) -Wp,-MD,deps.tmp -I$(dir $<) $(CFLAGS) -o src/redboot_ncs.o $<
281 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o src/redboot_ncs.tmp $(PREFIX)/lib/version.o src/redboot_ncs.o
282 $(OBJCOPY) --strip-debug src/redboot_ncs.tmp src/redboot_ncs.img
283 $(OBJCOPY) -O binary src/redboot_ncs.img src/redboot_ncs.bin
284 # @rm src/redboot_ncs.tmp src/redboot_ncs.img
285 # Prepare dependency file
286 @echo $@ ": \\" > $(notdir $@).deps
287 @echo $(wildcard $(PREFIX)/lib/*) " \\" >> $(notdir $@).deps
288 @tail -n +2 deps.tmp >> $(notdir $@).deps
289 @echo >> $(notdir $@).deps
291 # Then build version with checksum from previously built image.
292 @cp $(dir $<)flash_cksum.tcl src/
293 $(CC) -c -DCHECKSUM=`src/flash_cksum.tcl src/redboot_ncs.bin` $(INCLUDE_PATH) -I$(dir $<) $(CFLAGS) -o src/redboot.o $<
294 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o src/redboot.tmp $(PREFIX)/lib/version.o src/redboot.o
295 $(OBJCOPY) --strip-debug src/redboot.tmp $(@:.bin=.img)
296 $(OBJCOPY) -O binary $(@:.bin=.img) src/redboot.bin
297 uuencode src/redboot.bin redboot.bin | tr '`' ' ' > $(@:.bin=.UU)
298 @rm src/redboot.tmp src/redboot_ncs.bin
299 @mv src/redboot.bin $@