1 # ====================================================================
3 # hal_arm_at91_sam7s.cdl
5 # ARM AT91 SAM7 HAL package configuration data
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
10 ## Copyright (C) 2003 Nick Garnett <nickg@calivar.com>
11 ## Copyright (C) 2005 eCosCentric Ltd
12 ## Copyright (C) 2005 Andrew Lunn
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.
36 ## -------------------------------------------
37 #####ECOSGPLCOPYRIGHTEND####
38 # ====================================================================
39 ######DESCRIPTIONBEGIN####
42 # Contributors: gthomas, tkoeller, nickg, Oliver Munz, asl
45 #####DESCRIPTIONEND####
47 # ====================================================================
49 cdl_package CYGPKG_HAL_ARM_AT91SAM7 {
50 display "Atmel AT91SAM7 HAL"
52 define_header hal_arm_at91sam7.h
56 The AT91SAM7 HAL package provides the support needed to run
57 eCos on an Atmel AT91SAM7 based board."
59 compile at91sam7s_misc.c
61 requires { CYGHWR_HAL_ARM_AT91_FIQ }
62 requires { CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7s32" implies
63 CYGPKG_IO_SERIAL_ARM_AT91_SERIAL0 == 0 }
65 implements CYGINT_HAL_ARM_AT91_SERIAL_DBG_HW
66 implements CYGINT_HAL_ARM_AT91_PIT_HW
67 implements CYGINT_HAL_ARM_AT91_SYS_INTERRUPT
70 puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_arm.h>"
71 puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H <pkgconf/hal_arm_at91.h>"
72 puts $::cdl_system_header "#define CYGBLD_HAL_ARM_VAR_IO_H"
75 cdl_option CYGHWR_HAL_ARM_AT91SAM7 {
76 display "AT91SAM7 variant used"
78 default_value {"at91sam7s256"}
79 legal_values {"at91sam7s32" "at91sam7s321" "at91sam7s64"
80 "at91sam7s128" "at91sam7s256"
81 "at91sam7x128" "at91sam7x256" "at91sam7x512"
82 "at91sam7xc128" "at91sam7xc256" }
84 The AT91SAM7 microcontroller family has several variants,
85 the main differences being the amount of on-chip SRAM,
86 FLASH, peripherals and their layout. This option allows the
87 platform HALs to select the specific microcontroller
91 cdl_option CYGHWR_HAL_ARM_AT91SAM7S {
92 display "SAM7S device"
93 calculated { CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7s256" ||
94 CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7s128" ||
95 CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7s64" ||
96 CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7s32" ||
97 CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7s321" }
99 Is the AT91SAM7 device a member of the AT91SAM7S family?"
102 cdl_option CYGHWR_HAL_ARM_AT91SAM7X {
103 display "SAM7X device"
104 calculated { CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7x512" ||
105 CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7x256" ||
106 CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7x128" }
108 Is the AT91SAM7 device a member of the AT91SAM7X family?"
111 cdl_option CYGHWR_HAL_ARM_AT91SAM7XC {
112 display "SAM7XC device"
113 calculated { CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7xc256" ||
114 CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7xc128" }
116 Is the AT91SAM7 device a member of the AT91SAM7XC family?"
119 cdl_option CYGBLD_HAL_ARM_AT91SAM7_USB {
121 active_if {!( "at91sam7s32" == CYGHWR_HAL_ARM_AT91SAM7S) ||
122 CYGHWR_HAL_ARM_AT91SAM7X ||
123 CYGHWR_HAL_ARM_AT91SAM7XC }
124 implements CYGINT_DEVS_USB_AT91_HAS_USB
128 All but the AT91SAM7S32 has the USB device"
131 cdl_option CYGBLD_HAL_ARM_AT91SAM7_SPI1 {
132 display "Second SPI bus controller"
133 active_if { CYGHWR_HAL_ARM_AT91SAM7X ||
134 CYGHWR_HAL_ARM_AT91SAM7XC }
135 implements CYGINT_DEVS_SPI_ARM_AT91_HAS_BUS1
139 The SAM7X and SAM7XC have the second SPI bus controller"
142 cdl_option CYGBLD_HAL_ARM_AT91SAM7_CAN0 {
143 display "CAN bus controller"
144 active_if { CYGHWR_HAL_ARM_AT91SAM7X ||
145 CYGHWR_HAL_ARM_AT91SAM7XC }
146 implements CYGINT_DEVS_CAN_AT91SAM7_CAN0
150 The SAM7X and SAM7XC have the CAN controller"
153 cdl_component CYGNUM_HAL_RTC_CONSTANTS {
154 display "Real-time clock constants"
157 cdl_option CYGNUM_HAL_RTC_NUMERATOR {
158 display "Real-time clock numerator"
160 default_value 1000000000
162 cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
163 display "Real-time clock denominator"
167 cdl_option CYGNUM_HAL_RTC_PERIOD {
168 display "Real-time clock period"
170 legal_values 1 to 0xffff
171 calculated ((CYGNUM_HAL_RTC_NUMERATOR * CYGNUM_HAL_ARM_AT91_CLOCK_SPEED/16) / CYGNUM_HAL_RTC_DENOMINATOR / 1000000000)
173 CYGNUM_HAL_RTC_PERIOD : (CYGNUM_HAL_RTC_NUMERATOR * CYGNUM_HAL_ARM_AT91_CLOCK_SPEED/16) / CYGNUM_HAL_RTC_DENOMINATOR / 1000000000 "
177 cdl_component CYG_HAL_STARTUP {
178 display "Startup type"
180 default_value {"ROM"}
181 legal_values {"RAM" "ROM"}
183 define -file system.h CYG_HAL_STARTUP
185 When targeting the AT91SAM7 eval boards it is possible to build
186 the system for either RAM bootstrap or ROM bootstrap(s). Select
187 'ram' when building programs to load into RAM using on board
188 debug software such as Angel or eCos GDB stubs. Select 'rom'
189 when building a stand-alone application which will be put
193 cdl_option CYGNUM_HAL_ARM_AT91_IMAGE_ADDRESS {
194 display "Address in flash the image should live"
195 active_if { CYG_HAL_STARTUP == "ROM" }
197 default_value 0x00100000
199 This optionspecifies where in flash the image
200 lives. By default it is at the bottom of the flash,
201 but for example redboot may be at the bottom and an
202 application lives higher up, which is acheived by
203 setting the address here."
206 # Real-time clock/counter specifics
207 cdl_option CYGNUM_HAL_ARM_AT91_CLOCK_SPEED {
208 display "CPU clock speed"
210 calculated { CYGNUM_HAL_ARM_AT91_CLOCK_OSC_MAIN *
211 CYGNUM_HAL_ARM_AT91_PLL_MULTIPLIER /
212 CYGNUM_HAL_ARM_AT91_PLL_DIVIDER / 2}
213 legal_values { 0 to 220000000 }
215 The master clock-frequency has to be 48MHz, 96MHz or
216 192MHz for the USB to work correctly. The clock setup uses
217 PLL clock divided by two"
220 cdl_option CYGNUM_HAL_ARM_AT91_CLOCK_OSC_MAIN {
221 display "Main oscillator frequency"
223 legal_values { 3000000 to 20000000}
224 default_value { 18432000 }
226 The frequency of the clock input, be it a crystal or a clock
230 cdl_option CYGNUM_HAL_ARM_AT91_CLOCK_TYPE {
231 display "Type of main frequency input"
233 default_value { "CRYSTAL" }
234 legal_values { "CRYSTAL" "EXTCLOCK" }
236 Whether a crystal or a XIN input clock is clocking the device."
239 cdl_option CYGNUM_HAL_ARM_AT91_PLL_DIVIDER {
240 display "Divider for PLL clock"
242 legal_values { 0 to 255 }
245 The X-tal clock is divided by this value when generating the
249 cdl_option CYGNUM_HAL_ARM_AT91_PLL_MULTIPLIER {
250 display "Multiplier for PLL clock"
252 legal_values { 0 to 2047 }
255 The X-tal clock is multiplied by this value when generating
259 cdl_option CYGNUM_HAL_ARM_AT91_SLOW_CLOCK {
260 display "Slow clock frequency"
262 default_value { 32768 }
264 The slow clock is an LC oscillator which runs all the
265 time. The accuracy of this clock is not very high and
266 is temperature dependent."
269 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
270 display "Number of communication channels on the board"
274 The AT91SAM7S development boards has two Serial port connectors.
275 these correspond to USART0 and the Debug Serial port. The chip
276 has a third serial port which does not have a 9pin D
277 connector, but is accessible via the patch panel pins."
280 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
281 display "Debug serial port"
282 active_if CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
284 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
287 The AT91SAM7S has three serial ports. This option
288 chooses which port will be used to connect to a host
292 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
293 display "Diagnostic serial port"
294 active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
296 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
299 The AT91SAM7S board has three USART serial ports. This option
300 chooses which port will be used for diagnostic output."
303 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
304 display "Diagnostic serial port baud rate"
306 legal_values 9600 19200 38400 57600 115200
309 This option selects the baud rate used for the diagnostic port."
312 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
313 display "GDB serial port baud rate"
315 legal_values 9600 19200 38400 57600 115200
318 This option controls the baud rate used for the GDB connection."
321 cdl_option CYGBLD_HAL_ARM_AT91_BAUD_DYNAMIC {
322 display "Dynamic calculation of baud rate"
325 The AT91SAM7S has a flexible clock generation mechanism
326 where the main clock used to drive peripherals can be
327 changed during run time. Such changes affect the serial port
328 baud rate generators. Enabling this option includes code
329 which calculates the baud rate setting dynamically from the
330 current clock settings. Without this option a static
331 calculation is performed which assumes the clock frequency
332 has not been changed."
335 cdl_option CYGSEM_HAL_ROM_MONITOR {
336 display "Behave as a ROM monitor"
339 parent CYGPKG_HAL_ROM_MONITOR
340 requires { CYG_HAL_STARTUP == "ROM" }
342 Enable this option if this program is to be used as a ROM monitor,
343 i.e. applications will be loaded into RAM on the board, and this
344 ROM monitor may process exceptions or interrupts generated from the
345 application. This enables features such as utilizing a separate
346 interrupt stack when exceptions are generated."
349 cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
350 display "Work with a ROM monitor"
352 legal_values { "Generic" "GDB_stubs" }
353 default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
354 parent CYGPKG_HAL_ROM_MONITOR
355 requires { CYG_HAL_STARTUP == "RAM" }
357 Support can be enabled for different varieties of ROM monitor.
358 This support changes various eCos semantics such as the encoding
359 of diagnostic output, or the overriding of hardware interrupt
361 Firstly there is \"Generic\" support which prevents the HAL
362 from overriding the hardware vectors that it does not use, to
363 instead allow an installed ROM monitor to handle them. This is
364 the most basic support which is likely to be common to most
365 implementations of ROM monitor.
366 \"GDB_stubs\" provides support when GDB stubs are included in
367 the ROM monitor or boot ROM."
370 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
371 display "Redboot HAL options"
374 parent CYGPKG_REDBOOT
375 active_if CYGPKG_REDBOOT
377 This option lists the target's requirements for a valid Redboot
380 cdl_option CYGBLD_BUILD_REDBOOT_BIN {
381 display "Build Redboot ROM binary image"
382 active_if CYGBLD_BUILD_REDBOOT
385 description "This option enables the conversion of the Redboot ELF
386 image to a binary image suitable for ROM programming."
389 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
390 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
391 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
392 $(OBJCOPY) -O binary $< $@
397 cdl_component CYGBLD_GLOBAL_OPTIONS {
398 display "Global build options"
402 Global build options including control over
403 compiler flags, linker flags and choice of toolchain."
405 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
406 display "Global command prefix"
409 default_value { "arm-elf" }
411 This option specifies the command prefix used when
412 invoking the build tools."
415 cdl_option CYGBLD_GLOBAL_CFLAGS {
416 display "Global compiler flags"
419 default_value { (CYGHWR_THUMB ? "-mthumb " : "") . (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . "-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" }
421 This option controls the global compiler flags which are used to
422 compile all packages by default. Individual packages may define
423 options which override these global flags."
426 cdl_option CYGBLD_GLOBAL_LDFLAGS {
427 display "Global linker flags"
430 default_value { (CYGHWR_THUMB ? "-mthumb " : "") . (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . "-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib" }
432 This option controls the global linker flags. Individual
433 packages may define options which override these global flags."
437 cdl_component CYGHWR_MEMORY_LAYOUT {
438 display "Memory layout"
441 calculated { (CYG_HAL_STARTUP == "RAM") ? \
442 "arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_ram" :
443 "arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_rom" }
445 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
446 display "Memory layout linker script fragment"
449 define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
450 calculated { (CYG_HAL_STARTUP == "RAM") ? \
451 "<pkgconf/mlt_arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_ram.ldi>" :
452 "<pkgconf/mlt_arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_rom.ldi>" }
455 cdl_option CYGHWR_MEMORY_LAYOUT_H {
456 display "Memory layout header file"
459 define -file system.h CYGHWR_MEMORY_LAYOUT_H
460 calculated { (CYG_HAL_STARTUP == "RAM") ? \
461 "<pkgconf/mlt_arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_ram.h>" :
462 "<pkgconf/mlt_arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_rom.h>" }