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