RTEMS 6.1-rc7
Loading...
Searching...
No Matches
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#define BSP_FEATURE_IRQ_EXTENSION
56
57/*
58 * BSP provides its own Idle thread body
59 */
60void *bsp_idle_thread( uintptr_t ignored );
61#define BSP_IDLE_TASK_BODY bsp_idle_thread
62
63/*
64 * Network driver configuration
65 */
66struct rtems_bsdnet_ifconfig;
67extern int rtems_leon_open_eth_driver_attach(
68 struct rtems_bsdnet_ifconfig *config
69);
70extern int rtems_smc91111_driver_attach_leon2(
71 struct rtems_bsdnet_ifconfig *config
72);
73#define RTEMS_BSP_NETWORK_DRIVER_NAME "open_eth1"
74#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
75 rtems_leon_open_eth_driver_attach
76#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
77 rtems_smc91111_driver_attach_leon2
78
79#define HAS_SMC91111
80
81/* Configure GRETH driver */
82#define GRETH_SUPPORTED
83#define GRETH_MEM_LOAD(addr) leon_r32_no_cache((uintptr_t) addr)
84
85/*
86 * The synchronous trap is an arbitrarily chosen software trap.
87 */
88
89extern int CPU_SPARC_HAS_SNOOPING;
90
91/* Constants */
92
93/*
94 * Information placed in the linkcmds file.
95 */
96
97extern int RAM_START;
98extern int RAM_END;
99extern int RAM_SIZE;
100
101extern int PROM_START;
102extern int PROM_END;
103extern int PROM_SIZE;
104
105extern int CLOCK_SPEED;
106
107extern int end; /* last address in the program */
108
109/* miscellaneous stuff assumed to exist */
110
111rtems_isr_entry set_vector( /* returns old vector */
112 rtems_isr_entry handler, /* isr routine */
113 rtems_vector_number vector, /* vector number */
114 int type /* RTEMS or RAW intr */
115);
116
117void BSP_fatal_exit(uint32_t error);
118
119/* Interrupt Service Routine (ISR) pointer */
120typedef void (*bsp_shared_isr)(void *arg);
121
122/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
123 * interrupt handlers may use the same IRQ number, all ISRs will be called
124 * when an interrupt on that line is fired.
125 *
126 * Arguments
127 * irq System IRQ number
128 * info Optional Name of IRQ source
129 * isr Function pointer to the ISR
130 * arg Second argument to function isr
131 */
132RTEMS_DEPRECATED static inline int BSP_shared_interrupt_register
133 (
134 int irq,
135 const char *info,
136 bsp_shared_isr isr,
137 void *arg
138 )
139{
140 return rtems_interrupt_handler_install(irq, info,
141 RTEMS_INTERRUPT_SHARED, isr, arg);
142}
143
144/* Unregister previously registered shared IRQ handler.
145 *
146 * Arguments
147 * irq System IRQ number
148 * isr Function pointer to the ISR
149 * arg Second argument to function isr
150 */
151RTEMS_DEPRECATED static inline int BSP_shared_interrupt_unregister
152 (
153 int irq,
154 bsp_shared_isr isr,
155 void *arg
156 )
157{
158 return rtems_interrupt_handler_remove(irq, isr, arg);
159}
160
161/* Clear interrupt pending on IRQ controller, this is typically done on a
162 * level triggered interrupt source such as PCI to avoid taking double IRQs.
163 * In such a case the interrupt source must be cleared first on LEON, before
164 * acknowledging the IRQ with this function.
165 *
166 * Arguments
167 * irq System IRQ number
168 */
169RTEMS_DEPRECATED static inline void BSP_shared_interrupt_clear( int irq )
170{
172}
173
174/* Enable Interrupt. This function will unmask the IRQ at the interrupt
175 * controller. This is normally done by _register(). Note that this will
176 * affect all ISRs on this IRQ.
177 *
178 * Arguments
179 * irq System IRQ number
180 */
181RTEMS_DEPRECATED static inline void BSP_shared_interrupt_unmask( int irq )
182{
184}
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 */
193RTEMS_DEPRECATED static inline void BSP_shared_interrupt_mask( int irq )
194{
196}
197
198/*
199 * Delay method
200 */
201void rtems_bsp_delay(int usecs);
202
203/*
204 * Prototypes for BSP methods that are used across file boundaries
205 */
206int cchip1_register(void);
207
208/* AT697 has PCI defined as big endian */
209#define BSP_PCI_BIG_ENDIAN
210
211/* Common driver build-time configurations. On small systems undefine
212 * [DRIVER]_INFO_AVAIL to avoid info routines get dragged in. It is good
213 * for debugging and printing information about the system, but makes the
214 * image bigger.
215 */
216#define AMBAPPBUS_INFO_AVAIL /* AMBAPP Bus driver */
217#define GPTIMER_INFO_AVAIL /* GPTIMER Timer driver */
218#define GRETH_INFO_AVAIL /* GRETH Ethernet driver */
219
220void console_outbyte_polled( int port, unsigned char ch );
221
222int console_inbyte_nonblocking( int port );
223
224#ifdef __cplusplus
225}
226#endif
227
230#endif
void console_outbyte_polled(int port, char ch)
Definition: console-io.c:59
This header file provides the default definition of BSP_INITIAL_EXTENSION.
#define RTEMS_DEPRECATED
Instructs the compiler in a declaration to issue a warning whenever a variable, function,...
Definition: basedefs.h:334
ISR_Handler_entry rtems_isr_entry
Interrupt service routines installed by rtems_interrupt_catch() shall have this type.
Definition: intr.h:134
rtems_status_code rtems_interrupt_vector_disable(rtems_vector_number vector)
Disables the interrupt vector.
Definition: irq-enable-disable.c:94
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler routine, void *arg)
Installs the interrupt handler routine and argument at the interrupt vector.
Definition: irq-handler-install.c:85
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition: intr.h:102
#define RTEMS_INTERRUPT_SHARED
This interrupt handler install option allows that the interrupt handler may share the interrupt vecto...
Definition: intr.h:960
rtems_status_code rtems_interrupt_handler_remove(rtems_vector_number vector, rtems_interrupt_handler routine, void *arg)
Removes the interrupt handler routine and argument from the interrupt vector.
Definition: irq-handler-remove.c:62
rtems_status_code rtems_interrupt_vector_enable(rtems_vector_number vector)
Enables the interrupt vector.
Definition: irq-enable-disable.c:85
rtems_status_code rtems_interrupt_clear(rtems_vector_number vector)
Clears the interrupt vector.
Definition: irq-raise-clear.c:92
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:39
int console_inbyte_nonblocking(int port)
Definition: console-io.c:88
This header file is provided for backward compatiblility.
LEON3 BSP data types and macros.
This header file defines the RTEMS Classic API.
Definition: deflate.c:114