source:
rtems/c/src/lib/libbsp/powerpc/qoriq/include/mmu.h
@
dc0a7df
Last change on this file since dc0a7df was dc0a7df, checked in by Sebastian Huber <sebastian.huber@…>, on 07/21/11 at 15:18:02 | |
---|---|
|
|
File size: 1.7 KB |
Line | |
---|---|
1 | /** |
2 | * @file |
3 | * |
4 | * @ingroup QorIQMMU |
5 | * |
6 | * @brief MMU API. |
7 | */ |
8 | |
9 | /* |
10 | * Copyright (c) 2011 embedded brains GmbH. All rights reserved. |
11 | * |
12 | * embedded brains GmbH |
13 | * Obere Lagerstr. 30 |
14 | * 82178 Puchheim |
15 | * Germany |
16 | * <rtems@embedded-brains.de> |
17 | * |
18 | * The license and distribution terms for this file may be |
19 | * found in the file LICENSE in this distribution or at |
20 | * http://www.rtems.com/license/LICENSE. |
21 | * |
22 | * $Id$ |
23 | */ |
24 | |
25 | #ifndef LIBBSP_POWERPC_QORIQ_MMU_H |
26 | #define LIBBSP_POWERPC_QORIQ_MMU_H |
27 | |
28 | #include <stdint.h> |
29 | #include <stdbool.h> |
30 | |
31 | #ifdef __cplusplus |
32 | extern "C" { |
33 | #endif /* __cplusplus */ |
34 | |
35 | /** |
36 | * @defgroup QorIQMMU QorIQ - MMU Support |
37 | * |
38 | * @ingroup QorIQ |
39 | * |
40 | * @brief MMU support. |
41 | * |
42 | * @{ |
43 | */ |
44 | |
45 | #define QORIQ_MMU_ENTRY_COUNT 32 |
46 | |
47 | #define QORIQ_MMU_MIN_POWER 12 |
48 | #define QORIQ_MMU_MAX_POWER 32 |
49 | #define QORIQ_MMU_POWER_STEP 2 |
50 | |
51 | typedef struct { |
52 | uint32_t begin; |
53 | uint32_t last; |
54 | uint32_t mas1; |
55 | uint32_t mas2; |
56 | uint32_t mas3; |
57 | } qoriq_mmu_entry; |
58 | |
59 | typedef struct { |
60 | int count; |
61 | qoriq_mmu_entry entries [QORIQ_MMU_ENTRY_COUNT]; |
62 | } qoriq_mmu_context; |
63 | |
64 | void qoriq_mmu_context_init(qoriq_mmu_context *self); |
65 | |
66 | bool qoriq_mmu_add( |
67 | qoriq_mmu_context *self, |
68 | uint32_t begin, |
69 | uint32_t last, |
70 | uint32_t mas1, |
71 | uint32_t mas2, |
72 | uint32_t mas3 |
73 | ); |
74 | |
75 | void qoriq_mmu_partition(qoriq_mmu_context *self, int max_count); |
76 | |
77 | void qoriq_mmu_write_to_tlb1(qoriq_mmu_context *self, int first_tlb); |
78 | |
79 | void qoriq_mmu_change_perm(uint32_t test, uint32_t set, uint32_t clear); |
80 | |
81 | void qoriq_mmu_config(int first_tlb, int scratch_tlb); |
82 | |
83 | void qoriq_tlb1_write( |
84 | int esel, |
85 | uint32_t mas1, |
86 | uint32_t mas2, |
87 | uint32_t mas3, |
88 | uint32_t ea, |
89 | uint32_t tsize |
90 | ); |
91 | |
92 | void qoriq_tlb1_invalidate(int esel); |
93 | |
94 | /** @} */ |
95 | |
96 | #ifdef __cplusplus |
97 | } |
98 | #endif /* __cplusplus */ |
99 | |
100 | #endif /* LIBBSP_POWERPC_QORIQ_MMU_H */ |
Note: See TracBrowser
for help on using the repository browser.