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