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

4.115
Last change on this file since ddf0d60 was ddf0d60, checked in by Daniel Hellstrom <daniel@…>, on 04/17/12 at 14:25:40

LEON3: updated console driver for new AMBAPP layer

Signed-off-by: Daniel Hellstrom <daniel@…>

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