source: rtems/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c @ 5f6f7c9

Last change on this file since 5f6f7c9 was 5f6f7c9, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 17:30:53

2003-09-04 Joel Sherrill <joel@…>

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