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

4.115
Last change on this file since df217b0b was df217b0b, checked in by Toma Radu <radustoma@…>, on 12/04/13 at 18:07:04

leon3: improve doxygen

Add doxygen to the bsp.h, tm27.h, amba.h and leon.h files

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