]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/arm/mx25/3stack/v2_0/cdl/hal_arm_board.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / mx25 / 3stack / v2_0 / cdl / hal_arm_board.cdl
1 # ====================================================================
2 #
3 #      hal_arm_board.cdl
4 #
5 # ====================================================================
6 #####ECOSGPLCOPYRIGHTBEGIN####
7 ## -------------------------------------------
8 ## This file is part of eCos, the Embedded Configurable Operating System.
9 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
10 ##
11 ## eCos is free software; you can redistribute it and/or modify it under
12 ## the terms of the GNU General Public License as published by the Free
13 ## Software Foundation; either version 2 or (at your option) any later version.
14 ##
15 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
16 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 ## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18 ## for more details.
19 ##
20 ## You should have received a copy of the GNU General Public License along
21 ## with eCos; if not, write to the Free Software Foundation, Inc.,
22 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
23 ##
24 ## As a special exception, if other files instantiate templates or use macros
25 ## or inline functions from this file, or you compile this file and link it
26 ## with other works to produce a work based on this file, this file does not
27 ## by itself cause the resulting work to be covered by the GNU General Public
28 ## License. However the source code for this file must still be made available
29 ## in accordance with section (3) of the GNU General Public License.
30 ##
31 ## This exception does not invalidate any other reasons why a work based on
32 ## this file might be covered by the GNU General Public License.
33 ##
34 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
35 ## at http://sources.redhat.com/ecos/ecos-license/
36 ## -------------------------------------------
37 #####ECOSGPLCOPYRIGHTEND####
38
39 cdl_package CYGPKG_HAL_ARM_MX25_3STACK {
40     display       "Freescale board"
41     parent        CYGPKG_HAL_ARM_MX25
42     hardware
43     include_dir   cyg/hal
44     define_header hal_arm_board.h
45     description   "
46         This HAL platform package provides generic
47         support for the Freescale i.MX25 3-Stack Board."
48
49     compile       board_misc.c board_diag.c
50     implements    CYGINT_HAL_DEBUG_GDB_STUBS
51     implements    CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
52     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
53
54     implements    CYGHWR_HAL_ARM_SOC_UART1
55
56     define_proc {
57         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
58         puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H  <pkgconf/hal_arm_soc.h>"
59         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_board.h>"
60         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"i.MX25 \""
61         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"Freescale\""
62         puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  1771"
63         puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK board_program_new_stack"
64     }
65
66     cdl_component CYG_HAL_STARTUP {
67         display       "Startup type"
68         flavor        data
69         default_value {"ROM"}
70         legal_values  {"RAM" "ROM" "ROMRAM"}
71         no_define
72         define -file system.h CYG_HAL_STARTUP
73         description   "
74            When targetting the eval board it is possible to build
75            the system for either RAM bootstrap or ROM bootstrap(s). Select
76            'ram' when building programs to load into RAM using eCos GDB
77            stubs.  Select 'rom' when building a stand-alone application
78            which will be put into ROM, or for the special case of
79            building the eCos GDB stubs themselves. Using ROMRAM will allow
80            the program to exist in ROM, but be copied to RAM during startup."
81     }
82
83     cdl_interface     CYGHWR_HAL_ARM_DUART_UARTA {
84         display   "ST16552 UARTA available as diagnostic/debug channel"
85         description "
86           The board has a ST16552 DUART chip. This
87           interface allows a platform to indicate that the specified
88           serial port can be used as a diagnostic and/or debug channel."
89     }
90
91     cdl_interface     CYGHWR_HAL_ARM_DUART_UARTB {
92         display   "ST16552 UARTB available as diagnostic/debug channel"
93         description "
94           The board has a ST16552 DUART chip. This
95           interface allows a platform to indicate that the specified
96           serial port can be used as a diagnostic and/or debug channel."
97     }
98
99     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
100         display       "Diagnostic serial port baud rate"
101         flavor        data
102         legal_values  9600 19200 38400 57600 115200
103         default_value 115200
104         description   "
105             This option selects the baud rate used for the console port.
106             Note: this should match the value chosen for the GDB port if the
107             console and GDB port are the same."
108     }
109
110     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
111         display       "GDB serial port baud rate"
112         flavor        data
113         legal_values  9600 19200 38400 57600 115200
114         default_value 115200
115         description   "
116             This option selects the baud rate used for the GDB port.
117             Note: this should match the value chosen for the console port if the
118             console and GDB port are the same."
119     }
120
121     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
122         display      "Number of communication channels on the board"
123         flavor       data
124         calculated   5
125     }
126
127     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
128         display          "Debug serial port"
129         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
130         flavor data
131         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
132         default_value    0
133         description      "
134             The board has three serial ports. This option
135             chooses which port will be used to connect to a host
136             running GDB."
137      }
138
139      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
140          display      "Default console channel."
141          flavor       data
142          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
143          calculated   0
144      }
145
146      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
147          display          "Console serial port"
148          active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
149          flavor data
150          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
151          default_value    CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
152          description      "
153             The board has only three serial ports.  This option
154             chooses which port will be used for console output."
155      }
156
157     cdl_component CYGBLD_GLOBAL_OPTIONS {
158         display "Global build options"
159         flavor  none
160         no_define
161         description   "
162             Global build options including control over
163             compiler flags, linker flags and choice of toolchain."
164
165
166         parent  CYGPKG_NONE
167
168         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
169             display "Global command prefix"
170             flavor  data
171             no_define
172             default_value { "arm-none-eabi" }
173             description "
174                 This option specifies the command prefix used when
175                 invoking the build tools."
176         }
177
178         cdl_option CYGBLD_GLOBAL_CFLAGS {
179             display "Global compiler flags"
180             flavor  data
181             no_define
182             default_value { "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-builtin -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
183             description   "
184                 This option controls the global compiler flags which are used to
185                 compile all packages by default. Individual packages may define
186                 options which override these global flags."
187         }
188
189         cdl_option CYGBLD_GLOBAL_LDFLAGS {
190             display "Global linker flags"
191             flavor  data
192             no_define
193             default_value { "-Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" }
194             description   "
195                 This option controls the global linker flags. Individual
196                 packages may define options which override these global flags."
197         }
198
199         cdl_option CYGBLD_BUILD_GDB_STUBS {
200             display "Build GDB stub ROM image"
201             default_value 0
202             requires { CYG_HAL_STARTUP == "ROM" }
203             requires CYGSEM_HAL_ROM_MONITOR
204             requires CYGBLD_BUILD_COMMON_GDB_STUBS
205             requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
206             requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
207             requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
208             requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
209             requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
210             no_define
211             description "
212                 This option enables the building of the GDB stubs for the
213                 board. The common HAL controls takes care of most of the
214                 build process, but the final conversion from ELF image to
215                 binary data is handled by the platform CDL, allowing
216                 relocation of the data if necessary."
217
218             make -priority 320 {
219                 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
220                 $(OBJCOPY) --remove-section=.fixed_vectors -O binary $< $@
221             }
222         }
223     }
224
225     cdl_component CYGPKG_HAL_ARM_BOARD_OPTIONS {
226         display "Freescale MXC Board build options"
227         flavor  none
228         no_define
229         description   "
230             Package specific build options including control over
231             compiler flags used only in building this package,
232             and details of which tests are built."
233
234         cdl_option CYGPKG_HAL_ARM_BOARD_CFLAGS_ADD {
235             display "Additional compiler flags"
236             flavor  data
237             no_define
238             default_value { "" }
239             description   "
240                 This option modifies the set of compiler flags for
241                 building the board HAL. These flags are used in addition
242                 to the set of global flags."
243         }
244
245         cdl_option CYGPKG_HAL_ARM_BOARD_CFLAGS_REMOVE {
246             display "Suppressed compiler flags"
247             flavor  data
248             no_define
249             default_value { "" }
250             description   "
251                 This option modifies the set of compiler flags for
252                 building the board HAL. These flags are removed from
253                 the set of global flags if present."
254         }
255
256     }
257
258     cdl_component CYGHWR_MEMORY_LAYOUT {
259         display "Memory layout"
260         flavor data
261         no_define
262         calculated { (CYG_HAL_STARTUP == "RAM")    ? "arm_board_ram" :
263                      (CYG_HAL_STARTUP == "ROMRAM") ? "arm_board_romram" :
264                                                      "arm_board_rom" }
265
266         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
267             display "Memory layout linker script fragment"
268             flavor data
269             no_define
270             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
271             calculated { (CYG_HAL_STARTUP == "RAM") ?    "<pkgconf/mlt_arm_board_ram.ldi>" :
272                          (CYG_HAL_STARTUP == "ROMRAM") ? "<pkgconf/mlt_arm_board_romram.ldi>" :
273                                                          "<pkgconf/mlt_arm_board_rom.ldi>" }
274         }
275
276         cdl_option CYGHWR_MEMORY_LAYOUT_H {
277             display "Memory layout header file"
278             flavor data
279             no_define
280             define -file system.h CYGHWR_MEMORY_LAYOUT_H
281             calculated { (CYG_HAL_STARTUP == "RAM")    ? "<pkgconf/mlt_arm_board_ram.h>" :
282                          (CYG_HAL_STARTUP == "ROMRAM") ? "<pkgconf/mlt_arm_board_romram.h>" :
283                                                          "<pkgconf/mlt_arm_board_rom.h>" }
284         }
285     }
286
287     cdl_option CYGSEM_HAL_ROM_MONITOR {
288         display       "Behave as a ROM monitor"
289         flavor        bool
290         default_value 0
291         parent        CYGPKG_HAL_ROM_MONITOR
292         requires      { CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "ROMRAM" }
293         description   "
294             Enable this option if this program is to be used as a ROM monitor,
295             i.e. applications will be loaded into RAM on the board, and this
296             ROM monitor may process exceptions or interrupts generated from the
297             application. This enables features such as utilizing a separate
298             interrupt stack when exceptions are generated."
299     }
300
301     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
302          display       "Work with a ROM monitor"
303          flavor        booldata
304          legal_values  { "Generic" "GDB_stubs" }
305          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
306          parent        CYGPKG_HAL_ROM_MONITOR
307          requires      { CYG_HAL_STARTUP == "RAM" }
308          description   "
309              Support can be enabled for different varieties of ROM monitor.
310              This support changes various eCos semantics such as the encoding
311              of diagnostic output, or the overriding of hardware interrupt
312              vectors.
313              Firstly there is \"Generic\" support which prevents the HAL
314              from overriding the hardware vectors that it does not use, to
315              instead allow an installed ROM monitor to handle them. This is
316              the most basic support which is likely to be common to most
317              implementations of ROM monitor.
318              \"GDB_stubs\" provides support when GDB stubs are included in
319              the ROM monitor or boot ROM."
320      }
321
322     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
323         display       "Redboot HAL options"
324         flavor        none
325         no_define
326         parent        CYGPKG_REDBOOT
327         active_if     CYGPKG_REDBOOT
328         description   "
329             This option lists the target's requirements for a valid Redboot
330             configuration."
331
332             compile -library=libextras.a redboot_cmds.c
333
334         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
335             display       "Build Redboot ROM binary image"
336             active_if     CYGBLD_BUILD_REDBOOT
337             default_value 1
338             no_define
339             description "This option enables the conversion of the Redboot ELF
340                          image to a binary image suitable for ROM programming."
341
342             make -priority 325 {
343                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
344                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
345                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
346                 $(OBJCOPY) -O binary $< $@
347             }
348         }
349     }
350
351     cdl_component CYGPKG_REDBOOT_HAL_BOARD_OPTIONS {
352         display       "Redboot HAL variant options"
353         flavor        none
354         no_define
355         parent        CYGPKG_REDBOOT
356         active_if     CYGPKG_REDBOOT
357
358         # RedBoot details
359         requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0x80008000 }
360         define_proc {
361             puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
362         }
363     }
364 }