]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/arm/mx27/karo/v1_0/cdl/hal_arm_tx27.cdl
d8bcdc6f0dd5abcfe0872231fa2d566a196b7650
[karo-tx-redboot.git] / packages / hal / arm / mx27 / karo / v1_0 / cdl / hal_arm_tx27.cdl
1 # ====================================================================
2 #
3 #      hal_arm_tx27.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_TX27KARO {
40     display       "Ka-Ro TX27 module"
41     parent        CYGPKG_HAL_ARM_MX27
42     requires      CYGINT_ISO_CTYPE
43     hardware
44     include_dir   cyg/hal
45     define_header hal_arm_tx27.h
46     description   "
47         This HAL platform package provides generic
48         support for the Ka-Ro electronics TX27 module."
49
50     compile       tx27_misc.c tx27_diag.c
51     implements    CYGINT_HAL_DEBUG_GDB_STUBS
52     implements    CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
53     implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
54
55     implements    CYGHWR_HAL_ARM_SOC_UART1
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_tx27.h>"
64         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"Freescale i.MX27 based\""
65         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"Ka-Ro TX27 processor module\""
66         puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  1600"
67         puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK tx27_program_new_stack"
68     }
69
70     cdl_component CYG_HAL_STARTUP {
71         display       "Startup type"
72         flavor        data
73         default_value {"ROMRAM"}
74         legal_values  {"ROMRAM"}
75         no_define
76         define -file system.h CYG_HAL_STARTUP
77         description   "
78            The only startup type allowed is ROMRAM, since this will allow
79            the program to exist in ROM, but be copied to RAM during startup
80            which is required to boot from NAND flash."
81     }
82
83     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
84         display       "Diagnostic serial port baud rate"
85         flavor        data
86         legal_values  9600 19200 38400 57600 115200
87         default_value 115200
88         description   "
89             This option selects the baud rate used for the console port.
90             Note: this should match the value chosen for the GDB port if the
91             console and GDB port are the same."
92     }
93
94     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
95         display       "GDB serial port baud rate"
96         flavor        data
97         legal_values  9600 19200 38400 57600 115200
98         default_value 115200
99         description   "
100             This option selects the baud rate used for the GDB port.
101             Note: this should match the value chosen for the console port if the
102             console and GDB port are the same."
103     }
104
105     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
106         display      "Number of communication channels on the TX27"
107         flavor       data
108         calculated   3
109     }
110
111     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
112         display          "Debug serial port"
113         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
114         flavor data
115         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
116         default_value    0
117         description      "
118             The TX27 provides access to three serial ports. This option
119             chooses which port will be used to connect to a host
120             running GDB."
121      }
122
123      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
124          display      "Default console channel."
125          flavor       data
126          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
127          calculated   0
128      }
129
130      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
131          display          "Console serial port"
132          active_if        CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
133          flavor data
134          legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
135          default_value    CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
136          description      "
137             The TX27 provides access to three serial ports. This option
138             chooses which port will be used for console output."
139      }
140
141     cdl_component CYGBLD_GLOBAL_OPTIONS {
142         display "Global build options"
143         flavor  none
144         no_define
145         description   "
146             Global build options including control over
147             compiler flags, linker flags and choice of toolchain."
148
149
150         parent  CYGPKG_NONE
151
152         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
153             display "Global command prefix"
154             flavor  data
155             no_define
156             default_value { "arm-linux" }
157             description "
158                 This option specifies the command prefix used when
159                 invoking the build tools."
160         }
161
162         cdl_option CYGBLD_GLOBAL_CFLAGS {
163             display "Global compiler flags"
164             flavor  data
165             no_define
166             default_value { "-mcpu=arm9 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
167             description   "
168                 This option controls the global compiler flags which are used to
169                 compile all packages by default. Individual packages may define
170                 options which override these global flags."
171         }
172
173         cdl_option CYGBLD_GLOBAL_LDFLAGS {
174             display "Global linker flags"
175             flavor  data
176             no_define
177             default_value { "-Wl,--gc-sections -Wl,-static -O2 -nostdlib" }
178             description   "
179                 This option controls the global linker flags. Individual
180                 packages may define options which override these global flags."
181         }
182     }
183     cdl_component CYGPKG_HAL_ARM_TX27_OPTIONS {
184         display "Ka-Ro electronics TX27 module build options"
185         flavor  none
186         no_define
187         description   "
188             Package specific build options including control over
189             compiler flags used only in building this package,
190             and details of which tests are built."
191
192         cdl_option CYGPKG_HAL_ARM_TX27_CFLAGS_ADD {
193             display "Additional compiler flags"
194             flavor  data
195             no_define
196             default_value { "" }
197             description   "
198                 This option modifies the set of compiler flags for
199                 building the TX27 HAL. These flags are used in addition
200                 to the set of global flags."
201         }
202
203         cdl_option CYGPKG_HAL_ARM_TX27_CFLAGS_REMOVE {
204             display "Suppressed compiler flags"
205             flavor  data
206             no_define
207             default_value { "" }
208             description   "
209                 This option modifies the set of compiler flags for
210                 building the TX27 HAL. These flags are removed from
211                 the set of global flags if present."
212         }
213
214     }
215
216     cdl_component CYGHWR_MEMORY_LAYOUT {
217         display "Memory layout"
218         flavor data
219         no_define
220         calculated { (CYG_HAL_STARTUP == "RAM")    ? "arm_tx27_ram" :
221                      (CYG_HAL_STARTUP == "ROMRAM") ? "arm_tx27_romram" :
222                                                      "arm_tx27_rom" }
223
224         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
225             display "Memory layout linker script fragment"
226             flavor data
227             no_define
228             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
229             calculated { (CYG_HAL_STARTUP == "RAM") ?    "<pkgconf/mlt_arm_tx27_ram.ldi>" :
230                          (CYG_HAL_STARTUP == "ROMRAM") ? "<pkgconf/mlt_arm_tx27_romram.ldi>" :
231                                                          "<pkgconf/mlt_arm_tx27_rom.ldi>" }
232         }
233
234         cdl_option CYGHWR_MEMORY_LAYOUT_H {
235             display "Memory layout header file"
236             flavor data
237             no_define
238             define -file system.h CYGHWR_MEMORY_LAYOUT_H
239             calculated { (CYG_HAL_STARTUP == "RAM")    ? "<pkgconf/mlt_arm_tx27_ram.h>" :
240                          (CYG_HAL_STARTUP == "ROMRAM") ? "<pkgconf/mlt_arm_tx27_romram.h>" :
241                                                          "<pkgconf/mlt_arm_tx27_rom.h>" }
242         }
243     }
244
245     cdl_option CYGSEM_HAL_ROM_MONITOR {
246         display       "Behave as a ROM monitor"
247         flavor        bool
248         default_value 0
249         parent        CYGPKG_HAL_ROM_MONITOR
250         requires      { CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "ROMRAM" }
251         description   "
252             Enable this option if this program is to be used as a ROM monitor,
253             i.e. applications will be loaded into RAM on the TX27, and this
254             ROM monitor may process exceptions or interrupts generated from the
255             application. This enables features such as utilizing a separate
256             interrupt stack when exceptions are generated."
257     }
258
259     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
260          display       "Work with a ROM monitor"
261          flavor        booldata
262          legal_values  { "Generic" "GDB_stubs" }
263          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
264          parent        CYGPKG_HAL_ROM_MONITOR
265          requires      { CYG_HAL_STARTUP == "RAM" }
266          description   "
267              Support can be enabled for different varieties of ROM monitor.
268              This support changes various eCos semantics such as the encoding
269              of diagnostic output, or the overriding of hardware interrupt
270              vectors.
271              Firstly there is \"Generic\" support which prevents the HAL
272              from overriding the hardware vectors that it does not use, to
273              instead allow an installed ROM monitor to handle them. This is
274              the most basic support which is likely to be common to most
275              implementations of ROM monitor.
276              \"GDB_stubs\" provides support when GDB stubs are included in
277              the ROM monitor or boot ROM."
278     }
279
280     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
281         display       "Redboot HAL options"
282         flavor        none
283         no_define
284         parent        CYGPKG_REDBOOT
285         active_if     CYGPKG_REDBOOT
286         description   "
287             This option lists the target's requirements for a valid Redboot
288             configuration."
289         
290             compile -library=libextras.a redboot_cmds.c
291
292         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
293             display       "Build Redboot ROM binary image"
294             active_if     CYGBLD_BUILD_REDBOOT
295             default_value 1
296             no_define
297             description "This option enables the conversion of the Redboot ELF
298                          image to a binary image suitable for ROM programming."
299
300             make -priority 325 {
301                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
302                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
303                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
304                 $(OBJCOPY) -O binary $< $@
305             }
306         }
307     }
308
309     cdl_component CYGPKG_REDBOOT_HAL_TX27_OPTIONS {
310         display       "Redboot HAL variant options"
311         flavor        none
312         no_define
313         parent        CYGPKG_REDBOOT
314         active_if     CYGPKG_REDBOOT
315
316         # RedBoot details
317         requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0xA0108000 }
318         define_proc {
319             puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
320         }
321     }
322 }