source: rtems/bsps/sparc/leon3/include/bsp.h @ 212663be

5
Last change on this file since 212663be was 212663be, checked in by Sebastian Huber <sebastian.huber@…>, on 02/26/19 at 14:44:50

bsps: Adjust architecture Doxygen groups

  • Use CamelCase as it is not used in our C code. Enables simple search and replace.
  • Prefix with "RTEMS" to aid deployment and integration. It aids searching and sorting.

Update #3706.

  • Property mode set to 100644
File size: 6.8 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup sparc_leon3
5 *
6 * @brief Global BSP Definitions.
7 */
8
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>
32#include <bsp/default-initial-extension.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
42/**
43 *  @defgroup sparc_leon3 LEON3 Support
44 *
45 *  @ingroup RTEMSBSPsSPARC
46 *
47 *  @brief LEON3 support package
48 *
49 */
50
51/* SPARC CPU variant: LEON3 */
52#define LEON3 1
53
54/*
55 *  BSP provides its own Idle thread body
56 */
57void *bsp_idle_thread( uintptr_t ignored );
58#define BSP_IDLE_TASK_BODY bsp_idle_thread
59
60/* Maximum supported APBUARTs by BSP */
61#define BSP_NUMBER_OF_TERMIOS_PORTS 8
62
63/* Make sure maximum number of consoles fit in filesystem */
64#define BSP_MAXIMUM_DEVICES 8
65
66/*
67 * Network driver configuration
68 */
69struct rtems_bsdnet_ifconfig;
70extern int rtems_leon_open_eth_driver_attach(
71  struct rtems_bsdnet_ifconfig *config,
72  int attach
73);
74extern int rtems_smc91111_driver_attach_leon3(
75  struct rtems_bsdnet_ifconfig *config,
76  int attach
77);
78extern int rtems_leon_greth_driver_attach(
79  struct rtems_bsdnet_ifconfig *config,
80  int attach
81);
82
83#define RTEMS_BSP_NETWORK_DRIVER_NAME_OPENETH "open_eth1"
84#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH   \
85    rtems_leon_open_eth_driver_attach
86#define RTEMS_BSP_NETWORK_DRIVER_NAME_SMC91111 "smc_eth1"
87#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
88    rtems_smc91111_driver_attach_leon3
89#define RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH "gr_eth1"
90#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH \
91    rtems_leon_greth_driver_attach
92
93#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
94#define RTEMS_BSP_NETWORK_DRIVER_NAME   RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH
95#define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH
96#endif
97
98#define HAS_SMC91111
99
100/* Configure GRETH driver */
101#define GRETH_SUPPORTED
102#define GRETH_MEM_LOAD(addr) leon_r32_no_cache((uintptr_t)addr)
103
104extern int   CPU_SPARC_HAS_SNOOPING;
105
106/* Constants */
107
108/*
109 *  Information placed in the linkcmds file.
110 */
111
112extern int   RAM_START;
113extern int   RAM_END;
114extern int   RAM_SIZE;
115
116extern int   PROM_START;
117extern int   PROM_END;
118extern int   PROM_SIZE;
119
120extern int   CLOCK_SPEED;
121
122extern int   end;        /* last address in the program */
123
124/* miscellaneous stuff assumed to exist */
125
126rtems_isr_entry set_vector(                     /* returns old vector */
127    rtems_isr_entry     handler,                /* isr routine        */
128    rtems_vector_number vector,                 /* vector number      */
129    int                 type                    /* RTEMS or RAW intr  */
130);
131
132void BSP_fatal_exit(uint32_t error);
133
134void bsp_spurious_initialize( void );
135
136/*
137 *  Delay for the specified number of microseconds.
138 */
139void rtems_bsp_delay(int usecs);
140
141/* Interrupt Service Routine (ISR) pointer */
142typedef void (*bsp_shared_isr)(void *arg);
143
144/* Initializes the Shared System Interrupt service */
145extern void BSP_shared_interrupt_init(void);
146
147/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
148void bsp_isr_handler(rtems_vector_number vector);
149
150/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
151 * interrupt handlers may use the same IRQ number, all ISRs will be called
152 * when an interrupt on that line is fired.
153 *
154 * Arguments
155 *  irq       System IRQ number
156 *  info      Optional Name of IRQ source
157 *  isr       Function pointer to the ISR
158 *  arg       Second argument to function isr
159 */
160static __inline__ int BSP_shared_interrupt_register
161       (
162       int irq,
163       const char *info,
164       bsp_shared_isr isr,
165       void *arg
166       )
167{
168       return rtems_interrupt_handler_install(irq, info,
169                                       RTEMS_INTERRUPT_SHARED, isr, arg);
170}
171
172/* Unregister previously registered shared IRQ handler.
173 *
174 * Arguments
175 *  irq       System IRQ number
176 *  isr       Function pointer to the ISR
177 *  arg       Second argument to function isr
178 */
179static __inline__ int BSP_shared_interrupt_unregister
180       (
181       int irq,
182       bsp_shared_isr isr,
183       void *arg
184       )
185{
186       return rtems_interrupt_handler_remove(irq, isr, arg);
187}
188
189/* Clear interrupt pending on IRQ controller, this is typically done on a
190 * level triggered interrupt source such as PCI to avoid taking double IRQs.
191 * In such a case the interrupt source must be cleared first on LEON, before
192 * acknowledging the IRQ with this function.
193 *
194 * Arguments
195 *  irq       System IRQ number
196 */
197extern void BSP_shared_interrupt_clear(int irq);
198
199/* Enable Interrupt. This function will unmask the IRQ at the interrupt
200 * controller. This is normally done by _register(). Note that this will
201 * affect all ISRs on this IRQ.
202 *
203 * Arguments
204 *  irq       System IRQ number
205 */
206extern void BSP_shared_interrupt_unmask(int irq);
207
208/* Disable Interrupt. This function will mask one IRQ at the interrupt
209 * controller. This is normally done by _unregister().  Note that this will
210 * affect all ISRs on this IRQ.
211 *
212 * Arguments
213 *  irq         System IRQ number
214 */
215extern void BSP_shared_interrupt_mask(int irq);
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#ifdef RTEMS_SMP
226/* Weak table used to implement static interrupt CPU affinity in a SMP
227 * configuration. The array index is the interrupt to be looked up, and
228 * the array[INTERRUPT] content is the CPU number relative to boot CPU
229 * index that will be servicing the interrupts from the IRQ source. The
230 * default is to let the first CPU (the boot cpu) to handle all
231 * interrupts (all zeros).
232 */
233extern const unsigned char LEON3_irq_to_cpu[32];
234#endif
235
236/* Common driver build-time configurations. On small systems undefine
237 * [DRIVER]_INFO_AVAIL to avoid info routines get dragged in. It is good
238 * for debugging and printing information about the system, but makes the
239 * image bigger.
240 */
241#define AMBAPPBUS_INFO_AVAIL          /* AMBAPP Bus driver */
242#define APBUART_INFO_AVAIL            /* APBUART Console driver */
243#define GPTIMER_INFO_AVAIL            /* GPTIMER Timer driver */
244#define GRETH_INFO_AVAIL              /* GRETH Ethernet driver */
245
246#ifdef __cplusplus
247}
248#endif
249
250#endif
Note: See TracBrowser for help on using the repository browser.