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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [host/] [regdefs.h] - Blame information for rev 6

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

Line No. Rev Author Line
1 4 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    regdefs.h
4
//
5
// Project:     OpenArty, an entirely open SoC based upon the Arty platform
6
//
7
// Purpose:     
8
//
9
// Creator:     Dan Gisselquist, Ph.D.
10
//              Gisselquist Technology, LLC
11
//
12
////////////////////////////////////////////////////////////////////////////////
13
//
14
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
15
//
16
// This program is free software (firmware): you can redistribute it and/or
17
// modify it under the terms of  the GNU General Public License as published
18
// by the Free Software Foundation, either version 3 of the License, or (at
19
// your option) any later version.
20
//
21
// This program is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26
// You should have received a copy of the GNU General Public License along
27
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
28
// target there if the PDF file isn't present.)  If not, see
29
// <http://www.gnu.org/licenses/> for a copy.
30
//
31
// License:     GPL, v3, as defined and found on www.gnu.org,
32
//              http://www.gnu.org/licenses/gpl.html
33
//
34
//
35
////////////////////////////////////////////////////////////////////////////////
36
//
37
//
38
#ifndef REGDEFS_H
39
#define REGDEFS_H
40
 
41
#define R_VERSION       0x00000100
42
#define R_ICONTROL      0x00000101
43
#define R_BUSERR        0x00000102
44
#define R_PWCOUNT       0x00000103
45
#define R_BTNSW         0x00000104
46
#define R_LEDS          0x00000105
47
#define R_UART_SETUP    0x00000106
48
#define R_GPS_SETUP     0x00000107
49
#define R_CLR0          0x00000108
50
#define R_CLR1          0x00000109
51
#define R_CLR2          0x0000010a
52
#define R_CLR3          0x0000010b
53
#define R_DATE          0x0000010c
54
#define R_GPIO          0x0000010d
55
#define R_UARTRX        0x0000010e
56
#define R_UARTTX        0x0000010f
57
#define R_GPSRX         0x00000110
58
#define R_GPSTX         0x00000111
59
// WB Scope registers
60
#define R_QSCOPE        0x00000120      // Quad SPI scope ctrl
61
#define R_QSCOPED       0x00000121      //      and data
62
#define R_GPSCOPE       0x00000122      // GPS configuration scope control
63
#define R_GPSCOPED      0x00000123      //      and data, uses Mouse scope addrs
64 6 dgisselq
#define R_RAMSCOPE      0x00000124      // DDR3 SDRAM Scope
65
#define R_RAMSCOPED     0x00000125      //
66
#define R_NETSCOPE      0x00000126      // Ethernet debug scope
67
#define R_NETSCOPED     0x00000127      //
68 4 dgisselq
// RTC Clock Registers
69
#define R_CLOCK         0x00000128
70
#define R_TIMER         0x00000129
71
#define R_STOPWATCH     0x0000012a
72
#define R_CKALARM       0x0000012b
73
// SD Card Control
74
#define R_SDCARD_CTRL   0x0000012c
75
#define R_SDCARD_DATA   0x0000012d
76
#define R_SDCARD_FIFOA  0x0000012e
77
#define R_SDCARD_FIFOB  0x0000012f
78
// GPS Loop control, 0x0130
79
#define R_GPS_ALPHA     0x00000130
80
#define R_GPS_BETA      0x00000131
81
#define R_GPS_GAMMA     0x00000132
82
#define R_GPS_STEP      0x00000133
83
// Network packet interface, 0x0134
84
// OLED
85
#define R_OLED_CMD      0x00000138
86
#define R_OLED_CDATA    0x00000139
87
#define R_OLED_CDATB    0x0000013a
88
#define R_OLED_DATA     0x0000013b
89
// Unused: 0x13c-0x13f
90
// GPS Testbench: 0x140-0x147
91
#define R_GPSTB_FREQ    0x00000140
92
#define R_GPSTB_JUMP    0x00000141
93
#define R_GPSTB_ERRHI   0x00000142
94
#define R_GPSTB_ERRLO   0x00000143
95
#define R_GPSTB_COUNTHI 0x00000144
96
#define R_GPSTB_COUNTLO 0x00000145
97
#define R_GPSTB_STEPHI  0x00000146
98
#define R_GPSTB_STEPLO  0x00000147
99
// Unused: 0x148-0x19f
100
// Ethernet configuration (MDIO) port: 0x1a0-0x1bf
101
#define R_MDIO_BMCR     0x000001a0
102
#define R_MDIO_BMSR     0x000001a1
103
#define R_MDIO_PHYIDR1  0x000001a2
104
#define R_MDIO_PHYIDR2  0x000001a3
105
#define R_MDIO_ANAR     0x000001a4
106
#define R_MDIO_ANLPAR   0x000001a5
107
// #define      R_MDIO_ANLPARNP 0x000001a5
108
#define R_MDIO_ANER     0x000001a6
109
#define R_MDIO_ANNPTR   0x000001a7
110
#define R_MDIO_PHYSTS   0x000001b0
111
#define R_MDIO_FCSCR    0x000001b4
112
#define R_MDIO_RECR     0x000001b5
113
#define R_MDIO_PCSR     0x000001b6
114
#define R_MDIO_RBR      0x000001b7
115
#define R_MDIO_LEDCR    0x000001b8
116
#define R_MDIO_PHYCR    0x000001b9
117
#define R_MDIO_BTSCR    0x000001ba
118
#define R_MDIO_CDCTRL   0x000001bb
119
#define R_MDIO_EDCR     0x000001bd
120
// Flash: 0x1c0-0x1df
121
#define R_QSPI_EREG     0x000001c0
122
#define R_QSPI_STAT     0x000001c1
123
#define R_QSPI_NVCONF   0x000001c2
124
#define R_QSPI_VCONF    0x000001c3
125
#define R_QSPI_EVCONF   0x000001c4
126
#define R_QSPI_LOCK     0x000001c5
127
#define R_QSPI_FLAG     0x000001c6
128
// #define      R_QSPI_ASYNC    0x000001c7
129
#define R_QSPI_ID       0x000001c8
130
#define R_QSPI_IDA      0x000001c9
131
#define R_QSPI_IDB      0x000001ca
132
#define R_QSPI_IDC      0x000001cb
133
#define R_QSPI_IDD      0x000001cc
134
//
135
#define R_QSPI_OTPWP    0x000001cf
136
#define R_QSPI_OTP      0x000001d0
137
 
