1 |
786 |
skrzyp |
# ====================================================================
|
2 |
|
|
#
|
3 |
|
|
# hal_openrisc.cdl
|
4 |
|
|
#
|
5 |
|
|
# OpenRISC architectural HAL package configuration data
|
6 |
|
|
#
|
7 |
|
|
# ====================================================================
|
8 |
|
|
## ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 2003 Free Software Foundation, Inc.
|
12 |
|
|
##
|
13 |
|
|
## eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
## the terms of the GNU General Public License as published by the Free
|
15 |
|
|
## Software Foundation; either version 2 or (at your option) any later
|
16 |
|
|
## version.
|
17 |
|
|
##
|
18 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
## ANY 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
|
24 |
|
|
## along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
##
|
27 |
|
|
## As a special exception, if other files instantiate templates or use
|
28 |
|
|
## macros or inline functions from this file, or you compile this file
|
29 |
|
|
## and link it with other works to produce a work based on this file,
|
30 |
|
|
## this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
## the GNU General Public License. However the source code for this file
|
32 |
|
|
## must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
## General Public License v2.
|
34 |
|
|
##
|
35 |
|
|
## This exception does not invalidate any other reasons why a work based
|
36 |
|
|
## on this file might be covered by the GNU General Public License.
|
37 |
|
|
## -------------------------------------------
|
38 |
|
|
## ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
# ====================================================================
|
40 |
|
|
######DESCRIPTIONBEGIN####
|
41 |
|
|
#
|
42 |
|
|
# Author(s): sfurman
|
43 |
|
|
# Original data: bartv, nickg
|
44 |
|
|
# Contributors: jskov
|
45 |
|
|
# Date: 2003-02-28
|
46 |
|
|
#
|
47 |
|
|
#####DESCRIPTIONEND####
|
48 |
|
|
#
|
49 |
|
|
# ====================================================================
|
50 |
|
|
|
51 |
|
|
cdl_package CYGPKG_HAL_OPENRISC {
|
52 |
|
|
display "OpenRISC architecture"
|
53 |
|
|
parent CYGPKG_HAL
|
54 |
|
|
hardware
|
55 |
|
|
include_dir cyg/hal
|
56 |
|
|
define_header hal_openrisc.h
|
57 |
|
|
description "
|
58 |
|
|
The OpenRISC architecture HAL package provides generic support
|
59 |
|
|
for this processor architecture. It is also necessary to
|
60 |
|
|
select a specific target platform HAL package."
|
61 |
|
|
|
62 |
|
|
compile context.S vectors.S hal_misc.c openrisc_stub.c
|
63 |
|
|
|
64 |
|
|
implements CYGINT_HAL_DEBUG_GDB_STUBS
|
65 |
|
|
implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
|
66 |
|
|
|
67 |
|
|
make {
|
68 |
|
|
/lib/vectors.o : /src/vectors.S
|
69 |
|
|
$(CC) -Wp,-MD,vectors.tmp $(INCLUDE_PATH) $(CFLAGS) -c -o $@ $<
|
70 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
71 |
|
|
@tail -n +2 vectors.tmp >> $(notdir $@).deps
|
72 |
|
|
@echo >> $(notdir $@).deps
|
73 |
|
|
@rm vectors.tmp
|
74 |
|
|
}
|
75 |
|
|
|
76 |
|
|
define_proc {
|
77 |
|
|
puts $::cdl_header "#define HAL_ARCH_PROGRAM_NEW_STACK hal_arch_program_new_stack"
|
78 |
|
|
}
|
79 |
|
|
|
80 |
|
|
cdl_option CYGBLD_LINKER_SCRIPT {
|
81 |
|
|
display "Linker script"
|
82 |
|
|
flavor data
|
83 |
|
|
no_define
|
84 |
|
|
calculated { "src/openrisc.ld" }
|
85 |
|
|
}
|
86 |
|
|
|
87 |
|
|
make {
|
88 |
|
|
/lib/target.ld: /src/openrisc.ld
|
89 |
|
|
$(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(ACTUAL_CFLAGS) -o $@ $<
|
90 |
|
|
@echo $@ ": \\" > $(notdir $@).deps
|
91 |
|
|
@tail -n +2 target.tmp >> $(notdir $@).deps
|
92 |
|
|
@echo >> $(notdir $@).deps
|
93 |
|
|
@rm target.tmp
|
94 |
|
|
}
|
95 |
|
|
|
96 |
|
|
cdl_component CYG_HAL_STARTUP {
|
97 |
|
|
display "Startup type"
|
98 |
|
|
flavor data
|
99 |
|
|
legal_values {"RAM" "ROM" "JTAG"}
|
100 |
|
|
default_value {"JTAG"}
|
101 |
|
|
no_define
|
102 |
|
|
define -file system.h CYG_HAL_STARTUP
|
103 |
|
|
description "
|
104 |
|
|
Selects whether code initially runs from ROM or RAM. In the case of ROM startup,
|
105 |
|
|
it's possible for the code to be copied into RAM and executed there."
|
106 |
|
|
}
|
107 |
|
|
|
108 |
|
|
cdl_component CYGHWR_MEMORY_LAYOUT {
|
109 |
|
|
display "Memory layout"
|
110 |
|
|
flavor data
|
111 |
|
|
no_define
|
112 |
|
|
calculated { CYG_HAL_STARTUP == "ROM" ? "openrisc_orpsoc_rom" : \
|
113 |
|
|
"openrisc_orpsoc_ram" }
|
114 |
|
|
|
115 |
|
|
cdl_option CYGHWR_MEMORY_LAYOUT_LDI {
|
116 |
|
|
display "Memory layout linker script fragment"
|
117 |
|
|
flavor data
|
118 |
|
|
no_define
|
119 |
|
|
define -file system.h CYGHWR_MEMORY_LAYOUT_LDI
|
120 |
|
|
calculated { CYG_HAL_STARTUP == "ROM" ? "" : \
|
121 |
|
|
"" }
|
122 |
|
|
}
|
123 |
|
|
|
124 |
|
|
cdl_option CYGHWR_MEMORY_LAYOUT_H {
|
125 |
|
|
display "Memory layout header file"
|
126 |
|
|
flavor data
|
127 |
|
|
no_define
|
128 |
|
|
define -file system.h CYGHWR_MEMORY_LAYOUT_H
|
129 |
|
|
calculated { CYG_HAL_STARTUP == "ROM" ? "" : \
|
130 |
|
|
"" }
|
131 |
|
|
}
|
132 |
|
|
}
|
133 |
|
|
|
134 |
|
|
# Real-time clock/counter specifics
|
135 |
|
|
cdl_component CYGNUM_HAL_RTC_CONSTANTS {
|
136 |
|
|
display "Real-time clock constants."
|
137 |
|
|
flavor none
|
138 |
|
|
|
139 |
|
|
cdl_option CYGNUM_HAL_RTC_NUMERATOR {
|
140 |
|
|
display "Real-time clock numerator"
|
141 |
|
|
flavor data
|
142 |
|
|
default_value 1000000000
|
143 |
|
|
}
|
144 |
|
|
cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
|
145 |
|
|
display "Real-time clock denominator"
|
146 |
|
|
flavor data
|
147 |
|
|
default_value 100
|
148 |
|
|
}
|
149 |
|
|
cdl_option CYGNUM_HAL_RTC_PERIOD {
|
150 |
|
|
display "Real-time clock period"
|
151 |
|
|
flavor data
|
152 |
|
|
default_value {CYGHWR_HAL_OPENRISC_CPU_FREQ * 1000000 / CYGNUM_HAL_RTC_DENOMINATOR}
|
153 |
|
|
description "
|
154 |
|
|
The tick timer facility is used
|
155 |
|
|
to drive the eCos kernel RTC. The count register
|
156 |
|
|
increments at the CPU clock speed. By default, 100 Hz"
|
157 |
|
|
}
|
158 |
|
|
}
|
159 |
|
|
|
160 |
|
|
cdl_component CYGBLD_GLOBAL_OPTIONS {
|
161 |
|
|
display "Global build options"
|
162 |
|
|
flavor none
|
163 |
|
|
description "
|
164 |
|
|
Global build options including control over
|
165 |
|
|
compiler flags, linker flags and choice of toolchain."
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
parent CYGPKG_NONE
|
169 |
|
|
|
170 |
|
|
cdl_option CYGBLD_GLOBAL_COMMAND_PREFIX {
|
171 |
|
|
display "Global command prefix"
|
172 |
|
|
flavor data
|
173 |
|
|
no_define
|
174 |
|
|
default_value { "or32-elf" }
|
175 |
|
|
description "
|
176 |
|
|
This option specifies the command prefix used when
|
177 |
|
|
invoking the build tools."
|
178 |
|
|
}
|
179 |
|
|
|
180 |
|
|
cdl_option CYGBLD_GLOBAL_CFLAGS {
|
181 |
|
|
display "Global compiler flags"
|
182 |
|
|
flavor data
|
183 |
|
|
no_define
|
184 |
|
|
default_value { CYGBLD_GLOBAL_WARNFLAGS .
|
185 |
790 |
skrzyp |
"-g -O2 -fno-omit-frame-pointer -fno-rtti -fno-exceptions " .
|
186 |
786 |
skrzyp |
(CYGHWR_MUL_IMPLEMENTED ? "-mhard-mul " : "-msoft-mul ") .
|
187 |
|
|
(CYGHWR_DIV_IMPLEMENTED ? "-mhard-div " : "-msoft-div ") .
|
188 |
|
|
(CYGHWR_FPU_IMPLEMENTED ? "-mhard-float " : "-msoft-float ") }
|
189 |
|
|
description "
|
190 |
|
|
This option controls the global compiler flags which
|
191 |
|
|
are used to compile all packages by
|
192 |
|
|
default. Individual packages may define
|
193 |
|
|
options which override these global flags."
|
194 |
|
|
}
|
195 |
|
|
|
196 |
|
|
cdl_option CYGBLD_GLOBAL_LDFLAGS {
|
197 |
|
|
display "Global linker flags"
|
198 |
|
|
flavor data
|
199 |
|
|
no_define
|
200 |
790 |
skrzyp |
default_value { "-g -O2 -nostdlib -Wl,--gc-sections -Wl,-static " .
|
201 |
786 |
skrzyp |
(CYGHWR_MUL_IMPLEMENTED ? "-mhard-mul " : "-msoft-mul ") .
|
202 |
|
|
(CYGHWR_DIV_IMPLEMENTED ? "-mhard-div " : "-msoft-div ") .
|
203 |
|
|
(CYGHWR_FPU_IMPLEMENTED ? "-mhard-float " : "-msoft-float ") }
|
204 |
|
|
description "
|
205 |
|
|
This option controls the global linker flags. Individual
|
206 |
|
|
packages may define options which override these global flags."
|
207 |
|
|
}
|
208 |
|
|
}
|
209 |
|
|
|
210 |
|
|
cdl_option CYGBLD_BUILD_GDB_STUBS {
|
211 |
|
|
display "Build GDB stub ROM image"
|
212 |
|
|
default_value 0
|
213 |
|
|
parent CYGBLD_GLOBAL_OPTIONS
|
214 |
|
|
requires { CYG_HAL_STARTUP == "ROM" }
|
215 |
|
|
requires CYGSEM_HAL_ROM_MONITOR
|
216 |
|
|
requires CYGBLD_BUILD_COMMON_GDB_STUBS
|
217 |
|
|
requires CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
|
218 |
|
|
requires ! CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
|
219 |
|
|
requires ! CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT
|
220 |
|
|
requires ! CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT
|
221 |
|
|
requires ! CYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM
|
222 |
|
|
no_define
|
223 |
|
|
description "
|
224 |
|
|
This option enables the building of the GDB stubs for the
|
225 |
|
|
board. The common HAL controls takes care of most of the
|
226 |
|
|
build process, but the final conversion from ELF image to
|
227 |
|
|
binary data is handled by the platform CDL, allowing
|
228 |
|
|
relocation of the data if necessary."
|
229 |
|
|
|
230 |
|
|
make -priority 320 {
|
231 |
|
|
/bin/gdb_module.bin : /bin/gdb_module.img
|
232 |
|
|
$(OBJCOPY) -O binary $< $@
|
233 |
|
|
}
|
234 |
|
|
}
|
235 |
|
|
|
236 |
|
|
cdl_option CYGNUM_HAL_BREAKPOINT_LIST_SIZE {
|
237 |
|
|
display "Number of breakpoints supported by the HAL."
|
238 |
|
|
flavor data
|
239 |
|
|
default_value 25
|
240 |
|
|
description "
|
241 |
|
|
This option determines the number of breakpoints supported by the HAL."
|
242 |
|
|
}
|
243 |
|
|
|
244 |
|
|
cdl_option CYGSEM_HAL_USE_ROM_MONITOR {
|
245 |
|
|
display "Work with a ROM monitor"
|
246 |
|
|
flavor bool
|
247 |
|
|
default_value { CYG_HAL_STARTUP == "RAM" ? 1 : 0 }
|
248 |
|
|
parent CYGPKG_HAL_ROM_MONITOR
|
249 |
|
|
requires { CYG_HAL_STARTUP == "RAM" }
|
250 |
|
|
description "
|
251 |
|
|
Allow coexistence with ROM monitor (CygMon or GDB stubs) by
|
252 |
|
|
only initializing interrupt vectors on startup, thus leaving
|
253 |
|
|
exception handling to the ROM monitor."
|
254 |
|
|
}
|
255 |
|
|
|
256 |
|
|
cdl_option CYGSEM_HAL_ROM_MONITOR {
|
257 |
|
|
display "Behave as a ROM monitor"
|
258 |
|
|
flavor bool
|
259 |
|
|
default_value 0
|
260 |
|
|
parent CYGPKG_HAL_ROM_MONITOR
|
261 |
|
|
requires { CYG_HAL_STARTUP == "ROM" }
|
262 |
|
|
description "
|
263 |
|
|
Enable this option if this program is to be used as a ROM monitor,
|
264 |
|
|
i.e. applications will be loaded into RAM on the board, and this
|
265 |
|
|
ROM monitor may process exceptions or interrupts generated from the
|
266 |
|
|
application. This enables features such as utilizing a separate
|
267 |
|
|
interrupt stack when exceptions are generated."
|
268 |
|
|
}
|
269 |
|
|
|
270 |
|
|
cdl_component CYGPKG_REDBOOT_HAL_OPTIONS {
|
271 |
|
|
display "Redboot HAL options"
|
272 |
|
|
flavor none
|
273 |
|
|
no_define
|
274 |
|
|
parent CYGPKG_REDBOOT
|
275 |
|
|
active_if CYGPKG_REDBOOT
|
276 |
|
|
description "
|
277 |
|
|
This option lists the target's requirements for a valid Redboot
|
278 |
|
|
configuration."
|
279 |
|
|
|
280 |
|
|
cdl_option CYGBLD_BUILD_REDBOOT_BIN {
|
281 |
|
|
display "Build Redboot ROM binary image"
|
282 |
|
|
active_if CYGBLD_BUILD_REDBOOT
|
283 |
|
|
default_value 1
|
284 |
|
|
no_define
|
285 |
|
|
description "This option enables the conversion of the Redboot ELF
|
286 |
|
|
image to a binary image suitable for ROM programming."
|
287 |
|
|
|
288 |
|
|
compile -library=libextras.a
|
289 |
|
|
|
290 |
|
|
make -priority 325 {
|
291 |
|
|
/bin/redboot.srec : /bin/redboot.elf
|
292 |
|
|
$(OBJCOPY) --strip-all $< $(@:.srec=.img)
|
293 |
|
|
$(OBJCOPY) -O srec $< $@
|
294 |
|
|
}
|
295 |
|
|
}
|
296 |
|
|
}
|
297 |
|
|
|
298 |
|
|
cdl_option CYGHWR_HAL_OPENRISC_CPU_FREQ {
|
299 |
|
|
display "CPU frequency"
|
300 |
|
|
flavor data
|
301 |
|
|
legal_values 0 to 1000000
|
302 |
|
|
default_value 50
|
303 |
|
|
description "
|
304 |
|
|
This option contains the frequency of the CPU in MegaHertz.
|
305 |
|
|
Choose the frequency to match the processor you have. This
|
306 |
|
|
may affect thing like serial device, interval clock and
|
307 |
|
|
memory access speed settings."
|
308 |
|
|
}
|
309 |
|
|
|
310 |
|
|
cdl_option CYGHWR_MUL_IMPLEMENTED {
|
311 |
|
|
display "Hardware multiplier implemented"
|
312 |
|
|
flavor bool
|
313 |
|
|
default_value 1
|
314 |
|
|
description "
|
315 |
|
|
Select this option only if hardware multiplier is
|
316 |
|
|
implemented."
|
317 |
|
|
}
|
318 |
|
|
|
319 |
|
|
cdl_option CYGHWR_DIV_IMPLEMENTED {
|
320 |
|
|
display "Hardware divisor implemented"
|
321 |
|
|
flavor bool
|
322 |
|
|
default_value 1
|
323 |
|
|
description "
|
324 |
|
|
Select this option only if hardware division is
|
325 |
|
|
implemented."
|
326 |
|
|
}
|
327 |
|
|
|
328 |
|
|
cdl_option CYGHWR_FPU_IMPLEMENTED {
|
329 |
|
|
display "Hardware FPU implemented"
|
330 |
|
|
flavor bool
|
331 |
|
|
default_value 0
|
332 |
|
|
description "
|
333 |
|
|
Select this option only if FPU is implemented."
|
334 |
|
|
}
|
335 |
|
|
|
336 |
|
|
cdl_component CYGHWR_CACHE {
|
337 |
|
|
|
338 |
|
|
display "Cache"
|
339 |
|
|
flavor none
|
340 |
|
|
description "
|
341 |
|
|
Cache is optional in the OpenRISC architecture. Removing
|
342 |
|
|
cache is a common way to save hardware space."
|
343 |
|
|
|
344 |
|
|
cdl_option CYGHWR_ICACHE_IMPLEMENTED {
|
345 |
|
|
display "Instruction cache implemented"
|
346 |
|
|
flavor bool
|
347 |
|
|
default_value 1
|
348 |
|
|
description "
|
349 |
|
|
Select this option only if instruction cache is
|
350 |
|
|
implemented."
|
351 |
|
|
}
|
352 |
|
|
|
353 |
|
|
cdl_option CYGHWR_ICACHE_SIZE {
|
354 |
|
|
display "Instruction cache size"
|
355 |
|
|
active_if CYGHWR_ICACHE_IMPLEMENTED
|
356 |
|
|
flavor data
|
357 |
|
|
legal_values 4096 8192
|
358 |
|
|
default_value 8192
|
359 |
|
|
description "
|
360 |
|
|
Size of the instruction cache."
|
361 |
|
|
}
|
362 |
|
|
|
363 |
|
|
cdl_option CYGHWR_DCACHE_IMPLEMENTED {
|
364 |
|
|
display "Data cache implemented"
|
365 |
|
|
flavor bool
|
366 |
|
|
default_value 1
|
367 |
|
|
description "
|
368 |
|
|
Select this option only if data cache is
|
369 |
|
|
implemented."
|
370 |
|
|
}
|
371 |
|
|
|
372 |
|
|
cdl_option CYGHWR_DCACHE_SIZE {
|
373 |
|
|
display "Data cache size"
|
374 |
|
|
active_if CYGHWR_DCACHE_IMPLEMENTED
|
375 |
|
|
flavor data
|
376 |
|
|
legal_values 4096 8192
|
377 |
|
|
default_value 4096
|
378 |
|
|
description "
|
379 |
|
|
Size of the data cache."
|
380 |
|
|
}
|
381 |
|
|
|
382 |
|
|
}
|
383 |
|
|
|
384 |
|
|
}
|
385 |
|
|
|
386 |
|
|
# EOF hal_openrisc.cdl
|