1 | /* cop2/vcache definitions */ |
---|
2 | #define VC_PTPR $0 /* set Page Table Pointer Register */ |
---|
3 | #define VC_TLB_EN $1 /* set Data & Inst TLBs Mode Register */ |
---|
4 | #define VC_TLB_EN_ITLB 0x8 /* enable instruction TLB */ |
---|
5 | #define VC_TLB_EN_DTLB 0x4 /* enable data TLB */ |
---|
6 | #define VC_TLB_EN_ICACHE 0x2 /* enable instruction cache */ |
---|
7 | #define VC_TLB_EN_DCACHE 0x1 /* enable data cache */ |
---|
8 | #define VC_ICACHE_FLUSH $2 /* Instruction Cache flush */ |
---|
9 | #define VC_DCACHE_FLUSH $3 /* Data Cache flush */ |
---|
10 | #define VC_ITLB_INVAL $4 /* Instruction TLB line invalidate */ |
---|
11 | #define VC_DTLB_INVAL $5 /* Data TLB line invalidate */ |
---|
12 | #define VC_ICACHE_INVAL $6 /* Instruction Cache line invalidate */ |
---|
13 | #define VC_DCACHE_INVAL $7 /* Data Cache line invalidate */ |
---|
14 | #define VC_ICACHE_PREFETCH $8 /* Instruction Cache line prefetch */ |
---|
15 | #define VC_DCACHE_PREFETCH $9 /* Data Cache line prefetch */ |
---|
16 | #define VC_SYNC $10 /* Complete pending writes */ |
---|
17 | #define VC_IERR_TYPE $11 /* Instruction Exception type Register */ |
---|
18 | #define VC_DERR_TYPE $12 /* Data Exception type Register */ |
---|
19 | #define VC_DATA_LO $17 /* misc register low */ |
---|
20 | #define VC_DATA_HI $18 /* misc register hight */ |
---|
21 | #define VC_ICACHE_INVAL_PA $19 /* misc register hight */ |
---|
22 | #define VC_DCACHE_INVAL_PA $20 /* misc register hight */ |
---|
23 | #define VC_ERR_PT1_UNMAPPED 0x001 /* Page fault on Table1 (invalid PTE) */ |
---|
24 | #define VC_ERR_PT2_UNMAPPED 0x002 /* Page fault on Table 2 (invalid PTE) */ |
---|
25 | #define VC_ERR_PRIVILEGE_VIOLATION 0x004 /* Protected access in user mode */ |
---|
26 | #define VC_ERR_WRITE_VIOLATION 0x008 /* Write access to a non write page */ |
---|
27 | #define VC_ERR_EXEC_VIOLATION 0x010 /* Exec access to a non exec page */ |
---|
28 | #define VC_ERR_UNDEFINED_XTN 0x020 /* Undefined external access address */ |
---|
29 | #define VC_ERR_PT1_ILLEGAL_ACCESS 0x040 /* Bus Error in Table1 access */ |
---|
30 | #define VC_ERR_PT2_ILLEGAL_ACCESS 0x080 /* Bus Error in Table2 access */ |
---|
31 | #define VC_ERR_CACHE_ILLEGAL_ACCESS 0x100 /* Bus Error during the cache access */ |
---|
32 | #define VC_I_BAD_VADDR $13 /* Instruction Bad Virtual Address Register */ |
---|
33 | #define VC_D_BAD_VADDR $14 /* Data Bad Virtual Address Register */ |
---|
34 | #define VC_DATA_L $17 /* cache parameters */ |
---|
35 | #define VC_DATA_H $18 /* cache parameters */ |
---|
36 | #define VC_ICACHE_INVAL_PA $19 /* icache inval per physical address */ |
---|
37 | #define VC_DCACHE_INVAL_PA $20 /* dcache inval per physical address */ |
---|
38 | |
---|
39 | /* vcache page level 1 format */ |
---|
40 | #define PTE1_V (1 << 31) /* entry valid */ |
---|
41 | #define PTE1_T (1 << 30) /* 0 == entry is a PTE1 (maps a 2M page) */ |
---|
42 | #define PTE1_L (1 << 29) /* accessed by local CPU */ |
---|
43 | #define PTE1_R (1 << 28) /* accessed by remote CPU */ |
---|
44 | #define PTE1_C (1 << 27) /* cachable */ |
---|
45 | #define PTE1_W (1 << 26) /* writable */ |
---|
46 | #define PTE1_X (1 << 25) /* executable */ |
---|
47 | #define PTE1_U (1 << 24) /* user-accessible */ |
---|
48 | #define PTE1_G (1 << 23) /* global */ |
---|
49 | #define PTE1_D (1 << 22) /* dirty */ |
---|
50 | |
---|
51 | /* vcache page level 2 format: same as level 1, PTE1_T */ |
---|
52 | #define PTE2_V (1 << 31) /* entry valid */ |
---|
53 | /* reserved, 0 */ |
---|
54 | #define PTE2_L (1 << 29) /* accessed by local CPU */ |
---|
55 | #define PTE2_R (1 << 28) /* accessed by remote CPU */ |
---|
56 | #define PTE2_C (1 << 27) /* cachable */ |
---|
57 | #define PTE2_W (1 << 26) /* writable */ |
---|
58 | #define PTE2_X (1 << 25) /* executable */ |
---|
59 | #define PTE2_U (1 << 24) /* user-accessible */ |
---|
60 | #define PTE2_G (1 << 23) /* global */ |
---|
61 | #define PTE2_D (1 << 22) /* dirty */ |
---|
62 | #define PTE2_os 0xff /* OS-reserved bits */ |
---|
63 | |
---|
64 | #define PTE2_SHIFT 12 |
---|
65 | #define PTE2_MASK 0x0001ff000 |
---|
66 | #define VADDR_TO_PTE2I(va) (((va) & PTE2_MASK) >> PTE2_SHIFT) |
---|