source: rtems/c/src/lib/libbsp/arm/rtl22xx/include/bsp.h @ 78e529a6

4.11
Last change on this file since 78e529a6 was 78e529a6, checked in by Daniel Ramirez <javamonn@…>, on Dec 22, 2013 at 7:49:52 PM

arm_rtl22xx: added new doxygen

  • Property mode set to 100644
File size: 4.7 KB
Line 
1/**
2 * @file
3 * @ingroup arm_rtl22xx
4 * @brief Global BSP definitions.
5 */
6
7/*
8 * Philips LPC22XX/LPC21xx BSP header file
9 *
10 * by Ray,Xu <Rayx.cn@gmail.com>
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15*/
16#ifndef _BSP_H
17#define _BSP_H
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include <bspopts.h>
24#include <bsp/default-initial-extension.h>
25
26/**
27 * @defgroup arm_rtl22xx RTL22XX Support
28 * @ingroup bsp_arm
29 * @brief RTL22XX Support Package
30 * @{
31 */
32
33#define BSP_SMALL_MEMORY 1
34
35#include <rtems.h>
36#include <rtems/iosupp.h>
37#include <rtems/console.h>
38#include <rtems/clockdrv.h>
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
46/** @brief system clk frequecy,<=60Mhz, defined in system configuration */
47#define LPC22xx_Fcclk   CONFIG_ARM_CLK
48
49/* Fcco 156M~320Mhz*/
50/** @brief system clk frequecy,<=60Mhz, defined in system configuration */
51#define LPC22xx_Fcclk   CONFIG_ARM_CLK
52#define LPC22xx_Fcco    LPC22xx_Fcclk * 4
53/** @brief VPB clk frequency,1,1/2,1/4 times of Fcclk */
54#define LPC22xx_Fpclk   (LPC22xx_Fcclk /4) *1
55
56
57
58/**
59 * @name Fcclk range: 10MHz ~ MCU allowed frequency
60 * @{
61 */
62
63#define Fcclk_MIN           10000000L
64#define Fcclk_MAX           60000000L
65
66/** @} */
67
68/**
69 * @name Fcco range: 156MHz ~ 320MHz
70 * @{
71 */
72
73#define Fcco_MIN            156000000L
74#define Fcco_MAX            320000000L
75
76/** @} */
77
78#define PLLFEED_DATA1       0xAA
79#define PLLFEED_DATA2       0x55
80
81/**
82 * @name PLL PLLCON register bit descriptions
83 * @{
84 */
85
86#define PLLCON_ENABLE_BIT   0
87#define PLLCON_CONNECT_BIT  1
88
89/** @} */
90
91/**
92 * @name PLL PLLSTAT register bit descriptions
93 * @{
94 */
95
96#define PLLSTAT_ENABLE_BIT  8
97#define PLLSTAT_CONNECT_BIT 9
98#define PLLSTAT_LOCK_BIT    10
99
100/** @} */
101
102/**
103 * @name PM Peripheral Type
104 * @{
105 */
106
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
116/** @} */
117
118/** @brief OSC [Hz] */
119#define FOSC              11059200
120/** @brief Core clk [Hz] */
121#define FCCLK             FOSC<<2
122
123/**
124 * @name System Configure
125 * @{
126 */
127
128/** @brief osc freq,10MHz~25MHz, change to a real one if needed */
129#define Fosc    11059200
130/** @brief system freq 2^n time of  Fosc(1~32) <=60MHZ */
131#define Fcclk   (Fosc << 2)
132/** @brief CCO freq 2,4,8,16 time of Fcclk 156MHz~320MHz */
133#define Fcco    (Fcclk <<2)
134/** @brief VPB freq only(Fcclk / 4) 1~4 */
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
141/** @} */
142
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
149/** @brief Time Precision time [us] */
150#define TIMER_PRECISION   10
151
152/** @brief I2C Speed [bit/s] */
153#define I2CSPEED          20000         // 20 Kbit/s
154
155/**
156 * @name Uarts buffers size
157 * @{
158 */
159
160#define RXBUFSIZE         32
161#define TXBUFSIZE         32
162
163/** @} */
164
165/** @brief SPI Speed [bit/s] */
166#define SPISPEED          1500000       // 1.5 Mbit/s
167/** @brief SPI EEPROM CS pin
168 *
169 *  (SSEL is not suitable for CS, because is used by SPI module for multi master SPI interface)
170 */
171#define SPI_CS_PIN        P0_13
172#define SPI_CS_PIN_FUNC   PINSEL0_bit.SPI_CS_PIN
173
174/**
175 * @name Flash definition
176 * @{
177 */
178
179//#define FLASH_SIZE      (0x200000-FLASH_BOOT)   // Total area of Flash region in words 8 bit
180/** @brief Total area of Flash region in words 8 bit */
181#define FLASH_SIZE        (0x80000-FLASH_BOOT)
182//#define FLASH_SIZE      (0x80000-FLASH_BOOT)      // Total area of Flash region in words 8 bit
183#define FLASH_BEGIN       0x80000000
184/** @brief First 0x8000 bytes reserved for boot loader etc. */
185#define FLASH_BASE        (FLASH_BEGIN+FLASH_BOOT)
186
187/** @} */
188
189/**
190 * @name SRAM definition
191 * @{
192 */
193
194/** @brief Total area of Flash region in words 8 bit */
195#define SRAM_SIZE         0x100000
196/** @brief First 0x8000 bytes reserved for boot loader etc. */
197#define SRAM_BASE         0x81000000
198
199/** @} */
200
201/** @brief CS8900A definition */
202#define CS8900A_BASE      0x82000000
203/** @brief RTL8019AS definition */
204#define RTL8019AS_BASE    0x82000000
205
206struct rtems_bsdnet_ifconfig;
207int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
208                          int                          attaching);
209
210/**
211 * @name Network driver configuration
212 * @{
213 */
214
215#define RTEMS_BSP_NETWORK_DRIVER_NAME   "eth0"
216#define RTEMS_BSP_NETWORK_DRIVER_ATTACH cs8900_driver_attach
217
218/** @} */
219
220/** @} */
221
222#ifdef __cplusplus
223}
224#endif
225
226#endif /* _BSP_H */
Note: See TracBrowser for help on using the repository browser.