]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/arm9/smdk2410/v2_0/cdl/hal_arm_arm9_smdk2410.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / arm9 / smdk2410 / v2_0 / cdl / hal_arm_arm9_smdk2410.cdl
1 # ====================================================================
2 #
3 #      hal_arm_arm9_smdk2410.cdl
4 #
5 #      Samsung ARM9/SMDK2410 evaluation board HAL package configuration data
6 #
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.
12 ##
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.
16 ##
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
20 ## for more details.
21 ##
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.
25 ##
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.
32 ##
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.
35 ##
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####
42 #
43 # Author(s):      michael anburaj <michaelanburaj@hotmail.com>
44 # Contributors:   michael anburaj <michaelanburaj@hotmail.com>
45 # Date:           2003-08-01
46 #
47 #####DESCRIPTIONEND####
48 #
49 # ====================================================================
50
51 cdl_package CYGPKG_HAL_ARM_ARM9_SMDK2410 {
52     display       "Samsung ARM9/SMDK2410 development board"
53     parent        CYGPKG_HAL_ARM_ARM9
54     requires      CYGPKG_HAL_ARM_ARM9_ARM920T
55     hardware
56     include_dir   cyg/hal
57     define_header hal_arm_arm9_smdk2410.h
58     description   "
59          The SMDK2410 HAL package provides the support needed to run eCos on Samsung
60          S3C2410X (ARM920T) based boards."
61
62     compile       smdk2410_misc.c hal_diag.c
63
64     implements    CYGINT_HAL_DEBUG_GDB_STUBS
65     implements    CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
66     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
67
68     define_proc {
69         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
70         puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H  <pkgconf/hal_arm_arm9.h>"
71         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_arm9_smdk2410.h>"
72         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"ARM9\""
73         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"SMDK2410 system\""
74         puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
75
76         puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  106"
77     }
78
79     cdl_component CYG_HAL_STARTUP {
80         display       "Startup type"
81         flavor        data
82         legal_values  { "RAM" "ROM" "ROMRAM" }
83         default_value  { "RAM" }
84         no_define
85         define -file system.h CYG_HAL_STARTUP
86         description   "
87             When targetting the SMDK2410 evaluation 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 stubs.
90             Select 'rom' when building a stand-alone application which will be
91             put into ROM, or for the special case of building the eCos GDB stubs
92             themselves."
93     }
94
95     # Both PLLs are in bypass mode on startup.
96     # FIXME: Add proper configury
97     cdl_option CYGNUM_HAL_ARM_SMDK2410_CPU_CLOCK {
98         display       "CPU speed"
99         flavor        data
100         legal_values  176000000 180000000 184000000 192000000 200000000
101         default_value { 184000000 }
102         description   "
103             This is the actual CPU operating frequency (FCLK)."
104     }
105
106     cdl_option CYGNUM_HAL_ARM_SMDK2410_BUS_CLOCK {
107         display       "ARM920T bus speed"
108         flavor        data
109         calculated    { CYGNUM_HAL_ARM_SMDK2410_CPU_CLOCK / 2 }
110         description   "
111             This is the ARM920T AHB bus operating frequency (HCLK)."
112     }
113
114     cdl_option CYGNUM_HAL_ARM_SMDK2410_PERIPHERAL_CLOCK {
115         display       "Peripheral bus speed"
116         flavor        data
117         calculated    { CYGNUM_HAL_ARM_SMDK2410_CPU_CLOCK / 4 }
118         description   "
119             This is the peripheral (APB) bus operating frequency (PCLK)."
120     }
121
122     cdl_option CYGNUM_HAL_ARM_SMDK2410_TIMER_PRESCALE {
123         display       "Timer prescale"
124         flavor        data
125         legal_values  0 to 255
126         default_value 16
127         description   "
128             This is the prescale value used on the clock used to drive
129             the kernel counter. Note that some parts of the code may fail
130             if this is changed due to over/underflows of expressions."
131     }
132
133     # Real-time clock/counter specifics
134     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
135         display       "Real-time clock constants"
136         flavor        none
137         no_define
138     
139         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
140             display       "Real-time clock numerator"
141             flavor        data
142             calculated    1000000000
143         }
144         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
145             display       "Real-time clock denominator"
146             flavor        data
147             calculated    100
148         }
149         cdl_option CYGNUM_HAL_RTC_PERIOD {
150             display       "Real-time clock period"
151             flavor        data
152             calculated    ((CYGNUM_HAL_ARM_SMDK2410_PERIPHERAL_CLOCK/CYGNUM_HAL_ARM_SMDK2410_TIMER_PRESCALE/2)/CYGNUM_HAL_RTC_DENOMINATOR)
153             description   "
154             Assuming 1/2 post prescale divider."
155         }
156     }
157
158     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
159         display       "Diagnostic serial port baud rate"
160         flavor        data
161         legal_values  9600 19200 38400 57600 115200
162         default_value 38400
163         description   "
164             This option selects the baud rate used for the diagnostic port.
165             Note: this should match the value chosen for the GDB port if the
166             diagnostic and GDB port are the same."
167     }
168
169     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
170         display       "GDB serial port baud rate"
171         flavor        data
172         legal_values  9600 19200 38400 57600 115200
173         default_value 38400
174         description   "
175             This option selects the baud rate used for the diagnostic port.
176             Note: this should match the value chosen for the GDB port if the
177             diagnostic and GDB port are the same."
178     }
179
180     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
181         display      "Number of communication channels on the board"
182         flavor       data
183         calculated   2
184     }
185
186     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
187         display      "Default console channel."
188         flavor       data
189         legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
190         calculated   0
191     }
192  
193     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
194         display          "Debug serial port"
195         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
196         flavor data
197         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
198         default_value    0
199         description      "
200             The SMDK2410 boards have two serial ports. This option
201             chooses which port will be used to connect to a host
202             running GDB."
203      }
204  
205      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
206          display         "Diagnostic serial port"
207          active_if       CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
208          flavor data
209          legal_values    0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
210          default_value   CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
211          description     "
212              The SMDK2410 boards have two serial ports.  This option
213              chooses which port will be used for diagnostic output."
214      }
215
216     cdl_component CYGBLD_GLOBAL_OPTIONS {
217         display "Global build options"
218         flavor  none
219         no_define
220         description   "
221             Global build options including control over
222             compiler flags, linker flags and choice of toolchain."
223
224         parent  CYGPKG_NONE
225
226         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
227             display "Global command prefix"
228             flavor  data
229             no_define
230             default_value { "arm-elf" }
231             description "
232                 This option specifies the command prefix used when
233                 invoking the build tools."
234         }
235
236         cdl_option CYGBLD_GLOBAL_CFLAGS {
237             display "Global compiler flags"
238             flavor  data
239             no_define
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" }
241             description   "
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."
245         }
246
247         cdl_option CYGBLD_GLOBAL_LDFLAGS {
248             display "Global linker flags"
249             flavor  data
250             no_define
251             default_value { "--no-target-default-spec -Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" }
252             description   "
253                 This option controls the global linker flags. Individual
254                 packages may define options which override these global flags."
255         }
256
257         cdl_option CYGBLD_BUILD_GDB_STUBS {
258             display "Build GDB stub ROM image"
259             default_value 0
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
268             no_define
269             description "
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."
275
276             make -priority 320 {
277                 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
278                 $(OBJCOPY) -O binary $< $@
279             }
280         }
281    }
282
283
284     cdl_component CYGPKG_HAL_ARM_ARM9_SMDK2410_OPTIONS {
285         display "ARM9/SMDK2410 build options"
286         flavor  none
287         no_define
288         description   "
289             Package specific build options including control over
290             compiler flags used only in building this package,
291             and details of which tests are built."
292
293         cdl_option CYGPKG_HAL_ARM_ARM9_SMDK2410_CFLAGS_ADD {
294             display "Additional compiler flags"
295             flavor  data
296             no_define
297             default_value { "" }
298             description   "
299                 This option modifies the set of compiler flags for
300                 building the ARM9 SMDK2410 HAL. These flags are used in addition
301                 to the set of global flags."
302         }
303
304         cdl_option CYGPKG_HAL_ARM_ARM9_SMDK2410_CFLAGS_REMOVE {
305             display "Suppressed compiler flags"
306             flavor  data
307             no_define
308             default_value { "" }
309             description   "
310                 This option modifies the set of compiler flags for
311                 building the ARM9 SMDK2410 HAL. These flags are removed from
312                 the set of global flags if present."
313         }
314
315         cdl_option CYGPKG_HAL_ARM_ARM9_SMDK2410_TESTS {
316             display "ARM9/SMDK2410 tests"
317             flavor  data
318             no_define
319             calculated { "" }
320             description   "
321                 This option specifies the set of tests for the ARM9/SMDK2410 HAL."
322         }
323     }
324
325     cdl_component CYGHWR_MEMORY_LAYOUT {
326         display "Memory layout"
327         flavor data
328         no_define
329         calculated { CYG_HAL_STARTUP == "RAM" ? "arm_arm9_smdk2410_ram" : \
330                      CYG_HAL_STARTUP == "ROM" ? "arm_arm9_smdk2410_rom" : \
331                                                 "arm_arm9_smdk2410_romram" }
332
333         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
334             display "Memory layout linker script fragment"
335             flavor data
336             no_define
337             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
338             calculated {CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_arm9_smdk2410_ram.ldi>" :  \
339                         CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_arm9_smdk2410_rom.ldi>" : \
340                                                    "<pkgconf/mlt_arm_arm9_smdk2410_romram.ldi>" }
341         }
342
343         cdl_option CYGHWR_MEMORY_LAYOUT_H {
344             display "Memory layout header file"
345             flavor data
346             no_define
347             define -file system.h CYGHWR_MEMORY_LAYOUT_H
348             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_arm_arm9_smdk2410_ram.h>" :  \
349                          CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_arm_arm9_smdk2410_rom.h>" : \
350                                                     "<pkgconf/mlt_arm_arm9_smdk2410_romram.h>" }
351         }
352     }
353
354     cdl_option CYGSEM_HAL_ROM_MONITOR {
355         display       "Behave as a ROM monitor"
356         flavor        bool
357         default_value 0
358         parent        CYGPKG_HAL_ROM_MONITOR
359         requires      { (CYG_HAL_STARTUP == "ROM") || (CYG_HAL_STARTUP == "ROMRAM") }
360         description   "
361             Enable this option if this program is to be used as a ROM monitor,
362             i.e. applications will be loaded into RAM on the board, and this
363             ROM monitor may process exceptions or interrupts generated from the
364             application. This enables features such as utilizing a separate
365             interrupt stack when exceptions are generated."
366     }
367
368     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
369          display       "Work with a ROM monitor"
370          flavor        booldata
371          legal_values  { "GDB_stubs" }
372          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
373          parent        CYGPKG_HAL_ROM_MONITOR
374          requires      { CYG_HAL_STARTUP == "RAM" }
375          description   "
376              Support can be enabled for different varieties of ROM monitor.
377              This support changes various eCos semantics such as the encoding
378              of diagnostic output, or the overriding of hardware interrupt
379              vectors.
380              \"GDB_stubs\" provides support when GDB stubs are included in
381              the ROM monitor or boot ROM."
382      }
383
384     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
385         display       "Redboot HAL options"
386         flavor        none
387         no_define
388         parent        CYGPKG_REDBOOT
389         active_if     CYGPKG_REDBOOT
390         description   "
391             This option lists the target's requirements for a valid Redboot
392             configuration."
393
394         # The backup image is not needed, since ROMRAM is the normal
395         # RedBoot startup type.
396         requires {!CYGPKG_REDBOOT_FLASH || CYGOPT_REDBOOT_FIS_REDBOOT_BACKUP == 0}
397
398         # RedBoot details
399         requires { CYGPKG_REDBOOT_ARM_LINUX_EXEC }
400         requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0x00008000 }
401         define_proc {
402             puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
403         }
404     
405         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
406             display       "Build Redboot ROM binary image"
407             active_if     CYGBLD_BUILD_REDBOOT
408             default_value 1
409             no_define
410             description "This option enables the conversion of the Redboot ELF
411                          image to a binary image suitable for ROM programming."
412     
413             make -priority 325 {
414                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
415                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img) 
416                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
417                 $(OBJCOPY) -O binary $< $@
418             }
419         }
420     }
421
422 }