]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/mx53/karo/v1_0/cdl/hal_arm_tx53.cdl
TX53 Release 2011-12-20
[karo-tx-redboot.git] / packages / hal / arm / mx53 / karo / v1_0 / cdl / hal_arm_tx53.cdl
1 # ====================================================================
2 #
3 #      hal_arm_tx53.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_TX53KARO {
40     display       "Ka-Ro TX53 module"
41     parent        CYGPKG_HAL_ARM_MX53
42     requires      CYGINT_ISO_CTYPE
43     hardware
44     include_dir   cyg/hal
45     define_header hal_arm_tx53.h
46     description   "
47         This HAL platform package provides generic
48         support for the Ka-Ro electronics TX53 module."
49
50     compile       tx53_misc.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_tx53.h>"
66         puts $::cdl_system_header "#define CYGBLD_HAL_PLF_DEFS_H <cyg/hal/karo_tx53.h>"
67         puts $::cdl_header "#define HAL_PLATFORM_CPU    \"Freescale i.MX53 based\""
68         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"Ka-Ro TX53 processor module\""
69         puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE  3279"
70         puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK tx53_program_new_stack"
71     }
72
73     cdl_component CYG_HAL_STARTUP {
74         display       "Startup type"
75         flavor        data
76         default_value { "ROMRAM" }
77         legal_values  { "ROMRAM" "RAM" }
78         no_define
79         define -file system.h CYG_HAL_STARTUP
80         description   "
81            The only startup type allowed is ROMRAM, since this will allow
82            the program to exist in ROM, but be copied to RAM during startup
83            which is required to boot from NAND flash."
84     }
85
86     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
87         display       "Diagnostic serial port baud rate"
88         flavor        data
89         legal_values  9600 19200 38400 57600 115200
90         default_value 115200
91         description   "
92             This option selects the baud rate used for the console port.
93             Note: this should match the value chosen for the GDB port if the
94             console and GDB port are the same."
95     }
96
97     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
98         display       "GDB serial port baud rate"
99         flavor        data
100         legal_values  9600 19200 38400 57600 115200
101         default_value 115200
102         description   "
103             This option selects the baud rate used for the GDB port.
104             Note: this should match the value chosen for the console port if the
105             console and GDB port are the same."
106     }
107
108     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
109         display      "Number of communication channels on the TX53"
110         flavor       data
111         calculated   5
112     }
113
114     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
115         display          "Debug serial port"
116         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
117         flavor           data
118         legal_values     0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
119         default_value    0
120         description      "
121             The TX53 provides access to five serial ports. This option
122             chooses which port will be used to connect to a host
123             running GDB."
124      }
125
126      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
127          display         "Default console channel."
128          flavor          data
129          legal_values    0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
130          calculated      0
131      }
132
133      cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
134          display         "Console serial port"
135          active_if       CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
136          flavor data
137          legal_values    0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
138          default_value   CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
139          description     "
140             The TX53 provides access to three serial ports. This option
141             chooses which port will be used for console output."
142      }
143
144     cdl_component CYGBLD_GLOBAL_OPTIONS {
145         display       "Global build options"
146         flavor        none
147         no_define
148         description   "
149             Global build options including control over
150             compiler flags, linker flags and choice of toolchain."
151
152
153         parent  CYGPKG_NONE
154
155         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
156             display       "Global command prefix"
157             flavor        data
158             no_define
159             default_value { "arm-926ejs-linux-gnu" }
160             description   "
161                 This option specifies the command prefix used when
162                 invoking the build tools."
163         }
164
165         cdl_option CYGBLD_GLOBAL_CFLAGS {
166             display       "Global compiler flags"
167             flavor        data
168             no_define
169             requires CYGBLD_INFRA_CFLAGS_WARNINGS_AS_ERRORS
170             default_value { "-march=armv5 -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" }
171             description   "
172                 This option controls the global compiler flags which are used to
173                 compile all packages by default. Individual packages may define
174                 options which override these global flags."
175         }
176
177         cdl_option CYGBLD_GLOBAL_LDFLAGS {
178             display       "Global linker flags"
179             flavor        data
180             no_define
181             default_value { "-Wl,--gc-sections -Wl,-static -O2 -nostdlib" }
182             description   "
183                 This option controls the global linker flags. Individual
184                 packages may define options which override these global flags."
185         }
186     }
187
188     cdl_component CYGPKG_HAL_ARM_TX53_OPTIONS {
189         display "Ka-Ro electronics TX53 module build options"
190         flavor        none
191         no_define
192         requires      { CYGBLD_REDBOOT_FLASH_BOOT_OFFSET == 0 }
193         description   "
194             Package specific build options including control over
195             compiler flags used only in building this package,
196             and details of which tests are built."
197
198         cdl_option CYGNUM_HAL_ARM_TX53_SDRAM_TYPE {
199             display       "SDRAM DDR type"
200             flavor        data
201             legal_values  { 2 3 }
202             default_value { 2 }
203             description   "
204                 This option specifies the SDRAM type of the TX53 module.
205                 Valid options are '2' for DDR2 and '3' for DDR3."
206         }
207
208         cdl_option CYGNUM_HAL_ARM_TX53_SDRAM_SIZE {
209             display       "SDRAM size"
210             flavor        data
211             legal_values  { 0x40000000 0x20000000 }
212             default_value { 0x20000000 }
213 # This is what I would like to do, but define_proc currently does not allow for
214 # accessing variables
215 #            display       "SDRAM size in MiB"
216 #            legal_values  { 1024 512 }
217 #            default_value { 1024 }
218 #            define_proc {
219 #                puts $::cdl_header "#define CYGNUM_HAL_ARM_TX53_SDRAM_SIZE \
220 #                       [format "0x%08x" [expr $CYGNUM_HAL_ARM_TX53_SDRAM_SIZE * 1048576]]"
221 #            }
222             description   "
223                 This option specifies the SDRAM size of the TX53 module."
224         }
225
226         cdl_option CYGNUM_HAL_ARM_TX53_CPU_CLK {
227             display       "CPU clock"
228             flavor        data
229             legal_values  { 800 1000 }
230             default_value { 1000 }
231             description   "
232                 This option specifies the CPU clock in MHz of the TX51 module."
233         }
234
235         cdl_option CYGOPT_HAL_ARM_TX53_DEBUG {
236             display "Enable low level debugging with LED"
237             flavor bool
238             default_value { false }
239             description   "
240                 This option enables low level debugging by blink codes
241                 of the LED on STK5."
242         }
243
244         cdl_option CYGPKG_HAL_ARM_TX53_CFLAGS_ADD {
245             display       "Additional compiler flags"
246             flavor        data
247             no_define
248             default_value { "" }
249             description   "
250                 This option modifies the set of compiler flags for
251                 building the TX53 HAL. These flags are used in addition
252                 to the set of global flags."
253         }
254
255         cdl_option CYGPKG_HAL_ARM_TX53_CFLAGS_REMOVE {
256             display       "Suppressed compiler flags"
257             flavor        data
258             no_define
259             default_value { "" }
260             description   "
261                 This option modifies the set of compiler flags for
262                 building the TX53 HAL. These flags are removed from
263                 the set of global flags if present."
264         }
265
266         cdl_option CYGHWR_MX53_LCD_LOGO {
267                 display       "Show a splash screen from the FIS partition: 'logo'"
268         active_if     { CYGPKG_DEVS_IMX_IPU }
269         default_value 0
270         description   "
271             When this option is enabled, RedBoot will look for a flash partition
272             named 'logo' and display the contents of this partition as initial
273             screen on the LCD"
274             compile       mx53_fastlogo.c
275         }
276     }
277
278     cdl_component CYGHWR_HAL_ARM_TX53_DDR2_OPTIONS {
279         display       "Options for DDR2 SDRAM"
280         active_if     { CYGNUM_HAL_ARM_TX53_SDRAM_TYPE == 2 }
281         flavor        none
282         no_define
283
284         cdl_option CYGNUM_HAL_ARM_TX53_DDR2_CLK {
285             display       "SDRAM clock"
286             flavor        data
287             legal_values  { 216 266 333 400 }
288             default_value { 400 }
289             description   "
290                 This option specifies the SDRAM clock im MHz of the TX53 module."
291         }
292     }
293
294     cdl_component CYGHWR_HAL_ARM_TX53_DDR3_OPTIONS {
295         display       "Options for DDR3 SDRAM"
296         active_if     { CYGNUM_HAL_ARM_TX53_SDRAM_TYPE == 3 }
297         flavor        none
298         no_define
299
300         cdl_option CYGNUM_HAL_ARM_TX53_DDR3_CLK {
301             display       "SDRAM clock"
302             flavor        data
303             legal_values  { 333 }
304             default_value { 333 }
305             description   "
306                 This option specifies the SDRAM clock im MHz of the TX53 module."
307         }
308     }
309
310     cdl_component CYGHWR_MEMORY_LAYOUT {
311         display "Memory layout"
312         flavor data
313         no_define
314         calculated { "arm_tx53_romram" }
315
316         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
317             display "Memory layout linker script fragment"
318             flavor data
319             no_define
320             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
321             calculated { "<pkgconf/mlt_arm_tx53_romram.ldi>" }
322         }
323
324         cdl_option CYGHWR_MEMORY_LAYOUT_H {
325             display "Memory layout header file"
326             flavor data
327             no_define
328             define -file system.h CYGHWR_MEMORY_LAYOUT_H
329             calculated { "<pkgconf/mlt_arm_tx53_romram.h>" }
330         }
331     }
332
333     cdl_option CYGSEM_HAL_ROM_MONITOR {
334         display       "Behave as a ROM monitor"
335         flavor        bool
336         default_value 0
337         parent        CYGPKG_HAL_ROM_MONITOR
338         requires      { CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "ROMRAM" }
339         description   "
340             Enable this option if this program is to be used as a ROM monitor,
341             i.e. applications will be loaded into RAM on the TX53 module, and this
342             ROM monitor may process exceptions or interrupts generated from the
343             application. This enables features such as utilizing a separate
344             interrupt stack when exceptions are generated."
345     }
346
347     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
348          display       "Work with a ROM monitor"
349          flavor        booldata
350          legal_values  { "Generic" "GDB_stubs" }
351          default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
352          parent        CYGPKG_HAL_ROM_MONITOR
353          requires      { CYG_HAL_STARTUP == "RAM" }
354          description   "
355              Support can be enabled for different varieties of ROM monitor.
356              This support changes various eCos semantics such as the encoding
357              of diagnostic output, or the overriding of hardware interrupt
358              vectors.
359              Firstly there is \"Generic\" support which prevents the HAL
360              from overriding the hardware vectors that it does not use, to
361              instead allow an installed ROM monitor to handle them. This is
362              the most basic support which is likely to be common to most
363              implementations of ROM monitor.
364              \"GDB_stubs\" provides support when GDB stubs are included in
365              the ROM monitor or boot ROM."
366     }
367
368     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
369         display       "Redboot HAL options"
370         flavor        none
371         no_define
372         parent        CYGPKG_REDBOOT
373         active_if     CYGPKG_REDBOOT
374         description   "
375             This option lists the target's requirements for a valid Redboot
376             configuration."
377
378             compile -library=libextras.a redboot_cmds.c
379
380         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
381             display       "Build Redboot ROM binary image"
382             active_if     CYGBLD_BUILD_REDBOOT
383             default_value 1
384             no_define
385             description "This option enables the conversion of the Redboot ELF
386                          image to a binary image suitable for ROM programming."
387
388             make -priority 325 {
389                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
390                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
391                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
392                 $(OBJCOPY) -O binary $< $@
393                 $(COMMAND_PREFIX)nm $< | awk 'NF == 3 {print}' | sort > $(<:.elf=.map)
394             }
395         }
396     }
397
398     cdl_component CYGPKG_REDBOOT_HAL_TX53_OPTIONS {
399         display       "Redboot HAL variant options"
400         flavor        none
401         no_define
402         parent        CYGPKG_REDBOOT
403         active_if     CYGPKG_REDBOOT
404
405         # RedBoot details
406         requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0x70108000 }
407         define_proc {
408             puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"
409         }
410     }
411 }