summaryrefslogtreecommitdiffstats
path: root/arch/hexagon/kernel/vm_init_segtable.S
blob: 80967f2192b37aee002b0f05c0aff64cd5e02f16 (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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
/*
 * Initial page table for Linux kernel under Hexagon VM,
 *
 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

/*
 * These tables are pre-computed and linked into kernel.
 */

#include <asm/vm_mmu.h>
/*  #include <asm/iomap.h>  */

/*
 * Start with mapping PA=0 to both VA=0x0 and VA=0xc000000 as 16MB large pages.
 * No user mode access, RWX, write-back cache.  The entry needs
 * to be replicated for all 4 virtual segments mapping to the page.
 */

/* "Big Kernel Page"  */
#define BKP(pa) (((pa) & __HVM_PTE_PGMASK_4MB)		\
		| __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X	\
		| __HEXAGON_C_WB_L2 << 6			\
		| __HVM_PDE_S_16MB)

/*  No cache version  */

#define BKPG_IO(pa) (((pa) & __HVM_PTE_PGMASK_16MB) \
			| __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X \
			| __HVM_PDE_S_16MB | __HEXAGON_C_DEV << 6 )

#define FOURK_IO(pa) (((pa) & __HVM_PTE_PGMASK_4KB) \
			| __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X \
			| __HEXAGON_C_DEV << 6 )

#define L2_PTR(pa) (((pa) & __HVM_PTE_PGMASK_4KB) \
			| __HVM_PDE_S_4KB  )

#define X __HVM_PDE_S_INVALID

	.p2align 12
	.globl swapper_pg_dir
	.globl _K_init_segtable
swapper_pg_dir:
/* VA 0x00000000 */
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
	.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X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X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
	.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
	.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
	.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
	.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
/*0xa8*/.word X,X,X,X
#ifdef CONFIG_COMET_EARLY_UART_DEBUG
UART_PTE_ENTRY:
/*0xa9*/.word BKPG_IO(0xa9000000),BKPG_IO(0xa9000000),BKPG_IO(0xa9000000),BKPG_IO(0xa9000000)
#else
/*0xa9*/.word X,X,X,X
#endif
/*0xaa*/.word X,X,X,X
/*0xab*/.word X,X,X,X
/*0xac*/.word X,X,X,X
/*0xad*/.word X,X,X,X
/*0xae*/.word X,X,X,X
/*0xaf*/.word X,X,X,X
/*0xb0*/.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
	.word X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X
