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