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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [powerpc/] [dmv177/] [scv64/] [scv64.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  scv64.c
2
 *
3
 *  This set of routines control the scv64 chip on the DMV177 board.
4
 *
5
 *
6
 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *  All rights assigned to U.S. Government, 1994.
9
 *
10
 *  $Id: scv64.c,v 1.2 2001-09-27 12:00:33 chris Exp $
11
 */
12
 
13
#include <rtems.h>
14
#include <bsp.h>
15
 
16
typedef struct {
17
  /* DARF Registers */
18
  volatile rtems_unsigned32  DMALAR;             /* 0x00 */
19
  volatile rtems_unsigned32  DMAVAR;             /* 0x04 */
20
  volatile rtems_unsigned32  DMATC;              /* 0x08 */
21
  volatile rtems_unsigned32  DCSR;               /* 0x0c */
22
  volatile rtems_unsigned32  VMEBAR;             /* 0x10 */
23
  volatile rtems_unsigned32  RXDATA;             /* 0x14 */
24
  volatile rtems_unsigned32  RXADDR;             /* 0x18 */
25
  volatile rtems_unsigned32  RXCTL;              /* 0x1c */
26
  volatile rtems_unsigned32  BUSSEL;             /* 0x20 */
27
  volatile rtems_unsigned32  IVECT;              /* 0x24 */
28
  volatile rtems_unsigned32  APBR;               /* 0x28 */
29
  volatile rtems_unsigned32  TXDATA;             /* 0x2c */
30
  volatile rtems_unsigned32  TXADDR;             /* 0x30 */
31
  volatile rtems_unsigned32  TXCTL;              /* 0x34 */
32
  volatile rtems_unsigned32  LMFIFO;             /* 0x38 */
33
  volatile rtems_unsigned32  MODE;               /* 0x3c */
34
  volatile rtems_unsigned32  SA64BAR;            /* 0x40 */
35
  volatile rtems_unsigned32  MA64BAR;            /* 0x44 */
36
  volatile rtems_unsigned32  LAG;                /* 0x48 */
37
  volatile rtems_unsigned32  DMAVTC;             /* 0x4c */
38
 
39
  /* Reserved */
40
  volatile rtems_unsigned32  reserved_50_7F[12];
41
 
42
  /* ACC Registers */
43
  volatile rtems_unsigned8   STAT0_pad[3];       /* 0x80 */
44
  volatile rtems_unsigned8   STAT0;
45
  volatile rtems_unsigned8   STAT1_pad[3];       /* 0x84 */
46
  volatile rtems_unsigned8   STAT1;
47
  volatile rtems_unsigned8   GENCTL_pad[3];      /* 0x88 */
48
  volatile rtems_unsigned8   GENCTL;
49
  volatile rtems_unsigned8   VINT_pad[3];        /* 0x8c */
50
  volatile rtems_unsigned8   VINT;
51
  volatile rtems_unsigned8   VREQ_pad[3];        /* 0x90 */
52
  volatile rtems_unsigned8   VREQ;
53
  volatile rtems_unsigned8   VARB_pad[3];        /* 0x94 */
54
  volatile rtems_unsigned8   VARB;
55
  volatile rtems_unsigned8   ID_pad[3];          /* 0x98 */
56
  volatile rtems_unsigned8   ID;
57
  volatile rtems_unsigned8   NA_pad[3];          /* 0x9c */
58
  volatile rtems_unsigned8   NA;
59
  volatile rtems_unsigned8   _7IS_pad[3];        /* 0xa0 */
60
  volatile rtems_unsigned8   _7IS;
61
  volatile rtems_unsigned8   LIS_pad[3];         /* 0xa4 */
62
  volatile rtems_unsigned8   LIS;
63
  volatile rtems_unsigned8   UIE_pad[3];         /* 0xa8 */
64
  volatile rtems_unsigned8   UIE;
65
  volatile rtems_unsigned8   LIE_pad[3];         /* 0xac */
66
  volatile rtems_unsigned8   LIE;
67
  volatile rtems_unsigned8   VIE_pad[3];         /* 0xb0 */
68
  volatile rtems_unsigned8   VIE;
69
  volatile rtems_unsigned8   IC10_pad[3];        /* 0xb4 */
70
  volatile rtems_unsigned8   IC10;
71
  volatile rtems_unsigned8   IC32_pad[3];        /* 0xb8 */
72
  volatile rtems_unsigned8   IC32;
73
  volatile rtems_unsigned8   IC54_pad[3];        /* 0xbc */
74
  volatile rtems_unsigned8   IC54;
75
  /* Utility Registers */
76
  volatile rtems_unsigned32  MISC;
77
  volatile rtems_unsigned32  delay_line[3];
78
  volatile rtems_unsigned32  MBOX0;
79
  volatile rtems_unsigned32  MBOX1;
80
  volatile rtems_unsigned32  MBOX2;
81
  volatile rtems_unsigned32  MBOX3;
82
} SCV64_Registers;
83
 
84
/*
85
 * LIE Register
86
 */
87
#define LOCAL_INTERRUPT_ENABLE_0  0x01
88
#define LOCAL_INTERRUPT_ENABLE_1  0x02
89
#define LOCAL_INTERRUPT_ENABLE_2  0x04
90
#define LOCAL_INTERRUPT_ENABLE_3  0x08
91
#define LOCAL_INTERRUPT_ENABLE_4  0x10
92
#define LOCAL_INTERRUPT_ENABLE_5  0x20
93
 
94
/*
95
 * IC54 Register
96
 */
97
#define AUTOVECTOR_5  0x80
98
 
99
 
100
/*
101
 * Set the registers pointer to the base address of the SCV64
102
 */
103
SCV64_Registers *SCV64 =  (void *)DMV170_SCV64_BASE_ADDRESS;
104
 
105
/*PAGE
106
 *
107
 *  SCV64_Initialize
108
 *
109
 *  This routine initializes the SCV64.
110
 */
111
void SCV64_Initialize() {
112
  SCV64->LIE = 0;
113
}
114
 
115
/*PAGE
116
 *
117
 *  SCV64_Generate_DUART_Interrupts
118
 *
119
 *  This sets the SCV64 to generate duart interrupts for
120
 *  the DMV177 board.
121
 */
122
void SCV64_Generate_DUART_Interrupts() {
123
 
124
  rtems_unsigned8 data;
125
 
126
  /*
127
   * Set Local Interrupt 5 enable
128
   */
129
  data = SCV64->LIE;
130
  data |= LOCAL_INTERRUPT_ENABLE_5;
131
  SCV64->LIE = data;
132
 
133
  /*
134
   * Set Autovector.
135
   */
136
  data = SCV64->IC54;
137
  data |= AUTOVECTOR_5;
138
  SCV64->IC54 = data;
139
}
140
 
141
/*PAGE
142
 *
143
 *  SCV64_Get_Interrupt
144
 *
145
 *  This routine returns the SCV64 status register.
146
 */
147
rtems_unsigned32 SCV64_Get_Interrupt()
148
{
149
  rtems_unsigned8 data;
150
 
151
  /*
152
   * Put the LIS data into the lower byte of the result
153
   */
154
  data = SCV64->LIS;
155
 
156
  return data;
157
}
158
 
159
/*PAGE
160
 *
161
 * SCV64_Get_Interrupt_Enable
162
 *
163
 * This routine returns the interrupt enable mask.
164
 */
165
rtems_unsigned32 SCV64_Get_Interrupt_Enable()
166
{
167
  /*
168
   * Return the set of interrupts enabled.
169
   */
170
  return SCV64->LIE;
171
}

powered by: WebSVN 2.1.0

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