_K_init_segtable:
/* VA 0xC0000000 */
	.word BKP(0x00000000), BKP(0x00400000), BKP(0x00800000), BKP(0x00c00000)
	.word BKP(0x01000000), BKP(0x01400000), BKP(0x01800000), BKP(0x01c00000)
	.word BKP(0x02000000), BKP(0x02400000), BKP(0x02800000), BKP(0x02c00000)
	.word BKP(0x03000000), BKP(0x03400000), BKP(0x03800000), BKP(0x03c00000)
	.word BKP(0x04000000), BKP(0x04400000), BKP(0x04800000), BKP(0x04c00000)
	.word BKP(0x05000000), BKP(0x05400000), BKP(0x05800000), BKP(0x05c00000)
	.word BKP(0x06000000), BKP(0x06400000), BKP(0x06800000), BKP(0x06c00000)
	.word BKP(0x07000000), BKP(0x07400000), BKP(0x07800000), BKP(0x07c00000)

	.word BKP(0x08000000), BKP(0x08400000), BKP(0x08800000), BKP(0x08c00000)
	.word BKP(0x09000000), BKP(0x09400000), BKP(0x09800000), BKP(0x09c00000)
	.word BKP(0x0a000000), BKP(0x0a400000), BKP(0x0a800000), BKP(0x0ac00000)
	.word BKP(0x0b000000), BKP(0x0b400000), BKP(0x0b800000), BKP(0x0bc00000)
	.word BKP(0x0c000000), BKP(0x0c400000), BKP(0x0c800000), BKP(0x0cc00000)
	.word BKP(0x0d000000), BKP(0x0d400000), BKP(0x0d800000), BKP(0x0dc00000)
	.word BKP(0x0e000000), BKP(0x0e400000), BKP(0x0e800000), BKP(0x0ec00000)
	.word BKP(0x0f000000), BKP(0x0f400000), BKP(0x0f800000), BKP(0x0fc00000)

	.word BKP(0x10000000), BKP(0x10400000), BKP(0x10800000), BKP(0x10c00000)
	.word BKP(0x11000000), BKP(0x11400000), BKP(0x11800000), BKP(0x11c00000)
	.word BKP(0x12000000), BKP(0x12400000), BKP(0x12800000), BKP(0x12c00000)
	.word BKP(0x13000000), BKP(0x13400000), BKP(0x13800000), BKP(0x13c00000)
	.word BKP(0x14000000), BKP(0x14400000), BKP(0x14800000), BKP(0x14c00000)
	.word BKP(0x15000000), BKP(0x15400000), BKP(0x15800000), BKP(0x15c00000)
	.word BKP(0x16000000), BKP(0x16400000), BKP(0x16800000), BKP(0x16c00000)
	.word BKP(0x17000000), BKP(0x17400000), BKP(0x17800000), BKP(0x17c00000)

	.word BKP(0x18000000), BKP(0x18400000), BKP(0x18800000), BKP(0x18c00000)
	.word BKP(0x19000000), BKP(0x19400000), BKP(0x19800000), BKP(0x19c00000)
	.word BKP(0x1a000000), BKP(0x1a400000), BKP(0x1a800000), BKP(0x1ac00000)
	.word BKP(0x1b000000), BKP(0x1b400000), BKP(0x1b800000), BKP(0x1bc00000)
	.word BKP(0x1c000000), BKP(0x1c400000), BKP(0x1c800000), BKP(0x1cc00000)
	.word BKP(0x1d000000), BKP(0x1d400000), BKP(0x1d800000), BKP(0x1dc00000)
	.word BKP(0x1e000000), BKP(0x1e400000), BKP(0x1e800000), BKP(0x1ec00000)
	.word BKP(0x1f000000), BKP(0x1f400000), BKP(0x1f800000), BKP(0x1fc00000)

	.word BKP(0x20000000), BKP(0x20400000), BKP(0x20800000), BKP(0x20c00000)
	.word BKP(0x21000000), BKP(0x21400000), BKP(0x21800000), BKP(0x21c00000)
	.word BKP(0x22000000), BKP(0x22400000), BKP(0x22800000), BKP(0x22c00000)
	.word BKP(0x23000000), BKP(0x23400000), BKP(0x23800000), BKP(0x23c00000)
	.word BKP(0x24000000), BKP(0x24400000), BKP(0x24800000), BKP(0x24c00000)
	.word BKP(0x25000000), BKP(0x25400000), BKP(0x25800000), BKP(0x25c00000)
	.word BKP(0x26000000), BKP(0x26400000), BKP(0x26800000), BKP(0x26c00000)
	.word BKP(0x27000000), BKP(0x27400000), BKP(0x27800000), BKP(0x27c00000)

	.word BKP(0x28000000), BKP(0x28400000), BKP(0x28800000), BKP(0x28c00000)
	.word BKP(0x29000000), BKP(0x29400000), BKP(0x29800000), BKP(0x29c00000)
	.word BKP(0x2a000000), BKP(0x2a400000), BKP(0x2a800000), BKP(0x2ac00000)
	.word BKP(0x2b000000), BKP(0x2b400000), BKP(0x2b800000), BKP(0x2bc00000)
	.word BKP(0x2c000000), BKP(0x2c400000), BKP(0x2c800000), BKP(0x2cc00000)
	.word BKP(0x2d000000), BKP(0x2d400000), BKP(0x2d800000), BKP(0x2dc00000)
	.word BKP(0x2e000000), BKP(0x2e400000), BKP(0x2e800000), BKP(0x2ec00000)
	.word BKP(0x2f000000), BKP(0x2f400000), BKP(0x2f800000), BKP(0x2fc00000)

	.word BKP(0x30000000), BKP(0x30400000), BKP(0x30800000), BKP(0x30c00000)
	.word BKP(0x31000000), BKP(0x31400000), BKP(0x31800000), BKP(0x31c00000)
	.word BKP(0x32000000), BKP(0x32400000), BKP(0x32800000), BKP(0x32c00000)
	.word BKP(0x33000000), BKP(0x33400000), BKP(0x33800000), BKP(0x33c00000)
	.word BKP(0x34000000), BKP(0x34400000), BKP(0x34800000), BKP(0x34c00000)
	.word BKP(0x35000000), BKP(0x35400000), BKP(0x35800000), BKP(0x35c00000)
	.word BKP(0x36000000), BKP(0x36400000), BKP(0x36800000), BKP(0x36c00000)
	.word BKP(0x37000000), BKP(0x37400000), BKP(0x37800000), BKP(0x37c00000)

	.word BKP(0x38000000), BKP(0x38400000), BKP(0x38800000), BKP(0x38c00000)
	.word BKP(0x39000000), BKP(0x39400000), BKP(0x39800000), BKP(0x39c00000)
	.word BKP(0x3a000000), BKP(0x3a400000), BKP(0x3a800000), BKP(0x3ac00000)
	.word BKP(0x3b000000), BKP(0x3b400000), BKP(0x3b800000), BKP(0x3bc00000)
	.word BKP(0x3c000000), BKP(0x3c400000), BKP(0x3c800000), BKP(0x3cc00000)
	.word BKP(0x3d000000), BKP(0x3d400000), BKP(0x3d800000), BKP(0x3dc00000)
_K_io_map:
	.word X,X,X,X /* 0x3e000000 - device IO early remap */
	.word X,X,X,X /* 0x3f000000 - hypervisor space*/

#if 0
/*
 * This is in here as an example for devices which need to be mapped really
 * early.
 */
	.p2align 12
	.globl _K_io_kmap
	.globl _K_init_devicetable
_K_init_devicetable:  /*  Should be 4MB worth of entries  */
	.word FOURK_IO(MSM_GPIO1_PHYS),FOURK_IO(MSM_GPIO2_PHYS),FOURK_IO(MSM_SIRC_PHYS),X
	.word FOURK_IO(TLMM_GPIO1_PHYS),X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
	.word X,X,X,X
#endif