1 # ====================================================================
3 # hal_powerpc_rattler.cdl
5 # Analogue & Micro Rattler (MPC8250) HAL package configuration data
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12 ## Copyright (C) 2003 Gary Thomas
14 ## eCos is free software; you can redistribute it and/or modify it under
15 ## the terms of the GNU General Public License as published by the Free
16 ## Software Foundation; either version 2 or (at your option) any later version.
18 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
19 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 ## You should have received a copy of the GNU General Public License along
24 ## with eCos; if not, write to the Free Software Foundation, Inc.,
25 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27 ## As a special exception, if other files instantiate templates or use macros
28 ## or inline functions from this file, or you compile this file and link it
29 ## with other works to produce a work based on this file, this file does not
30 ## by itself cause the resulting work to be covered by the GNU General Public
31 ## License. However the source code for this file must still be made available
32 ## in accordance with section (3) of the GNU General Public License.
34 ## This exception does not invalidate any other reasons why a work based on
35 ## this file might be covered by the GNU General Public License.
37 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
38 ## at http://sources.redhat.com/ecos/ecos-license/
39 ## -------------------------------------------
40 #####ECOSGPLCOPYRIGHTEND####
41 # ====================================================================
42 ######DESCRIPTIONBEGIN####
49 #####DESCRIPTIONEND####
51 # ====================================================================
53 cdl_package CYGPKG_HAL_POWERPC_RATTLER {
54 display "Analogue & Micro Rattler board"
55 parent CYGPKG_HAL_POWERPC
56 requires CYGPKG_HAL_POWERPC_MPC8XXX
57 define_header hal_powerpc_rattler.h
60 The RATTLER HAL package provides the support needed to run
61 eCos on an Analogue & Micro Rattler board."
63 compile hal_diag.c hal_aux.c rattler.S
65 implements CYGINT_HAL_DEBUG_GDB_STUBS
66 implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
67 implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
68 requires CYGSEM_HAL_POWERPC_RESET_USES_JUMP
70 implements CYGNUM_HAL_MPC8XXX_SCC1
71 implements CYGNUM_HAL_MPC8XXX_SMC1
73 # Note: uncomment this to get old-style debug behaviour
74 # implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_NOT_GUARANTEED
77 puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_powerpc_mpc8xxx.h>"
78 puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_powerpc_rattler.h>"
80 puts $::cdl_header "#define HAL_PLATFORM_CPU \"PowerPC MPC8250\""
81 puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Rattler\""
82 puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\""
85 cdl_component CYG_HAL_STARTUP {
86 display "Startup type"
88 legal_values { "RAM" "ROM" "ROMRAM" }
89 default_value { "RAM" }
91 define -file system.h CYG_HAL_STARTUP
93 This option is used to control where the application program will
94 run, either from RAM or ROM (flash) memory. ROM based applications
95 must be self contained, while RAM applications will typically assume
96 the existence of a debug environment, such as GDB stubs."
99 cdl_option CYGHWR_HAL_POWERPC_DISABLE_MMU {
100 display "DISABLE MMU"
105 This option will disable the MMU enabled."
108 cdl_option CYGHWR_HAL_POWERPC_BUS_SPEED {
109 display "Development board clock speed (MHz)"
114 The Rattler currently only runs at 66MHz"
117 cdl_option CYGHWR_HAL_POWERPC_CPU_SPEED {
118 display "Development board clock speed (MHz)"
123 The Rattler is configured to run the CPU at 3.5x"
126 cdl_option CYGHWR_HAL_POWERPC_CPM_SPEED {
127 display "Development board clock speed (MHz)"
130 default_value { (CYGHWR_HAL_POWERPC_RATTLER_PCI == 0) ? 166 : 133 }
132 The Rattler is configured to run the CPM at 2.5x
133 This clock is used by the baud rate generators"
136 cdl_option CYGHWR_HAL_POWERPC_RATTLER_PCI {
137 display "Rattler with PCI (agent) support"
141 The Rattler comes in two variants - one with PCI
142 and another without."
144 puts $::cdl_header "#undef HAL_PLATFORM_BOARD"
145 puts $::cdl_header "#define HAL_PLATFORM_BOARD \"Rattler-PCI\""
149 # Real-time clock/counter specifics
150 cdl_component CYGNUM_HAL_RTC_CONSTANTS {
151 display "Real-time clock constants."
153 Period is busclock/4/CYGNUM_HAL_RTC_DENOMINATOR. VERIFY THIS!!!"
157 cdl_option CYGNUM_HAL_RTC_NUMERATOR {
158 display "Real-time clock numerator"
160 calculated 1000000000
162 cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
163 display "Real-time clock denominator"
167 This option selects the number of system clock 'ticks'
168 per second. This rate is sometimes known as the heartbeat rate."
170 cdl_option CYGNUM_HAL_RTC_PERIOD {
171 display "Real-time clock period"
173 calculated { (((CYGHWR_HAL_POWERPC_BUS_SPEED*1000000)/4)/CYGNUM_HAL_RTC_DENOMINATOR) }
177 cdl_component CYGBLD_GLOBAL_OPTIONS {
178 display "Global build options"
181 Global build options including control over
182 compiler flags, linker flags and choice of toolchain."
186 cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
187 display "Global command prefix"
190 default_value { "powerpc-eabi" }
192 This option specifies the command prefix used when
193 invoking the build tools."
196 cdl_option CYGBLD_GLOBAL_CFLAGS {
197 display "Global compiler flags"
200 default_value { "-msoft-float -mcpu=603e -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
202 This option controls the global compiler flags which
203 are used to compile all packages by
204 default. Individual packages may define
205 options which override these global flags."
208 cdl_option CYGBLD_GLOBAL_LDFLAGS {
209 display "Global linker flags"
212 default_value { "-msoft-float -mcpu=603e -g -nostdlib -Wl,--gc-sections -Wl,-static" }
214 This option controls the global linker flags. Individual
215 packages may define options which override these global flags."
218 cdl_option CYGBLD_BUILD_GDB_STUBS {
219 display "Build GDB stub ROM image"
221 requires { (CYG_HAL_STARTUP == "ROM") || (CYG_HAL_STARTUP == "ROMRAM") }
222 requires CYGSEM_HAL_ROM_MONITOR
223 requires CYGBLD_BUILD_COMMON_GDB_STUBS
224 requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
226 requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
227 requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
228 requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
229 requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
232 This option enables the building of the GDB stubs for the
233 board. The common HAL controls takes care of most of the
234 build process, but the platform CDL takes care of creating
235 an S-Record data file. -- This needs more work"
238 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
239 $(OBJCOPY) -O srec --srec-forceS3 $< $(@:.bin=.s19)
240 $(OBJCOPY) -O binary $< $@
245 cdl_component CYGPKG_HAL_POWERPC_RATTLER_OPTIONS {
246 display "MPC8260 RATTLER build options"
249 Package specific build options including control over
250 compiler flags used only in building this package,
251 and details of which tests are built."
254 cdl_option CYGPKG_HAL_POWERPC_RATTLER_CFLAGS_ADD {
255 display "Additional compiler flags"
260 This option modifies the set of compiler flags for
261 building the RATTLER HAL. These flags are used in addition
262 to the set of global flags."
265 cdl_option CYGPKG_HAL_POWERPC_RATTLER_CFLAGS_REMOVE {
266 display "Suppressed compiler flags"
271 This option modifies the set of compiler flags for
272 building the RATTLER HAL. These flags are removed from
273 the set of global flags if present."
277 cdl_component CYGHWR_MEMORY_LAYOUT {
278 display "Memory layout"
281 calculated { CYG_HAL_STARTUP == "RAM" ? "powerpc_rattler_ram" : \
282 CYG_HAL_STARTUP == "ROM" ? "powerpc_rattler_rom" : \
283 "powerpc_rattler_romram" }
285 cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
286 display "Memory layout linker script fragment"
289 define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
290 calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_powerpc_rattler_ram.ldi>" : \
291 CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_powerpc_rattler_rom.ldi>" : \
292 "<pkgconf/mlt_powerpc_rattler_romram.ldi>" }
295 cdl_option CYGHWR_MEMORY_LAYOUT_H {
296 display "Memory layout header file"
299 define -file system.h CYGHWR_MEMORY_LAYOUT_H
300 calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_powerpc_rattler_ram.h>" : \
301 CYG_HAL_STARTUP == "ROM" ? "<pkgconf/mlt_powerpc_rattler_rom.h>" : \
302 "<pkgconf/mlt_powerpc_rattler_romram.h>" }
306 cdl_option CYGSEM_HAL_ROM_MONITOR {
307 display "Behave as a ROM monitor"
310 parent CYGPKG_HAL_ROM_MONITOR
311 requires { (CYG_HAL_STARTUP == "ROM") || (CYG_HAL_STARTUP == "ROMRAM") }
313 Enable this option if this program is to be used as a ROM monitor,
314 i.e. applications will be loaded into RAM on the board, and this
315 ROM monitor may process exceptions or interrupts generated from the
316 application. This enables features such as utilizing a separate
317 interrupt stack when exceptions are generated."
320 cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
321 display "Work with a ROM monitor"
323 default_value { (CYG_HAL_STARTUP == "RAM" &&
324 !CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS &&
325 !CYGINT_HAL_USE_ROM_MONITOR_UNSUPPORTED &&
326 !CYGSEM_HAL_POWERPC_COPY_VECTORS) ? 1 : 0 }
327 parent CYGPKG_HAL_ROM_MONITOR
328 requires { CYG_HAL_STARTUP == "RAM" }
329 requires ! CYGSEM_HAL_POWERPC_COPY_VECTORS
330 requires ! CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
331 requires ! CYGINT_HAL_USE_ROM_MONITOR_UNSUPPORTED
333 Allow coexistence with ROM monitor (CygMon or GDB stubs) by
334 only initializing interrupt vectors on startup, thus leaving
335 exception handling to the ROM monitor."
339 # FIXME: the option above should be adjusted to select between monitor
341 cdl_option CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs {
342 parent CYGPKG_HAL_ROM_MONITOR
343 display "Bad CDL workaround"
345 active_if CYGSEM_HAL_USE_ROM_MONITOR
349 cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
350 display "Redboot HAL options"
353 parent CYGPKG_REDBOOT
354 active_if CYGPKG_REDBOOT
356 This option lists the target's requirements for a valid Redboot
359 cdl_option CYGSEM_REDBOOT_PLF_LINUX_BOOT {
360 active_if CYGBLD_BUILD_REDBOOT_WITH_EXEC
361 display "Support booting Linux via RedBoot"
365 This option enables RedBoot to support booting of a Linux kernel."
367 compile plf_redboot_linux_exec.c
370 cdl_option CYGBLD_BUILD_REDBOOT_BIN {
371 display "Build Redboot ROM binary image"
372 active_if CYGBLD_BUILD_REDBOOT
375 description "This option enables the conversion of the Redboot ELF
376 image to a binary image suitable for ROM programming.
377 This needs more work."
380 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
381 $(OBJCOPY) --strip-debug $< $(@:.bin=.img)
382 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
383 $(OBJCOPY) -O binary $< $@