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