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