RTEMS 7.0-rc1
Loading...
Searching...
No Matches
bsp.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
11/* bsp.h
12 *
13 * This include file contains all SPARC simulator definitions.
14 *
15 * COPYRIGHT (c) 1989-1998.
16 * On-Line Applications Research Corporation (OAR).
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 *
22 * Ported to ERC32 implementation of the SPARC by On-Line Applications
23 * Research Corporation (OAR) under contract to the European Space
24 * Agency (ESA).
25 *
26 * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
27 * European Space Agency.
28 */
29
30#ifndef LIBBSP_SPARC_LEON2_BSP_H
31#define LIBBSP_SPARC_LEON2_BSP_H
32
33#include <bspopts.h>
35
36#include <rtems.h>
37#include <leon.h>
38#include <rtems/irq-extension.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
54/* SPARC CPU variant: LEON2 */
55#define LEON2 1
56
57#define BSP_FEATURE_IRQ_EXTENSION
58
59/*
60 * BSP provides its own Idle thread body
61 */
62void *bsp_idle_thread( uintptr_t ignored );
63#define BSP_IDLE_TASK_BODY bsp_idle_thread
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);
72extern int rtems_smc91111_driver_attach_leon2(
73 struct rtems_bsdnet_ifconfig *config
74);
75#define RTEMS_BSP_NETWORK_DRIVER_NAME "open_eth1"
76#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
77 rtems_leon_open_eth_driver_attach
78#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
79 rtems_smc91111_driver_attach_leon2
80
81#define HAS_SMC91111
82
83/* Configure GRETH driver */
84#define GRETH_SUPPORTED
85#define GRETH_MEM_LOAD(addr) leon_r32_no_cache((uintptr_t) addr)
86
87/*
88 * The synchronous trap is an arbitrarily chosen software trap.
89 */
90
91extern int CPU_SPARC_HAS_SNOOPING;
92
93/* Constants */
94
95/*
96 * Information placed in the linkcmds file.
97 */
98
99extern int RAM_START;
100extern int RAM_END;
101extern int RAM_SIZE;
102
103extern int PROM_START;
104extern int PROM_END;
105extern int PROM_SIZE;
106
107extern int CLOCK_SPEED;
108
109extern int end; /* last address in the program */
110
111void SPARC_Clear_and_unmask_interrupt(rtems_vector_number vector);
112
113void BSP_fatal_exit(uint32_t error);
114
115/* Interrupt Service Routine (ISR) pointer */
116typedef void (*bsp_shared_isr)(void *arg);
117
118/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
119 * interrupt handlers may use the same IRQ number, all ISRs will be called
120 * when an interrupt on that line is fired.
121 *
122 * Arguments
123 * irq System IRQ number
124 * info Optional Name of IRQ source
125 * isr Function pointer to the ISR
126 * arg Second argument to function isr
127 */
128RTEMS_DEPRECATED static inline int BSP_shared_interrupt_register
129 (
130 int irq,
131 const char *info,
132 bsp_shared_isr isr,
133 void *arg
134 )
135{
136 return rtems_interrupt_handler_install(irq, info,
137 RTEMS_INTERRUPT_SHARED, isr, arg);
138}
139
140/* Unregister previously registered shared IRQ handler.
141 *
142 * Arguments
143 * irq System IRQ number
144 * isr Function pointer to the ISR
145 * arg Second argument to function isr
146 */
147RTEMS_DEPRECATED static inline int BSP_shared_interrupt_unregister
148 (
149 int irq,
150 bsp_shared_isr isr,
151 void *arg
152 )
153{
154 return rtems_interrupt_handler_remove(irq, isr, arg);
155}
156
157/* Clear interrupt pending on IRQ controller, this is typically done on a
158 * level triggered interrupt source such as PCI to avoid taking double IRQs.
159 * In such a case the interrupt source must be cleared first on LEON, before
160 * acknowledging the IRQ with this function.
161 *
162 * Arguments
163 * irq System IRQ number
164 */
165RTEMS_DEPRECATED static inline void BSP_shared_interrupt_clear( int irq )
166{
168}
169
170/* Enable Interrupt. This function will unmask the IRQ at the interrupt
171 * controller. This is normally done by _register(). Note that this will
172 * affect all ISRs on this IRQ.
173 *
174 * Arguments
175 * irq System IRQ number
176 */
177RTEMS_DEPRECATED static inline void BSP_shared_interrupt_unmask( int irq )
178{
180}
181
182/* Disable Interrupt. This function will mask one IRQ at the interrupt
183 * controller. This is normally done by _unregister(). Note that this will
184 * affect all ISRs on this IRQ.
185 *
186 * Arguments
187 * irq System IRQ number
188 */
189RTEMS_DEPRECATED static inline void BSP_shared_interrupt_mask( int irq )
190{
192}
193
194/*
195 * Delay method
196 */
197void rtems_bsp_delay(int usecs);
198
199/*
200 * Prototypes for BSP methods that are used across file boundaries
201 */
202int cchip1_register(void);
203
204/* AT697 has PCI defined as big endian */
205#define BSP_PCI_BIG_ENDIAN
206
207/* Common driver build-time configurations. On small systems undefine
208 * [DRIVER]_INFO_AVAIL to avoid info routines get dragged in. It is good
209 * for debugging and printing information about the system, but makes the
210 * image bigger.
211 */
212#define AMBAPPBUS_INFO_AVAIL /* AMBAPP Bus driver */
213#define GPTIMER_INFO_AVAIL /* GPTIMER Timer driver */
214#define GRETH_INFO_AVAIL /* GRETH Ethernet driver */
215
216void console_outbyte_polled( int port, unsigned char ch );
217
218int console_inbyte_nonblocking( int port );
219
220#ifdef __cplusplus
221}
222#endif
223
226#endif
void console_outbyte_polled(int port, char ch)
Definition: console-io.c:57
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
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:78
This header file is provided for backward compatiblility.
LEON3 BSP data types and macros.
This header file defines the RTEMS Classic API.