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_LEON3_BSP_H
29#define LIBBSP_SPARC_LEON3_BSP_H
30
31#include <bspopts.h>
33
34#include <rtems.h>
35#include <rtems/irq-extension.h>
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
51/* SPARC CPU variant: LEON3 */
52#define LEON3 1
53
54#define BSP_FEATURE_IRQ_EXTENSION
55
56/*
57 * BSP provides its own Idle thread body
58 */
59void *bsp_idle_thread( uintptr_t ignored );
60#define BSP_IDLE_TASK_BODY bsp_idle_thread
61
62/* Maximum supported APBUARTs by BSP */
63#define BSP_NUMBER_OF_TERMIOS_PORTS 8
64
65/*
66 * Network driver configuration
67 */
68struct rtems_bsdnet_ifconfig;
69extern int rtems_leon_open_eth_driver_attach(
70 struct rtems_bsdnet_ifconfig *config,
71 int attach
72);
73extern int rtems_smc91111_driver_attach_leon3(
74 struct rtems_bsdnet_ifconfig *config,
75 int attach
76);
77extern int rtems_leon_greth_driver_attach(
78 struct rtems_bsdnet_ifconfig *config,
79 int attach
80);
81
82#define RTEMS_BSP_NETWORK_DRIVER_NAME_OPENETH "open_eth1"
83#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
84 rtems_leon_open_eth_driver_attach
85#define RTEMS_BSP_NETWORK_DRIVER_NAME_SMC91111 "smc_eth1"
86#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
87 rtems_smc91111_driver_attach_leon3
88#define RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH "gr_eth1"
89#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH \
90 rtems_leon_greth_driver_attach
91
92#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
93#define RTEMS_BSP_NETWORK_DRIVER_NAME RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH
94#define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH
95#endif
96
97#define HAS_SMC91111
98
99/* Configure GRETH driver */
100#define GRETH_SUPPORTED
101#define GRETH_MEM_LOAD(addr) leon_r32_no_cache((uintptr_t)addr)
102
103extern int CPU_SPARC_HAS_SNOOPING;
104
105/* Constants */
106
107/*
108 * Information placed in the linkcmds file.
109 */
110
111extern int RAM_START;
112extern int RAM_END;
113extern int RAM_SIZE;
114
115extern int PROM_START;
116extern int PROM_END;
117extern int PROM_SIZE;
118
119extern int CLOCK_SPEED;
120
121extern int end; /* last address in the program */
122
123/* miscellaneous stuff assumed to exist */
124
125rtems_isr_entry set_vector( /* returns old vector */
126 rtems_isr_entry handler, /* isr routine */
127 rtems_vector_number vector, /* vector number */
128 int type /* RTEMS or RAW intr */
129);
130
131void BSP_fatal_exit(uint32_t error);
132
133/*
134 * Delay for the specified number of microseconds.
135 */
136void rtems_bsp_delay(int usecs);
137
138/* Interrupt Service Routine (ISR) pointer */
139typedef void (*bsp_shared_isr)(void *arg);
140
141/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
142 * interrupt handlers may use the same IRQ number, all ISRs will be called
143 * when an interrupt on that line is fired.
144 *
145 * Arguments
146 * irq System IRQ number
147 * info Optional Name of IRQ source
148 * isr Function pointer to the ISR
149 * arg Second argument to function isr
150 */
151RTEMS_DEPRECATED static inline int BSP_shared_interrupt_register
152 (
153 int irq,
154 const char *info,
155 bsp_shared_isr isr,
156 void *arg
157 )
158{
159 return rtems_interrupt_handler_install(irq, info,
160 RTEMS_INTERRUPT_SHARED, isr, arg);
161}
162
163/* Unregister previously registered shared IRQ handler.
164 *
165 * Arguments
166 * irq System IRQ number
167 * isr Function pointer to the ISR
168 * arg Second argument to function isr
169 */
170RTEMS_DEPRECATED static inline int BSP_shared_interrupt_unregister
171 (
172 int irq,
173 bsp_shared_isr isr,
174 void *arg
175 )
176{
177 return rtems_interrupt_handler_remove(irq, isr, arg);
178}
179
180/* Clear interrupt pending on IRQ controller, this is typically done on a
181 * level triggered interrupt source such as PCI to avoid taking double IRQs.
182 * In such a case the interrupt source must be cleared first on LEON, before
183 * acknowledging the IRQ with this function.
184 *
185 * Arguments
186 * irq System IRQ number
187 */
188RTEMS_DEPRECATED static inline void BSP_shared_interrupt_clear( int irq )
189{
191}
192
193/* Enable Interrupt. This function will unmask the IRQ at the interrupt
194 * controller. This is normally done by _register(). Note that this will
195 * affect all ISRs on this IRQ.
196 *
197 * Arguments
198 * irq System IRQ number
199 */
200RTEMS_DEPRECATED static inline void BSP_shared_interrupt_unmask( int irq )
201{
203}
204
205/* Disable Interrupt. This function will mask one IRQ at the interrupt
206 * controller. This is normally done by _unregister(). Note that this will
207 * affect all ISRs on this IRQ.
208 *
209 * Arguments
210 * irq System IRQ number
211 */
212RTEMS_DEPRECATED static inline void BSP_shared_interrupt_mask( int irq )
213{
215}
216
217#if defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING)
218/* Irq used by the shared memory driver and for inter-processor interrupts.
219 * The variable is weakly linked. Redefine the variable in your application
220 * to override the BSP default.
221 */
222extern const unsigned char LEON3_mp_irq;
223#endif
224
225/* Common driver build-time configurations. On small systems undefine
226 * [DRIVER]_INFO_AVAIL to avoid info routines get dragged in. It is good
227 * for debugging and printing information about the system, but makes the
228 * image bigger.
229 */
230#define AMBAPPBUS_INFO_AVAIL /* AMBAPP Bus driver */
231#define APBUART_INFO_AVAIL /* APBUART Console driver */
232#define GPTIMER_INFO_AVAIL /* GPTIMER Timer driver */
233#define GRETH_INFO_AVAIL /* GRETH Ethernet driver */
234
235#ifdef __cplusplus
236}
237#endif
238
241#endif
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
This header file is provided for backward compatiblility.
This header file defines the RTEMS Classic API.
Definition: deflate.c:114