lconf.h
3.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* -----------------------------------------------------------------------------
* Copyright (C) 2020 daiteq s.r.o. http://www.daiteq.com
*
* This program is distributed WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
*
* -----------------------------------------------------------------------------
* Filename : lconf.h
* Authors : Martin Danek
* Description : system register definitions
* Release :
* Version : 1.0
* Date : 18.6.2020
* -----------------------------------------------------------------------------
*/
#ifndef LCONF_H
#define LCONF_H
// LEON2FT configuration register definitions
#define LCONF_BASE 0x80000024
#define LCONF_FPU_BASE LCONF_BASE+4
#define LCONF_SWAR_BASE LCONF_BASE+8
// LCONF CONFIGURATION BITS
#define LCONF_WPROTEN_MSK 0x00000003
#define LCONF_WPROTEN 0x00000001
//
#define LCONF_PCI_MSK 0x0000000C
#define LCONF_PCI_INSILICON 0x00000004
#define LCONF_PCI_ESA 0x00000008
#define LCONF_PCI_OTHER 0x0000000C
//
#define LCONF_FPU_MSK 0x00000030
#define LCONF_FPU_MEIKO 0x00000010
#define LCONF_FPU_GRFPU 0x00000020
#define LCONF_FPU_DAIFPU 0x00000030
//
#define LCONF_AHBSTATEN 0x00000040
#define LCONF_WDOGEN 0x00000080
#define LCONF_MULTIPLIER 0x00000100
#define LCONF_DIVIDER 0x00000200
//
#define LCONF_DLINE_BITS 0x00000C00
#define LCONF_DSIZE 0x00007000
#define LCONF_ILINE_BITS 0x00018000
#define LCONF_ISIZE 0x000E0000
//
#define LCONF_NWINDOWS 0x01F00000
#define LCONF_MACEN 0x02000000
#define LCONF_WATCHPOINTS 0x1C000000
#define LCONF_SDRAMEN 0x20000000
#define LCONF_DSU 0x40000000
#define LCONF_MEN 0x80000000
// LCONF_FPU CONFIGURATION BITS
#define LCONF_FPU_DIV 0x000001
#define LCONF_FPU_SQRT 0x000002
//
#define LCONF_FPU_PACKED 0x000004
#define LCONF_FPU_DUAL 0x000008
//
#define LCONF_FPU_EXPH_BITS 0x0000F0
#define LCONF_FPU_TRSIGH_BITS 0x003F00
#define LCONF_FPU_EXPL_BITS 0x03C000
#define LCONF_FPU_TRSIGL_BITS 0xFC0000
// LCONF_SWAR CONFIGURATION BITS
#define LCONF_SWAR_CORREL 0x00000001
#define LCONF_SWAR_DEMOD 0x00000002
#define LCONF_SWAR_SINCOS 0x00000004
//
#define LCONF_SWAR_AUDIO 0x00000008
#define LCONF_SWAR_VIDEO 0x00000010
#define LCONF_SWAR_ALU 0x00000020
//
#define LCONF_SWAR_ACC 0x00000040
//
#define LCONF_SWAR_LANES 0x001F0000
#define LCONF_SWAR_SWIDTH 0x03E00000
#define LCONF_SWAR_AWIDTH 0xFC000000
// FPU TYPES
#define FPU_NONE 0
#define FPU_MEIKO 1
#define FPU_GRFPU 2
#define FPU_DAIFPU 3
// PCI TYPES
#define PCI_NONE 0
#define PCI_INSILICON 1
#define PCI_ESA 2
#define PCI_OTHER 3
typedef struct lconf_type {
unsigned ahbstaten;
unsigned wdogen;
unsigned multiplier;
unsigned divider;
unsigned macen;
unsigned sdramen;
unsigned dsu;
unsigned men;
unsigned dline_bits;
unsigned dset_bits;
unsigned iline_bits;
unsigned iset_bits;
unsigned nwindows;
unsigned watchpoints;
unsigned fpu;
unsigned pci;
unsigned wproten;
} lconf_type;
typedef struct lconf_fpu_type {
unsigned fdiv;
unsigned fsqrt;
unsigned packed;
unsigned dual;
unsigned exp_hi;
unsigned trsig_hi;
unsigned exp_lo;
unsigned trsig_lo;
} lconf_fpu_type;
typedef struct lconf_swar_type {
unsigned correl;
unsigned demod;
unsigned sincos;
unsigned audio;
unsigned video;
unsigned alu;
unsigned acc;
unsigned lanes;
unsigned swidth;
unsigned awidth;
} lconf_swar_type;
void get_lconf(lconf_type *lconf);
void get_lconf_fpu(lconf_fpu_type *lconf_fpu);
void get_lconf_swar(lconf_swar_type *lconf_swar);
void report_lconf(lconf_type *lconf);
void report_lconf_fpu(lconf_fpu_type *lconf_fpu);
void report_lconf_swar(lconf_swar_type *lconf_swar);
#endif