source: rtems/c/src/lib/libbsp/arm/rtl22xx/include/bsp.h @ 336d67a

4.104.115
Last change on this file since 336d67a was 336d67a, checked in by Sebastian Huber <sebastian.huber@…>, on 04/30/10 at 14:24:03

2010-04-30 Sebastian Huber <sebastian.huber@…>

  • Makefile.am, preinstall.am: Added generic interrupt support modules.
  • include/bsp.h: Define BSP_FEATURE_IRQ_EXTENSION.
  • startup/bspstart.c, network/network.c: Interrupt support changes.
  • console/uart.c: Fixed warnings.
  • Property mode set to 100644
File size: 4.1 KB
Line 
1/*
2 * Philips LPC22XX/LPC21xx BSP header file
3 *
4 * by Ray,Xu <Rayx.cn@gmail.com>
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *
12 *  $Id$
13*/
14#ifndef _BSP_H
15#define _BSP_H
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21#include <bspopts.h>
22
23#include <rtems.h>
24#include <rtems/iosupp.h>
25#include <rtems/console.h>
26#include <rtems/clockdrv.h>
27
28#define BSP_FEATURE_IRQ_EXTENSION
29
30#define CONFIG_ARM_CLK 60000000L
31/* cclk=cco/(2*P) */
32/* cco = cclk*2*P       */
33
34/* system clk frequecy,<=60Mhz, defined in system configuration */
35#define LPC22xx_Fcclk   CONFIG_ARM_CLK
36
37/* Fcco 156M~320Mhz*/
38/* system clk frequecy,<=60Mhz, defined in system configuration */
39#define LPC22xx_Fcclk   CONFIG_ARM_CLK
40#define LPC22xx_Fcco    LPC22xx_Fcclk * 4
41/*VPB clk frequency,1,1/2,1/4 times of Fcclk */
42#define LPC22xx_Fpclk   (LPC22xx_Fcclk /4) *1
43
44
45
46/* Fcclk range: 10MHz ~ MCU allowed frequency */
47#define Fcclk_MIN           10000000L
48#define Fcclk_MAX           60000000L
49
50/* Fcco range: 156MHz ~ 320MHz */
51#define Fcco_MIN            156000000L
52#define Fcco_MAX            320000000L
53
54#define PLLFEED_DATA1       0xAA
55#define PLLFEED_DATA2       0x55
56
57/* PLL PLLCON register bit descriptions */
58#define PLLCON_ENABLE_BIT   0
59#define PLLCON_CONNECT_BIT  1
60
61/* PLL PLLSTAT register bit descriptions */
62#define PLLSTAT_ENABLE_BIT  8
63#define PLLSTAT_CONNECT_BIT 9
64#define PLLSTAT_LOCK_BIT    10
65
66/* PM Peripheral Type */
67#define PC_TIMER0           0x2
68#define PC_TIMER1           0x4
69#define PC_UART0            0x8
70#define PC_UART1            0x10
71#define PC_PWM0             0x20
72#define PC_I2C              0x80
73#define PC_SPI0             0x100
74#define PC_RTC              0x200
75
76// OSC [Hz]
77#define FOSC              11059200
78// Core clk [Hz]
79#define FCCLK             FOSC<<2
80/**
81* help file
82*/
83/* System configure, Fosc Fcclk Fcco Fpclk must be defined*/
84#define Fosc    11059200          // osc freq,10MHz~25MHz,
85                                  //    change to real one if needed
86#define Fcclk   (Fosc << 2)       //system freq 2^n time of  Fosc(1~32) <=60MHZ
87#define Fcco    (Fcclk <<2)       //CCO freq 2,4,8,16 time of Fcclk 156MHz~320MHz
88#define Fpclk   (Fcclk >>2) * 1   //VPB freq only(Fcclk / 4) 1~4
89/* This was M.  That is a BAD BAD public constant.  I renamed it to
90 * JOEL_M so it wouldn't conflict with user code.  If you can find
91 * a better name, fix this.  But nothing I found uses it.
92 */
93#define JOEL_M       Fcclk / Fosc
94#define P_min   Fcco_MIN / (2*Fcclk) + 1;
95#define P_max   Fcco_MAX / (2*Fcclk);
96
97
98
99#define  UART_BPS       115200
100
101// Time Precision time [us]
102#define TIMER_PRECISION   10
103
104// I2C Speed [bit/s]
105#define I2CSPEED          20000         // 20 Kbit/s
106
107// Uarts buffers size
108#define RXBUFSIZE         32
109#define TXBUFSIZE         32
110
111// SPI Speed [bit/s]
112#define SPISPEED          1500000       // 1.5 Mbit/s
113// SPI EEPROM CS pin (SSEL is not suitable for CS, because is used by SPI module for multi master SPI interface)
114#define SPI_CS_PIN        P0_13
115#define SPI_CS_PIN_FUNC   PINSEL0_bit.SPI_CS_PIN
116
117// Flash definition
118//#define FLASH_SIZE      (0x200000-FLASH_BOOT)   // Total area of Flash region in words 8 bit
119#define FLASH_SIZE        (0x80000-FLASH_BOOT)   // Total area of Flash region in words 8 bit
120//#define FLASH_SIZE      (0x80000-FLASH_BOOT)      // Total area of Flash region in words 8 bit
121#define FLASH_BEGIN       0x80000000
122#define FLASH_BASE        (FLASH_BEGIN+FLASH_BOOT)   //First 0x8000 bytes reserved for boot loader etc.
123
124// SRAM definition
125#define SRAM_SIZE         0x100000                  // Total area of Flash region in words 8 bit
126#define SRAM_BASE         0x81000000                //First 0x8000 bytes reserved for boot loader etc.
127
128// CS8900A definition
129#define CS8900A_BASE      0x82000000
130// RTL8019AS definition
131#define RTL8019AS_BASE    0x82000000
132
133struct rtems_bsdnet_ifconfig;
134int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
135                          int                          attaching);
136
137/*
138 * Network driver configuration
139 */
140#define RTEMS_BSP_NETWORK_DRIVER_NAME   "eth0"
141#define RTEMS_BSP_NETWORK_DRIVER_ATTACH cs8900_driver_attach
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif /* _BSP_H */
Note: See TracBrowser for help on using the repository browser.