Subversion Repositories freemyipod

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
85 theseven 1
//
2
//
3
//    Copyright 2010 TheSeven
4
//
5
//
6
//    This file is part of emBIOS.
7
//
8
//    emBIOS is free software: you can redistribute it and/or
9
//    modify it under the terms of the GNU General Public License as
10
//    published by the Free Software Foundation, either version 2 of the
11
//    License, or (at your option) any later version.
12
//
13
//    emBIOS is distributed in the hope that it will be useful,
14
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
//    See the GNU General Public License for more details.
17
//
18
//    You should have received a copy of the GNU General Public License along
19
//    with emBIOS.  If not, see <http://www.gnu.org/licenses/>.
20
//
21
//
22
 
23
 
24
#ifndef __S5L8720_H__
25
#define __S5L8720_H__
26
 
27
#include "global.h"
28
 
29
 
87 theseven 30
/////SYSCON/////
31
#define PWRCON(i)    (*((volatile uint32_t*)(0x3C500000 \
32
                                           + ((i) == 4 ? 0x6C : \
33
                                             ((i) == 3 ? 0x68 : \
34
                                             ((i) == 2 ? 0x58 : \
35
                                             ((i) == 1 ? 0x4C : \
36
                                                         0x48)))))))
85 theseven 37
 
38
 
39
/////TIMER/////
40
#define TACON        (*((volatile uint32_t*)(0x3C700000)))
41
#define TACMD        (*((volatile uint32_t*)(0x3C700004)))
42
#define TADATA0      (*((volatile uint32_t*)(0x3C700008)))
43
#define TADATA1      (*((volatile uint32_t*)(0x3C70000C)))
44
#define TAPRE        (*((volatile uint32_t*)(0x3C700010)))
45
#define TACNT        (*((volatile uint32_t*)(0x3C700014)))
46
#define TBCON        (*((volatile uint32_t*)(0x3C700020)))
47
#define TBCMD        (*((volatile uint32_t*)(0x3C700024)))
48
#define TBDATA0      (*((volatile uint32_t*)(0x3C700028)))
49
#define TBDATA1      (*((volatile uint32_t*)(0x3C70002C)))
50
#define TBPRE        (*((volatile uint32_t*)(0x3C700030)))
51
#define TBCNT        (*((volatile uint32_t*)(0x3C700034)))
52
#define TCCON        (*((volatile uint32_t*)(0x3C700040)))
53
#define TCCMD        (*((volatile uint32_t*)(0x3C700044)))
54
#define TCDATA0      (*((volatile uint32_t*)(0x3C700048)))
55
#define TCDATA1      (*((volatile uint32_t*)(0x3C70004C)))
56
#define TCPRE        (*((volatile uint32_t*)(0x3C700050)))
57
#define TCCNT        (*((volatile uint32_t*)(0x3C700054)))
58
#define TDCON        (*((volatile uint32_t*)(0x3C700060)))
59
#define TDCMD        (*((volatile uint32_t*)(0x3C700064)))
60
#define TDDATA0      (*((volatile uint32_t*)(0x3C700068)))
61
#define TDDATA1      (*((volatile uint32_t*)(0x3C70006C)))
62
#define TDPRE        (*((volatile uint32_t*)(0x3C700070)))
63
#define TDCNT        (*((volatile uint32_t*)(0x3C700074)))
64
#define TECON        (*((volatile uint32_t*)(0x3C7000A0)))
65
#define TECMD        (*((volatile uint32_t*)(0x3C7000A4)))
66
#define TEDATA0      (*((volatile uint32_t*)(0x3C7000A8)))
67
#define TEDATA1      (*((volatile uint32_t*)(0x3C7000AC)))
68
#define TEPRE        (*((volatile uint32_t*)(0x3C7000B0)))
69
#define TECNT        (*((volatile uint32_t*)(0x3C7000B4)))
70
#define TFCON        (*((volatile uint32_t*)(0x3C7000C0)))
71
#define TFCMD        (*((volatile uint32_t*)(0x3C7000C4)))
72
#define TFDATA0      (*((volatile uint32_t*)(0x3C7000C8)))
73
#define TFDATA1      (*((volatile uint32_t*)(0x3C7000CC)))
74
#define TFPRE        (*((volatile uint32_t*)(0x3C7000D0)))
75
#define TFCNT        (*((volatile uint32_t*)(0x3C7000D4)))
76
#define TGCON        (*((volatile uint32_t*)(0x3C7000E0)))
77
#define TGCMD        (*((volatile uint32_t*)(0x3C7000E4)))
78
#define TGDATA0      (*((volatile uint32_t*)(0x3C7000E8)))
79
#define TGDATA1      (*((volatile uint32_t*)(0x3C7000EC)))
80
#define TGPRE        (*((volatile uint32_t*)(0x3C7000F0)))
81
#define TGCNT        (*((volatile uint32_t*)(0x3C7000F4)))
82
#define THCON        (*((volatile uint32_t*)(0x3C700100)))
83
#define THCMD        (*((volatile uint32_t*)(0x3C700104)))
84
#define THDATA0      (*((volatile uint32_t*)(0x3C700108)))
85
#define THDATA1      (*((volatile uint32_t*)(0x3C70010C)))
86
#define THPRE        (*((volatile uint32_t*)(0x3C700110)))
87
#define THCNT        (*((volatile uint32_t*)(0x3C700114)))
88
 
