RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bsp.h
Go to the documentation of this file.
1
9/* bsp.h
10 *
11 * This include file contains all SPARC simulator definitions.
12 *
13 * COPYRIGHT (c) 1989-1998.
14 * On-Line Applications Research Corporation (OAR).
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 *
20 * Ported to ERC32 implementation of the SPARC by On-Line Applications
21 * Research Corporation (OAR) under contract to the European Space
22 * Agency (ESA).
23 *
24 * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
25 * European Space Agency.
26 */
27
28#ifndef LIBBSP_SPARC_LEON2_BSP_H
29#define LIBBSP_SPARC_LEON2_BSP_H
30
31#include <bspopts.h>
33
34#include <rtems.h>
35#include <leon.h>
36#include <rtems/irq-extension.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
52/* SPARC CPU variant: LEON2 */
53#define LEON2 1
54
55/*
56 * BSP provides its own Idle thread body
57 */
58void *bsp_idle_thread( uintptr_t ignored );
59#define BSP_IDLE_TASK_BODY bsp_idle_thread
60
61/*
62 * Network driver configuration
63 */
64struct rtems_bsdnet_ifconfig;
65extern int rtems_leon_open_eth_driver_attach(
66 struct rtems_bsdnet_ifconfig *config
67);
68extern int rtems_smc91111_driver_attach_leon2(
69 struct rtems_bsdnet_ifconfig *config
70);
71#define RTEMS_BSP_NETWORK_DRIVER_NAME "open_eth1"
72#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
73 rtems_leon_open_eth_driver_attach
74#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
75 rtems_smc91111_driver_attach_leon2
76
77#define HAS_SMC91111
78
79/* Configure GRETH driver */
80#define GRETH_SUPPORTED
81#define GRETH_MEM_LOAD(addr) leon_r32_no_cache((uintptr_t) addr)
82
83/*
84 * The synchronous trap is an arbitrarily chosen software trap.
85 */
86
87extern int CPU_SPARC_HAS_SNOOPING;
88
89/* Constants */
90
91/*
92 * Information placed in the linkcmds file.
93 */
94
95extern int RAM_START;
96extern int RAM_END;
97extern int RAM_SIZE;
98
99extern int PROM_START;
100extern int PROM_END;
101extern int PROM_SIZE;
102
103extern int CLOCK_SPEED;
104
105extern int end; /* last address in the program */
106
107/* miscellaneous stuff assumed to exist */
108
109rtems_isr_entry set_vector( /* returns old vector */
110 rtems_isr_entry handler, /* isr routine */
111 rtems_vector_number vector, /* vector number */
112 int type /* RTEMS or RAW intr */
113);
114
115void BSP_fatal_exit(uint32_t error);
116
117void bsp_spurious_initialize( void );
118
119/* Interrupt Service Routine (ISR) pointer */
120typedef void (*bsp_shared_isr)(void *arg);
121
122/* Initializes the Shared System Interrupt service */
123extern void BSP_shared_interrupt_init(void);
124
125/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
126void bsp_isr_handler(rtems_vector_number vector);
127
128/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
129 * interrupt handlers may use the same IRQ number, all ISRs will be called
130 * when an interrupt on that line is fired.
131 *
132 * Arguments
133 * irq System IRQ number
134 * info Optional Name of IRQ source
135 * isr Function pointer to the ISR
136 * arg Second argument to function isr
137 */
138static __inline__ int BSP_shared_interrupt_register
139 (
140 int irq,
141 const char *info,
142 bsp_shared_isr isr,
143 void *arg
144 )
145{
146 return rtems_interrupt_handler_install(irq, info,
147 RTEMS_INTERRUPT_SHARED, isr, arg);
148}
149
150/* Unregister previously registered shared IRQ handler.
151 *
152 * Arguments
153 * irq System IRQ number
154 * isr Function pointer to the ISR
155 * arg Second argument to function isr
156 */
157static __inline__ int BSP_shared_interrupt_unregister
158 (
159 int irq,
160 bsp_shared_isr isr,
161 void *arg
162 )
163{
164 return rtems_interrupt_handler_remove(irq, isr, arg);
165}
166
167/* Clear interrupt pending on IRQ controller, this is typically done on a
168 * level triggered interrupt source such as PCI to avoid taking double IRQs.
169 * In such a case the interrupt source must be cleared first on LEON, before
170 * acknowledging the IRQ with this function.
171 *
172 * Arguments
173 * irq System IRQ number
174 */
175extern void BSP_shared_interrupt_clear(int irq);
176
177/* Enable Interrupt. This function will unmask the IRQ at the interrupt
178 * controller. This is normally done by _register(). Note that this will
179 * affect all ISRs on this IRQ.
180 *
181 * Arguments
182 * irq System IRQ number
183 */
184extern void BSP_shared_interrupt_unmask(int irq);
185
186/* Disable Interrupt. This function will mask one IRQ at the interrupt
187 * controller. This is normally done by _unregister(). Note that this will
188 * affect all ISRs on this IRQ.
189 *
190 * Arguments
191 * irq System IRQ number
192 */
193extern void BSP_shared_interrupt_mask(int irq);
194
195/*
196 * Delay method
197 */
198void rtems_bsp_delay(int usecs);
199
200/*
201 * Prototypes for BSP methods that are used across file boundaries
202 */
203int cchip1_register(void);
204
205/* AT697 has PCI defined as big endian */
206#define BSP_PCI_BIG_ENDIAN
207
208/* Common driver build-time configurations. On small systems undefine
209 * [DRIVER]_INFO_AVAIL to avoid info routines get dragged in. It is good
210 * for debugging and printing information about the system, but makes the
211 * image bigger.
212 */
213#define AMBAPPBUS_INFO_AVAIL /* AMBAPP Bus driver */
214#define GPTIMER_INFO_AVAIL /* GPTIMER Timer driver */
215#define GRETH_INFO_AVAIL /* GRETH Ethernet driver */
216
217void console_outbyte_polled( int port, unsigned char ch );
218
219int console_inbyte_nonblocking( int port );
220
221#ifdef __cplusplus
222}
223#endif
224
227#endif
DEFAULT_INITIAL_EXTENSION Support.
ISR_Vector_number rtems_vector_number
Control block type used to manage the vectors.
Definition: intr.h:47
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:26
rtems_isr_entry set_vector(rtems_isr_entry handler, rtems_vector_number vector, int type)
Install an interrupt handler.
Definition: setvec.c:28
int console_inbyte_nonblocking(int port)
Definition: console-io.c:84
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler handler, void *arg)
Installs the interrupt handler routine handler for the interrupt vector with number vector.
Definition: irq.c:127
#define RTEMS_INTERRUPT_SHARED
Allows that this interrupt handler may share a common interrupt vector with other handler.
Definition: irq-extension.h:50
rtems_status_code rtems_interrupt_handler_remove(rtems_vector_number vector, rtems_interrupt_handler handler, void *arg)
Removes the interrupt handler routine handler with argument arg for the interrupt vector with number ...
Definition: irq.c:175
Header file for the Interrupt Manager Extension.
LEON3 BSP data types and macros.
Definition: deflate.c:115