1 # ====================================================================
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.
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.
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
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.
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.
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.
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####
39 cdl_package CYGPKG_HAL_ARM_TX37KARO {
40 display "Ka-Ro TX37 module"
41 parent CYGPKG_HAL_ARM_MX37
42 requires CYGINT_ISO_CTYPE
45 define_header hal_arm_tx37.h
47 This HAL platform package provides generic
48 support for the Ka-Ro electronics TX37 module."
50 compile tx37_misc.c tx37_diag.c
51 implements CYGINT_HAL_DEBUG_GDB_STUBS
52 implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
53 implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
55 implements CYGHWR_HAL_ARM_SOC_UART1
56 implements CYGHWR_HAL_ARM_SOC_UART2
58 requires {CYGBLD_BUILD_REDBOOT == 1}
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_tx37.h>"
64 puts $::cdl_header "#define HAL_PLATFORM_CPU \"Freescale i.MX37 based\""
65 puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Ka-Ro TX37 processor module\""
66 puts $::cdl_header "#define HAL_PLATFORM_MACHINE_TYPE 1575"
67 puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK tx37_program_new_stack"
70 cdl_component CYG_HAL_STARTUP {
71 display "Startup type"
73 default_value { "ROMRAM" }
74 legal_values { "ROMRAM" }
76 define -file system.h CYG_HAL_STARTUP
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."
83 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
84 display "Diagnostic serial port baud rate"
86 legal_values 9600 19200 38400 57600 115200
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."
94 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_BAUD {
95 display "GDB serial port baud rate"
97 legal_values 9600 19200 38400 57600 115200
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."
105 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
106 display "Number of communication channels on the TX37"
111 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
112 display "Debug serial port"
113 active_if CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE
115 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
118 The TX37 provides access to two serial ports. This option
119 chooses which port will be used to connect to a host
123 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT {
124 display "Default console channel."
126 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
130 cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL {
131 display "Console serial port"
132 active_if CYGPRI_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_CONFIGURABLE
134 legal_values 0 to CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS-1
135 default_value CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT
137 The TX37 provides access to two serial ports. This option
138 chooses which port will be used for console output."
141 cdl_component CYGBLD_GLOBAL_OPTIONS {
142 display "Global build options"
146 Global build options including control over
147 compiler flags, linker flags and choice of toolchain."
152 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
153 display "Global command prefix"
156 default_value { "arm-1136jfs-linux-gnu" }
158 This option specifies the command prefix used when
159 invoking the build tools."
162 cdl_option CYGBLD_GLOBAL_CFLAGS {
163 display "Global compiler flags"
166 requires CYGBLD_INFRA_CFLAGS_WARNINGS_AS_ERRORS
167 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" }
169 This option controls the global compiler flags which are used to
170 compile all packages by default. Individual packages may define
171 options which override these global flags."
174 cdl_option CYGBLD_GLOBAL_LDFLAGS {
175 display "Global linker flags"
178 default_value { "-Wl,--gc-sections -Wl,-static -O2 -nostdlib" }
180 This option controls the global linker flags. Individual
181 packages may define options which override these global flags."
185 cdl_component CYGPKG_HAL_ARM_TX37_OPTIONS {
186 display "Ka-Ro electronics TX37 module build options"
189 requires { CYGBLD_REDBOOT_FLASH_BOOT_OFFSET == 0 }
191 Package specific build options including control over
192 compiler flags used only in building this package,
193 and details of which tests are built."
195 cdl_option CYGNUM_HAL_ARM_TX37_SDRAM_SIZE {
198 legal_values { 0x08000000 0x04000000 }
199 default_value { 0x08000000 }
200 # This is what I would like to do, but define_proc currently does not allow for
201 # accessing variables
202 # display "SDRAM size in MiB"
203 # legal_values { 128 }
204 # default_value { 128 }
206 # puts $::cdl_header "#define CYGNUM_HAL_ARM_TX37_SDRAM_SIZE \
207 # [format "0x%08x" [expr $CYGNUM_HAL_ARM_TX37_SDRAM_SIZE * 1048576]]"
210 This option specifies the SDRAM size of the TX37 module."
213 cdl_option CYGOPT_HAL_ARM_TX37_DEBUG {
214 display "Enable low level debugging with LED"
216 default_value { false }
218 This option enables low level debugging by blink codes
222 cdl_option CYGPKG_HAL_ARM_TX37_CFLAGS_ADD {
223 display "Additional compiler flags"
228 This option modifies the set of compiler flags for
229 building the TX37 HAL. These flags are used in addition
230 to the set of global flags."
233 cdl_option CYGPKG_HAL_ARM_TX37_CFLAGS_REMOVE {
234 display "Suppressed compiler flags"
239 This option modifies the set of compiler flags for
240 building the TX37 HAL. These flags are removed from
241 the set of global flags if present."
246 cdl_component CYGHWR_MEMORY_LAYOUT {
247 display "Memory layout"
250 calculated { "arm_tx37_romram" }
252 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
253 display "Memory layout linker script fragment"
256 define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
257 calculated { "<pkgconf/mlt_arm_tx37_romram.ldi>" }
260 cdl_option CYGHWR_MEMORY_LAYOUT_H {
261 display "Memory layout header file"
264 define -file system.h CYGHWR_MEMORY_LAYOUT_H
265 calculated { "<pkgconf/mlt_arm_tx37_romram.h>" }
269 cdl_option CYGSEM_HAL_ROM_MONITOR {
270 display "Behave as a ROM monitor"
273 parent CYGPKG_HAL_ROM_MONITOR
274 requires { CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "ROMRAM" }
276 Enable this option if this program is to be used as a ROM monitor,
277 i.e. applications will be loaded into RAM on the TX37 module, and this
278 ROM monitor may process exceptions or interrupts generated from the
279 application. This enables features such as utilizing a separate
280 interrupt stack when exceptions are generated."
283 cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
284 display "Work with a ROM monitor"
286 legal_values { "Generic" "GDB_stubs" }
287 default_value { CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 }
288 parent CYGPKG_HAL_ROM_MONITOR
289 requires { CYG_HAL_STARTUP == "RAM" }
291 Support can be enabled for different varieties of ROM monitor.
292 This support changes various eCos semantics such as the encoding
293 of diagnostic output, or the overriding of hardware interrupt
295 Firstly there is \"Generic\" support which prevents the HAL
296 from overriding the hardware vectors that it does not use, to
297 instead allow an installed ROM monitor to handle them. This is
298 the most basic support which is likely to be common to most
299 implementations of ROM monitor.
300 \"GDB_stubs\" provides support when GDB stubs are included in
301 the ROM monitor or boot ROM."
304 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
305 display "Redboot HAL options"
308 parent CYGPKG_REDBOOT
309 active_if CYGPKG_REDBOOT
311 This option lists the target's requirements for a valid Redboot
314 compile -library=libextras.a redboot_cmds.c
316 cdl_option CYGBLD_BUILD_REDBOOT_BIN {
317 display "Build Redboot ROM binary image"
318 active_if CYGBLD_BUILD_REDBOOT
321 description "This option enables the conversion of the Redboot ELF
322 image to a binary image suitable for ROM programming."
325 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
326 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
327 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
328 $(OBJCOPY) -O binary $< $@
329 $(COMMAND_PREFIX)nm $< | awk 'NF == 3 {print}' | sort > $(<:.elf=.map)
334 cdl_component CYGPKG_REDBOOT_HAL_TX37_OPTIONS {
335 display "Redboot HAL variant options"
338 parent CYGPKG_REDBOOT
339 active_if CYGPKG_REDBOOT
342 requires { CYGHWR_REDBOOT_ARM_LINUX_EXEC_ADDRESS_DEFAULT == 0x40108000 }
344 puts $::cdl_header "#define CYGHWR_REDBOOT_ARM_TRAMPOLINE_ADDRESS 0x00001f00"