89
 
90
/////USB/////
91
#define OTGBASE 0x38400000
92
#define PHYBASE 0x3C400000
93
 
94
 
95
/////I2C/////
87 theseven 96
#define IICCON(bus)  (*((volatile uint32_t*)(0x3C600000 + 0x300000 * (bus))))
97
#define IICSTAT(bus) (*((volatile uint32_t*)(0x3C600004 + 0x300000 * (bus))))
98
#define IICADD(bus)  (*((volatile uint32_t*)(0x3C600008 + 0x300000 * (bus))))
99
#define IICDS(bus)   (*((volatile uint32_t*)(0x3C60000C + 0x300000 * (bus))))
85 theseven 100
 
101
 
102
/////INTERRUPTS/////
103
#define VICIRQSTATUS(v)       (*((volatile uint32_t*)(0x38E00000 + 0x1000 * (v))))
104
#define VICFIQSTATUS(v)       (*((volatile uint32_t*)(0x38E00004 + 0x1000 * (v))))
105
#define VICRAWINTR(v)         (*((volatile uint32_t*)(0x38E00008 + 0x1000 * (v))))
106
#define VICINTSELECT(v)       (*((volatile uint32_t*)(0x38E0000C + 0x1000 * (v))))
107
#define VICINTENABLE(v)       (*((volatile uint32_t*)(0x38E00010 + 0x1000 * (v))))
108
#define VICINTENCLEAR(v)      (*((volatile uint32_t*)(0x38E00014 + 0x1000 * (v))))
109
#define VICSOFTINT(v)         (*((volatile uint32_t*)(0x38E00018 + 0x1000 * (v))))
110
#define VICSOFTINTCLEAR(v)    (*((volatile uint32_t*)(0x38E0001C + 0x1000 * (v))))
111
#define VICPROTECTION(v)      (*((volatile uint32_t*)(0x38E00020 + 0x1000 * (v))))
112
#define VICSWPRIORITYMASK(v)  (*((volatile uint32_t*)(0x38E00024 + 0x1000 * (v))))
113
#define VICPRIORITYDAISY(v)   (*((volatile uint32_t*)(0x38E00028 + 0x1000 * (v))))
114
#define VICVECTADDR(v, i)     (*((volatile uint32_t*)(0x38E00100 + 0x1000 * (v) + 4 * (i))))
115
#define VICVECTPRIORITY(v, i) (*((volatile uint32_t*)(0x38E00200 + 0x1000 * (v) + 4 * (i))))
116
#define VICADDRESS(v)         (*((volatile uint32_t*)(0x38E00F00 + 0x1000 * (v))))
117
#define VIC0IRQSTATUS         (*((volatile uint32_t*)(0x38E00000)))
118
#define VIC0FIQSTATUS         (*((volatile uint32_t*)(0x38E00004)))
119
#define VIC0RAWINTR           (*((volatile uint32_t*)(0x38E00008)))
120
#define VIC0INTSELECT         (*((volatile uint32_t*)(0x38E0000C)))
121
#define VIC0INTENABLE         (*((volatile uint32_t*)(0x38E00010)))
122
#define VIC0INTENCLEAR        (*((volatile uint32_t*)(0x38E00014)))
123
#define VIC0SOFTINT           (*((volatile uint32_t*)(0x38E00018)))
124
#define VIC0SOFTINTCLEAR      (*((volatile uint32_t*)(0x38E0001C)))
125
#define VIC0PROTECTION        (*((volatile uint32_t*)(0x38E00020)))
126
#define VIC0SWPRIORITYMASK    (*((volatile uint32_t*)(0x38E00024)))
127
#define VIC0PRIORITYDAISY     (*((volatile uint32_t*)(0x38E00028)))
128
#define VIC0VECTADDR(i)       (*((volatile uint32_t*)(0x38E00100 + 4 * (i))))
129
#define VIC0VECTADDR0         (*((volatile uint32_t*)(0x38E00100)))
130
#define VIC0VECTADDR1         (*((volatile uint32_t*)(0x38E00104)))
131
#define VIC0VECTADDR2         (*((volatile uint32_t*)(0x38E00108)))
132
#define VIC0VECTADDR3         (*((volatile uint32_t*)(0x38E0010C)))
133
#define VIC0VECTADDR4         (*((volatile uint32_t*)(0x38E00110)))
134
#define VIC0VECTADDR5         (*((volatile uint32_t*)(0x38E00114)))
135
#define VIC0VECTADDR6         (*((volatile uint32_t*)(0x38E00118)))
136
#define VIC0VECTADDR7         (*((volatile uint32_t*)(0x38E0011C)))
137
#define VIC0VECTADDR8         (*((volatile uint32_t*)(0x38E00120)))
138
#define VIC0VECTADDR9         (*((volatile uint32_t*)(0x38E00124)))
139
#define VIC0VECTADDR10        (*((volatile uint32_t*)(0x38E00128)))
140
#define VIC0VECTADDR11        (*((volatile uint32_t*)(0x38E0012C)))
141
#define VIC0VECTADDR12        (*((volatile uint32_t*)(0x38E00130)))
142
#define VIC0VECTADDR13        (*((volatile uint32_t*)(0x38E00134)))
143
#define VIC0VECTADDR14        (*((volatile uint32_t*)(0x38E00138)))
144
#define VIC0VECTADDR15        (*((volatile uint32_t*)(0x38E0013C)))
145
#define VIC0VECTADDR16        (*((volatile uint32_t*)(0x38E00140)))
146
#define VIC0VECTADDR17        (*((volatile uint32_t*)(0x38E00144)))
147
#define VIC0VECTADDR18        (*((volatile uint32_t*)(0x38E00148)))
148
#define VIC0VECTADDR19        (*((volatile uint32_t*)(0x38E0014C)))
149
#define VIC0VECTADDR20        (*((volatile uint32_t*)(0x38E00150)))
150
#define VIC0VECTADDR21        (*((volatile uint32_t*)(0x38E00154)))
151
#define VIC0VECTADDR22        (*((volatile uint32_t*)(0x38E00158)))
152
#define VIC0VECTADDR23        (*((volatile uint32_t*)(0x38E0015C)))
153
#define VIC0VECTADDR24        (*((volatile uint32_t*)(0x38E00160)))
154
#define VIC0VECTADDR25        (*((volatile uint32_t*)(0x38E00164)))
155
#define VIC0VECTADDR26        (*((volatile uint32_t*)(0x38E00168)))
156
#define VIC0VECTADDR27        (*((volatile uint32_t*)(0x38E0016C)))
157
#define VIC0VECTADDR28        (*((volatile uint32_t*)(0x38E00170)))
158
#define VIC0VECTADDR29        (*((volatile uint32_t*)(0x38E00174)))
159
#define VIC0VECTADDR30        (*((volatile uint32_t*)(0x38E00178)))
160
#define VIC0VECTADDR31        (*((volatile uint32_t*)(0x38E0017C)))
161
#define VIC0VECTPRIORITY(i)   (*((volatile uint32_t*)(0x38E00200 + 4 * (i))))
162
#define VIC0VECTPRIORITY0     (*((volatile uint32_t*)(0x38E00200)))
163
#define VIC0VECTPRIORITY1     (*((volatile uint32_t*)(0x38E00204)))
164
#define VIC0VECTPRIORITY2     (*((volatile uint32_t*)(0x38E00208)))
165
#define VIC0VECTPRIORITY3     (*((volatile uint32_t*)(0x38E0020C)))
166
#define VIC0VECTPRIORITY4     (*((volatile uint32_t*)(0x38E00210)))
167
#define VIC0VECTPRIORITY5     (*((volatile uint32_t*)(0x38E00214)))
168
#define VIC0VECTPRIORITY6     (*((volatile uint32_t*)(0x38E00218)))
169
#define VIC0VECTPRIORITY7     (*((volatile uint32_t*)(0x38E0021C)))
170
#define VIC0VECTPRIORITY8     (*((volatile uint32_t*)(0x38E00220)))
171
#define VIC0VECTPRIORITY9     (*((volatile uint32_t*)(0x38E00224)))
172
#define VIC0VECTPRIORITY10    (*((volatile uint32_t*)(0x38E00228)))
173
#define VIC0VECTPRIORITY11    (*((volatile uint32_t*)(0x38E0022C)))
174
#define VIC0VECTPRIORITY12    (*((volatile uint32_t*)(0x38E00230)))
175
#define VIC0VECTPRIORITY13    (*((volatile uint32_t*)(0x38E00234)))
176
#define VIC0VECTPRIORITY14    (*((volatile uint32_t*)(0x38E00238)))
177
#define VIC0VECTPRIORITY15    (*((volatile uint32_t*)(0x38E0023C)))
178
#define VIC0VECTPRIORITY16    (*((volatile uint32_t*)(0x38E00240)))
179
#define VIC0VECTPRIORITY17    (*((volatile uint32_t*)(0x38E00244)))
180
#define VIC0VECTPRIORITY18    (*((volatile uint32_t*)(0x38E00248)))
181
#define VIC0VECTPRIORITY19    (*((volatile uint32_t*)(0x38E0024C)))
182
#define VIC0VECTPRIORITY20    (*((volatile uint32_t*)(0x38E00250)))
183
#define VIC0VECTPRIORITY21    (*((volatile uint32_t*)(0x38E00254)))
184
#define VIC0VECTPRIORITY22    (*((volatile uint32_t*)(0x38E00258)))
185
#define VIC0VECTPRIORITY23    (*((volatile uint32_t*)(0x38E0025C)))
186
#define VIC0VECTPRIORITY24    (*((volatile uint32_t*)(0x38E00260)))
187
#define VIC0VECTPRIORITY25    (*((volatile uint32_t*)(0x38E00264)))
188
#define VIC0VECTPRIORITY26    (*((volatile uint32_t*)(0x38E00268)))
189
#define VIC0VECTPRIORITY27    (*((volatile uint32_t*)(0x38E0026C)))
190
#define VIC0VECTPRIORITY28    (*((volatile uint32_t*)(0x38E00270)))
191
#define VIC0VECTPRIORITY29    (*((volatile uint32_t*)(0x38E00274)))
192
#define VIC0VECTPRIORITY30    (*((volatile uint32_t*)(0x38E00278)))
193
#define VIC0VECTPRIORITY31    (*((volatile uint32_t*)(0x38E0027C)))
194
#define VIC0ADDRESS           (*((volatile uint32_t*)(0x38E00F00)))
195
#define VIC1IRQSTATUS         (*((volatile uint32_t*)(0x38E01000)))
196
#define VIC1FIQSTATUS         (*((volatile uint32_t*)(0x38E01004)))
197
#define VIC1RAWINTR           (*((volatile uint32_t*)(0x38E01008)))
198
#define VIC1INTSELECT         (*((volatile uint32_t*)(0x38E0100C)))
199
#define VIC1INTENABLE         (*((volatile uint32_t*)(0x38E01010)))
200
#define VIC1INTENCLEAR        (*((volatile uint32_t*)(0x38E01014)))
201
#define VIC1SOFTINT           (*((volatile uint32_t*)(0x38E01018)))
202
#define VIC1SOFTINTCLEAR      (*((volatile uint32_t*)(0x38E0101C)))
203
#define VIC1PROTECTION        (*((volatile uint32_t*)(0x38E01020)))
204
#define VIC1SWPRIORITYMASK    (*((volatile uint32_t*)(0x38E01024)))
205
#define VIC1PRIORITYDAISY     (*((volatile uint32_t*)(0x38E01028)))
206
#define VIC1VECTADDR(i)       (*((volatile uint32_t*)(0x38E01100 + 4 * (i))))
207
#define VIC1VECTADDR0         (*((volatile uint32_t*)(0x38E01100)))
208
#define VIC1VECTADDR1         (*((volatile uint32_t*)(0x38E01104)))
209
#define VIC1VECTADDR2         (*((volatile uint32_t*)(0x38E01108)))
210
#define VIC1VECTADDR3         (*((volatile uint32_t*)(0x38E0110C)))
211
#define VIC1VECTADDR4         (*((volatile uint32_t*)(0x38E01110)))
212
#define VIC1VECTADDR5         (*((volatile uint32_t*)(0x38E01114)))
213
#define VIC1VECTADDR6         (*((volatile uint32_t*)(0x38E01118)))
214
#define VIC1VECTADDR7         (*((volatile uint32_t*)(0x38E0111C)))
215
#define VIC1VECTADDR8         (*((volatile uint32_t*)(0x38E01120)))
216
#define VIC1VECTADDR9         (*((volatile uint32_t*)(0x38E01124)))
217
#define VIC1VECTADDR10        (*((volatile uint32_t*)(0x38E01128)))
218
#define VIC1VECTADDR11        (*((volatile uint32_t*)(0x38E0112C)))
219
#define VIC1VECTADDR12        (*((volatile uint32_t*)(0x38E01130)))
220
#define VIC1VECTADDR13        (*((volatile uint32_t*)(0x38E01134)))
221
#define VIC1VECTADDR14        (*((volatile uint32_t*)(0x38E01138)))
222
#define VIC1VECTADDR15        (*((volatile uint32_t*)(0x38E0113C)))
223
#define VIC1VECTADDR16        (*((volatile uint32_t*)(0x38E01140)))
224
#define VIC1VECTADDR17        (*((volatile uint32_t*)(0x38E01144)))
225
#define VIC1VECTADDR18        (*((volatile uint32_t*)(0x38E01148)))
226
#define VIC1VECTADDR19        (*((volatile uint32_t*)(0x38E0114C)))
227
#define VIC1VECTADDR20        (*((volatile uint32_t*)(0x38E01150)))
228
#define VIC1VECTADDR21        (*((volatile uint32_t*)(0x38E01154)))
229
#define VIC1VECTADDR22        (*((volatile uint32_t*)(0x38E01158)))
230
#define VIC1VECTADDR23        (*((volatile uint32_t*)(0x38E0115C)))
231
#define VIC1VECTADDR24        (*((volatile uint32_t*)(0x38E01160)))
232
#define VIC1VECTADDR25        (*((volatile uint32_t*)(0x38E01164)))
233
#define VIC1VECTADDR26        (*((volatile uint32_t*)(0x38E01168)))
234
#define VIC1VECTADDR27        (*((volatile uint32_t*)(0x38E0116C)))
235
#define VIC1VECTADDR28        (*((volatile uint32_t*)(0x38E01170)))
236
#define VIC1VECTADDR29        (*((volatile uint32_t*)(0x38E01174)))
237
#define VIC1VECTADDR30        (*((volatile uint32_t*)(0x38E01178)))
238
#define VIC1VECTADDR31        (*((volatile uint32_t*)(0x38E0117C)))
239
#define VIC1VECTPRIORITY(i)   (*((volatile uint32_t*)(0x38E01200 + 4 * (i))))
240
#define VIC1VECTPRIORITY0     (*((volatile uint32_t*)(0x38E01200)))
241
#define VIC1VECTPRIORITY1     (*((volatile uint32_t*)(0x38E01204)))
242
#define VIC1VECTPRIORITY2     (*((volatile uint32_t*)(0x38E01208)))
243
#define VIC1VECTPRIORITY3     (*((volatile uint32_t*)(0x38E0120C)))
244
#define VIC1VECTPRIORITY4     (*((volatile uint32_t*)(0x38E01210)))
245
#define VIC1VECTPRIORITY5     (*((volatile uint32_t*)(0x38E01214)))
246
#define VIC1VECTPRIORITY6     (*((volatile uint32_t*)(0x38E01218)))
247
#define VIC1VECTPRIORITY7     (*((volatile uint32_t*)(0x38E0121C)))
248
#define VIC1VECTPRIORITY8     (*((volatile uint32_t*)(0x38E01220)))
249
#define VIC1VECTPRIORITY9     (*((volatile uint32_t*)(0x38E01224)))
250
#define VIC1VECTPRIORITY10    (*((volatile uint32_t*)(0x38E01228)))
251
#define VIC1VECTPRIORITY11    (*((volatile uint32_t*)(0x38E0122C)))
252
#define VIC1VECTPRIORITY12    (*((volatile uint32_t*)(0x38E01230)))
253
#define VIC1VECTPRIORITY13    (*((volatile uint32_t*)(0x38E01234)))
254
#define VIC1VECTPRIORITY14    (*((volatile uint32_t*)(0x38E01238)))
255
#define VIC1VECTPRIORITY15    (*((volatile uint32_t*)(0x38E0123C)))
256
#define VIC1VECTPRIORITY16    (*((volatile uint32_t*)(0x38E01240)))
257
#define VIC1VECTPRIORITY17    (*((volatile uint32_t*)(0x38E01244)))
258
#define VIC1VECTPRIORITY18    (*((volatile uint32_t*)(0x38E01248)))
259
#define VIC1VECTPRIORITY19    (*((volatile uint32_t*)(0x38E0124C)))
260
#define VIC1VECTPRIORITY20    (*((volatile uint32_t*)(0x38E01250)))
261
#define VIC1VECTPRIORITY21    (*((volatile uint32_t*)(0x38E01254)))
262
#define VIC1VECTPRIORITY22    (*((volatile uint32_t*)(0x38E01258)))
263
#define VIC1VECTPRIORITY23    (*((volatile uint32_t*)(0x38E0125C)))
264
#define VIC1VECTPRIORITY24    (*((volatile uint32_t*)(0x38E01260)))
265
#define VIC1VECTPRIORITY25    (*((volatile uint32_t*)(0x38E01264)))
266
#define VIC1VECTPRIORITY26    (*((volatile uint32_t*)(0x38E01268)))
267
#define VIC1VECTPRIORITY27    (*((volatile uint32_t*)(0x38E0126C)))
268
#define VIC1VECTPRIORITY28    (*((volatile uint32_t*)(0x38E01270)))
269
#define VIC1VECTPRIORITY29    (*((volatile uint32_t*)(0x38E01274)))
270
#define VIC1VECTPRIORITY30    (*((volatile uint32_t*)(0x38E01278)))
271
#define VIC1VECTPRIORITY31    (*((volatile uint32_t*)(0x38E0127C)))
272
#define VIC1ADDRESS           (*((volatile uint32_t*)(0x38E01F00)))
87 theseven 273
 
274
 
275
/////CLOCK GATES/////
276
#define CLOCKGATE_USB_1 2
277
#define CLOCKGATE_USB_2 35
278
 
279
 
280
/////INTERRUPTS/////
85 theseven 281
#define IRQ_TIMER 8
282
#define IRQ_USB_FUNC 19
283
 
284
 
285
#endif