source: rtems/c/src/exec/score/cpu/m68k/qsm.h @ 110f4ff7

4.104.114.84.95
Last change on this file since 110f4ff7 was eb5a7e07, checked in by Joel Sherrill <joel.sherrill@…>, on 10/06/95 at 20:48:38

fixed missing CVS IDs

  • Property mode set to 100644
File size: 7.8 KB
Line 
1/*
2 *-------------------------------------------------------------------
3 *
4 *   QSM -- Queued Serial Module
5 *
6 * The QSM contains two serial interfaces: (a) the queued serial
7 * peripheral interface (QSPI) and the serial communication interface
8 * (SCI). The QSPI provides peripheral expansion and/or interprocessor
9 * communication through a full-duplex, synchronous, three-wire bus. A
10 * self contained RAM queue permits serial data transfers without CPU
11 * intervention and automatic continuous sampling. The SCI provides a
12 * standard non-return to zero mark/space format with wakeup functions
13 * to allow the CPU to run uninterrupted until woken
14 *
15 * For more information, refer to Motorola's "Modular Microcontroller
16 * Family Queued Serial Module Reference Manual" (Motorola document
17 * QSMRM/AD).
18 *
19 * This file has been created by John S. Gwynne for support of
20 * Motorola's 68332 MCU in the efi332 project.
21 *
22 * Redistribution and use in source and binary forms are permitted
23 * provided that the following conditions are met:
24 * 1. Redistribution of source code and documentation must retain
25 *    the above authorship, this list of conditions and the
26 *    following disclaimer.
27 * 2. The name of the author may not be used to endorse or promote
28 *    products derived from this software without specific prior
29 *    written permission.
30 *
31 * This software is provided "AS IS" without warranty of any kind,
32 * either expressed or implied, including, but not limited to, the
33 * implied warranties of merchantability, title and fitness for a
34 * particular purpose.
35 *
36 *------------------------------------------------------------------
37 *
38 *  $Id$
39 */
40
41#ifndef _QSM_H_
42#define _QSM_H_
43
44
45#include <efi332.h>
46
47
48/* SAM-- shift and mask */
49#undef  SAM
50#define SAM(a,b,c) ((a << b) & c)
51
52
53/* QSM_CRB (QSM Control Register Block) base address of the QSM
54   control registers */
55#if SIM_MM == 0
56#define QSM_CRB 0x7ffc00
57#else
58#undef SIM_MM
59#define SIM_MM 1
60#define QSM_CRB 0xfffc00
61#endif
62
63
64#define QSMCR (volatile unsigned short int * const)(0x00 + QSM_CRB)
65                                /* QSM Configuration Register */
66#define    STOP 0x8000          /*    Stop Enable */
67#define    FRZ  0x6000          /*    Freeze Control */
68#define    SUPV 0x0080          /*    Supervisor/Unrestricted */
69#define    IARB 0x000f          /*    Inerrupt Arbitration */
70
71
72#define QTEST (volatile unsigned short int * const)(0x02 + QSM_CRB)
73                                /* QSM Test Register */
74/* Used only for factor testing */
75
76
77#define QILR (volatile unsigned char * const)(0x04 + QSM_CRB)
78                                /* QSM Interrupt Level Register */
79#define    ILQSPI 0x38          /*    Interrupt Level for QSPI */
80#define    ILSCI  0x07          /*    Interrupt Level for SCI */
81
82
83#define QIVR (volatile unsigned char * const)(0x05 + QSM_CRB)
84                                /* QSM Interrupt Vector Register */
85#define    INTV   0xff          /*    Interrupt Vector Number */
86
87
88#define SCCR0 (volatile unsigned short int * const)(0x08 + QSM_CRB)
89                                /* SCI Control Register 0 */
90#define    SCBR   0x1fff        /*    SCI Baud Rate */
91
92
93#define SCCR1 (volatile unsigned short int * const)(0x0a + QSM_CRB)
94                                /* SCI Control Register 1 */
95#define    LOOPS  0x4000        /*    Loop Mode */
96#define    WOMS   0x2000        /*    Wired-OR Mode for SCI Pins */
97#define    ILT    0x1000        /*    Idle-Line Detect Type */
98#define    PT     0x0800        /*    Parity Type */
99#define    PE     0x0400        /*    Parity Enable */
100#define    M      0x0200        /*    Mode Select */
101#define    WAKE   0x0100        /*    Wakeup by Address Mark */
102#define    TIE    0x0080        /*    Transmit Complete Interrupt Enable */
103#define    TCIE   0x0040        /*    Transmit Complete Interrupt Enable */
104#define    RIE    0x0020        /*    Receiver Interrupt Enable */
105#define    ILIE   0x0010        /*    Idle-Line Interrupt Enable */
106#define    TE     0x0008        /*    Transmitter Enable */
107#define    RE     0x0004        /*    Receiver Enable */
108#define    RWU    0x0002        /*    Receiver Wakeup */
109#define    SBK    0x0001        /*    Send Break */
110
111
112#define SCSR (volatile unsigned short int * const)(0x0c + QSM_CRB)
113                                /* SCI Status Register */
114#define    TDRE   0x0100        /*    Transmit Data Register Empty */
115#define    TC     0x0080        /*    Transmit Complete */
116#define    RDRF   0x0040        /*    Receive Data Register Full */
117#define    RAF    0x0020        /*    Receiver Active */
118#define    IDLE   0x0010        /*    Idle-Line Detected */
119#define    OR     0x0008        /*    Overrun Error */
120#define    NF     0x0004        /*    Noise Error Flag */
121#define    FE     0x0002        /*    Framing Error */
122#define    PF     0x0001        /*    Parity Error */
123
124
125#define SCDR (volatile unsigned short int * const)(0x0e + QSM_CRB)
126                                /* SCI Data Register */
127
128
129#define PORTQS (volatile unsigned char * const)(0x15 + QSM_CRB)
130                                /* Port QS Data Register */
131
132#define PQSPAR (volatile unsigned char * const)(0x16 + QSM_CRB)
133                                /* PORT QS Pin Assignment Rgister */
134/* Any bit cleared (zero) defines the corresponding pin to be an I/O
135   pin. Any bit set defines the corresponding pin to be a QSPI
136   signal. */
137/* note: PQS2 is a digital I/O pin unless the SPI is enabled in which
138   case it becomes the SPI serial clock SCK. */
139/* note: PQS7 is a digital I/O pin unless the SCI transmitter is
140   enabled in which case it becomes the SCI serial output TxD. */
141#define QSMFun 0x0
142#define QSMDis 0x1
143/*
144 * PQSPAR Field     | QSM Function | Discrete I/O pin
145 *------------------+--------------+------------------   */
146#define PQSPA0   0  /*   MISO      |      PQS0           */
147#define PQSPA1   1  /*   MOSI      |      PQS1           */
148#define PQSPA2   2  /*   SCK       |      PQS2 (see note)*/
149#define PQSPA3   3  /*   PCSO/!SS  |      PQS3           */
150#define PQSPA4   4  /*   PCS1      |      PQS4           */
151#define PQSPA5   5  /*   PCS2      |      PQS5           */
152#define PQSPA6   6  /*   PCS3      |      PQS6           */
153#define PQSPA7   7  /*   TxD       |      PQS7 (see note)*/
154
155
156#define DDRQS  (volatile unsigned char * const)(0x17 + QSM_CRB)
157                                /* PORT QS Data Direction Register */
158/* Clearing a bit makes the corresponding pin an input; setting a bit
159   makes the pin an output. */
160
161
162#define SPCR0 (volatile unsigned short int * const)(0x18 + QSM_CRB)
163                                /* QSPI Control Register 0 */
164#define    MSTR   0x8000        /*    Master/Slave Mode Select */
165#define    WOMQ   0x4000        /*    Wired-OR Mode for QSPI Pins */
166#define    BITS   0x3c00        /*    Bits Per Transfer */
167#define    CPOL   0x0200        /*    Clock Polarity */
168#define    CPHA   0x0100        /*    Clock Phase */
169#define    SPBR   0x00ff        /*    Serial Clock Baud Rate */
170
171
172#define SPCR1 (volatile unsigned short int * const)(0x1a + QSM_CRB)
173                                /* QSPI Control Register 1 */
174#define    SPE    0x8000        /*    QSPI Enable */
175#define    DSCKL  0x7f00        /*    Delay before SCK */
176#define    DTL    0x00ff        /*    Length of Delay after Transfer */
177
178
179#define SPCR2 (volatile unsigned short int * const)(0x1c + QSM_CRB)
180                                /* QSPI Control Register 2 */
181#define    SPIFIE 0x8000        /*    SPI Finished Interrupt Enable */
182#define    WREN   0x4000        /*    Wrap Enable */
183#define    WRTO   0x2000        /*    Wrap To */
184#define    ENDQP  0x0f00        /*    Ending Queue Pointer */
185#define    NEWQP  0x000f        /*    New Queue Pointer Value */
186
187
188#define SPCR3 (volatile unsigned char * const)(0x1e + QSM_CRB)
189                                /* QSPI Control Register 3 */
190#define    LOOPQ  0x0400        /*    QSPI Loop Mode */
191#define    HMIE   0x0200        /*    HALTA and MODF Interrupt Enable */
192#define    HALT   0x0100        /*    Halt */
193
194
195#define SPSR (volatile unsigned char * const)(0x1f + QSM_CRB)
196                                /* QSPI Status Register */
197#define    SPIF   0x0080        /*    QSPI Finished Flag */
198#define    MODF   0x0040        /*    Mode Fault Flag */
199#define    HALTA  0x0020        /*    Halt Acknowlwdge Flag */
200#define    CPTQP  x0000f        /*    Completed Queue Pointer */
201
202#define QSPIRR (volatile unsigned char * const)(0x100 + QSM_CRB)
203                                /* QSPI Receive Data RAM */
204#define QSPITR (volatile unsigned char * const)(0x120 + QSM_CRB)
205                                /* QSPI Transmit Data RAM */
206#define QSPIcR (volatile unsigned char * const)(0x140 + QSM_CRB)
207                                /* QSPI Command RAM */
208
209#endif /* _QSM_H_ */
Note: See TracBrowser for help on using the repository browser.