1 # ====================================================================
5 # SH3 variant 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.
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 version.
17 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 ## You should have received a copy of the GNU General Public License along
23 ## with eCos; if not, write to the Free Software Foundation, Inc.,
24 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 ## As a special exception, if other files instantiate templates or use macros
27 ## or inline functions from this file, or you compile this file and link it
28 ## with other works to produce a work based on this file, this file does not
29 ## by itself cause the resulting work to be covered by the GNU General Public
30 ## License. However the source code for this file must still be made available
31 ## in accordance with section (3) of the GNU General Public License.
33 ## This exception does not invalidate any other reasons why a work based on
34 ## this file might be covered by the GNU General Public License.
36 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 ## at http://sources.redhat.com/ecos/ecos-license/
38 ## -------------------------------------------
39 #####ECOSGPLCOPYRIGHTEND####
40 # ====================================================================
41 ######DESCRIPTIONBEGIN####
44 # Original data: jskov
48 #####DESCRIPTIONEND####
50 # ====================================================================
52 cdl_package CYGPKG_HAL_SH_SH3 {
57 define_header hal_sh_sh3.h
59 The SH3 (SuperH 3) variant HAL package provides generic
60 support for SH3 variant CPUs."
63 puts $::cdl_system_header "#define CYGBLD_HAL_VARIANT_H <pkgconf/hal_sh_sh3.h>"
64 puts $::cdl_header "#define CYGBLD_HAL_VAR_EXCEPTION_MODEL_H <cyg/hal/hal_var_bank.h>"
65 puts $::cdl_header "#define CYGBLD_HAL_VAR_EXCEPTION_MODEL_INC <cyg/hal/hal_var_bank.inc>"
66 puts $::cdl_header "#define CYGBLD_HAL_VAR_INTR_MODEL_H <cyg/hal/hal_intr_excevt.h>"
69 compile sh3_sci.c sh3_scif.c var_misc.c variant.S
71 # The "-o file" is a workaround for CR100958 - without it the
72 # output file would end up in the source directory under CygWin.
73 # n.b. grep does not behave itself under win32
75 <PREFIX>/include/cyg/hal/sh3_offsets.inc : <PACKAGE>/src/var_mk_defs.c
76 $(CC) $(CFLAGS) $(INCLUDE_PATH) -Wp,-MD,sh3_offsets.tmp -o var_mk_defs.tmp -S $<
77 fgrep .equ var_mk_defs.tmp | sed s/#// > $@
78 @echo $@ ": \\" > $(notdir $@).deps
79 @tail -n +2 sh3_offsets.tmp >> $(notdir $@).deps
80 @echo >> $(notdir $@).deps
81 @rm sh3_offsets.tmp var_mk_defs.tmp
84 # CPU variant supported
85 cdl_option CYGPKG_HAL_SH_7707A {
86 display "SH 7707A microprocessor"
87 parent CYGPKG_HAL_SH_CPU
88 implements CYGINT_HAL_SH_VARIANT
89 implements CYGINT_HAL_SH_CPG_T2
92 define -file=system.h CYGPKG_HAL_SH_7707A
94 The SH3 7707A microprocessor. This is an embedded part that in
95 addition to the SH3 processor core has built in peripherals
96 such as memory controllers, serial ports, LCD controller and
99 puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H <cyg/hal/mod_7707a.h>"
103 cdl_option CYGPKG_HAL_SH_7708 {
104 display "SH 7708 microprocessor"
105 parent CYGPKG_HAL_SH_CPU
106 implements CYGINT_HAL_SH_VARIANT
107 implements CYGINT_HAL_SH_CPG_T1
110 define -file=system.h CYGPKG_HAL_SH_7708
112 The SH3 7708 microprocessor. This is an embedded part that in
113 addition to the SH3 processor core has built in peripherals
114 such as memory controllers, serial ports and
117 puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H <cyg/hal/mod_7708.h>"
121 cdl_option CYGPKG_HAL_SH_7709A {
122 display "SH 7709A microprocessor"
123 parent CYGPKG_HAL_SH_CPU
124 implements CYGINT_HAL_SH_VARIANT
125 implements CYGINT_HAL_SH_CPG_T3
126 implements CYGINT_HAL_SH_DMA_CHANNELS
127 implements CYGINT_HAL_SH_DMA_CHANNELS
128 implements CYGINT_HAL_SH_DMA_CHANNELS
129 implements CYGINT_HAL_SH_DMA_CHANNELS
132 define -file=system.h CYGPKG_HAL_SH_7709A
134 The SH3 7709A microprocessor. This is an embedded part that in
135 addition to the SH3 processor core has built in peripherals
136 such as memory controllers, DMA controllers, A/D and D/A
137 converters, serial ports and timers/counters."
139 puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H <cyg/hal/mod_7709a.h>"
143 cdl_option CYGPKG_HAL_SH_7709R {
144 display "SH 7709R microprocessor"
145 parent CYGPKG_HAL_SH_CPU
146 implements CYGINT_HAL_SH_VARIANT
147 implements CYGINT_HAL_SH_CPG_T3
150 define -file=system.h CYGPKG_HAL_SH_7709R
152 The SH3 7709R microprocessor. This is an embedded part that in
153 addition to the SH3 processor core has built in peripherals
154 such as memory controllers, DMA controllers, A/D and D/A
155 converters, serial ports and timers/counters."
157 puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H <cyg/hal/mod_7709r.h>"
161 cdl_option CYGPKG_HAL_SH_7709S {
162 display "SH 7709S microprocessor"
163 parent CYGPKG_HAL_SH_CPU
164 implements CYGINT_HAL_SH_VARIANT
165 implements CYGINT_HAL_SH_CPG_T3
166 implements CYGINT_HAL_SH_DMA_CHANNELS
167 implements CYGINT_HAL_SH_DMA_CHANNELS
168 implements CYGINT_HAL_SH_DMA_CHANNELS
169 implements CYGINT_HAL_SH_DMA_CHANNELS
172 define -file=system.h CYGPKG_HAL_SH_7709S
174 The SH3 7709S microprocessor. This is an embedded part that in
175 addition to the SH3 processor core has built in peripherals
176 such as memory controllers, DMA controllers, A/D and D/A
177 converters, serial ports and timers/counters."
179 puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H <cyg/hal/mod_7709s.h>"
183 cdl_option CYGPKG_HAL_SH_7729 {
184 display "SH 7729 microprocessor"
185 parent CYGPKG_HAL_SH_CPU
186 implements CYGINT_HAL_SH_VARIANT
187 implements CYGINT_HAL_SH_CPG_T3
190 define -file=system.h CYGPKG_HAL_SH_7729
192 The SH3 7729 microprocessor. This is an embedded part that in
193 addition to the SH3 processor core has built in peripherals
194 such as memory controllers, serial ports, and timers/counters,
197 puts $cdl_system_header "#define CYGBLD_HAL_CPU_MODULES_H <cyg/hal/mod_7729.h>"
201 cdl_component CYGHWR_HAL_SH_CLOCK_SETTINGS {
202 display "SH on-chip generic clock controls"
204 The various clocks used by the system are controlled by
205 these options, some of which are derived from platform
210 cdl_interface CYGINT_HAL_SH_CPG_T1 {
211 display "Clock pulse generator type 1"
214 cdl_interface CYGINT_HAL_SH_CPG_T2 {
215 display "Clock pulse generator type 2"
218 cdl_interface CYGINT_HAL_SH_CPG_T3 {
219 display "Clock pulse generator type 3"
223 cdl_option CYGHWR_HAL_SH_TMU_PRESCALE_0 {
224 display "TMU counter 0 prescaling"
226 The peripheral clock is driving the counter used for
227 the real-time clock, prescaled by this factor."
229 legal_values { 4 16 64 256 }
233 cdl_option CYGHWR_HAL_SH_RTC_PRESCALE {
234 display "eCos RTC prescaling"
236 calculated CYGHWR_HAL_SH_TMU_PRESCALE_0
239 cdl_option CYGHWR_HAL_SH_CLOCK_CKIO {
243 # CKIO is either XTAL or PLL2 output
244 calculated { CYGINT_HAL_SH_CPG_T1 ? (
245 (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 7)
246 ? (CYGHWR_HAL_SH_OOC_XTAL)
247 : CYGHWR_HAL_SH_PLL2_OUTPUT
249 : CYGINT_HAL_SH_CPG_T2 ? (
250 (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 2)
251 ? (CYGHWR_HAL_SH_OOC_XTAL)
252 : CYGHWR_HAL_SH_PLL2_OUTPUT
254 : CYGINT_HAL_SH_CPG_T3 ? (
255 (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 7)
256 ? (CYGHWR_HAL_SH_OOC_XTAL)
257 : CYGHWR_HAL_SH_PLL2_OUTPUT
262 cdl_option CYGHWR_HAL_SH_PLL1_OUTPUT {
263 display "The clock output from PLL1"
266 calculated { CYGHWR_HAL_SH_CLOCK_CKIO * CYGHWR_HAL_SH_OOC_PLL_1 }
269 cdl_option CYGHWR_HAL_SH_PLL2_OUTPUT {
270 display "The clock output from PLL2"
273 calculated { CYGINT_HAL_SH_CPG_T1 ? (
274 (CYGHWR_HAL_SH_OOC_XTAL * CYGHWR_HAL_SH_OOC_PLL_2)
276 : CYGINT_HAL_SH_CPG_T2 ? (
277 (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 5)
278 ? (CYGHWR_HAL_SH_OOC_XTAL / 2)
279 : (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 6)
281 : (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 7)
283 : (CYGHWR_HAL_SH_OOC_XTAL * CYGHWR_HAL_SH_OOC_PLL_2)
285 : CYGINT_HAL_SH_CPG_T3 ? (
286 (CYGHWR_HAL_SH_OOC_XTAL * CYGHWR_HAL_SH_OOC_PLL_2)
292 cdl_option CYGHWR_HAL_SH_DIVIDER1_INPUT {
293 display "The clock input to divider 1"
296 # DIV1 input is either PLL2 output or PLL1 output
297 calculated { (CYGHWR_HAL_SH_OOC_PLL_1 == 0)
298 ? CYGHWR_HAL_SH_PLL2_OUTPUT
299 : CYGHWR_HAL_SH_PLL1_OUTPUT }
302 cdl_option CYGHWR_HAL_SH_DIVIDER2_INPUT {
303 display "The clock input to divider 2"
306 # DIV2 input is either PLL2 output or PLL1 output
307 calculated { CYGINT_HAL_SH_CPG_T1 ? (
308 (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 3 || CYGHWR_HAL_SH_OOC_CLOCK_MODE == 4)
309 ? CYGHWR_HAL_SH_PLL2_OUTPUT
310 : CYGHWR_HAL_SH_PLL1_OUTPUT
312 : CYGINT_HAL_SH_CPG_T2 ? (
313 (CYGHWR_HAL_SH_OOC_CLOCK_MODE <= 2)
314 ? CYGHWR_HAL_SH_PLL1_OUTPUT
315 : CYGHWR_HAL_SH_PLL2_OUTPUT
317 : CYGINT_HAL_SH_CPG_T3 ? (
318 (CYGHWR_HAL_SH_OOC_CLOCK_MODE == 3 || CYGHWR_HAL_SH_OOC_CLOCK_MODE == 4)
319 ? CYGHWR_HAL_SH_PLL2_OUTPUT
320 : CYGHWR_HAL_SH_PLL1_OUTPUT
325 cdl_option CYGHWR_HAL_SH_PROCESSOR_SPEED {
326 display "Processor clock speed (MHz)"
328 calculated { CYGHWR_HAL_SH_DIVIDER1_INPUT / CYGHWR_HAL_SH_OOC_DIVIDER_1 }
330 The core (CPU, cache and MMU) speed is computed from
331 the input clock speed and the divider 1 setting."
334 cdl_option CYGHWR_HAL_SH_BOARD_SPEED {
335 display "Platform bus clock speed (MHz)"
337 calculated { CYGHWR_HAL_SH_CLOCK_CKIO }
339 The platform bus speed is CKIO."
342 cdl_option CYGHWR_HAL_SH_ONCHIP_PERIPHERAL_SPEED {
343 display "Processor on-chip peripheral clock speed (MHz)"
345 calculated { CYGHWR_HAL_SH_DIVIDER2_INPUT / CYGHWR_HAL_SH_OOC_DIVIDER_2 }
347 The peripheral speed is computed from the input clock
348 speed and the divider 2 settings."
352 cdl_option CYGNUM_HAL_SH_SH3_SCI_BAUD_RATE {
353 display "SCI serial port default baud rate"
355 legal_values { 4800 9600 14400 19200 38400 57600 115200 }
356 default_value { CYGNUM_HAL_SH_SH3_SCI_BAUD_RATE_DEFAULT ? \
357 CYGNUM_HAL_SH_SH3_SCI_BAUD_RATE_DEFAULT : 38400 }
359 This controls the default baud rate used for communicating
360 with GDB / displaying diagnostic output."
363 cdl_option CYGNUM_HAL_SH_SH3_SCIF_BAUD_RATE {
364 display "SCIF serial ports default baud rate"
366 legal_values { 4800 9600 14400 19200 38400 57600 115200 }
367 default_value { CYGNUM_HAL_SH_SH3_SCIF_BAUD_RATE_DEFAULT ? \
368 CYGNUM_HAL_SH_SH3_SCIF_BAUD_RATE_DEFAULT : 38400 }
370 This controls the default baud rate used for communicating
371 with GDB / displaying diagnostic output."
374 cdl_component CYGPKG_HAL_SH_INTERRUPT {
375 display "Interrupt controls"
379 Initial interrupt settings can be specified using these option."
381 cdl_option CYGHWR_HAL_SH_IRQ_HANDLE_SPURIOUS_INTERRUPTS {
382 display "Handle spurious interrupts"
385 The SH3 may generate spurious interrupts with INTEVT = 0
386 when changing the BL bit of the status register. Enabling
387 this option will cause such interrupts to be identified
388 very early in the interrupt handler and be ignored. Given
389 that the SH HAL uses the I-mask to control interrupts,
390 these spurious interrupts should not occur, and so there
391 should be no reason to include the special handling code."
394 cdl_option CYGHWR_HAL_SH_IRQ_USE_IRQLVL {
395 display "Use IRQ0-3 pins as IRL input"
398 It is possible for the IRQ0-3 pins to be used as IRL
399 inputs by enabling this option."
402 cdl_option CYGHWR_HAL_SH_IRQ_ENABLE_IRLS_INTERRUPTS {
403 display "Enable IRLS interrupt pins"
405 active_if CYGHWR_HAL_SH_IRQ_USE_IRQLVL
407 IRLS interrupt pins must be specifically
408 activated. When they are, they will cause the same
409 type of interrupt as those caused by the IRL pins. If
410 IRL and IRLS pins signal an interrupt at the same
411 time, the highest level interrupt will be generated.
412 Only available on some cores, and probably share pins
413 with other interrupt sources (PINT) which cannot be
414 used in this configuration."
419 cdl_option CYGHWR_HAL_SH_CACHE_MODE_P0 {
420 display "Select cache mode set for P0/U0/P3 at startup"
421 parent CYGPKG_HAL_SH_CACHE
422 default_value { "WRITE_BACK" }
423 legal_values { "WRITE_BACK" "WRITE_THROUGH" }
426 Controls what cache mode the cache should be put in at
427 startup for areas P0, U0 and P3. Write-back mode improves
428 performance by letting dirty data to be kept in the
429 cache for a period of time, allowing mutiple writes to
430 the same cache line to be written back to memory in
431 one memory transaction. In Write-through mode, each
432 individual write will cause a memory transaction."
435 cdl_option CYGHWR_HAL_SH_CACHE_MODE_P1 {
436 display "Select cache mode set for P1 at startup"
437 parent CYGPKG_HAL_SH_CACHE
438 default_value { "WRITE_BACK" }
439 legal_values { "WRITE_BACK" "WRITE_THROUGH" }
442 Controls what cache mode the cache should be put in at
443 startup for area P1. Write-back mode improves
444 performance by letting dirty data to be kept in the
445 cache for a period of time, allowing mutiple writes to
446 the same cache line to be written back to memory in
447 one memory transaction. In Write-through mode, each
448 individual write will cause a memory transaction."