RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
m68k
uC5282
include
bsp.h
Go to the documentation of this file.
1
8
9
/*
10
* Copyright (c) 2005 Eric Norum <eric@norum.ca>
11
*
12
* COPYRIGHT (c) 2005.
13
* On-Line Applications Research Corporation (OAR).
14
*
15
* The license and distribution terms for this file may be
16
* found in the file LICENSE in this distribution or at
17
* http://www.rtems.org/license/LICENSE.
18
*/
19
20
#ifndef LIBBSP_M68K_UC5282_BSP_H
21
#define LIBBSP_M68K_UC5282_BSP_H
22
32
33
#include <bspopts.h>
34
#include <
bsp/default-initial-extension.h
>
35
36
#include <
rtems.h
>
37
#include <
rtems/bspIo.h
>
38
39
#ifdef __cplusplus
40
extern
"C"
{
41
#endif
42
43
/***************************************************************************/
45
/*
46
* Uncomment to use instruction/data cache
47
* Leave commented to use instruction-only cache
48
*/
49
#define RTEMS_MCF5282_BSP_ENABLE_DATA_CACHE
50
51
/***************************************************************************/
53
#include <mcf5282/mcf5282.h>
/* internal MCF5282 modules */
54
55
/***************************************************************************/
57
struct
rtems_bsdnet_ifconfig;
58
extern
int
rtems_fec_driver_attach (
struct
rtems_bsdnet_ifconfig *config,
int
attaching );
59
#define RTEMS_BSP_NETWORK_DRIVER_NAME "fs1"
60
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_fec_driver_attach
61
62
/***************************************************************************/
64
65
/* define which port the console should use - all other ports are then defined as general purpose */
66
#define CONSOLE_PORT 0
67
68
/* functions */
69
70
typedef
struct
{
71
unsigned
int
l;
72
void
*v;
73
}
bsp_mnode_t
;
74
75
#define RTEMS_BSP_PGM_ERASE_FIRST 0x1
76
#define RTEMS_BSP_PGM_RESET_AFTER 0x2
77
#define RTEMS_BSP_PGM_EXEC_AFTER 0x4
78
#define RTEMS_BSP_PGM_HALT_AFTER 0x8
79
80
uint32_t bsp_get_CPU_clock_speed(
void
);
81
rtems_status_code
bsp_allocate_interrupt(
int
level,
int
priority);
82
int
bsp_sysReset(
int
flags);
83
int
bsp_program(
bsp_mnode_t
*chain,
int
flags);
84
unsigned
const
char
*bsp_gethwaddr(
int
a);
85
const
char
*bsp_getbenv(
const
char
*a);
86
int
bsp_flash_erase_range(
volatile
unsigned
short
*flashptr,
int
start,
int
end);
87
int
bsp_flash_write_range(
volatile
unsigned
short
*flashptr,
bsp_mnode_t
*chain,
int
offset);
88
89
rtems_isr_entry
set_vector(
90
rtems_isr_entry
handler,
91
rtems_vector_number
vector,
92
int
type
93
);
94
95
/*
96
* Interrupt assignments
97
* Highest-priority listed first
98
*/
99
#define FEC_IRQ_LEVEL 4
100
#define FEC_IRQ_RX_PRIORITY 7
101
#define FEC_IRQ_TX_PRIORITY 6
102
103
#define PIT3_IRQ_LEVEL 4
104
#define PIT3_IRQ_PRIORITY 0
105
106
#define UART0_IRQ_LEVEL 3
107
#define UART0_IRQ_PRIORITY 7
108
#define UART1_IRQ_LEVEL 3
109
#define UART1_IRQ_PRIORITY 6
110
#define UART2_IRQ_LEVEL 3
111
#define UART2_IRQ_PRIORITY 5
112
113
/*
114
* Fake VME support
115
* This makes it easier to use EPICS driver support on this BSP.
116
*/
117
#define VME_AM_STD_SUP_ASCENDING 0x3f
118
#define VME_AM_STD_SUP_PGM 0x3e
119
#define VME_AM_STD_USR_ASCENDING 0x3b
120
#define VME_AM_STD_USR_PGM 0x3a
121
#define VME_AM_STD_SUP_DATA 0x3d
122
#define VME_AM_STD_USR_DATA 0x39
123
#define VME_AM_EXT_SUP_ASCENDING 0x0f
124
#define VME_AM_EXT_SUP_PGM 0x0e
125
#define VME_AM_EXT_USR_ASCENDING 0x0b
126
#define VME_AM_EXT_USR_PGM 0x0a
127
#define VME_AM_EXT_SUP_DATA 0x0d
128
#define VME_AM_EXT_USR_DATA 0x09
129
#define VME_AM_SUP_SHORT_IO 0x2d
130
#define VME_AM_USR_SHORT_IO 0x29
131
132
/*
133
* 'Extended' BSP support
134
*/
135
rtems_status_code
bspExtInit(
void
);
136
typedef
void (*BSP_VME_ISR_t)(
void
*usrArg,
unsigned
long
vector);
137
BSP_VME_ISR_t BSP_getVME_isr(
unsigned
long
vector,
void
**parg);
138
int
BSP_installVME_isr(
unsigned
long
vector, BSP_VME_ISR_t handler,
void
*usrArg);
139
int
BSP_removeVME_isr(
unsigned
long
vector, BSP_VME_ISR_t handler,
void
*usrArg);
140
int
BSP_enableVME_int_lvl(
unsigned
int
level);
141
int
BSP_disableVME_int_lvl(
unsigned
int
level);
142
int
BSP_vme2local_adrs(
unsigned
am,
unsigned
long
vmeaddr,
unsigned
long
*plocaladdr);
143
144
/*
145
* This BSP provides its own IDLE task to override the RTEMS one.
146
* So we prototype it and define the constant confdefs.h expects
147
* to configure a BSP specific one.
148
*/
149
void
*
bsp_idle_thread
( uintptr_t ignored );
150
#define BSP_IDLE_TASK_BODY bsp_idle_thread
151
152
/*
153
* The custom IDLE task keeps some idle statistics.
154
*/
155
int
bsp_cpu_load_percentage(
void
);
156
157
/*
158
* This is a helper method to determine the cause of a reset.
159
*/
160
void
bsp_reset_cause(
char
*buf,
size_t
capacity);
161
162
/*
163
* SRAM. The BSP uses SRAM for maintaining some clock-driver data
164
* and for ethernet descriptors (and the initial stack during
165
* early boot).
166
*/
167
168
typedef
struct
mcf5282BufferDescriptor_
{
169
volatile
uint16_t status;
170
uint16_t length;
171
volatile
void
*buffer;
172
} mcf5282BufferDescriptor_t;
173
174
extern
struct
{
175
uint32_t idle_counter;
176
uint32_t filtered_idle;
177
uint32_t max_idle_count;
178
uint32_t pitc_per_tick;
179
uint32_t nsec_per_pitc;
180
uint32_t pad[3];
/* align to 16-bytes for descriptors */
181
mcf5282BufferDescriptor_t fec_descriptors[];
182
/* buffer descriptors are allocated from here */
183
184
/* initial stack is at top of SRAM (start.S) */
185
} __SRAMBASE;
186
187
#ifdef __cplusplus
188
}
189
#endif
190
192
193
#endif
bspIo.h
This header file provides the kernel character input/output support API.
default-initial-extension.h
This header file provides the default definition of BSP_INITIAL_EXTENSION.
rtems_isr_entry
ISR_Handler_entry rtems_isr_entry
Interrupt service routines installed by rtems_interrupt_catch() shall have this type.
Definition
intr.h:134
rtems_vector_number
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition
intr.h:102
rtems_status_code
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition
status.h:85
bsp_idle_thread
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition
bspidle.c:39
rtems.h
This header file defines the RTEMS Classic API.
bsp_mnode_t
Definition
bsp.h:70
mcf5282BufferDescriptor_
Definition
bsp.h:168
Generated by
1.18.0