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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [regdefs.h] - Blame information for rev 8

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

Line No. Rev Author Line
1 8 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    regdefs.h
4
//
5
// Project:     CMod S6 System on a Chip, ZipCPU demonstration project
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       0x00000108
42
#define R_ICONTROL      0x00000100
43
#define R_BUSERR        0x00000101
44
#define R_ITIMERA       0x00000102
45
#define R_ITIMERB       0x00000103
46
#define R_PWM           0x00000104
47
#define R_SPIO          0x00000105
48
#define R_GPIO          0x00000106
49
#define R_UART          0x00000107
50
 
51
// WB Scope registers
52
#define R_SCOPE         0x00000200
53
#define R_SCOPED        0x00000201
54
//
55
// And because the flash driver needs these constants defined ...
56
#define R_QSPI_EREG     0x0000030c
57
#define R_QSPI_CREG     0x0000030d
58
#define R_QSPI_SREG     0x0000030e
59
#define R_QSPI_IDREG    0x0000030f
60
//
61
// FPGA CONFIG/ICAP REGISTERS
62
#define R_CFG_CRC       0x00000400
63
#define R_CFG_FAR_MAJ   0x00000401
64
#define R_CFG_FAR_MIN   0x00000402
65
#define R_CFG_FDRI      0x00000403
66
#define R_CFG_FDRO      0x00000404
67
#define R_CFG_CMD       0x00000405
68
#define R_CFG_CTL       0x00000406
69
#define R_CFG_MASK      0x00000407
70
#define R_CFG_STAT      0x00000408
71
#define R_CFG_LOUT      0x00000409
72
#define R_CFG_COR1      0x0000040a
73
#define R_CFG_COR2      0x0000040b
74
#define R_CFG_PWRDN     0x0000040c
75
#define R_CFG_FLR       0x0000040d
76
#define R_CFG_IDCODE    0x0000040e
77
#define R_CFG_CWDT      0x0000040f
78
#define R_CFG_HCOPT     0x00000410
79
#define R_CFG_CSBO      0x00000412
80
#define R_CFG_GEN1      0x00000413
81
#define R_CFG_GEN2      0x00000414
82
#define R_CFG_GEN3      0x00000415
83
#define R_CFG_GEN4      0x00000416
84
#define R_CFG_GEN5      0x00000417
85
#define R_CFG_MODE      0x00000418
86
#define R_CFG_GWE       0x00000419
87
#define R_CFG_GTS       0x0000041a
88
#define R_CFG_MFWR      0x0000041b
89
#define R_CFG_CCLK      0x0000041c
90
#define R_CFG_SEU       0x0000041d
91
#define R_CFG_EXP       0x0000041e
92
#define R_CFG_RDBK      0x0000041f
93
#define R_CFG_BOOTSTS   0x00000420
94
#define R_CFG_EYE       0x00000421
95
#define R_CFG_CBC       0x00000422
96
// RTC clock control
97
#define R_CLOCK         0x00000800
98
#define R_TIMER         0x00000801
99
#define R_STOPWATCH     0x00000802
100
#define R_CKALARM       0x00000803
101
 
102
// RAM memory space
103
#define RAMBASE         0x00002000
104
#define MEMWORDS        (1<<12)
105
// Flash memory space
106
#define SPIFLASH        0x00040000
107
#define FLASHWORDS      (1<<18)
108
// SDRAM memory space
109
#define SDRAMBASE       0x00400000
110
#define SDRAMWORDS      (1<<24)
111
 
112
// Interrupt control constants
113
// #define      GIE             0x80000000      // Enable all interrupts
114
// #define      SCOPEN          0x80080008      // Enable WBSCOPE interrupts
115
// #define      ISPIF_EN        0x80040004      // Enable SPI Flash interrupts
116
// #define      ISPIF_DIS       0x00040000      // Disable SPI Flash interrupts
117
// #define      ISPIF_CLR       0x00000004      // Clear pending SPI Flash interrupt
118
 
119
// Flash control constants
120
#define ERASEFLAG       0x80000000
121
#define DISABLEWP       0x10000000
122
 
123
#define SZPAGE          64
124
#define PGLEN           64
125
#define NPAGES          32
126
#define SECTORSZ        (NPAGES * SZPAGE)
127
#define NSECTORS        256
128
#define SECTOROF(A)     ((A) & (-1<<10))
129
#define PAGEOF(A)       ((A) & (-1<<6))
130
 
131
#define RAMLEN          MEMWORDS
132
 
133
// Scop definition/sequences
134
#define SCOPE_NO_RESET  0x80000000
135
#define SCOPE_TRIGGER   (0x08000000|SCOPE_NO_RESET)
136
#define SCOPE_DISABLE   (0x04000000)
137
 
138
typedef struct {
139
        unsigned        m_addr;
140
        const char      *m_name;
141
} REGNAME;
142
 
143
extern  const   REGNAME *bregs;
144
extern  const   int     NREGS;
145
// #define      NREGS   (sizeof(bregs)/sizeof(bregs[0]))
146
 
147
extern  unsigned        addrdecode(const char *v);
148
extern  const   char *addrname(const unsigned v);
149
 
150
// #include "ttybus.h"
151
// #include "portbus.h"
152
// #include "deppbus.h"
153
 
154
// typedef      DEPPBUS FPGA;
155
 
156
#endif

powered by: WebSVN 2.1.0

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