RTEMS  5.0.0
mmu.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2011-2015 embedded brains GmbH. All rights reserved.
11  *
12  * embedded brains GmbH
13  * Dornierstr. 4
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.org/license/LICENSE.
21  */
22 
23 #ifndef LIBBSP_POWERPC_QORIQ_MMU_H
24 #define LIBBSP_POWERPC_QORIQ_MMU_H
25 
26 #include <stdint.h>
27 #include <stdbool.h>
28 
29 #include <bspopts.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
45 #define QORIQ_MMU_MIN_POWER 12
46 #define QORIQ_MMU_MAX_POWER 30
47 #define QORIQ_MMU_POWER_STEP 2
48 
49 typedef struct {
50  uintptr_t begin;
51  uintptr_t last;
52  uint32_t mas1;
53  uint32_t mas2;
54  uint32_t mas3;
55  uint32_t mas7;
57 
58 typedef struct {
59  int count;
60  qoriq_mmu_entry entries [QORIQ_TLB1_ENTRY_COUNT];
62 
63 void qoriq_mmu_context_init(qoriq_mmu_context *self);
64 
65 bool qoriq_mmu_add(
66  qoriq_mmu_context *self,
67  uintptr_t begin,
68  uintptr_t last,
69  uint32_t mas1,
70  uint32_t mas2,
71  uint32_t mas3,
72  uint32_t mas7
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(bool boot_processor, 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 mas7,
89  uintptr_t ea,
90  int tsize
91 );
92 
93 void qoriq_tlb1_invalidate(int esel);
94 
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100 
101 #endif /* LIBBSP_POWERPC_QORIQ_MMU_H */
Definition: mmu.h:49
Definition: mmu.h:58