OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [powerpc/] [dmv177/] [include/] [bsp.h] - Blame information for rev 389

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  bsp.h
2
 *
3
 *  This include file contains all DY-4 DMV170 board IO definitions.
4
 *
5
 *  COPYRIGHT (c) 1989-1997.
6
 *  On-Line Applications Research Corporation (OAR).
7
 *  All rights assigned to U.S. Government, 1994.
8
 *
9
 *  This material may be reproduced by or for the U.S. Government pursuant
10
 *  to the copyright license under the clause at DFARS 252.227-7013.  This
11
 *  notice must appear in all copies of this file and its derivatives.
12
 *
13
 *  $Id: bsp.h,v 1.2 2001-09-27 12:00:33 chris Exp $
14
 */
15
 
16
#ifndef __DMV170_BSP_h
17
#define __DMV170_BSP_h
18
 
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
 
23
/*
24
 *  confdefs.h overrides for this BSP:
25
 *   - termios serial ports (defaults to 1)
26
 *   - Interrupt stack space is not minimum if defined.
27
 */
28
 
29
#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 4
30
#define CONFIGURE_INTERRUPT_STACK_MEMORY  (12 * 1024)
31
 
32
#ifdef ASM
33
/* Definition of where to store registers in alignment handler */
34
#define ALIGN_REGS 0x0140
35
 
36
#else
37
#include <rtems.h>
38
#include <console.h>
39
#include <clockdrv.h>
40
#include <console.h>
41
#include <iosupp.h>
42
 
43
#include <dmv170.h>
44
 
45
#if 0
46
#define Enable_Debug() \
47
  DMV170_WRITE( 0xffffbd0c, 0 )
48
 
49
#define Debug_Entry( num ) \
50
  DMV170_WRITE( 0xffffbd06, num )
51
#else
52
#define Enable_Debug()
53
#define Debug_Entry( num )
54
#endif
55
 
56
/*
57
 * Network driver configuration
58
 */
59
struct rtems_bsdnet_ifconfig;
60
int rtems_dmv177_sonic_driver_attach(struct rtems_bsdnet_ifconfig *config);
61
#define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
62
#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_dmv177_sonic_driver_attach
63
 
64
 
65
/*
66
 * The following macro calculates the Baud constant. For the Z8530 chip.
67
 */
68
#define Z8530_Baud( _frequency, _clock_by, _baud_rate  )   \
69
  ( (_frequency /( _clock_by * 2 * _baud_rate))  - 2)
70
 
71
 
72
/*
73
 *  Define the time limits for RTEMS Test Suite test durations.
74
 *  Long test and short test duration limits are provided.  These
75
 *  values are in seconds and need to be converted to ticks for the
76
 *  application.
77
 *
78
 */
79
 
80
#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
81
#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
82
 
83
 
84
/*
85
 *  Stuff for Time Test 27
86
 */
87
 
88
#define MUST_WAIT_FOR_INTERRUPT 1
89
 
90
#define Install_tm27_vector( _handler ) \
91
  set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
92
 
93
#define Cause_tm27_intr()  \
94
  do { \
95
    unsigned32 _clicks = 1; \
96
    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
97
  } while (0)
98
 
99
#define Clear_tm27_intr() \
100
  do { \
101
    unsigned32 _clicks = 0xffffffff; \
102
    unsigned32 _msr = 0; \
103
    _ISR_Set_level( 0 ); \
104
    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
105
    _msr &=  ~0x8000; \
106
    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
107
    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
108
  } while (0)
109
 
110
#define Lower_tm27_intr() \
111
  do { \
112
    unsigned32 _msr = 0; \
113
    _ISR_Set_level( 0 ); \
114
    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
115
    _msr |=  0x8002; \
116
    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
117
  } while (0)
118
 
119
/* Constants */
120
 
121
/*
122
 *  Device Driver Table Entries
123
 */
124
 
125
/*
126
 * NOTE: Use the standard Console driver entry
127
 */
128
 
129
/*
130
 * NOTE: Use the standard Clock driver entry
131
 */
132
 
133
 
134
/*
135
 *  Information placed in the linkcmds file.
136
 */
137
 
138
extern int   RAM_START;
139
extern int   RAM_END;
140
extern int   RAM_SIZE;
141
 
142
extern int   PROM_START;
143
extern int   PROM_END;
144
extern int   PROM_SIZE;
145
 
146
extern int   CLOCK_SPEED;
147
 
148
extern int   end;        /* last address in the program */
149
 
150
/*
151
 * How many libio files we want
152
 */
153
 
154
#define BSP_LIBIO_MAX_FDS       20
155
 
156
/* functions */
157
 
158
/*
159
 * genvec.c
160
 */
161
rtems_isr_entry  set_EE_vector(
162
  rtems_isr_entry     handler,                  /* isr routine        */
163
  rtems_vector_number vector                    /* vector number      */
164
);
165
void initialize_external_exception_vector ();
166
 
167
/*
168
 * console.c
169
 */
170
void DEBUG_puts( char *string );
171
 
172
void BSP_fatal_return( void );
173
 
174
 
175
 
176
void bsp_start( void );
177
 
178
void bsp_cleanup( void );
179
 
180
rtems_isr_entry set_vector(                    /* returns old vector */
181
  rtems_isr_entry     handler,                  /* isr routine        */
182
  rtems_vector_number vector,                   /* vector number      */
183
  int                 type                      /* RTEMS or RAW intr  */
184
);
185
 
186
void BSP_fatal_return( void );
187
 
188
void bsp_spurious_initialize( void );
189
 
190
extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
191
 
192
extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
193
 
194
extern rtems_unsigned32          bsp_isr_level;
195
 
196
extern int   CPU_PPC_CLICKS_PER_MS;
197
 
198
#endif /* ASM */
199
 
200
#ifdef __cplusplus
201
}
202
#endif
203
 
204
#endif
205
/* end of include file */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.