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

4.11
Last change on this file since d230d8e was d230d8e, checked in by Radu Toma <radustoma@…>, on Nov 30, 2013 at 8:51:35 PM

sparc/leon3: Add doxygen.

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