138
// FPGA CONFIG REGISTERS: 0x1e0-0x1ff
139
#define R_CFG_CRC       0x000001e0
140
#define R_CFG_FAR       0x000001e1
141
#define R_CFG_FDRI      0x000001e2
142
#define R_CFG_FDRO      0x000001e3
143
#define R_CFG_CMD       0x000001e4
144
#define R_CFG_CTL0      0x000001e5
145
#define R_CFG_MASK      0x000001e6
146
#define R_CFG_STAT      0x000001e7
147
#define R_CFG_LOUT      0x000001e8
148
#define R_CFG_COR0      0x000001e9
149
#define R_CFG_MFWR      0x000001ea
150
#define R_CFG_CBC       0x000001eb
151
#define R_CFG_IDCODE    0x000001ec
152
#define R_CFG_AXSS      0x000001ed
153
#define R_CFG_COR1      0x000001ee
154
#define R_CFG_WBSTAR    0x000001f0
155
#define R_CFG_TIMER     0x000001f1
156
#define R_CFG_BOOTSTS   0x000001f6
157
#define R_CFG_CTL1      0x000001f8
158
#define R_CFG_BSPI      0x000001ff
159
// Block RAM memory space
160
#define MEMBASE         0x00008000
161
#define MEMWORDS        0x00008000
162
// Flash memory space
163
#define EQSPIFLASH      0x00400000
164
#define FLASHWORDS      (1<<22)
165
// DDR3 SDRAM memory space
166
#define RAMBASE         0x04000000
167 6 dgisselq
#define SDRAMBASE       RAMBASE
168 4 dgisselq
#define RAMWORDS        (1<<26)
169
// Zip CPU Control and Debug registers
170
#define R_ZIPCTRL       0x01000000
171
#define R_ZIPDATA       0x01000001
172
 
173
// Interrupt control constants
174
#define GIE             0x80000000      // Enable all interrupts
175
#define ISPIF_EN        0x82000200      // Enable all, enable QSPI, clear QSPI
176
#define ISPIF_DIS       0x02000200      // Disable all, disable QSPI
177
#define ISPIF_CLR       0x00000200      // Clear QSPI interrupt
178
#define SCOPEN          0x84000400      // Enable WBSCOPE interrupts
179
 
180
// Flash control constants
181
#define ERASEFLAG       0x80000000
182
#define DISABLEWP       0x10000000
183
 
184
#define SZPAGE          64
185
#define PGLEN           64
186
#define NPAGES          256
187
#define SECTORSZ        (NPAGES * SZPAGE)
188
#define NSECTORS        64
189
#define SECTOROF(A)     ((A) & (-1<<14))
190
#define PAGEOF(A)       ((A) & (-1<<6))
191
 
192
#define CPU_GO          0x0000
193
#define CPU_RESET       0x0040
194
#define CPU_INT         0x0080
195
#define CPU_STEP        0x0100
196
#define CPU_STALL       0x0200
197
#define CPU_HALT        0x0400
198
#define CPU_CLRCACHE    0x0800
199
#define CPU_sR0         (0x0000|CPU_HALT)
200
#define CPU_sSP         (0x000d|CPU_HALT)
201
#define CPU_sCC         (0x000e|CPU_HALT)
202
#define CPU_sPC         (0x000f|CPU_HALT)
203
#define CPU_uR0         (0x0010|CPU_HALT)
204
#define CPU_uSP         (0x001d|CPU_HALT)
205
#define CPU_uCC         (0x001e|CPU_HALT)
206
#define CPU_uPC         (0x001f|CPU_HALT)
207
 
208
#define SCOPE_NO_RESET  0x80000000
209
#define SCOPE_TRIGGER   (0x08000000|SCOPE_NO_RESET)
210
#define SCOPE_DISABLE   (0x04000000)
211
 
212
typedef struct {
213
        unsigned        m_addr;
214
        const char      *m_name;
215
} REGNAME;
216
 
217
extern  const   REGNAME *bregs;
218
extern  const   int     NREGS;
219
// #define      NREGS   (sizeof(bregs)/sizeof(bregs[0]))
220
 
221
extern  unsigned        addrdecode(const char *v);
222
extern  const   char *addrname(const unsigned v);
223
 
224
#include "ttybus.h"
225
// #include "portbus.h"
226
 
227
typedef TTYBUS  FPGA;
228
 
229
#endif

powered by: WebSVN 2.1.0

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