File indexing completed on 2025-05-11 08:23:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef LIBBSP_POWERPC_QORIQ_MMU_H
0037 #define LIBBSP_POWERPC_QORIQ_MMU_H
0038
0039 #include <stdint.h>
0040 #include <stdbool.h>
0041
0042 #include <bspopts.h>
0043
0044 #ifdef __cplusplus
0045 extern "C" {
0046 #endif
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 #define QORIQ_MMU_MIN_POWER 12
0059 #define QORIQ_MMU_MAX_POWER 30
0060 #define QORIQ_MMU_POWER_STEP 2
0061
0062 typedef struct {
0063 uintptr_t begin;
0064 uintptr_t last;
0065 uint32_t mas1;
0066 uint32_t mas2;
0067 uint32_t mas3;
0068 uint32_t mas7;
0069 } qoriq_mmu_entry;
0070
0071 typedef struct {
0072 int count;
0073 qoriq_mmu_entry entries [QORIQ_TLB1_ENTRY_COUNT];
0074 } qoriq_mmu_context;
0075
0076 void qoriq_mmu_context_init(qoriq_mmu_context *self);
0077
0078 bool qoriq_mmu_add(
0079 qoriq_mmu_context *self,
0080 uintptr_t begin,
0081 uintptr_t last,
0082 uint32_t mas1,
0083 uint32_t mas2,
0084 uint32_t mas3,
0085 uint32_t mas7
0086 );
0087
0088 void qoriq_mmu_partition(qoriq_mmu_context *self, int max_count);
0089
0090 void qoriq_mmu_write_to_tlb1(qoriq_mmu_context *self, int first_tlb);
0091
0092 void qoriq_mmu_change_perm(uint32_t test, uint32_t set, uint32_t clear);
0093
0094 int qoriq_mmu_find_free_tlb1_entry(void);
0095
0096 void qoriq_mmu_config(bool boot_processor, int first_tlb, int scratch_tlb);
0097
0098 void qoriq_tlb1_write(
0099 int esel,
0100 uint32_t mas1,
0101 uint32_t mas2,
0102 uint32_t mas3,
0103 uint32_t mas7,
0104 uintptr_t ea,
0105 int tsize
0106 );
0107
0108 void qoriq_mmu_adjust_and_write_to_tlb1(
0109 int tlb,
0110 uintptr_t begin,
0111 uintptr_t last,
0112 uint32_t mas1,
0113 uint32_t mas2,
0114 uint32_t mas3,
0115 uint32_t mas7
0116 );
0117
0118 void qoriq_tlb1_invalidate(int esel);
0119
0120
0121
0122 #ifdef __cplusplus
0123 }
0124 #endif
0125
0126 #endif