]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/hal/arm/lpc2xxx/var/v2_0/cdl/hal_arm_lpc2xxx.cdl
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / packages / hal / arm / lpc2xxx / var / v2_0 / cdl / hal_arm_lpc2xxx.cdl
1 # ====================================================================
2 #
3 #      hal_arm_lpc2xxx.cdl
4 #
5 #      Philips LPC2XXX 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):      jani 
43 # Contributors:   gthomas, tkoeller, tdrury, nickg
44 # Date:           2001-07-12
45 #
46 #####DESCRIPTIONEND####
47 #
48 # ====================================================================
49
50 cdl_package CYGPKG_HAL_ARM_LPC2XXX {
51     display       "Philips LPC2XXX variant HAL"
52     parent        CYGPKG_HAL_ARM
53     define_header hal_arm_lpc2xxx.h
54     include_dir   cyg/hal
55     hardware
56     description   "
57         The LPC2XXX HAL package provides the support needed to run
58         eCos on Philips LPC2XXX based targets."
59
60     compile       hal_diag.c lpc2xxx_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     # This is going to get really messy before long as the number of parts
77     # explodes. Its useful to know the actual part in use, but its just as
78     # useful to know which family it belongs to. LPC210x shouldn't really
79     # be in the list of devices, but will probably break something if removed.
80     cdl_component CYGHWR_HAL_ARM_LPC2XXX {
81         display        "LPC2XXX variant used"
82         flavor         data
83         default_value  { "LPC210x" }
84         legal_values   { "LPC210x"
85                 "LPC2101" "LPC2102" "LPC2103" "LPC2104" "LPC2105" "LPC2106"
86                 "LPC2114" "LPC2119" "LPC2124" "LPC2129" "LPC2131" "LPC2132" 
87                 "LPC2134" "LPC2136" "LPC2138" "LPC2141" "LPC2142" "LPC2144"
88                 "LPC2146" "LPC2148" "LPC2194" "LPC2210" "LPC2212" "LPC2214"
89                 "LPC2220" "LPC2290" "LPC2292" "LPC2294" }
90         description    "
91              The LPC2XXX microcontroller family has several variants,
92              the main differences being the amount of on-chip RAM,
93              flash and peripherals. This option allows the platform
94              HALs to select the specific microcontroller being used."
95
96         cdl_option CYGHWR_HAL_ARM_LPC2XXX_FAMILY {
97             display       "LPC2XXX variant family"
98             flavor        data
99             calculated    {
100                 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC22") ? "LPC22XX" :
101                 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC213") ? "LPC213X" :
102                 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC214") ? "LPC214X" :
103                 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC210") ? "LPC210X" :
104                 "LPC21XX"
105                           }
106             description   "
107                 This specifies the family that the processor
108                 belongs to. This is useful as it defines certain common
109                 characteristics (e.g lpc22xx has the external bus and
110                 lpc214x has USB) which affect which features should be
111                 available in the HAL."
112         }
113         
114         cdl_option CYGHWR_HAL_ARM_LPC2XXX_VARIANT_VERSION {
115             display       "LPC2XXX variant version"
116             flavor        data
117             calculated    {
118                 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC21") ? 1 :
119                 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC22") ? 2 :
120                 is_substr(CYGHWR_HAL_ARM_LPC2XXX, "LPC24") ? 4 : 0
121                           }
122             description   "
123                 This specifies the variant version that the processor
124                 belongs to. Some common characteristics may be 
125                 different in newer LPC2xxx versions. I.e. the LPC24xx variants
126                 are significant different from former LPC2xxx variants." 
127         }
128         
129         cdl_option CYGHWR_HAL_ARM_LPC2XXX_SUFFIX {
130             display       "Suffix of LPC2XXX device"
131             flavor        data
132             legal_values  { "no_suffix" "00" "01" }
133             default_value { "no_suffix" }
134             description   "
135                 This option sets the version number of LPC2XXX microcontroller.
136                 To denote different version of LPC2XXX the following suffixes 
137                 are used: no suffix, /00, /01. All /01 version contain
138                 enhanced features."
139         }
140     }
141
142     # Important! Be very careful changing this value. That will always
143     # enter the LPC2XXX bootloader after reset and consequently will
144     # never run your code. You must know what you are doing. Look at
145     # arch. vectors.S for details.
146     cdl_option CYGNUM_HAL_ARM_VECTOR_0x14 {
147         display       "ARM vector at 0x14"
148         flavor        data
149         default_value 0xB4405F62
150         legal_values  0 to 0xFFFFFFFF
151         description "
152            In order to detect if a valid program is present, every
153            user program must have a program signature. This signature
154            is a word-wide number that is stored in the unused
155            location in the ARM7 vector table at 0x00000014. The
156            program signature is the two's compliment of the checksum
157            of the ARM vector table."
158     }
159
160     cdl_component CYGNUM_HAL_ARM_LPC2XXX_VPBDIV {
161         display       "VPB clock divisor"
162         flavor        data
163         legal_values  { 4 2 1 }
164         default_value { 4 }
165         description   "
166             The VPB Divider determines the relationship between the 
167             processor clock (cclk) and the clock used by peripheral 
168             devices (pclk). The VPB Divider serves two purposes. 
169             The first is to provides peripherals with desired pclk 
170             via VPB bus so that they can operate at the speed chosen for the ARM 
171             processor. In order to achieve this, the VPB bus may be slowed down 
172             to one half or one fourth of the processor clock rate. 
173             Because the VPB bus must work properly at power up (and its timing 
174             cannot be altered if it does not work since the VPB divider control 
175             registers reside on the VPB bus), the default condition at reset is 
176             for the VPB bus to run at one quarter speed. The second purpose of 
177             the VPB Divider is to allow power savings when an application 
178             does not require any peripherals to run at the full processor rate.
179             This option sets the divisor for the VPB clock relative to
180             the processor clock. 4 means that the VPB clock runs at
181             one fourth the processor clock, 2 means that it runs at
182             one half of the processor clock and 1 means that it is the
183             same as the processor clock."
184         
185         cdl_option CYGNUM_HAL_ARM_LPC2XXX_PCLK {
186             display       "Peripheral clock"
187             flavor        data
188             calculated    {CYGNUM_HAL_ARM_LPC2XXX_CLOCK_SPEED / CYGNUM_HAL_ARM_LPC2XXX_VPBDIV}
189             description "
190                 The peripheral clock is the clock derived from the processor clock
191                 speed divided by the VPB clock divisor." 
192         }
193     }
194
195     cdl_component CYGNUM_HAL_ARM_LPC2XXX_XCLKDIV {
196         display         "XCLK clock divisor"
197         flavor          data
198         legal_values    { 4 2 1 }
199         default_value   { 4 }
200         active_if       { CYGHWR_HAL_ARM_LPC2XXX_FAMILY == "LPC22XX" }
201         description     "
202             This option sets the divisor for the XCLK clock relative
203             to the processor clock. 4 means that the XCLK clock runs
204             at one fourth the processor clock, 2 means that it runs at
205             one half of the processor clock and 1 means that it is the
206             same as the processor clock."
207             
208         cdl_option CYGNUM_HAL_ARM_LPC2XXX_XCLK {
209             display       "Clock on XCLK pin"
210             flavor        data
211             calculated    {CYGNUM_HAL_ARM_LPC2XXX_CLOCK_SPEED / CYGNUM_HAL_ARM_LPC2XXX_VPBDIV}
212             description "
213                 This option controls the clock that can be driven onto the 
214                 A23/XCLK pin" 
215         }
216     }
217
218     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
219         display       "Real-time clock constants"
220         flavor        none
221
222         cdl_option CYGNUM_HAL_RTC_NUMERATOR {
223             display       "Real-time clock numerator"
224             flavor        data
225             default_value 1000000000
226         }
227         cdl_option CYGNUM_HAL_RTC_DENOMINATOR {
228             display       "Real-time clock denominator"
229             flavor        data
230             default_value 100
231         }
232         cdl_option CYGNUM_HAL_RTC_PERIOD {
233             display       "Real-time clock period"
234             flavor        data
235             default_value { ((CYGNUM_HAL_ARM_LPC2XXX_CLOCK_SPEED) / 
236                               CYGNUM_HAL_RTC_DENOMINATOR) }
237         }
238     }
239    
240     # Enable this by default, as I believe it won't affect parts that
241     # don't have the problem (other than slowing them down slightly)
242     # but causes a lock-up on those that do...
243     cdl_option CYGHWR_HAL_ARM_LPC2XXX_EXTINT_ERRATA {
244         display       "EXTINT.1 errata workaround"
245         flavor        bool       
246         default_value 1           
247         description   "
248
249             On some chips writing to the EXTPOLAR or EXTMODE registers
250             while VPBDIV is non-zero can corrupt the latter. Also
251             reading them will yield incorrect values.  Enable this
252             option to work around the problem."  
253     }
254
255     cdl_option CYGHWR_HAL_ARM_LPC2XXX_IDLE_PWRSAVE {
256         display       "Stop clock in idle loop to save power"
257         flavor        bool
258         default_value { is_active(CYGPKG_REDBOOT) ? 0 : 1 }
259         description   "
260            Select this option when it is desired to save power by
261            stoping the processor clock in the idle loop. This is
262            controlled by the PCON register. Generally this is a good
263            thing, but it may be necessary to disable this when
264            debugging via JTAG, as stopping the clock can prevent the
265            debugger getting control of the system."
266     }
267     
268     cdl_option CYGNUM_HAL_KERNEL_COUNTERS_CLOCK_ISR_DEFAULT_PRIORITY {
269             display             "Default priority for system clock interrupts"
270             flavor              data
271             legal_values  { 0 to 16 }
272         default_value 0
273             description "
274             The LPC2xxx eCos HAL supports up to 17 interrupt levels.
275             Interrupt levels 0 - 15 are vectored IRQs. Vectored IRQs 
276             have a higher priority then non vectored IRQs and they 
277             are processed faster. Non vectored  IRQs are all chained together 
278             into one single slot and the ISR need to  find out which interrupt 
279             occured. The default value for the system clock interrupts is 0 - 
280             this is the highest priority IRQ."
281     }
282
283 }