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