1 # ====================================================================
3 # hal_arm_arm9_excalibur.cdl
5 # Altera ARM9/EXCALIBUR platform 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: jskov, gthomas
47 #####DESCRIPTIONEND####
49 # ====================================================================
50 cdl_package CYGPKG_HAL_ARM_ARM9_EXCALIBUR {
51 display "Altera ARM9/Excalibur board"
52 parent CYGPKG_HAL_ARM_ARM9
53 requires CYGPKG_HAL_ARM_ARM9_ARM922T
56 define_header hal_arm_arm9_excalibur.h
58 This HAL platform package provides generic
59 support for the Altera ARM9 based board, known as 'excalibur'."
61 compile excalibur_misc.c hal_diag.c
63 implements CYGINT_HAL_DEBUG_GDB_STUBS
64 implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
65 implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
68 puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_arm.h>"
69 puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H <pkgconf/hal_arm_arm9.h>"
70 puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_arm9_excalibur.h>"
71 puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM9\""
72 puts $::cdl_header "#define HAL_PLATFORM_BOARD \"EXCALIBUR system\""
73 puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\""
74 puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK excalibur_program_new_stack"
76 puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE 62"
79 cdl_component CYG_HAL_STARTUP {
80 display "Startup type"
83 legal_values {"RAM" "ROM" "ROMRAM" "REDBOOT" }
85 define -file system.h CYG_HAL_STARTUP
87 When targetting the Excalibur eval board it is possible to build
88 the system for either RAM bootstrap or ROM bootstrap(s). Select
89 'ram' when building programs to load into RAM using eCos GDB
90 stubs. Select 'rom' when building a stand-alone application
91 which will be put into ROM, or for the special case of
92 building the eCos GDB stubs themselves. Select 'redboot' when
93 building RedBoot to place RedBoot at top of memory, leaving
94 the bottom of memory (from 0x8000) to applications."
97 # Both PLLs are in bypass mode on startup.
98 # FIXME: Add proper configury
99 cdl_option CYGNUM_HAL_ARM_EXCALIBUR_CPU_CLOCK {
100 display "CPU bus speed"
102 calculated { 150000000 }
104 This is the actual CPU operating frequency (AHB1)."
107 cdl_option CYGNUM_HAL_ARM_EXCALIBUR_PERIPHERAL_CLOCK {
108 display "Peripheral bus speed"
110 calculated { CYGNUM_HAL_ARM_EXCALIBUR_CPU_CLOCK / 2 }
112 This is the peripheral bus operating frequency (AHB2)."
115 cdl_option CYGNUM_HAL_ARM_EXCALIBUR_SDRAM_CLOCK {
116 display "SDRAM clock"
118 calculated { 75000000 }
120 This is the SDRAM bus operating frequency (SD_CLK)."
123 cdl_option CYGNUM_HAL_ARM_EXCALIBUR_TIMER_PRESCALE {
124 display "Timer prescale"
126 legal_values 0 to 255
129 This is the prescale value used on the clock used to drive
130 the kernel counter. Note that some parts of the code may fail
131 if this is changed due to over/underflows of expressions."
134 # Real-time clock/counter specifics
135 cdl_component CYGNUM_HAL_RTC_CONSTANTS {
136 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_EXCALIBUR_PERIPHERAL_CLOCK/(CYGNUM_HAL_ARM_EXCALIBUR_TIMER_PRESCALE*CYGNUM_HAL_RTC_DENOMINATOR))-1
157 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
158 display "Diagnostic serial port baud rate"
160 legal_values 9600 19200 38400 57600 115200
163 This option selects the baud rate used for the diagnostic port.
164 Note: this should match the value chosen for the GDB port if the
165 diagnostic and GDB port are the same."
168 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
169 display "GDB serial port baud rate"
171 legal_values 9600 19200 38400 57600 115200
174 This option selects the baud rate used for the diagnostic port.
175 Note: this should match the value chosen for the GDB port if the
176 diagnostic and GDB port are the same."
179 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
180 display "Number of communication channels on the board"
185 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
186 display "Debug serial port"
187 active_if CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
189 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
192 The excalibur board has two serial ports. This option
193 chooses which port will be used to connect to a host
197 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
198 display "Default console channel."
200 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
204 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
205 display "Diagnostic serial port"
206 active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
208 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
209 default_value CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
211 The excalibur board has two serial ports. This option
212 chooses which port will be used for diagnostic output."
215 cdl_component CYGBLD_GLOBAL_OPTIONS {
216 display "Global build options"
220 Global build options including control over
221 compiler flags, linker flags and choice of toolchain."
226 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
227 display "Global command prefix"
230 default_value { "arm-elf" }
232 This option specifies the command prefix used when
233 invoking the build tools."
236 cdl_option CYGBLD_GLOBAL_CFLAGS {
237 display "Global compiler flags"
240 default_value { "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
242 This option controls the global compiler flags which are used to
243 compile all packages by default. Individual packages may define
244 options which override these global flags."
247 cdl_option CYGBLD_GLOBAL_LDFLAGS {
248 display "Global linker flags"
251 default_value { "--no-target-default-spec -Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" }
253 This option controls the global linker flags. Individual
254 packages may define options which override these global flags."
257 cdl_option CYGBLD_BUILD_GDB_STUBS {
258 display "Build GDB stub ROM image"
260 requires { CYG_HAL_STARTUP == "ROM" }
261 requires CYGSEM_HAL_ROM_MONITOR
262 requires CYGBLD_BUILD_COMMON_GDB_STUBS
263 requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
264 requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
265 requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
266 requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
267 requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
270 This option enables the building of the GDB stubs for the
271 board. The common HAL controls takes care of most of the
272 build process, but the final conversion from ELF image to
273 binary data is handled by the platform CDL, allowing
274 relocation of the data if necessary."
277 <PREFIX>/bin/gdb_module.srec : <PREFIX>/bin/gdb_module.img
278 $(OBJCOPY) --remove-section=.fixed_vectors $< gdb_module.tmp
283 cdl_component CYGPKG_HAL_ARM_ARM9_EXCALIBUR_OPTIONS {
284 display "ARM9/EXCALIBUR build options"
288 Package specific build options including control over
289 compiler flags used only in building this package,
290 and details of which tests are built."
293 cdl_option CYGPKG_HAL_ARM_ARM9_EXCALIBUR_CFLAGS_ADD {
294 display "Additional compiler flags"
299 This option modifies the set of compiler flags for
300 building the ARM9 EXCALIBUR HAL. These flags are used in addition
301 to the set of global flags."
304 cdl_option CYGPKG_HAL_ARM_ARM9_EXCALIBUR_CFLAGS_REMOVE {
305 display "Suppressed compiler flags"
310 This option modifies the set of compiler flags for
311 building the ARM9 EXCALIBUR HAL. These flags are removed from
312 the set of global flags if present."
315 cdl_option CYGPKG_HAL_ARM_ARM9_EXCALIBUR_TESTS {
316 display "ARM9/EXCALIBUR tests"
321 This option specifies the set of tests for the ARM9 Excalibur HAL."
325 cdl_component CYGHWR_MEMORY_LAYOUT {
326 display "Memory layout"
329 calculated { CYG_HAL_STARTUP == "RAM" ? "arm_arm9_excalibur_ram" : \
330 CYG_HAL_STARTUP == "ROM" ? "arm_arm9_excalibur_rom" : \
331 CYG_HAL_STARTUP == "ROMRAM" ? "arm_arm9_excalibur_romram" : \
332 "arm_arm9_excalibur_redboot" }
334 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
335 display "Memory layout linker script fragment"
338 define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
339 calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_arm9_excalibur_ram.ldi>" : \
340 CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_arm9_excalibur_rom.ldi>" : \
341 CYG_HAL_STARTUP == "ROMRAM" ? "<pkgconf/mlt_arm_arm9_excalibur_romram.ldi>" : \
342 "<pkgconf/mlt_arm_arm9_excalibur_redboot.ldi>" }
345 cdl_option CYGHWR_MEMORY_LAYOUT_H {
346 display "Memory layout header file"
349 define -file system.h CYGHWR_MEMORY_LAYOUT_H
350 calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_arm9_excalibur_ram.h>" : \
351 CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_arm9_excalibur_rom.h>" : \
352 CYG_HAL_STARTUP == "ROMRAM" ? "<pkgconf/mlt_arm_arm9_excalibur_romram.h>" : \
353 "<pkgconf/mlt_arm_arm9_excalibur_redboot.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" || CYG_HAL_STARTUP == "ROMRAM" || CYG_HAL_STARTUP == "REDBOOT" }
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_option CYGSEM_HAL_USE_ROM_MONITOR {
372 display "Work with a ROM monitor"
374 legal_values { "GDB_stubs" }
375 default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
376 parent CYGPKG_HAL_ROM_MONITOR
377 requires { CYG_HAL_STARTUP == "RAM" }
379 Support can be enabled for different varieties of ROM monitor.
380 This support changes various eCos semantics such as the encoding
381 of diagnostic output, or the overriding of hardware interrupt
383 \"GDB_stubs\" provides support when GDB stubs are included in
384 the ROM monitor or boot ROM."
387 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
388 display "Redboot HAL options"
391 parent CYGPKG_REDBOOT
392 active_if CYGPKG_REDBOOT
394 This option lists the target's requirements for a valid Redboot
397 # The backup image is not needed, since ROMRAM/REDBOOT is the normal
398 # RedBoot startup type.
399 requires {!CYGPKG_REDBOOT_FLASH || CYGOPT_REDBOOT_FIS_REDBOOT_BACKUP == 0}
402 requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0x00008000 }
404 puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
407 cdl_option CYGBLD_BUILD_REDBOOT_BIN {
408 display "Build Redboot ROM binary image"
409 active_if CYGBLD_BUILD_REDBOOT
412 description "This option enables the conversion of the Redboot ELF
413 image to the various relocated SREC images needed
417 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
418 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
419 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
420 $(OBJCOPY) --change-address 0xc0000000 -O ihex $< $(@:.bin=.hex)
421 $(OBJCOPY) -O binary $< $@