]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/arm/mx35/3stack/v2_0/cdl/hal_arm_board.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / mx35 / 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_MX35_3STACK {
40     display       "Freescale board"
41     parent        CYGPKG_HAL_ARM_MX35
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 MX35 3STACK 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_DUART_UARTB
55     implements    CYGHWR_HAL_ARM_SOC_UART1
56
57     define_proc {
58         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
59         puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H  <pkgconf/hal_arm_soc.h>"
60         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_board.h>"
61         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"i.MX35 \""
62         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"Freescale\""
63         puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  1645"
64         puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK board_program_new_stack"
65     }
66
67     cdl_component CYG_HAL_STARTUP {
68         display       "Startup type"
69         flavor        data
70         default_value {"ROM"}
71         legal_values  {"RAM" "ROM" "ROMRAM"}
72         no_define
73         define -file system.h CYG_HAL_STARTUP
74         description   "
75            When targetting the eval board it is possible to build
76            the system for either RAM bootstrap or ROM bootstrap(s). Select
77            'ram' when building programs to load into RAM using eCos GDB
78            stubs.  Select 'rom' when building a stand-alone application
79            which will be put into ROM, or for the special case of
80            building the eCos GDB stubs themselves. Using ROMRAM will allow
81            the program to exist in ROM, but be copied to RAM during startup."
82     }
83
84    cdl_interface CYGINT_DEVS_ETH_FEC_REQUIRED {
85         display   "FEC ethernet driver required"
86     }
87
88     implements CYGINT_DEVS_ETH_FEC_REQUIRED
89
90     cdl_interface     CYGHWR_HAL_ARM_DUART_UARTA {
91         display   "ST16552 UARTA available as diagnostic/debug channel"
92         description "
93           The board has a ST16552 DUART chip. This
94           interface allows a platform to indicate that the specified
95           serial port can be used as a diagnostic and/or debug channel."
96     }
97
98     cdl_interface     CYGHWR_HAL_ARM_DUART_UARTB {
99         display   "ST16552 UARTB available as diagnostic/debug channel"
100         description "
101           The board has a ST16552 DUART chip. This
102           interface allows a platform to indicate that the specified
103           serial port can be used as a diagnostic and/or debug channel."
104     }
105
106     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
107         display       "Diagnostic serial port baud rate"
108         flavor        data
109         legal_values  9600 19200 38400 57600 115200
110         default_value 115200
111         description   "
112             This option selects the baud rate used for the console port.
113             Note: this should match the value chosen for the GDB port if the
114             console and GDB port are the same."
115     }
116
117     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
118         display       "GDB serial port baud rate"
119         flavor        data
120         legal_values  9600 19200 38400 57600 115200
121         default_value 115200
122         description   "
123             This option selects the baud rate used for the GDB port.
124             Note: this should match the value chosen for the console port if the
125             console and GDB port are the same."
126     }
127
128     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
129         display      "Number of communication channels on the board"
130         flavor       data
131         calculated   3
132     }
133
134     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
135         display          "Debug serial port"
136         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
137         flavor data
138         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
139         default_value    0
140         description      "
141             The board has three serial ports. This option
142             chooses which port will be used to connect to a host
143             running GDB."
144      }
145
146      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
147          display      "Default console channel."
148          flavor       data
149          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
150          calculated   0
151      }
152
153      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
154          display          "Console serial port"
155          active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
156          flavor data
157          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
158          default_value    CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
159          description      "
160             The board has only three serial ports.  This option
161             chooses which port will be used for console output."
162      }
163
164     cdl_component CYGBLD_GLOBAL_OPTIONS {
165         display "Global build options"
166         flavor  none
167         no_define
168         description   "
169             Global build options including control over
170             compiler flags, linker flags and choice of toolchain."
171
172
173         parent  CYGPKG_NONE
174
175         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
176             display "Global command prefix"
177             flavor  data
178             no_define
179             default_value { "arm-none-eabi" }
180             description "
181                 This option specifies the command prefix used when
182                 invoking the build tools."
183         }
184
185         cdl_option CYGBLD_GLOBAL_CFLAGS {
186             display "Global compiler flags"
187             flavor  data
188             no_define
189             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" }
190             description   "
191                 This option controls the global compiler flags which are used to
192                 compile all packages by default. Individual packages may define
193                 options which override these global flags."
194         }
195
196         cdl_option CYGBLD_GLOBAL_LDFLAGS {
197             display "Global linker flags"
198             flavor  data
199             no_define
200             default_value { "-Wl,--gc-sections -Wl,-static -g -O2 -nostdlib" }
201             description   "
202                 This option controls the global linker flags. Individual
203                 packages may define options which override these global flags."
204         }
205
206         cdl_option CYGBLD_BUILD_GDB_STUBS {
207             display "Build GDB stub ROM image"
208             default_value 0
209             requires { CYG_HAL_STARTUP == "ROM" }
210             requires CYGSEM_HAL_ROM_MONITOR
211             requires CYGBLD_BUILD_COMMON_GDB_STUBS
212             requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
213             requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
214             requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
215             requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
216             requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
217             no_define
218             description "
219                 This option enables the building of the GDB stubs for the
220                 board. The common HAL controls takes care of most of the
221                 build process, but the final conversion from ELF image to
222                 binary data is handled by the platform CDL, allowing
223                 relocation of the data if necessary."
224
225             make -priority 320 {
226                 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
227                 $(OBJCOPY) --remove-section=.fixed_vectors -O binary $< $@
228             }
229         }
230     }
231
232     cdl_component CYGPKG_HAL_ARM_BOARD_OPTIONS {
233         display "Freescale MXC Board build options"
234         flavor  none
235         no_define
236         description   "
237             Package specific build options including control over
238             compiler flags used only in building this package,
239             and details of which tests are built."
240
241         cdl_option CYGPKG_HAL_ARM_BOARD_CFLAGS_ADD {
242             display "Additional compiler flags"
243             flavor  data
244             no_define
245             default_value { "" }
246             description   "
247                 This option modifies the set of compiler flags for
248                 building the board HAL. These flags are used in addition
249                 to the set of global flags."
250         }
251
252         cdl_option CYGPKG_HAL_ARM_BOARD_CFLAGS_REMOVE {
253             display "Suppressed compiler flags"
254             flavor  data
255             no_define
256             default_value { "" }
257             description   "
258                 This option modifies the set of compiler flags for
259                 building the board HAL. These flags are removed from
260                 the set of global flags if present."
261         }
262
263     }
264
265     cdl_component CYGHWR_MEMORY_LAYOUT {
266         display "Memory layout"
267         flavor data
268         no_define
269         calculated { (CYG_HAL_STARTUP == "RAM")    ? "arm_board_ram" :
270                      (CYG_HAL_STARTUP == "ROMRAM") ? "arm_board_romram" :
271                                                      "arm_board_rom" }
272
273         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
274             display "Memory layout linker script fragment"
275             flavor data
276             no_define
277             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
278             calculated { (CYG_HAL_STARTUP == "RAM") ?    "<pkgconf/mlt_arm_board_ram.ldi>" :
279                          (CYG_HAL_STARTUP == "ROMRAM") ? "<pkgconf/mlt_arm_board_romram.ldi>" :
280                                                          "<pkgconf/mlt_arm_board_rom.ldi>" }
281         }
282
283         cdl_option CYGHWR_MEMORY_LAYOUT_H {
284             display "Memory layout header file"
285             flavor data
286             no_define
287             define -file system.h CYGHWR_MEMORY_LAYOUT_H
288             calculated { (CYG_HAL_STARTUP == "RAM")    ? "<pkgconf/mlt_arm_board_ram.h>" :
289                          (CYG_HAL_STARTUP == "ROMRAM") ? "<pkgconf/mlt_arm_board_romram.h>" :
290                                                          "<pkgconf/mlt_arm_board_rom.h>" }
291         }
292     }
293
294     cdl_option CYGSEM_HAL_ROM_MONITOR {
295         display       "Behave as a ROM monitor"
296         flavor        bool
297         default_value 0
298         parent        CYGPKG_HAL_ROM_MONITOR
299         requires      { CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "ROMRAM" }
300         description   "
301             Enable this option if this program is to be used as a ROM monitor,
302             i.e. applications will be loaded into RAM on the board, and this
303             ROM monitor may process exceptions or interrupts generated from the
304             application. This enables features such as utilizing a separate
305             interrupt stack when exceptions are generated."
306     }
307
308     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
309          display       "Work with a ROM monitor"
310          flavor        booldata
311          legal_values  { "Generic" "GDB_stubs" }
312          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
313          parent        CYGPKG_HAL_ROM_MONITOR
314          requires      { CYG_HAL_STARTUP == "RAM" }
315          description   "
316              Support can be enabled for different varieties of ROM monitor.
317              This support changes various eCos semantics such as the encoding
318              of diagnostic output, or the overriding of hardware interrupt
319              vectors.
320              Firstly there is \"Generic\" support which prevents the HAL
321              from overriding the hardware vectors that it does not use, to
322              instead allow an installed ROM monitor to handle them. This is
323              the most basic support which is likely to be common to most
324              implementations of ROM monitor.
325              \"GDB_stubs\" provides support when GDB stubs are included in
326              the ROM monitor or boot ROM."
327      }
328
329     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
330         display       "Redboot HAL options"
331         flavor        none
332         no_define
333         parent        CYGPKG_REDBOOT
334         active_if     CYGPKG_REDBOOT
335         description   "
336             This option lists the target's requirements for a valid Redboot
337             configuration."
338
339             compile -library=libextras.a redboot_cmds.c
340
341         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
342             display       "Build Redboot ROM binary image"
343             active_if     CYGBLD_BUILD_REDBOOT
344             default_value 1
345             no_define
346             description "This option enables the conversion of the Redboot ELF
347                          image to a binary image suitable for ROM programming."
348
349             make -priority 325 {
350                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
351                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
352                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
353                 $(OBJCOPY) -O binary $< $@
354             }
355         }
356     }
357
358     cdl_component CYGPKG_REDBOOT_HAL_BOARD_OPTIONS {
359         display       "Redboot HAL variant options"
360         flavor        none
361         no_define
362         parent        CYGPKG_REDBOOT
363         active_if     CYGPKG_REDBOOT
364
365         # RedBoot details
366         requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0x80008000 }
367         define_proc {
368             puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
369         }
370     }
371 }