RTEMS  5.0.0
bsp.h
Go to the documentation of this file.
1 
9 /*
10  * Philips LPC22XX/LPC21xx BSP header file
11  *
12  * by Ray,Xu <Rayx.cn@gmail.com>
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17 */
18 #ifndef LIBBSP_ARM_RTL22XX_BSP_H
19 #define LIBBSP_ARM_RTL22XX_BSP_H
20 
31 #include <bspopts.h>
33 
34 #include <rtems.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 #define BSP_FEATURE_IRQ_EXTENSION
41 
42 #define CONFIG_ARM_CLK 60000000L
43 /* cclk=cco/(2*P) */
44 /* cco = cclk*2*P */
45 
47 #define LPC22xx_Fcclk CONFIG_ARM_CLK
48 
49 /* Fcco 156M~320Mhz*/
51 #define LPC22xx_Fcclk CONFIG_ARM_CLK
52 #define LPC22xx_Fcco LPC22xx_Fcclk * 4
53 
54 #define LPC22xx_Fpclk (LPC22xx_Fcclk /4) *1
55 
56 
57 
63 #define Fcclk_MIN 10000000L
64 #define Fcclk_MAX 60000000L
65 
73 #define Fcco_MIN 156000000L
74 #define Fcco_MAX 320000000L
75 
78 #define PLLFEED_DATA1 0xAA
79 #define PLLFEED_DATA2 0x55
80 
86 #define PLLCON_ENABLE_BIT 0
87 #define PLLCON_CONNECT_BIT 1
88 
96 #define PLLSTAT_ENABLE_BIT 8
97 #define PLLSTAT_CONNECT_BIT 9
98 #define PLLSTAT_LOCK_BIT 10
99 
107 #define PC_TIMER0 0x2
108 #define PC_TIMER1 0x4
109 #define PC_UART0 0x8
110 #define PC_UART1 0x10
111 #define PC_PWM0 0x20
112 #define PC_I2C 0x80
113 #define PC_SPI0 0x100
114 #define PC_RTC 0x200
115 
119 #define FOSC 11059200
120 
121 #define FCCLK FOSC<<2
122 
129 #define Fosc 11059200
130 
131 #define Fcclk (Fosc << 2)
132 
133 #define Fcco (Fcclk <<2)
134 
135 #define Fpclk (Fcclk >>2) * 1
136 /* This was M. That is a BAD BAD public constant. I renamed it to
137  * JOEL_M so it wouldn't conflict with user code. If you can find
138  * a better name, fix this. But nothing I found uses it.
139  */
140 
143 #define JOEL_M Fcclk / Fosc
144 #define P_min Fcco_MIN / (2*Fcclk) + 1;
145 #define P_max Fcco_MAX / (2*Fcclk);
146 
147 #define UART_BPS 115200
148 
150 #define TIMER_PRECISION 10
151 
153 #define I2CSPEED 20000 // 20 Kbit/s
154 
160 #define RXBUFSIZE 32
161 #define TXBUFSIZE 32
162 
166 #define SPISPEED 1500000 // 1.5 Mbit/s
167 
171 #define SPI_CS_PIN P0_13
172 #define SPI_CS_PIN_FUNC PINSEL0_bit.SPI_CS_PIN
173 
179 //#define RTL22XX_FLASH_SIZE (0x200000-RTL22XX_FLASH_BOOT) // Total area of Flash region in words 8 bit
181 #define RTL22XX_FLASH_SIZE (0x80000-RTL22XX_FLASH_BOOT)
182 //#define RTL22XX_FLASH_SIZE (0x80000-RTL22XX_FLASH_BOOT) // Total area of Flash region in words 8 bit
183 #define RTL22XX_FLASH_BEGIN 0x80000000
184 
185 #define RTL22XX_FLASH_BASE (RTL22XX_FLASH_BEGIN+RTL22XX_FLASH_BOOT)
186 
195 #define SRAM_SIZE 0x100000
196 
197 #define SRAM_BASE 0x81000000
198 
202 #define CS8900A_BASE 0x82000000
203 
204 #define RTL8019AS_BASE 0x82000000
205 
206 struct rtems_bsdnet_ifconfig;
207 int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
208  int attaching);
209 
215 #define RTEMS_BSP_NETWORK_DRIVER_NAME "eth0"
216 #define RTEMS_BSP_NETWORK_DRIVER_ATTACH cs8900_driver_attach
217 
220 /*
221  * Prototypes for methods used across file boundaries in the BSP.
222  */
223 extern void UART0_Ini(void);
224 
225 #ifdef __cplusplus
226 }
227 #endif
228 
231 #endif /* _BSP_H */
Definition: deflate.c:115
DEFAULT_INITIAL_EXTENSION Support.