1 | /* bsp.h |
---|
2 | * |
---|
3 | * This include file contains all board IO definitions for bf537Stamp. |
---|
4 | * |
---|
5 | * Copyright (c) 2006 by Atos Automacao Industrial Ltda. |
---|
6 | * written by Alain Schaefer <alain.schaefer@easc.ch> |
---|
7 | * and Antonio Giovanini <antonio@atos.com.br> |
---|
8 | * |
---|
9 | * The license and distribution terms for this file may be |
---|
10 | * found in the file LICENSE in this distribution or at |
---|
11 | * http://www.rtems.org/license/LICENSE. |
---|
12 | */ |
---|
13 | |
---|
14 | |
---|
15 | #ifndef LIBBSP_BFIN_BF537STAMP_BSP_H |
---|
16 | #define LIBBSP_BFIN_BF537STAMP_BSP_H |
---|
17 | |
---|
18 | #ifndef ASM |
---|
19 | |
---|
20 | #include <bspopts.h> |
---|
21 | #include <bsp/default-initial-extension.h> |
---|
22 | |
---|
23 | #include <rtems.h> |
---|
24 | #include <rtems/console.h> |
---|
25 | #include <rtems/clockdrv.h> |
---|
26 | |
---|
27 | #include <libcpu/bf537.h> |
---|
28 | #include <libcpu/memoryRegs.h> |
---|
29 | |
---|
30 | #ifdef __cplusplus |
---|
31 | extern "C" { |
---|
32 | #endif |
---|
33 | |
---|
34 | /* configure data cache to use 16K of each SRAM bank when enabled */ |
---|
35 | #define BSP_DATA_CACHE_CONFIG (3 << DMEM_CONTROL_DMC_SHIFT) |
---|
36 | |
---|
37 | |
---|
38 | /* |
---|
39 | * PLL and clock setup values: |
---|
40 | */ |
---|
41 | |
---|
42 | /* |
---|
43 | * PLL configuration for bf533Stamp |
---|
44 | * |
---|
45 | * XTL = 27 MHz |
---|
46 | * CLKIN = 13 MHz |
---|
47 | * VCO = 391 MHz |
---|
48 | * CCLK = 391 MHz |
---|
49 | * SCLK = 130 MHz |
---|
50 | */ |
---|
51 | |
---|
52 | #define PLL_CSEL 0x0000 /* CCLK = VCO */ |
---|
53 | #define PLL_SSEL 0x0003 /* SCLK = CCLK/3 */ |
---|
54 | #define PLL_MSEL 0x3A00 /* VCO = 29xCLKIN */ |
---|
55 | #define PLL_DF 0x0001 /* CLKIN = XTL/2 */ |
---|
56 | |
---|
57 | #define CCLK 500000000 /* CORE CLOCK */ |
---|
58 | #define SCLK 100000000 /* SYSTEM CLOCK */ |
---|
59 | |
---|
60 | #define CONSOLE_FORCE_BAUD 57600 |
---|
61 | |
---|
62 | /* |
---|
63 | * Blackfin environment memory map |
---|
64 | */ |
---|
65 | #define L1_DATA_SRAM_A 0xff800000L |
---|
66 | |
---|
67 | #define FIFOLENGTH 0x100 |
---|
68 | |
---|
69 | /* |
---|
70 | * Simple spin delay in microsecond units for device drivers. |
---|
71 | * This is very dependent on the clock speed of the target. |
---|
72 | */ |
---|
73 | |
---|
74 | #define rtems_bsp_delay( microseconds ) \ |
---|
75 | { \ |
---|
76 | } |
---|
77 | |
---|
78 | /* Constants */ |
---|
79 | |
---|
80 | #define RAM_START 0 |
---|
81 | #define RAM_END 0x4000000 |
---|
82 | |
---|
83 | /* functions */ |
---|
84 | |
---|
85 | /* |
---|
86 | * Helper Function to use the EzKits LEDS. |
---|
87 | * Can be used by the Application. |
---|
88 | */ |
---|
89 | void setLED(uint8_t value); |
---|
90 | |
---|
91 | /* |
---|
92 | * Helper Function to use the EzKits LEDS |
---|
93 | */ |
---|
94 | uint8_t getLEDs(void); |
---|
95 | void setLEDs(uint8_t value); |
---|
96 | uint8_t getButtons(void); |
---|
97 | |
---|
98 | rtems_isr_entry set_vector( /* returns old vector */ |
---|
99 | rtems_isr_entry handler, /* isr routine */ |
---|
100 | rtems_vector_number vector, /* vector number */ |
---|
101 | int type /* RTEMS or RAW intr */ |
---|
102 | ); |
---|
103 | |
---|
104 | /* |
---|
105 | * Internal BSP methods that are used across file boundaries |
---|
106 | */ |
---|
107 | void Init_RTC(void); |
---|
108 | |
---|
109 | /* |
---|
110 | * Network driver configuration |
---|
111 | */ |
---|
112 | struct rtems_bsdnet_ifconfig; |
---|
113 | extern int bf537Stamp_network_driver_attach(struct rtems_bsdnet_ifconfig *, int); |
---|
114 | |
---|
115 | #define RTEMS_BSP_NETWORK_DRIVER_NAME "eth1" |
---|
116 | #define RTEMS_BSP_NETWORK_DRIVER_ATTACH bf537Stamp_network_driver_attach |
---|
117 | |
---|
118 | #ifdef __cplusplus |
---|
119 | } |
---|
120 | #endif |
---|
121 | |
---|
122 | #endif /* !ASM */ |
---|
123 | |
---|
124 | #endif |
---|