]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/hal/powerpc/mbx/v2_0/cdl/hal_powerpc_mbx.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / powerpc / mbx / v2_0 / cdl / hal_powerpc_mbx.cdl
1 # ====================================================================
2 #
3 #      hal_powerpc_mbx.cdl
4 #
5 #      PowerPC/MBX board 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) 2002, 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):      jskov
45 # Original data:  hmt
46 # Contributors:
47 # Date:           1999-11-02
48 #
49 #####DESCRIPTIONEND####
50 #
51 # ====================================================================
52
53 cdl_package CYGPKG_HAL_POWERPC_MBX {
54     display       "Motorola MBX PowerPC evaluation board"
55     parent        CYGPKG_HAL_POWERPC
56     requires      CYGPKG_HAL_POWERPC_MPC8xx
57     define_header hal_powerpc_mbx.h
58     include_dir   cyg/hal
59     description   "
60         The MBX HAL package provides the support needed to run
61         eCos on a Motorola MBX board equipped with a PowerPC processor."
62
63     compile       hal_diag.c hal_aux.c mbx.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     implements    CYGNUM_HAL_QUICC_SMC1
69
70     requires      { CYGHWR_HAL_POWERPC_MPC8XX == "860" }
71
72     define_proc {
73         puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_powerpc_mpc8xx.h>"
74         puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_powerpc_mbx.h>"
75
76         puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"Motorola MBX\""
77         puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
78     }
79
80     cdl_component CYG_HAL_STARTUP {
81         display       "Startup type"
82         flavor        data
83         legal_values  {"RAM" "ROM"}
84         default_value {"RAM"}
85         no_define
86         define -file system.h CYG_HAL_STARTUP
87         description   "
88            This option is used to control where the application program will
89            run, either from RAM or ROM (flash) memory.  ROM based applications
90            must be self contained, while RAM applications will typically assume
91            the existence of a debug environment, such as GDB stubs."
92     }
93
94     cdl_option CYGHWR_HAL_POWERPC_BOARD_SPEED {
95         display          "Development board clock speed (MHz)"
96         flavor           data
97         legal_values     40 50
98         default_value    50
99         description      "
100            MBX Development Boards have various system clock speeds
101            depending on the processor fitted.  Select the clock speed
102            appropriate for your board so that the system can set the serial
103            baud rate correctly, amongst other things."
104    }
105
106    cdl_option CYGHWR_HAL_POWERPC_MBX_BOOT_32BIT_FLASH {
107        display          "Boot ROM is 32-bit Flash device"
108        default_value    0
109        description      "
110            MBX Development Boards have a socketed 8-bit ROM (AM27F040,
111            AM29F040 or similar) and a permanently soldered 32-bit flash
112            device.  Which is used for booting is link selectable (refer to
113            the MBX Series documentation from Motorola).  Enable this option
114            when booting from the 32-bit flash so that the correct memory
115            timing and access method is initialized.  This consideration
116            does apply to RAM start eCos applications as well as ROM start
117            or stub ROMs."
118    }
119
120     # Real-time clock/counter specifics
121     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
122         display       "Real-time clock constants."
123         description   "
124             Period is busclock/16/100."
125         flavor        none
126         no_define
127     
128         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
129             display       "Real-time clock numerator"
130             flavor        data
131             default_value 1000000000
132         }
133         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
134             display       "Real-time clock denominator"
135             flavor        data
136             default_value 100
137             description   "
138               This option selects the number of system clock 'ticks'
139               per second.  This rate is sometimes known as the heartbeat rate."
140         }
141         cdl_option CYGNUM_HAL_RTC_PERIOD {
142             display       "Real-time clock period"
143             flavor        data
144             default_value { (((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/16)/CYGNUM_HAL_RTC_DENOMINATOR) }
145         }
146     }
147     
148     cdl_component CYGBLD_GLOBAL_OPTIONS {
149         display "Global build options"
150         flavor  none
151         description   "
152             Global build options including control over
153             compiler flags, linker flags and choice of toolchain."
154
155
156         parent  CYGPKG_NONE
157
158         cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
159             display "Global command prefix"
160             flavor  data
161             no_define
162             default_value { "powerpc-eabi" }
163             description "
164                 This option specifies the command prefix used when
165                 invoking the build tools."
166         }
167
168         cdl_option CYGBLD_GLOBAL_CFLAGS {
169             display "Global compiler flags"
170             flavor  data
171             no_define
172             default_value { "-msoft-float -mcpu=860 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority" }
173             description   "
174                 This option controls the global compiler flags which
175                 are used to compile all packages by
176                 default. Individual packages may define
177                 options which override these global flags."
178         }
179
180         cdl_option CYGBLD_GLOBAL_LDFLAGS {
181             display "Global linker flags"
182             flavor  data
183             no_define
184             default_value { "-msoft-float -mcpu=860 -g -nostdlib -Wl,--gc-sections -Wl,-static" }
185             description   "
186                 This option controls the global linker flags. Individual
187                 packages may define options which override these global flags."
188         }
189
190         cdl_option CYGBLD_BUILD_GDB_STUBS {
191             display "Build GDB stub ROM image"
192             default_value 0
193             requires { CYG_HAL_STARTUP == "ROM" }
194             requires CYGSEM_HAL_ROM_MONITOR
195             requires CYGBLD_BUILD_COMMON_GDB_STUBS
196             requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
197             requires CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
198             requires CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
199             requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
200             requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
201             no_define
202             description "
203                 This option enables the building of the GDB stubs for the
204                 board. The common HAL controls takes care of most of the
205                 build process, but the platform CDL takes care of creating
206                 an S-Record data file suitable for programming using
207                 the board's EPPC-Bug firmware monitor."
208
209             make -priority 320 {
210                 <PREFIX>/bin/gdb_module.bin : <PREFIX>/bin/gdb_module.img
211                 $(OBJCOPY) -O srec --change-address=0x02040000 $< $(@:.bin=.srec)
212                 $(OBJCOPY) -O binary $< $@
213             }
214         }
215     }
216
217     cdl_component CYGPKG_HAL_POWERPC_MBX_OPTIONS {
218         display "MBX build options"
219         flavor  none
220         description   "
221             Package specific build options including control over
222             compiler flags used only in building this package,
223             and details of which tests are built."
224
225
226         cdl_option CYGPKG_HAL_POWERPC_MBX_CFLAGS_ADD {
227             display "Additional compiler flags"
228             flavor  data
229             no_define
230             default_value { "" }
231             description   "
232                 This option modifies the set of compiler flags for
233                 building the MBX HAL. These flags are used in addition
234                 to the set of global flags."
235         }
236
237         cdl_option CYGPKG_HAL_POWERPC_MBX_CFLAGS_REMOVE {
238             display "Suppressed compiler flags"
239             flavor  data
240             no_define
241             default_value { "" }
242             description   "
243                 This option modifies the set of compiler flags for
244                 building the MBX HAL. These flags are removed from
245                 the set of global flags if present."
246         }
247
248         cdl_option CYGPKG_HAL_POWERPC_MBX_TESTS {
249             display "MBX tests"
250             flavor  data
251             no_define
252             calculated { "tests/mbxtime" }
253             description   "
254                 This option specifies the set of tests for the MBX HAL."
255         }
256     }
257
258     cdl_component CYGHWR_MEMORY_LAYOUT {
259         display "Memory layout"
260         flavor data
261         no_define
262         calculated { CYG_HAL_STARTUP == "RAM" ? "powerpc_mbx_ram" : \
263                                                 "powerpc_mbx_rom" }
264
265         cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
266             display "Memory layout linker script fragment"
267             flavor data
268             no_define
269             define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
270             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_powerpc_mbx_ram.ldi>" : \
271                                                     "<pkgconf/mlt_powerpc_mbx_rom.ldi>" }
272         }
273
274         cdl_option CYGHWR_MEMORY_LAYOUT_H {
275             display "Memory layout header file"
276             flavor data
277             no_define
278             define -file system.h CYGHWR_MEMORY_LAYOUT_H
279             calculated { CYG_HAL_STARTUP == "RAM" ? "<pkgconf/mlt_powerpc_mbx_ram.h>" : \
280                                                     "<pkgconf/mlt_powerpc_mbx_rom.h>" }
281         }
282     }
283
284     cdl_option CYGSEM_HAL_ROM_MONITOR {
285         display       "Behave as a ROM monitor"
286         flavor        bool
287         default_value 0
288         parent        CYGPKG_HAL_ROM_MONITOR
289         requires      { CYG_HAL_STARTUP == "ROM" }
290         description   "
291             Enable this option if this program is to be used as a ROM monitor,
292             i.e. applications will be loaded into RAM on the board, and this
293             ROM monitor may process exceptions or interrupts generated from the
294             application. This enables features such as utilizing a separate
295             interrupt stack when exceptions are generated."
296     }
297
298     cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
299         display       "Redboot HAL options"
300         flavor        none
301         no_define
302         parent        CYGPKG_REDBOOT
303         active_if     CYGPKG_REDBOOT
304         description   "
305             This option lists the target's requirements for a valid Redboot
306             configuration."
307
308         cdl_option CYGSEM_REDBOOT_PLF_LINUX_BOOT {
309             active_if      CYGBLD_BUILD_REDBOOT_WITH_EXEC
310             display        "Support booting Linux via RedBoot"
311             flavor         bool
312             default_value  1
313             description    "
314                This option enables RedBoot to support booting of a Linux kernel."
315
316             compile plf_redboot_linux_exec.c
317         }
318         
319         cdl_option CYGBLD_BUILD_REDBOOT_BIN {
320             display       "Build Redboot ROM binary image"
321             active_if     CYGBLD_BUILD_REDBOOT
322             default_value 1
323             no_define
324             description "This option enables the conversion of the Redboot ELF
325                          image to a binary image suitable for ROM programming."
326
327             make -priority 325 {
328                 <PREFIX>/bin/redboot.bin : <PREFIX>/bin/redboot.elf
329                 $(OBJCOPY) --strip-debug $< $(@:.bin=.img) 
330                 $(OBJCOPY) -O srec $< $(@:.bin=.srec)
331                 $(OBJCOPY) -O srec --change-address=0x02040000 $< $(@:.bin=.ppcbug)
332                 $(OBJCOPY) -O binary $< $@
333             }
334         }
335     }
336 }