RTEMS 7.0-rc1
Loading...
Searching...
No Matches
qsm.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
22/*
23 * Copyright (c) 1995 John Gwynne <john.gwynne@matrixresearch.com>
24 *
25 * Redistribution and use in source and binary forms, with or without
26 * modification, are permitted provided that the following conditions
27 * are met:
28 * 1. Redistributions of source code must retain the above copyright
29 * notice, this list of conditions and the following disclaimer.
30 * 2. Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in the
32 * documentation and/or other materials provided with the distribution.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
38 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
39 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
42 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44 * POSSIBILITY OF SUCH DAMAGE.
45 */
46
47#ifndef _RTEMS_M68K_QSM_H
48#define _RTEMS_M68K_QSM_H
49
50/* SAM-- shift and mask */
51#undef SAM
52#define SAM(a,b,c) ((a << b) & c)
53
54
55/* QSM_CRB (QSM Control Register Block) base address of the QSM
56 control registers */
57#if SIM_MM == 0
58#define QSM_CRB 0x7ffc00
59#else
60#undef SIM_MM
61#define SIM_MM 1
62#define QSM_CRB 0xfffc00
63#endif
64
65
66#define QSMCR (volatile unsigned short int * const)(0x00 + QSM_CRB)
67 /* QSM Configuration Register */
68#define STOP 0x8000 /* Stop Enable */
69#define FRZ 0x6000 /* Freeze Control */
70#define SUPV 0x0080 /* Supervisor/Unrestricted */
71#define IARB 0x000f /* Inerrupt Arbitration */
72
73
74#define QTEST (volatile unsigned short int * const)(0x02 + QSM_CRB)
75 /* QSM Test Register */
76/* Used only for factor testing */
77
78
79#define QILR (volatile unsigned char * const)(0x04 + QSM_CRB)
80 /* QSM Interrupt Level Register */
81#define ILQSPI 0x38 /* Interrupt Level for QSPI */
82#define ILSCI 0x07 /* Interrupt Level for SCI */
83
84
85#define QIVR (volatile unsigned char * const)(0x05 + QSM_CRB)
86 /* QSM Interrupt Vector Register */
87#define INTV 0xff /* Interrupt Vector Number */
88
89
90#define SCCR0 (volatile unsigned short int * const)(0x08 + QSM_CRB)
91 /* SCI Control Register 0 */
92#define SCBR 0x1fff /* SCI Baud Rate */
93
94
95#define SCCR1 (volatile unsigned short int * const)(0x0a + QSM_CRB)
96 /* SCI Control Register 1 */
97#define LOOPS 0x4000 /* Loop Mode */
98#define WOMS 0x2000 /* Wired-OR Mode for SCI Pins */
99#define ILT 0x1000 /* Idle-Line Detect Type */
100#define PT 0x0800 /* Parity Type */
101#define PE 0x0400 /* Parity Enable */
102#define M 0x0200 /* Mode Select */
103#define WAKE 0x0100 /* Wakeup by Address Mark */
104#define TIE 0x0080 /* Transmit Complete Interrupt Enable */
105#define TCIE 0x0040 /* Transmit Complete Interrupt Enable */
106#define RIE 0x0020 /* Receiver Interrupt Enable */
107#define ILIE 0x0010 /* Idle-Line Interrupt Enable */
108#define TE 0x0008 /* Transmitter Enable */
109#define RE 0x0004 /* Receiver Enable */
110#define RWU 0x0002 /* Receiver Wakeup */
111#define SBK 0x0001 /* Send Break */
112
113
114#define SCSR (volatile unsigned short int * const)(0x0c + QSM_CRB)
115 /* SCI Status Register */
116#define TDRE 0x0100 /* Transmit Data Register Empty */
117#define TC 0x0080 /* Transmit Complete */
118#define RDRF 0x0040 /* Receive Data Register Full */
119#define RAF 0x0020 /* Receiver Active */
120#define IDLE 0x0010 /* Idle-Line Detected */
121#define OR 0x0008 /* Overrun Error */
122#define NF 0x0004 /* Noise Error Flag */
123#define FE 0x0002 /* Framing Error */
124#define PF 0x0001 /* Parity Error */
125
126
127#define SCDR (volatile unsigned short int * const)(0x0e + QSM_CRB)
128 /* SCI Data Register */
129
130
131#define PORTQS (volatile unsigned char * const)(0x15 + QSM_CRB)
132 /* Port QS Data Register */
133
134#define PQSPAR (volatile unsigned char * const)(0x16 + QSM_CRB)
135 /* PORT QS Pin Assignment Rgister */
136/* Any bit cleared (zero) defines the corresponding pin to be an I/O
137 pin. Any bit set defines the corresponding pin to be a QSPI
138 signal. */
139/* note: PQS2 is a digital I/O pin unless the SPI is enabled in which
140 case it becomes the SPI serial clock SCK. */
141/* note: PQS7 is a digital I/O pin unless the SCI transmitter is
142 enabled in which case it becomes the SCI serial output TxD. */
143#define QSMFun 0x0
144#define QSMDis 0x1
145/*
146 * PQSPAR Field | QSM Function | Discrete I/O pin
147 *------------------+--------------+------------------ */
148#define PQSPA0 0 /* MISO | PQS0 */
149#define PQSPA1 1 /* MOSI | PQS1 */
150#define PQSPA2 2 /* SCK | PQS2 (see note)*/
151#define PQSPA3 3 /* PCSO/!SS | PQS3 */
152#define PQSPA4 4 /* PCS1 | PQS4 */
153#define PQSPA5 5 /* PCS2 | PQS5 */
154#define PQSPA6 6 /* PCS3 | PQS6 */
155#define PQSPA7 7 /* TxD | PQS7 (see note)*/
156
157
158#define DDRQS (volatile unsigned char * const)(0x17 + QSM_CRB)
159 /* PORT QS Data Direction Register */
160/* Clearing a bit makes the corresponding pin an input; setting a bit
161 makes the pin an output. */
162
163
164#define SPCR0 (volatile unsigned short int * const)(0x18 + QSM_CRB)
165 /* QSPI Control Register 0 */
166#define MSTR 0x8000 /* Master/Slave Mode Select */
167#define WOMQ 0x4000 /* Wired-OR Mode for QSPI Pins */
168#define BITS 0x3c00 /* Bits Per Transfer */
169#define CPOL 0x0200 /* Clock Polarity */
170#define CPHA 0x0100 /* Clock Phase */
171#define SPBR 0x00ff /* Serial Clock Baud Rate */
172
173
174#define SPCR1 (volatile unsigned short int * const)(0x1a + QSM_CRB)
175 /* QSPI Control Register 1 */
176#define SPE 0x8000 /* QSPI Enable */
177#define DSCKL 0x7f00 /* Delay before SCK */
178#define DTL 0x00ff /* Length of Delay after Transfer */
179
180
181#define SPCR2 (volatile unsigned short int * const)(0x1c + QSM_CRB)
182 /* QSPI Control Register 2 */
183#define SPIFIE 0x8000 /* SPI Finished Interrupt Enable */
184#define WREN 0x4000 /* Wrap Enable */
185#define WRTO 0x2000 /* Wrap To */
186#define ENDQP 0x0f00 /* Ending Queue Pointer */
187#define NEWQP 0x000f /* New Queue Pointer Value */
188
189
190#define SPCR3 (volatile unsigned char * const)(0x1e + QSM_CRB)
191 /* QSPI Control Register 3 */
192#define LOOPQ 0x0400 /* QSPI Loop Mode */
193#define HMIE 0x0200 /* HALTA and MODF Interrupt Enable */
194#define HALT 0x0100 /* Halt */
195
196
197#define SPSR (volatile unsigned char * const)(0x1f + QSM_CRB)
198 /* QSPI Status Register */
199#define SPIF 0x0080 /* QSPI Finished Flag */
200#define MODF 0x0040 /* Mode Fault Flag */
201#define HALTA 0x0020 /* Halt Acknowlwdge Flag */
202#define CPTQP x0000f /* Completed Queue Pointer */
203
204#define QSPIRR (volatile unsigned char * const)(0x100 + QSM_CRB)
205 /* QSPI Receive Data RAM */
206#define QSPITR (volatile unsigned char * const)(0x120 + QSM_CRB)
207 /* QSPI Transmit Data RAM */
208#define QSPIcR (volatile unsigned char * const)(0x140 + QSM_CRB)
209 /* QSPI Command RAM */
210
211#endif /* _RTEMS_M68K_QSM_H */