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