source: rtems/c/src/lib/libbsp/sparc/leon3/include/bsp.h @ cfeb191

4.11
Last change on this file since cfeb191 was cfeb191, checked in by Toma Radu <radustoma@…>, on Dec 6, 2013 at 8:52:26 AM

sparc shared: improve doxygen

Add doxygen to the header files in sparc/shared/include directory.

  • Property mode set to 100644
File size: 5.5 KB
Line 
1/**
2 * @file
3 * @ingroup sparc_bsp
4 * @defgroup sparc_leon3 SPARC LEON3
5 * @ingroup sparc_leon3
6 * @brief SPARC LEON3 BSP
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.com/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 _BSP_H
29#define _BSP_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <bspopts.h>
36#include <bsp/default-initial-extension.h>
37
38#include <rtems.h>
39#include <leon.h>
40#include <rtems/clockdrv.h>
41#include <rtems/console.h>
42#include <rtems/irq-extension.h>
43
44/* SPARC CPU variant: LEON3 */
45#define LEON3 1
46
47/*
48 *  BSP provides its own Idle thread body
49 */
50void *bsp_idle_thread( uintptr_t ignored );
51#define BSP_IDLE_TASK_BODY bsp_idle_thread
52
53/* Maximum supported APBUARTs by BSP */
54#define BSP_NUMBER_OF_TERMIOS_PORTS 8
55
56/*
57 * Network driver configuration
58 */
59struct rtems_bsdnet_ifconfig;
60extern int rtems_leon_open_eth_driver_attach(
61  struct rtems_bsdnet_ifconfig *config,
62  int attach
63);
64extern int rtems_smc91111_driver_attach_leon3(
65  struct rtems_bsdnet_ifconfig *config,
66  int attach
67);
68extern int rtems_leon_greth_driver_attach(
69  struct rtems_bsdnet_ifconfig *config,
70  int attach
71);
72
73#define RTEMS_BSP_NETWORK_DRIVER_NAME_OPENETH   "open_eth1"
74#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH  rtems_leon_open_eth_driver_attach
75#define RTEMS_BSP_NETWORK_DRIVER_NAME_SMC91111  "smc_eth1"
76#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 rtems_smc91111_driver_attach_leon3
77#define RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH      "gr_eth1"
78#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH    rtems_leon_greth_driver_attach
79
80#ifndef RTEMS_BSP_NETWORK_DRIVER_NAME
81#define RTEMS_BSP_NETWORK_DRIVER_NAME   RTEMS_BSP_NETWORK_DRIVER_NAME_GRETH
82#define RTEMS_BSP_NETWORK_DRIVER_ATTACH RTEMS_BSP_NETWORK_DRIVER_ATTACH_GRETH
83#endif
84
85#define HAS_SMC91111
86
87/* Configure GRETH driver */
88#define GRETH_SUPPORTED
89#define GRETH_MEM_LOAD(addr) leon_r32_no_cache(addr)
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
111/* miscellaneous stuff assumed to exist */
112
113rtems_isr_entry set_vector(                     /* returns old vector */
114    rtems_isr_entry     handler,                /* isr routine        */
115    rtems_vector_number vector,                 /* vector number      */
116    int                 type                    /* RTEMS or RAW intr  */
117);
118
119void BSP_fatal_return( void );
120
121void bsp_spurious_initialize( void );
122
123/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function
124 * can be called at any time. The work-area will shrink when called before
125 * bsp_work_area_initialize(). malloc() is called to get memory when this function
126 * is called after bsp_work_area_initialize().
127 */
128void *bsp_early_malloc(int size);
129
130/* Interrupt Service Routine (ISR) pointer */
131typedef void (*bsp_shared_isr)(void *arg);
132
133/* Initializes the Shared System Interrupt service */
134extern void BSP_shared_interrupt_init(void);
135
136/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
137 * interrupt handlers may use the same IRQ number, all ISRs will be called
138 * when an interrupt on that line is fired.
139 *
140 * Arguments
141 *  irq       System IRQ number
142 *  info      Optional Name of IRQ source
143 *  isr       Function pointer to the ISR
144 *  arg       Second argument to function isr
145 */
146static __inline__ int BSP_shared_interrupt_register
147       (
148       int irq,
149       const char *info,
150       bsp_shared_isr isr,
151       void *arg
152       )
153{
154       return rtems_interrupt_handler_install(irq, info,
155                                       RTEMS_INTERRUPT_SHARED, isr, arg);
156}
157
158/* Unregister previously registered shared IRQ handler.
159 *
160 * Arguments
161 *  irq       System IRQ number
162 *  isr       Function pointer to the ISR
163 *  arg       Second argument to function isr
164 */
165static __inline__ int BSP_shared_interrupt_unregister
166       (
167       int irq,
168       bsp_shared_isr isr,
169       void *arg
170       )
171{
172       return rtems_interrupt_handler_remove(irq, isr, arg);
173}
174
175/* Clear interrupt pending on IRQ controller, this is typically done on a
176 * level triggered interrupt source such as PCI to avoid taking double IRQs.
177 * In such a case the interrupt source must be cleared first on LEON, before
178 * acknowledging the IRQ with this function.
179 *
180 * Arguments
181 *  irq       System IRQ number
182 */
183extern void BSP_shared_interrupt_clear(int irq);
184
185/* Enable Interrupt. This function will unmask the IRQ at the interrupt
186 * controller. This is normally done by _register(). Note that this will
187 * affect all ISRs on this IRQ.
188 *
189 * Arguments
190 *  irq       System IRQ number
191 */
192extern void BSP_shared_interrupt_unmask(int irq);
193
194/* Disable Interrupt. This function will mask one IRQ at the interrupt
195 * controller. This is normally done by _unregister().  Note that this will
196 * affect all ISRs on this IRQ.
197 *
198 * Arguments
199 *  irq         System IRQ number
200 */
201extern void BSP_shared_interrupt_mask(int irq);
202
203#ifdef __cplusplus
204}
205#endif
206
207#endif
208
209
Note: See TracBrowser for help on using the repository browser.