]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/powerpc/rattler/v2_0/cdl/hal_powerpc_rattler.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / powerpc / rattler / v2_0 / cdl / hal_powerpc_rattler.cdl
1 # ====================================================================
2 #
3 #      hal_powerpc_rattler.cdl
4 #
5 #      Analogue & Micro Rattler (MPC8250) HAL package configuration data
6 #
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
13 ##
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.
17 ##
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
21 ## for more details.
22 ##
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.
26 ##
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.
33 ##
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.
36 ##
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####
43 #
44 # Author(s):      gthomas
45 # Original data:  hmt
46 # Contributors:
47 # Date:           2003-06-30
48 #
49 #####DESCRIPTIONEND####
50 #
51 # ====================================================================
52
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
58     include_dir   cyg/hal
59     description   "
60         The RATTLER HAL package provides the support needed to run
61         eCos on an Analogue & Micro Rattler board."
62
63     compile       hal_diag.c hal_aux.c rattler.S
64
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        
69
70     implements    CYGNUM_HAL_MPC8XXX_SCC1
71     implements    CYGNUM_HAL_MPC8XXX_SMC1
72
73 # Note: uncomment this to get old-style debug behaviour
74 #   implements    CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT_NOT_GUARANTEED
75
76     define_proc {
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>"
79
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  \"\""
83     }
84
85     cdl_component CYG_HAL_STARTUP {
86         display       "Startup type"
87         flavor        data
88         legal_values  { "RAM" "ROM" "ROMRAM" }
89         default_value { "RAM" }
90         no_define
91         define -file system.h CYG_HAL_STARTUP
92         description   "
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."
97     }
98
99     cdl_option CYGHWR_HAL_POWERPC_DISABLE_MMU {
100         display       "DISABLE MMU"
101         flavor        bool
102         default_value 0
103         #        calculated    1
104         description   "
105             This option will disable the MMU enabled."
106     }
107
108     cdl_option CYGHWR_HAL_POWERPC_BUS_SPEED {
109         display          "Development board clock speed (MHz)"
110         flavor           data
111         legal_values     66
112         default_value    66
113         description      "
114            The Rattler currently only runs at 66MHz"
115     }
116  
117     cdl_option CYGHWR_HAL_POWERPC_CPU_SPEED {
118         display          "Development board clock speed (MHz)"
119         flavor           data
120         legal_values     200
121         default_value    200
122         description      "
123            The Rattler is configured to run the CPU at 3.5x"           
124     }
125
126     cdl_option CYGHWR_HAL_POWERPC_CPM_SPEED {
127         display          "Development board clock speed (MHz)"
128         flavor           data
129         legal_values     166 133
130         default_value    { (CYGHWR_HAL_POWERPC_RATTLER_PCI == 0) ? 166 : 133 }
131         description      "
132            The Rattler is configured to run the CPM at 2.5x
133            This clock is used by the baud rate generators"
134     }
135
136     cdl_option CYGHWR_HAL_POWERPC_RATTLER_PCI {
137         display          "Rattler with PCI (agent) support"
138         flavor           bool
139         default_value    0
140         description      "
141            The Rattler comes in two variants - one with PCI
142            and another without."
143         define_proc {
144             puts $::cdl_header "#undef  HAL_PLATFORM_BOARD"
145             puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"Rattler-PCI\""
146         }
147     }
148
149     # Real-time clock/counter specifics
150     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
151         display       "Real-time clock constants."
152         description   "
153             Period is busclock/4/CYGNUM_HAL_RTC_DENOMINATOR.  VERIFY THIS!!!"
154         flavor        none
155         no_define
156     
157         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
158             display       "Real-time clock numerator"
159             flavor        data
160             calculated    1000000000
161         }
162         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
163             display       "Real-time clock denominator"
164             flavor        data
165             default_value 100
166             description   "
167               This option selects the number of system clock 'ticks'
168               per second.  This rate is sometimes known as the heartbeat rate."
169         }
170         cdl_option CYGNUM_HAL_RTC_PERIOD {
171             display       "Real-time clock period"
172             flavor        data
173             calculated    { (((CYGHWR_HAL_POWERPC_BUS_SPEED*1000000)/4)/CYGNUM_HAL_RTC_DENOMINATOR) }
174         }
175     }
176     
177     cdl_component CYGBLD_GLOBAL_OPTIONS {
178         display "Global build options"
179         flavor  none
180         description   "
181             Global build options including control over
182             compiler flags, linker flags and choice of toolchain."
183
184         parent  CYGPKG_NONE
185
186         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
187             display "Global command prefix"
188             flavor  data
189             no_define
190             default_value { "powerpc-eabi" }
191             description "
192                 This option specifies the command prefix used when
193                 invoking the build tools."
194         }
195
196         cdl_option CYGBLD_GLOBAL_CFLAGS {
197             display "Global compiler flags"
198             flavor  data
199             no_define
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" }
201             description   "
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."
206         }
207
208         cdl_option CYGBLD_GLOBAL_LDFLAGS {
209             display "Global linker flags"
210             flavor  data
211             no_define
212             default_value { "-msoft-float -mcpu=603e -g -nostdlib -Wl,--gc-sections -Wl,-static" }
213             description   "
214                 This option controls the global linker flags. Individual
215                 packages may define options which override these global flags."
216         }
217
218         cdl_option CYGBLD_BUILD_GDB_STUBS {
219             display "Build GDB stub ROM image"
220             default_value 0
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
225
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
230             no_define
231             description "
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"
236
237             make -priority 320 {
238                 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
239                 $(OBJCOPY) -O srec --srec-forceS3 $< $(@:.bin=.s19)
240                 $(OBJCOPY) -O binary $< $@
241             }
242         }
243     }
244
245     cdl_component CYGPKG_HAL_POWERPC_RATTLER_OPTIONS {
246         display "MPC8260 RATTLER build options"
247         flavor  none
248         description   "
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."
252
253
254         cdl_option CYGPKG_HAL_POWERPC_RATTLER_CFLAGS_ADD {
255             display "Additional compiler flags"
256             flavor  data
257             no_define
258             default_value { "" }
259             description   "
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."
263         }
264
265         cdl_option CYGPKG_HAL_POWERPC_RATTLER_CFLAGS_REMOVE {
266             display "Suppressed compiler flags"
267             flavor  data
268             no_define
269             default_value { "" }
270             description   "
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."
274         }
275     }
276
277     cdl_component CYGHWR_MEMORY_LAYOUT {
278         display "Memory layout"
279         flavor data
280         no_define
281         calculated { CYG_HAL_STARTUP == "RAM" ? "powerpc_rattler_ram" : \
282                      CYG_HAL_STARTUP == "ROM" ? "powerpc_rattler_rom" : \
283                                                 "powerpc_rattler_romram" }
284
285         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
286             display "Memory layout linker script fragment"
287             flavor data
288             no_define
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>" }
293         }
294
295         cdl_option CYGHWR_MEMORY_LAYOUT_H {
296             display "Memory layout header file"
297             flavor data
298             no_define
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>" }
303         }
304     }
305
306     cdl_option CYGSEM_HAL_ROM_MONITOR {
307         display       "Behave as a ROM monitor"
308         flavor        bool
309         default_value 0
310         parent        CYGPKG_HAL_ROM_MONITOR
311         requires      { (CYG_HAL_STARTUP == "ROM") || (CYG_HAL_STARTUP == "ROMRAM") }
312         description   "
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."
318     }
319
320     cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
321         display       "Work with a ROM monitor"
322         flavor        bool
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
332         description   "
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."
336     }
337
338
339     # FIXME: the option above should be adjusted to select between monitor
340     #        variants
341     cdl_option CYGSEM_HAL_USE_ROM_MONITOR_GDB_stubs {
342         parent        CYGPKG_HAL_ROM_MONITOR
343         display "Bad CDL workaround"
344         calculated 1
345         active_if CYGSEM_HAL_USE_ROM_MONITOR
346     }
347
348
349     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
350         display       "Redboot HAL options"
351         flavor        none
352         no_define
353         parent        CYGPKG_REDBOOT
354         active_if     CYGPKG_REDBOOT
355         description   "
356             This option lists the target's requirements for a valid Redboot
357             configuration."
358
359         cdl_option CYGSEM_REDBOOT_PLF_LINUX_BOOT {
360             active_if      CYGBLD_BUILD_REDBOOT_WITH_EXEC
361             display        "Support booting Linux via RedBoot"
362             flavor         bool
363             default_value  1
364             description    "
365                This option enables RedBoot to support booting of a Linux kernel."
366
367             compile plf_redboot_linux_exec.c
368         }
369
370         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
371             display       "Build Redboot ROM binary image"
372             active_if     CYGBLD_BUILD_REDBOOT
373             default_value 1
374             no_define
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."
378
379             make -priority 325 {
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 $< $@
384             }
385         }
386     }
387 }