1 # ====================================================================
5 # PID 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 # Original data: gthomas
48 #####DESCRIPTIONEND####
50 # ====================================================================
52 cdl_package CYGPKG_HAL_ARM_PID {
53 display "ARM PID evaluation board"
55 define_header hal_arm_pid.h
59 The pid HAL package provides the support needed to run
60 eCos on an ARM PID evaluation board."
62 compile hal_diag.c pid_misc.c
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
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>"
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 \"\""
82 puts $::cdl_header "#define CYGPRI_KERNEL_TESTS_DHRYSTONE_PASSES 100000"
86 cdl_component CYG_HAL_STARTUP {
87 display "Startup type"
89 legal_values {"RAM" "ROM"}
92 define -file system.h CYG_HAL_STARTUP
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
103 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
104 display "Diagnostic serial port baud rate"
106 legal_values 9600 19200 38400 115200
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."
114 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
115 display "GDB serial port baud rate"
117 legal_values 9600 19200 38400 115200
120 This option controls the baud rate used for the GDB connection."
123 cdl_option CYGSEM_HAL_ARM_PID_ANGEL_BOOT {
124 display "Support startup from Angel"
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
133 cdl_option CYGHWR_HAL_ARM_PID_DIAG_LEDS {
134 display "Enable use of PPx LEDs"
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.
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
151 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
152 display "Default console channel."
157 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
158 display "Number of communication channels on the board"
163 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
164 display "Debug serial port"
165 active_if CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
167 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
170 The PID board has two serial ports. This option
171 chooses which port will be used to connect to a host
175 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
176 display "Diagnostic serial port"
177 active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
179 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
180 default_value CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
182 The PID board has two serial ports. This option
183 chooses which port will be used for diagnostic output."
186 # Real-time clock/counter specifics
187 cdl_component CYGNUM_HAL_RTC_CONSTANTS {
188 display "Real-time clock constants"
191 cdl_option CYGNUM_HAL_RTC_NUMERATOR {
192 display "Real-time clock numerator"
194 default_value 1000000000
196 cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
197 display "Real-time clock denominator"
201 cdl_option CYGNUM_HAL_RTC_PERIOD {
202 display "Real-time clock period"
208 cdl_component CYGBLD_GLOBAL_OPTIONS {
209 display "Global build options"
213 Global build options including control over
214 compiler flags, linker flags and choice of toolchain."
217 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
218 display "Global command prefix"
221 default_value { "arm-elf" }
223 This option specifies the command prefix used when
224 invoking the build tools."
227 cdl_option CYGBLD_GLOBAL_CFLAGS {
228 display "Global compiler flags"
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" }
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
242 cdl_option CYGBLD_GLOBAL_LDFLAGS {
243 display "Global linker flags"
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" }
251 This option controls the global linker flags. Individual
252 packages may define options which override these global flags."
255 cdl_option CYGBLD_BUILD_GDB_STUBS {
256 display "Build GDB stub ROM image"
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
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
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) $@
281 cdl_option CYGBLD_BUILD_FLASH_TOOL {
282 display "Build flash programming tool"
284 requires { CYG_HAL_STARTUP == "RAM" }
285 requires CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == 1
287 requires CYGPKG_KERNEL
289 description "This option enables the building of the flash programming tool for copying the GDB stubs into flash memory."
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
299 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ src/prog_flash.o
303 cdl_option CYGBLD_BUILD_FLASH_TOOL_BE {
304 display "Build flash programming tool for BE images on LE boards"
306 requires { CYG_HAL_STARTUP == "RAM" }
307 requires CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL == 1
309 requires CYGPKG_KERNEL
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."
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
325 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ src/prog_flash_be.o
330 cdl_component CYGHWR_MEMORY_LAYOUT {
331 display "Memory layout"
334 calculated { CYG_HAL_STARTUP == "RAM" ? "arm_pid_ram" : \
337 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
338 display "Memory layout linker script fragment"
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>" }
346 cdl_option CYGHWR_MEMORY_LAYOUT_H {
347 display "Memory layout header file"
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>" }
357 cdl_option CYGSEM_HAL_ROM_MONITOR {
358 display "Behave as a ROM monitor"
361 parent CYGPKG_HAL_ROM_MONITOR
362 requires { CYG_HAL_STARTUP == "ROM" }
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."
371 cdl_component CYGPKG_CYGMON_HAL_OPTIONS {
372 display "CygMon HAL options"
376 active_if CYGPKG_CYGMON
378 This option also lists the target's requirements for a valid CygMon
382 cdl_option CYGBLD_BUILD_CYGMON_BIN {
383 display "Build CygMon ROM binary image"
384 active_if CYGBLD_BUILD_CYGMON
387 description "This option enables the conversion of the CygMon ELF
388 image to a binary image suitable for ROM programming."
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 $< $@
399 cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
400 display "Work with a ROM monitor"
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" }
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
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."
420 # custom rule to create a shell script to execute SID
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
428 cdl_option CYGTST_SID_FLAGS {
429 display "SID execution flags"
431 default_value { CYGHWR_HAL_ARM_BIGENDIAN ? "--board=pid7t -EB" : "--board=pid7t -EL" }
434 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
435 display "Redboot HAL options"
438 parent CYGPKG_REDBOOT
439 active_if CYGPKG_REDBOOT
441 This option lists the target's requirements for a valid Redboot
444 cdl_option CYGBLD_BUILD_REDBOOT_BIN {
445 display "Build Redboot ROM binary image"
446 active_if CYGBLD_BUILD_REDBOOT
449 description "This option enables the conversion of the Redboot ELF
450 image to a binary image suitable for ROM programming."
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 $< $@