summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-2.6.18/add-hmatrix-support.patch
blob: 4387cac0b8e3d5348bb7b8f4c9f84342dcad159e (plain)
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
---
 arch/avr32/mach-at32ap/hmatrix2.h |  377 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 377 insertions(+)

Index: linux-2.6.18/arch/avr32/mach-at32ap/hmatrix2.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.18/arch/avr32/mach-at32ap/hmatrix2.h	2006-11-03 14:57:10.000000000 +0100
@@ -0,0 +1,377 @@
+/*
+ * Register definitions for HMATRIX2
+ *
+ * AHB Matrix
+ */
+#ifndef __ASM_AVR32_HMATRIX2_H__
+#define __ASM_AVR32_HMATRIX2_H__
+
+/* HMATRIX2 base address */
+#define HMATRIX2_BASE				(void *)0xfff00800
+
+/* HMATRIX2 register offsets */
+#define HMATRIX2_MCFG0                          0x0000
+#define HMATRIX2_MCFG1                          0x0004
+#define HMATRIX2_MCFG2                          0x0008
+#define HMATRIX2_MCFG3                          0x000c
+#define HMATRIX2_MCFG4                          0x0010
+#define HMATRIX2_MCFG5                          0x0014
+#define HMATRIX2_MCFG6                          0x0018
+#define HMATRIX2_MCFG7                          0x001c
+#define HMATRIX2_MCFG8                          0x0020
+#define HMATRIX2_MCFG9                          0x0024
+#define HMATRIX2_MCFG10                         0x0028
+#define HMATRIX2_MCFG11                         0x002c
+#define HMATRIX2_MCFG12                         0x0030
+#define HMATRIX2_MCFG13                         0x0034
+#define HMATRIX2_MCFG14                         0x0038
+#define HMATRIX2_MCFG15                         0x003c
+#define HMATRIX2_SCFG0                          0x0040
+#define HMATRIX2_SCFG1                          0x0044
+#define HMATRIX2_SCFG2                          0x0048
+#define HMATRIX2_SCFG3                          0x004c
+#define HMATRIX2_SCFG4                          0x0050
+#define HMATRIX2_SCFG5                          0x0054
+#define HMATRIX2_SCFG6                          0x0058
+#define HMATRIX2_SCFG7                          0x005c
+#define HMATRIX2_SCFG8                          0x0060
+#define HMATRIX2_SCFG9                          0x0064
+#define HMATRIX2_SCFG10                         0x0068
+#define HMATRIX2_SCFG11                         0x006c
+#define HMATRIX2_SCFG12                         0x0070
+#define HMATRIX2_SCFG13                         0x0074
+#define HMATRIX2_SCFG14                         0x0078
+#define HMATRIX2_SCFG15                         0x007c
+#define HMATRIX2_PRAS                           0x0080
+#define HMATRIX2_PRBS                           0x0084
+#define HMATRIX2_PRAS1                          0x0088
+#define HMATRIX2_PRBS1                          0x008c
+#define HMATRIX2_PRAS2                          0x0090
+#define HMATRIX2_PRBS2                          0x0094
+#define HMATRIX2_PRAS3                          0x0098
+#define HMATRIX2_PRBS3                          0x009c
+#define HMATRIX2_PRAS4                          0x00a0
+#define HMATRIX2_PRBS4                          0x00a4
+#define HMATRIX2_PRAS5                          0x00a8
+#define HMATRIX2_PRBS5                          0x00ac
+#define HMATRIX2_PRAS6                          0x00b0
+#define HMATRIX2_PRBS6                          0x00b4
+#define HMATRIX2_PRAS7                          0x00b8
+#define HMATRIX2_PRBS7                          0x00bc
+#define HMATRIX2_PRAS8                          0x00c0
+#define HMATRIX2_PRBS8                          0x00c4
+#define HMATRIX2_PRAS9                          0x00c8
+#define HMATRIX2_PRBS9                          0x00cc
+#define HMATRIX2_PRAS10                         0x00d0
+#define HMATRIX2_PRBS10                         0x00d4
+#define HMATRIX2_PRAS11                         0x00d8
+#define HMATRIX2_PRBS11                         0x00dc
+#define HMATRIX2_PRAS12                         0x00e0
+#define HMATRIX2_PRBS12                         0x00e4
+#define HMATRIX2_PRAS13                         0x00e8
+#define HMATRIX2_PRBS13                         0x00ec
+#define HMATRIX2_PRAS14                         0x00f0
+#define HMATRIX2_PRBS14                         0x00f4
+#define HMATRIX2_PRAS15                         0x00f8
+#define HMATRIX2_PRBS15                         0x00fc
+#define HMATRIX2_MRCR                           0x0100
+#define HMATRIX2_SFR0                           0x0110
+#define HMATRIX2_SFR1                           0x0114
+#define HMATRIX2_SFR2                           0x0118
+#define HMATRIX2_SFR3                           0x011c
+#define HMATRIX2_SFR4                           0x0120
+#define HMATRIX2_SFR5                           0x0124
+#define HMATRIX2_SFR6                           0x0128
+#define HMATRIX2_SFR7                           0x012c
+#define HMATRIX2_SFR8                           0x0130
+#define HMATRIX2_SFR9                           0x0134
+#define HMATRIX2_SFR10                          0x0138
+#define HMATRIX2_SFR11                          0x013c
+#define HMATRIX2_SFR12                          0x0140
+#define HMATRIX2_SFR13                          0x0144
+#define HMATRIX2_SFR14                          0x0148
+#define HMATRIX2_SFR15                          0x014c
+#define HMATRIX2_VERSION                        0x01fc
+
+/* Bitfields in MCFG0 */
+#define HMATRIX2_ULBT_OFFSET                    0
+#define HMATRIX2_ULBT_SIZE                      3
+
+/* Bitfields in MCFG1 */
+
+/* Bitfields in MCFG2 */
+
+/* Bitfields in MCFG3 */
+
+/* Bitfields in MCFG4 */
+
+/* Bitfields in MCFG5 */
+
+/* Bitfields in MCFG6 */
+
+/* Bitfields in MCFG7 */
+
+/* Bitfields in MCFG8 */
+
+/* Bitfields in MCFG9 */
+
+/* Bitfields in MCFG10 */
+
+/* Bitfields in MCFG11 */
+
+/* Bitfields in MCFG12 */
+
+/* Bitfields in MCFG13 */
+
+/* Bitfields in MCFG14 */
+
+/* Bitfields in MCFG15 */
+
+/* Bitfields in SCFG0 */
+#define HMATRIX2_SLOT_CYCLE_OFFSET              0
+#define HMATRIX2_SLOT_CYCLE_SIZE                8
+#define HMATRIX2_DEFMSTR_TYPE_OFFSET            16
+#define HMATRIX2_DEFMSTR_TYPE_SIZE              2
+#define HMATRIX2_FIXED_DEFMSTR_OFFSET           18
+#define HMATRIX2_FIXED_DEFMSTR_SIZE             4
+#define HMATRIX2_ARBT_OFFSET                    24
+#define HMATRIX2_ARBT_SIZE                      2
+
+/* Bitfields in SCFG1 */
+
+/* Bitfields in SCFG2 */
+
+/* Bitfields in SCFG3 */
+
+/* Bitfields in SCFG4 */
+
+/* Bitfields in SCFG5 */
+
+/* Bitfields in SCFG6 */
+
+/* Bitfields in SCFG7 */
+
+/* Bitfields in SCFG8 */
+
+/* Bitfields in SCFG9 */
+
+/* Bitfields in SCFG10 */
+
+/* Bitfields in SCFG11 */
+
+/* Bitfields in SCFG12 */
+
+/* Bitfields in SCFG13 */
+
+/* Bitfields in SCFG14 */
+
+/* Bitfields in SCFG15 */
+
+/* Bitfields in PRAS */
+#define HMATRIX2_M0PR_OFFSET                    0
+#define HMATRIX2_M0PR_SIZE                      4
+#define HMATRIX2_M1PR_OFFSET                    4
+#define HMATRIX2_M1PR_SIZE                      4
+#define HMATRIX2_M2PR_OFFSET                    8
+#define HMATRIX2_M2PR_SIZE                      4
+#define HMATRIX2_M3PR_OFFSET                    12
+#define HMATRIX2_M3PR_SIZE                      4
+#define HMATRIX2_M4PR_OFFSET                    16
+#define HMATRIX2_M4PR_SIZE                      4
+#define HMATRIX2_M5PR_OFFSET                    20
+#define HMATRIX2_M5PR_SIZE                      4
+#define HMATRIX2_M6PR_OFFSET                    24
+#define HMATRIX2_M6PR_SIZE                      4
+#define HMATRIX2_M7PR_OFFSET                    28
+#define HMATRIX2_M7PR_SIZE                      4
+
+/* Bitfields in PRBS */
+#define HMATRIX2_M8PR_OFFSET                    0
+#define HMATRIX2_M8PR_SIZE                      4
+#define HMATRIX2_M9PR_OFFSET                    4
+#define HMATRIX2_M9PR_SIZE                      4
+#define HMATRIX2_M10PR_OFFSET                   8
+#define HMATRIX2_M10PR_SIZE                     4
+#define HMATRIX2_M11PR_OFFSET                   12
+#define HMATRIX2_M11PR_SIZE                     4
+#define HMATRIX2_M12PR_OFFSET                   16
+#define HMATRIX2_M12PR_SIZE                     4
+#define HMATRIX2_M13PR_OFFSET                   20
+#define HMATRIX2_M13PR_SIZE                     4
+#define HMATRIX2_M14PR_OFFSET                   24
+#define HMATRIX2_M14PR_SIZE                     4
+#define HMATRIX2_M15PR_OFFSET                   28
+#define HMATRIX2_M15PR_SIZE                     4
+
+/* Bitfields in PRAS1 */
+
+/* Bitfields in PRBS1 */
+
+/* Bitfields in PRAS2 */
+
+/* Bitfields in PRBS2 */
+
+/* Bitfields in PRAS3 */
+
+/* Bitfields in PRBS3 */
+
+/* Bitfields in PRAS4 */
+
+/* Bitfields in PRBS4 */
+
+/* Bitfields in PRAS5 */
+
+/* Bitfields in PRBS5 */
+
+/* Bitfields in PRAS6 */
+
+/* Bitfields in PRBS6 */
+
+/* Bitfields in PRAS7 */
+
+/* Bitfields in PRBS7 */
+
+/* Bitfields in PRAS8 */
+
+/* Bitfields in PRBS8 */
+
+/* Bitfields in PRAS9 */
+
+/* Bitfields in PRBS9 */
+
+/* Bitfields in PRAS10 */
+
+/* Bitfields in PRBS10 */
+
+/* Bitfields in PRAS11 */
+
+/* Bitfields in PRBS11 */
+
+/* Bitfields in PRAS12 */
+
+/* Bitfields in PRBS12 */
+
+/* Bitfields in PRAS13 */
+
+/* Bitfields in PRBS13 */
+
+/* Bitfields in PRAS14 */
+
+/* Bitfields in PRBS14 */
+
+/* Bitfields in PRAS15 */
+
+/* Bitfields in PRBS15 */
+
+/* Bitfields in MRCR */
+#define HMATRIX2_RBC0_OFFSET                    0
+#define HMATRIX2_RBC0_SIZE                      1
+#define HMATRIX2_RBC1_OFFSET                    1
+#define HMATRIX2_RBC1_SIZE                      1
+#define HMATRIX2_RBC2_OFFSET                    2
+#define HMATRIX2_RBC2_SIZE                      1
+#define HMATRIX2_RBC3_OFFSET                    3
+#define HMATRIX2_RBC3_SIZE                      1
+#define HMATRIX2_RBC4_OFFSET                    4
+#define HMATRIX2_RBC4_SIZE                      1
+#define HMATRIX2_RBC5_OFFSET                    5
+#define HMATRIX2_RBC5_SIZE                      1
+#define HMATRIX2_RBC6_OFFSET                    6
+#define HMATRIX2_RBC6_SIZE                      1
+#define HMATRIX2_RBC7_OFFSET                    7
+#define HMATRIX2_RBC7_SIZE                      1
+#define HMATRIX2_RBC8_OFFSET                    8
+#define HMATRIX2_RBC8_SIZE                      1
+#define HMATRIX2_RBC9_OFFSET                    9
+#define HMATRIX2_RBC9_SIZE                      1
+#define HMATRIX2_RBC10_OFFSET                   10
+#define HMATRIX2_RBC10_SIZE                     1
+#define HMATRIX2_RBC11_OFFSET                   11
+#define HMATRIX2_RBC11_SIZE                     1
+#define HMATRIX2_RBC12_OFFSET                   12
+#define HMATRIX2_RBC12_SIZE                     1
+#define HMATRIX2_RBC13_OFFSET                   13
+#define HMATRIX2_RBC13_SIZE                     1
+#define HMATRIX2_RBC14_OFFSET                   14
+#define HMATRIX2_RBC14_SIZE                     1
+#define HMATRIX2_RBC15_OFFSET                   15
+#define HMATRIX2_RBC15_SIZE                     1
+
+/* Bitfields in SFR0 */
+#define HMATRIX2_SFR_OFFSET                     0
+#define HMATRIX2_SFR_SIZE                       32
+
+/* Bitfields in SFR1 */
+
+/* Bitfields in SFR2 */
+
+/* Bitfields in SFR3 */
+
+/* Bitfields in SFR4 */
+#define HMATRIX2_CS1A_OFFSET                    1
+#define HMATRIX2_CS1A_SIZE                      1
+#define HMATRIX2_CS3A_OFFSET                    3
+#define HMATRIX2_CS3A_SIZE                      1
+#define HMATRIX2_CS4A_OFFSET                    4
+#define HMATRIX2_CS4A_SIZE                      1
+#define HMATRIX2_CS5A_OFFSET                    5
+#define HMATRIX2_CS5A_SIZE                      1
+#define HMATRIX2_DBPUC_OFFSET                   8
+#define HMATRIX2_DBPUC_SIZE                     1
+
+/* Bitfields in SFR5 */
+
+/* Bitfields in SFR6 */
+
+/* Bitfields in SFR7 */
+
+/* Bitfields in SFR8 */
+
+/* Bitfields in SFR9 */
+
+/* Bitfields in SFR10 */
+
+/* Bitfields in SFR11 */
+
+/* Bitfields in SFR12 */
+
+/* Bitfields in SFR13 */
+
+/* Bitfields in SFR14 */
+
+/* Bitfields in SFR15 */
+
+/* Bitfields in VERSION */
+#define HMATRIX2_VERSION_OFFSET                 0
+#define HMATRIX2_VERSION_SIZE                   12
+#define HMATRIX2_MFN_OFFSET                     16
+#define HMATRIX2_MFN_SIZE                       3
+
+/* Constants for ULBT */
+#define HMATRIX2_ULBT_INFINITE                  0
+#define HMATRIX2_ULBT_SINGLE                    1
+#define HMATRIX2_ULBT_FOUR_BEAT                 2
+#define HMATRIX2_ULBT_SIXTEEN_BEAT              4
+
+/* Constants for DEFMSTR_TYPE */
+#define HMATRIX2_DEFMSTR_TYPE_NO_DEFAULT        0
+#define HMATRIX2_DEFMSTR_TYPE_LAST_DEFAULT      1
+#define HMATRIX2_DEFMSTR_TYPE_FIXED_DEFAULT     2
+
+/* Constants for ARBT */
+#define HMATRIX2_ARBT_ROUND_ROBIN               0
+#define HMATRIX2_ARBT_FIXED_PRIORITY            1
+
+/* Bit manipulation macros */
+#define HMATRIX2_BIT(name)                      (1 << HMATRIX2_##name##_OFFSET)
+#define HMATRIX2_BF(name,value)                 (((value) & ((1 << HMATRIX2_##name##_SIZE) - 1)) << HMATRIX2_##name##_OFFSET)
+#define HMATRIX2_BFEXT(name,value)              (((value) >> HMATRIX2_##name##_OFFSET) & ((1 << HMATRIX2_##name##_SIZE) - 1))
+#define HMATRIX2_BFINS(name,value,old)          (((old) & ~(((1 << HMATRIX2_##name##_SIZE) - 1) << HMATRIX2_##name##_OFFSET)) | HMATRIX2_BF(name,value))
+
+/* Register access macros */
+#define hmatrix2_readl(base,reg)			\
+	__raw_readl(base + HMATRIX2_##reg)
+#define hmatrix2_writel(base,reg,value)			\
+	__raw_writel((value), base + HMATRIX2_##reg)
+
+#endif /* __ASM_AVR32_HMATRIX2_H__ */
Index: linux-2.6.18/arch/avr32/mach-at32ap/at32ap7000.c
===================================================================
--- linux-2.6.18.orig/arch/avr32/mach-at32ap/at32ap7000.c	2006-11-03 14:57:26.000000000 +0100
+++ linux-2.6.18/arch/avr32/mach-at32ap/at32ap7000.c	2006-11-03 15:25:01.000000000 +0100
@@ -466,6 +466,15 @@
 	.users		= 1,
 };
 
+static struct clk hmatrix2_clk = {
+	.name		= "hmatrix2",
+	.parent		= &pbb_clk,
+	.mode		= pbb_clk_mode,
+	.get_rate	= pbb_clk_get_rate,
+	.users		= 1,
+	.index		= 2,
+};
+
 static struct resource dmac0_resource[] = {
 	{
 		.start	= 0xff200000,
@@ -1096,6 +1096,7 @@
 	&pdc_pclk,
 	&dmac0_hclk,
 	&pico_clk,
+	&hmatrix2_clk,
 	&pio0_mck,
 	&pio1_mck,
 	&pio2_mck,