]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/lpc24xx/var/v2_0/cdl/hal_arm_lpc24xx.cdl
Initial revision
[karo-tx-redboot.git] / packages / hal / arm / lpc24xx / var / v2_0 / cdl / hal_arm_lpc24xx.cdl
1 # ====================================================================
2 #
3 #      hal_arm_lpc24xx.cdl
4 #
5 #      NXP LPC24XX 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 Nick Garnett <nickg@calivar.com>
13 ## Copyright (C) 2004 eCosCentric Limited 
14 ##
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.
18 ##
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
22 ## for more details.
23 ##
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.
27 ##
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.
34 ##
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####
41 #
42 # Author(s):      Uwe Kindler
43 # Contributors:   gthomas, tkoeller, tdrury, nickg
44 # Date:           2008-07-05
45 #
46 #####DESCRIPTIONEND####
47 #
48 # ====================================================================
49
50 cdl_package CYGPKG_HAL_ARM_LPC24XX {
51     display       "NXP LPC24XX variant HAL"
52     parent        CYGPKG_HAL_ARM
53     define_header hal_arm_lpc24xx.h
54     include_dir   cyg/hal
55     hardware
56     description   "
57         The LPC24XX HAL package provides the support needed to run
58         eCos on NXP LPC24XX based targets."
59
60     compile       hal_diag.c lpc24xx_misc.c
61
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
68
69     # Let the architectural HAL see this variant's files
70     define_proc {
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"
74     }
75
76     cdl_component CYGHWR_HAL_ARM_LPC24XX {
77         display        "LPC24XX variant used"
78         flavor         data
79         default_value  { "LPC246x" }
80         legal_values   { "LPC246x" "LPC2458" "LPC2460" "LPC2468" "LPC2470" 
81                          "LPC2478"}
82         description    "
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."
87
88         cdl_option CYGHWR_HAL_ARM_LPC24XX_FAMILY {
89             display       "LPC24XX variant family"
90             flavor        data
91             calculated    {
92                 is_substr(CYGHWR_HAL_ARM_LPC24XX, "LPC246") ? 
93                    "LPC246X" : "LPC24XX"
94                           }
95             description   "
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."
100         }
101     }
102     
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"
109         flavor         data
110         calculated     CYGHWR_HAL_ARM_LPC24XX
111         description    "
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."
116
117         cdl_option CYGHWR_HAL_ARM_LPC2XXX_FAMILY {
118             display       "LPC2XXX variant family"
119             flavor        data
120             calculated    CYGHWR_HAL_ARM_LPC24XX_FAMILY
121             description   "
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."
127         }
128         
129         cdl_option CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION {
130             display       "LPC2XXX variant version"
131             flavor        data
132             calculated    {
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
136                           }
137             description   "
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." 
142         }
143     }
144
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"
151         flavor        data
152         default_value 0xB4405F62
153         legal_values  0 to 0xFFFFFFFF
154         description "
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."
161     }
162
163     cdl_component CYGNUM_HAL_ARM_LPC24XX_CLOCKING {
164         display       "Clocking"
165         flavor        none
166
167         cdl_option CYGNUM_HAL_ARM_LPC24XX_PLL_MUL {
168             display       "PLL multiplier"
169             flavor        data
170             legal_values  6 to 32767
171             default_value { 12 }
172         }
173     
174         cdl_option CYGNUM_HAL_ARM_LPC24XX_PLL_DIV {
175             display       "PLL divider"
176             flavor         data
177             legal_values  1 to 32 
178             default_value { 1 }
179         }
180
181         cdl_option CYGNUM_HAL_ARM_LPC24XX_PLL_OUTPUT {
182             display       "PLL output (MHz)"
183             flavor         data
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}
188             description "
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."
192         }
193        
194         cdl_component CYGNUM_HAL_ARM_LPC24XX_CLOCK_SPEED {
195             display       "CPU clock speed"
196             flavor        data
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}
201             description "
202                 The core CPU clock speed is the PLL output divided by the 
203                 CPU clock divider" 
204                 
205             cdl_option CYGNUM_HAL_ARM_LPC24XX_CPU_CLK_DIV {
206                 display       "CPU clock divider"
207                 flavor        data
208                 legal_values  6 to 256
209                 default_value { 6 }
210                 description "
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 
222                     the device."
223              }    
224         }
225     
226         
227         cdl_component CYGNUM_HAL_ARM_LPC24XX_USB_CLOCK_SPEED {
228             display       "USB clock speed"
229             flavor        data
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}
234             description "
235                 The USB clock speed is the PLL output divided by the 
236                 USB clock divider" 
237                 
238             cdl_option CYGNUM_HAL_ARM_LPC24XX_USB_CLK_DIV {
239                 display       "USB clock divider"
240                 flavor        data
241                 legal_values  1 to 8
242                 default_value { 6 }
243                 description "
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."
253             }
254         }
255         
256         cdl_component CYGNUM_HAL_ARM_LPC2XXX_CAN_CLK {
257             display       "CAN clock speed"
258             flavor        data
259             calculated   {  CYGNUM_HAL_ARM_LPC24XX_CLOCK_SPEED / 
260                             CYGNUM_HAL_ARM_LPC24XX_CAN_CLK_DIV}
261             description "
262                 The CAN clock speed is the CPU clock output divided by the 
263                 CAN clock divider" 
264                 
265             cdl_option CYGNUM_HAL_ARM_LPC24XX_CAN_CLK_DIV {
266                 display       "CAN clock divider"
267                 flavor        data
268                 legal_values  { 1 2 4 6 }
269                 default_value { 1 }
270                 description "
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."
274             }
275         }      
276     }
277     
278     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
279         display       "Real-time clock constants"
280         flavor        none
281
282         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
283             display       "Real-time clock numerator"
284             flavor        data
285             default_value 1000000000
286         }
287         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
288             display       "Real-time clock denominator"
289             flavor        data
290             default_value 100
291         }
292         cdl_option CYGNUM_HAL_RTC_PERIOD {
293             display       "Real-time clock period"
294             flavor        data
295             default_value { ((CYGNUM_HAL_ARM_LPC24XX_CLOCK_SPEED) / 
296                               CYGNUM_HAL_RTC_DENOMINATOR) }
297         }
298     }
299
300     cdl_option CYGHWR_HAL_ARM_LPC24XX_IDLE_PWRSAVE {
301         display       "Stop clock in idle loop to save power"
302         flavor        bool
303         default_value { is_active(CYGPKG_REDBOOT) ? 0 : 1 }
304         description   "
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."
311     }
312     
313     cdl_option CYGNUM_HAL_KERNEL_COUNTERS_CLOCK_ISR_DEFAULT_PRIORITY {
314             display             "Default priority for system clock interrupts"
315             flavor              data
316             legal_values  { 0 to 15 }
317         default_value 15
318             description "
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."
324     }
325
326 }