]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/at91/at91sam7s/v2_0/cdl/hal_arm_at91sam7s.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / at91 / at91sam7s / v2_0 / cdl / hal_arm_at91sam7s.cdl
1 # ====================================================================
2 #
3 #      hal_arm_at91_sam7s.cdl
4 #
5 #      ARM AT91 SAM7 HAL package configuration data
6 #
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
13 ##
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.
17 ##
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
21 ## for more details.
22 ##
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.
26 ##
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.
33 ##
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####
40 #
41 # Author(s):      gthomas
42 # Contributors:   gthomas, tkoeller, nickg, Oliver Munz, asl
43 # Date:           2005-06-20
44 #
45 #####DESCRIPTIONEND####
46 #
47 # ====================================================================
48
49 cdl_package CYGPKG_HAL_ARM_AT91SAM7 {
50     display       "Atmel AT91SAM7 HAL"
51     parent        CYGPKG_HAL_ARM
52     define_header hal_arm_at91sam7.h
53     include_dir   cyg/hal
54     hardware
55     description   "
56         The AT91SAM7 HAL package provides the support needed to run
57         eCos on an Atmel AT91SAM7 based board."
58
59     compile       at91sam7s_misc.c
60     
61     requires      { CYGHWR_HAL_ARM_AT91_FIQ     }
62     requires      { CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7s32" implies
63                     CYGPKG_IO_SERIAL_ARM_AT91_SERIAL0 == 0 }
64
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
68
69     define_proc {
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"
73     }
74
75     cdl_option CYGHWR_HAL_ARM_AT91SAM7 {
76         display        "AT91SAM7 variant used"
77         flavor         data
78         default_value  {"at91sam7s256"}
79         legal_values   {"at91sam7s32" "at91sam7s321" "at91sam7s64" 
80                         "at91sam7s128" "at91sam7s256" 
81                         "at91sam7x128" "at91sam7x256" "at91sam7x512" 
82                         "at91sam7xc128" "at91sam7xc256" }
83         description    "
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
88            being used."
89     }
90
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" }
98         description "
99             Is the AT91SAM7 device a member of the AT91SAM7S family?"
100     }
101
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" }        
107         description "
108             Is the AT91SAM7 device a member of the AT91SAM7X family?"
109     }
110
111     cdl_option CYGHWR_HAL_ARM_AT91SAM7XC {
112         display     "SAM7XC device" 
113         calculated  { CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7xc256" ||
114                       CYGHWR_HAL_ARM_AT91SAM7 == "at91sam7xc128" }        
115         description "
116             Is the AT91SAM7 device a member of the AT91SAM7XC family?"
117     }
118
119     cdl_option CYGBLD_HAL_ARM_AT91SAM7_USB {
120         display       "USB device"
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
125         default_value 1
126         no_define
127         description   "
128             All but the AT91SAM7S32 has the USB device"
129     }
130
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
136         default_value 1
137         no_define
138         description   "
139             The SAM7X and SAM7XC have the second SPI bus controller"
140     }
141
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
147         default_value 1
148         no_define
149         description   "
150             The SAM7X and SAM7XC have the CAN controller"
151     }
152
153     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
154         display       "Real-time clock constants"
155         flavor        none
156
157         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
158             display       "Real-time clock numerator"
159             flavor        data
160             default_value 1000000000
161         }
162         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
163             display       "Real-time clock denominator"
164             flavor        data
165             default_value 100
166         }
167         cdl_option CYGNUM_HAL_RTC_PERIOD {
168             display       "Real-time clock period"
169             flavor        data
170             legal_values  1 to 0xffff 
171             calculated    ((CYGNUM_HAL_RTC_NUMERATOR * CYGNUM_HAL_ARM_AT91_CLOCK_SPEED/16) / CYGNUM_HAL_RTC_DENOMINATOR / 1000000000)
172             description   "
173                 CYGNUM_HAL_RTC_PERIOD : (CYGNUM_HAL_RTC_NUMERATOR * CYGNUM_HAL_ARM_AT91_CLOCK_SPEED/16) / CYGNUM_HAL_RTC_DENOMINATOR / 1000000000 "
174         }
175     }
176     
177     cdl_component CYG_HAL_STARTUP {
178         display       "Startup type"
179         flavor        data
180         default_value {"ROM"}
181         legal_values  {"RAM" "ROM"}
182         no_define
183         define -file system.h CYG_HAL_STARTUP
184         description   "
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
190             into ROM"
191     }
192
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" }
196         flavor        data        
197         default_value 0x00100000
198         description   "
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."
204     }
205
206     # Real-time clock/counter specifics
207     cdl_option CYGNUM_HAL_ARM_AT91_CLOCK_SPEED {
208         display       "CPU clock speed"
209         flavor        data
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 }
214         description   "
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"
218     }
219
220     cdl_option CYGNUM_HAL_ARM_AT91_CLOCK_OSC_MAIN {
221         display       "Main oscillator frequency"
222         flavor        data
223         legal_values  { 3000000 to 20000000} 
224         default_value { 18432000 }
225         description   "
226             The frequency of the clock input, be it a crystal or a clock 
227             signal"
228     }
229
230     cdl_option CYGNUM_HAL_ARM_AT91_CLOCK_TYPE {
231         display       "Type of main frequency input"
232         flavor        data
233         default_value { "CRYSTAL" }
234         legal_values  { "CRYSTAL" "EXTCLOCK" } 
235         description   "
236             Whether a crystal or a XIN input clock is clocking the device."
237     }
238
239     cdl_option CYGNUM_HAL_ARM_AT91_PLL_DIVIDER {
240         display       "Divider for PLL clock"
241         flavor        data
242         legal_values  { 0 to 255 }
243         default_value 24
244         description   "
245             The X-tal clock is divided by this value when generating the
246             PLL clock"
247     }       
248         
249     cdl_option CYGNUM_HAL_ARM_AT91_PLL_MULTIPLIER {
250         display       "Multiplier for PLL clock"
251         flavor        data
252         legal_values  { 0 to 2047 }
253         default_value 125
254         description   "
255            The X-tal clock is multiplied by this value when generating
256            the PLL clock."
257     }
258
259     cdl_option CYGNUM_HAL_ARM_AT91_SLOW_CLOCK {
260         display       "Slow clock frequency"
261         flavor        data
262         default_value { 32768 }
263         description   "
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."
267     }
268
269     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
270         display       "Number of communication channels on the board"
271         flavor        data
272         default_value 3
273         description   "
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."
278     }
279  
280     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
281         display          "Debug serial port"
282         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
283         flavor data
284         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
285         default_value    2
286         description      "
287             The AT91SAM7S has three serial ports. This option
288             chooses which port will be used to connect to a host
289             running GDB."
290      }
291  
292      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
293          display          "Diagnostic serial port"
294          active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
295          flavor data
296          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
297          default_value    2
298          description      "
299             The AT91SAM7S board has three USART serial ports. This option
300             chooses which port will be used for diagnostic output."
301      }
302      
303      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
304         display       "Diagnostic serial port baud rate"
305         flavor        data
306         legal_values  9600 19200 38400 57600 115200
307         default_value 38400
308         description   "
309             This option selects the baud rate used for the diagnostic port."
310     }
311  
312     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
313          display       "GDB serial port baud rate"
314          flavor        data
315          legal_values  9600 19200 38400 57600 115200
316          default_value 38400
317          description   "
318             This option controls the baud rate used for the GDB connection."
319      }
320  
321     cdl_option CYGBLD_HAL_ARM_AT91_BAUD_DYNAMIC {
322         display       "Dynamic calculation of baud rate"
323         default_value 0
324         description   "
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."
333     }
334
335     cdl_option CYGSEM_HAL_ROM_MONITOR {
336         display       "Behave as a ROM monitor"
337         flavor        bool
338         default_value 0
339         parent        CYGPKG_HAL_ROM_MONITOR
340         requires      { CYG_HAL_STARTUP == "ROM" } 
341         description   "
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."
347     }
348
349     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
350          display       "Work with a ROM monitor"
351          flavor        booldata
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" }
356          description   "
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
360              vectors.
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."
368     }
369
370     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
371         display       "Redboot HAL options"
372         flavor        none
373         no_define
374         parent        CYGPKG_REDBOOT
375         active_if     CYGPKG_REDBOOT
376         description   "
377             This option lists the target's requirements for a valid Redboot
378             configuration."
379
380         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
381             display       "Build Redboot ROM binary image"
382             active_if     CYGBLD_BUILD_REDBOOT
383             default_value 1
384             no_define
385             description "This option enables the conversion of the Redboot ELF
386                          image to a binary image suitable for ROM programming."
387     
388             make -priority 325 {
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 $< $@
393             }
394         }
395     }
396
397     cdl_component CYGBLD_GLOBAL_OPTIONS {
398         display "Global build options"
399         flavor  none
400         parent  CYGPKG_NONE
401         description   "
402             Global build options including control over
403             compiler flags, linker flags and choice of toolchain."
404
405         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
406             display "Global command prefix"
407             flavor  data
408             no_define
409             default_value { "arm-elf" }
410             description "
411                 This option specifies the command prefix used when
412                 invoking the build tools."
413         }
414
415         cdl_option CYGBLD_GLOBAL_CFLAGS {
416             display "Global compiler flags"
417             flavor  data
418             no_define
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" }
420             description   "
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."
424         }
425
426         cdl_option CYGBLD_GLOBAL_LDFLAGS {
427             display "Global linker flags"
428             flavor  data
429             no_define
430             default_value { (CYGHWR_THUMB ? "-mthumb " : "") . (CYGBLD_ARM_ENABLE_THUMB_INTERWORK ? "-mthumb-interwork " : "") . "-mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib" }
431             description   "
432                 This option controls the global linker flags. Individual
433                 packages may define options which override these global flags."
434         }
435     }
436
437     cdl_component CYGHWR_MEMORY_LAYOUT {
438         display "Memory layout"
439         flavor data
440         no_define
441         calculated { (CYG_HAL_STARTUP == "RAM") ? \
442                      "arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_ram" :
443                      "arm_" . CYGHWR_HAL_ARM_AT91SAM7 . "_rom" }
444
445         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
446             display "Memory layout linker script fragment"
447             flavor data
448             no_define
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>" }
453         }
454
455         cdl_option CYGHWR_MEMORY_LAYOUT_H {
456             display "Memory layout header file"
457             flavor data
458             no_define
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>" }
463         }
464     }
465 }