1 # ====================================================================
5 # NXP LPC24XX 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 Nick Garnett <nickg@calivar.com>
13 ## Copyright (C) 2004 eCosCentric Limited
15 ## eCos is free software; you can redistribute it and/or modify it under
16 ## the terms of the GNU General Public License as published by the Free
17 ## Software Foundation; either version 2 or (at your option) any later version.
19 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 ## You should have received a copy of the GNU General Public License along
25 ## with eCos; if not, write to the Free Software Foundation, Inc.,
26 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 ## As a special exception, if other files instantiate templates or use macros
29 ## or inline functions from this file, or you compile this file and link it
30 ## with other works to produce a work based on this file, this file does not
31 ## by itself cause the resulting work to be covered by the GNU General Public
32 ## License. However the source code for this file must still be made available
33 ## in accordance with section (3) of the GNU General Public License.
35 ## This exception does not invalidate any other reasons why a work based on
36 ## this file might be covered by the GNU General Public License.
37 ## -------------------------------------------
38 #####ECOSGPLCOPYRIGHTEND####
39 # ====================================================================
40 ######DESCRIPTIONBEGIN####
42 # Author(s): Uwe Kindler
43 # Contributors: gthomas, tkoeller, tdrury, nickg
46 #####DESCRIPTIONEND####
48 # ====================================================================
50 cdl_package CYGPKG_HAL_ARM_LPC24XX {
51 display "NXP LPC24XX variant HAL"
53 define_header hal_arm_lpc24xx.h
57 The LPC24XX HAL package provides the support needed to run
58 eCos on NXP LPC24XX based targets."
60 compile hal_diag.c lpc24xx_misc.c
62 implements CYGINT_HAL_DEBUG_GDB_STUBS
63 implements CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
64 implements CYGINT_HAL_VIRTUAL_VECTOR_SUPPORT
65 implements CYGINT_HAL_VIRTUAL_VECTOR_COMM_BAUD_SUPPORT
66 implements CYGINT_HAL_ARM_ARCH_ARM7
67 implements CYGINT_HAL_ARM_THUMB_ARCH
69 # Let the architectural HAL see this variant's files
71 puts $::cdl_header "#define CYGBLD_HAL_VAR_INTS_H <cyg/hal/hal_var_ints.h>"
72 puts $::cdl_system_header "#define CYGBLD_HAL_ARM_VAR_IO_H"
73 puts $::cdl_system_header "#define CYGBLD_HAL_ARM_VAR_ARCH_H"
76 cdl_component CYGHWR_HAL_ARM_LPC24XX {
77 display "LPC24XX variant used"
79 default_value { "LPC246x" }
80 legal_values { "LPC246x" "LPC2458" "LPC2460" "LPC2468" "LPC2470"
83 The LPC24XX microcontroller family has several variants,
84 the main differences being the amount of on-chip RAM,
85 flash and peripherals. This option allows the platform
86 HALs to select the specific microcontroller being used."
88 cdl_option CYGHWR_HAL_ARM_LPC24XX_FAMILY {
89 display "LPC24XX variant family"
92 is_substr(CYGHWR_HAL_ARM_LPC24XX, "LPC246") ?
96 This specifies the family that the processor
97 belongs to. This is useful as it defines certain common
98 characteristics which affect which features should be
99 available in the HAL."
103 # This is going to get really messy before long as the number of parts
104 # explodes. Its useful to know the actual part in use, but its just as
105 # useful to know which family it belongs to. LPC210x shouldn't really
106 # be in the list of devices, but will probably break something if removed.
107 cdl_component CYGHWR_HAL_ARM_LPC2XXX {
108 display "LPC2XXX variant used"
110 calculated CYGHWR_HAL_ARM_LPC24XX
112 This option is only here for compatibility reasons because some of
113 the LPC2XXX device drivers rely on these definitions. If this
114 is defined here, the LPC24XX variant can use the LPC2XXX device
115 drivers for on-chip peripherals."
117 cdl_option CYGHWR_HAL_ARM_LPC2XXX_FAMILY {
118 display "LPC2XXX variant family"
120 calculated CYGHWR_HAL_ARM_LPC24XX_FAMILY
122 This option is only here for compatibility reasons
123 because some of the LPC2XXX device drivers rely on
124 these definitions. If this is defined here, the
125 LPC24XX variant can use the LPC2XXX device drivers
126 for on-chip peripherals."
129 cdl_option CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION {
130 display "LPC2XXX variant version"
133 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC21") ? 1 :
134 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC22") ? 2 :
135 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC24") ? 4 : 0
138 This specifies the variant version that the processor
139 belongs to. Some common characteristics may be
140 different in newer LPC2xxx versions. I.e. the LPC24xx variants
141 are significant different from former LPC2xxx variants."
145 # Important! Be very careful changing this value. That will always
146 # enter the LPC24XX bootloader after reset and consequently will
147 # never run your code. You must know what you are doing. Look at
148 # arch. vectors.S for details.
149 cdl_option CYGNUM_HAL_ARM_VECTOR_0x14 {
150 display "ARM vector at 0x14"
152 default_value 0xB4405F62
153 legal_values 0 to 0xFFFFFFFF
155 In order to detect if a valid program is present, every
156 user program must have a program signature. This signature
157 is a word-wide number that is stored in the unused
158 location in the ARM7 vector table at 0x00000014. The
159 program signature is the two's compliment of the checksum
160 of the ARM vector table."
163 cdl_component CYGNUM_HAL_ARM_LPC24XX_CLOCKING {
167 cdl_option CYGNUM_HAL_ARM_LPC24XX_PLL_MUL {
168 display "PLL multiplier"
170 legal_values 6 to 32767
174 cdl_option CYGNUM_HAL_ARM_LPC24XX_PLL_DIV {
175 display "PLL divider"
181 cdl_option CYGNUM_HAL_ARM_LPC24XX_PLL_OUTPUT {
182 display "PLL output (MHz)"
184 legal_values 275000000 to 290000000
185 calculated { 2 * CYGNUM_HAL_ARM_LPC24XX_PLL_MUL *
186 CYGNUM_HAL_ARM_LPC24XX_XTAL_FREQ /
187 CYGNUM_HAL_ARM_LPC24XX_PLL_DIV}
189 Normally the PLL output must be in the range of 275 MHz to
190 550 MHz Because of a chip errata the maximum output of the CCO
191 within the PLL block is limited to 290 MHz."
194 cdl_component CYGNUM_HAL_ARM_LPC24XX_CLOCK_SPEED {
195 display "CPU clock speed"
197 calculated { 2 * CYGNUM_HAL_ARM_LPC24XX_PLL_MUL *
198 CYGNUM_HAL_ARM_LPC24XX_XTAL_FREQ /
199 CYGNUM_HAL_ARM_LPC24XX_PLL_DIV /
200 CYGNUM_HAL_ARM_LPC24XX_CPU_CLK_DIV}
202 The core CPU clock speed is the PLL output divided by the
205 cdl_option CYGNUM_HAL_ARM_LPC24XX_CPU_CLK_DIV {
206 display "CPU clock divider"
208 legal_values 6 to 256
211 The CPU clock divider controls the division of the PLL
212 output before it is used by the CPU. When the PLL is
213 bypassed, the division may be by 1. When the PLL is
214 running, the output must be divided in order to bring the
215 CPU clock frequency (CCLK) within operating limits. An 8
216 bit divider allows a range of options, including slowing
217 CPU operation to a low rate for temporary power savings
218 without turning off the PLL. Only even values
219 (2, 4, 6, ..., 256) are supported and can be used.
220 Warning: Using an odd value (1, 3, 5, ..., 255) when
221 setting this option may result in incorrect operation of
227 cdl_component CYGNUM_HAL_ARM_LPC24XX_USB_CLOCK_SPEED {
228 display "USB clock speed"
230 calculated { 2 * CYGNUM_HAL_ARM_LPC24XX_PLL_MUL *
231 CYGNUM_HAL_ARM_LPC24XX_XTAL_FREQ /
232 CYGNUM_HAL_ARM_LPC24XX_PLL_DIV /
233 CYGNUM_HAL_ARM_LPC24XX_USB_CLK_DIV}
235 The USB clock speed is the PLL output divided by the
238 cdl_option CYGNUM_HAL_ARM_LPC24XX_USB_CLK_DIV {
239 display "USB clock divider"
244 This divider controls the division of the PLL output before
245 it is used by the USB block. If the PLL is bypassed, the
246 division may be by 1. In that case, the PLL input frequency
247 must be 48 MHz, with a 500 ppm tolerance. When the PLL is
248 running, the output must be divided in order to bring the
249 USB clock frequency to 48 MHz with a 50% duty cycle. A
250 4-bit divider allows obtaining the correct USB clock from
251 any even multiple of 48 MHz (i.e. any mutliple of 96 MHz)
252 within the PLL operating range."
256 cdl_component CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK {
257 display "CAN clock speed"
259 calculated { CYGNUM_HAL_ARM_LPC24XX_CLOCK_SPEED /
260 CYGNUM_HAL_ARM_LPC24XX_CAN_CLK_DIV}
262 The CAN clock speed is the CPU clock output divided by the
265 cdl_option CYGNUM_HAL_ARM_LPC24XX_CAN_CLK_DIV {
266 display "CAN clock divider"
268 legal_values { 1 2 4 6 }
271 This divider selects the peripheral clock for both CAN
272 channels. The divider divides the CPU clock to get the
273 clock for the CAN peripherals."
278 cdl_component CYGNUM_HAL_RTC_CONSTANTS {
279 display "Real-time clock constants"
282 cdl_option CYGNUM_HAL_RTC_NUMERATOR {
283 display "Real-time clock numerator"
285 default_value 1000000000
287 cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
288 display "Real-time clock denominator"
292 cdl_option CYGNUM_HAL_RTC_PERIOD {
293 display "Real-time clock period"
295 default_value { ((CYGNUM_HAL_ARM_LPC24XX_CLOCK_SPEED) /
296 CYGNUM_HAL_RTC_DENOMINATOR) }
300 cdl_option CYGHWR_HAL_ARM_LPC24XX_IDLE_PWRSAVE {
301 display "Stop clock in idle loop to save power"
303 default_value { is_active(CYGPKG_REDBOOT) ? 0 : 1 }
305 Select this option when it is desired to save power by
306 stopping the processor clock in the idle loop. This is
307 controlled by the PCON register. Generally this is a good
308 thing, but it may be necessary to disable this when
309 debugging via JTAG, as stopping the clock can prevent the
310 debugger getting control of the system."
313 cdl_option CYGNUM_HAL_KERNEL_COUNTERS_CLOCK_ISR_DEFAULT_PRIORITY {
314 display "Default priority for system clock interrupts"
316 legal_values { 0 to 15 }
319 There are 16 priority levels, corresponding to the values 0 through
320 15 decimal, of which 15 is the lowest priority. The reset value of
321 these interrupt priority registers defaults all interrupts to the
322 lowest priority, allowing a single write to elevate the priority
323 of an individual interrupt."