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