Wolfgang Denk | 72a087e | 2006-10-24 14:27:35 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Register definition for the High-speed Bus Matrix |
| 3 | */ |
| 4 | #ifndef __ASM_AVR32_HMATRIX2_H__ |
| 5 | #define __ASM_AVR32_HMATRIX2_H__ |
| 6 | |
| 7 | /* HMATRIX2 register offsets */ |
| 8 | #define HMATRIX2_MCFG0 0x0000 |
| 9 | #define HMATRIX2_MCFG1 0x0004 |
| 10 | #define HMATRIX2_MCFG2 0x0008 |
| 11 | #define HMATRIX2_MCFG3 0x000c |
| 12 | #define HMATRIX2_MCFG4 0x0010 |
| 13 | #define HMATRIX2_MCFG5 0x0014 |
| 14 | #define HMATRIX2_MCFG6 0x0018 |
| 15 | #define HMATRIX2_MCFG7 0x001c |
| 16 | #define HMATRIX2_MCFG8 0x0020 |
| 17 | #define HMATRIX2_MCFG9 0x0024 |
| 18 | #define HMATRIX2_MCFG10 0x0028 |
| 19 | #define HMATRIX2_MCFG11 0x002c |
| 20 | #define HMATRIX2_MCFG12 0x0030 |
| 21 | #define HMATRIX2_MCFG13 0x0034 |
| 22 | #define HMATRIX2_MCFG14 0x0038 |
| 23 | #define HMATRIX2_MCFG15 0x003c |
| 24 | #define HMATRIX2_SCFG0 0x0040 |
| 25 | #define HMATRIX2_SCFG1 0x0044 |
| 26 | #define HMATRIX2_SCFG2 0x0048 |
| 27 | #define HMATRIX2_SCFG3 0x004c |
| 28 | #define HMATRIX2_SCFG4 0x0050 |
| 29 | #define HMATRIX2_SCFG5 0x0054 |
| 30 | #define HMATRIX2_SCFG6 0x0058 |
| 31 | #define HMATRIX2_SCFG7 0x005c |
| 32 | #define HMATRIX2_SCFG8 0x0060 |
| 33 | #define HMATRIX2_SCFG9 0x0064 |
| 34 | #define HMATRIX2_SCFG10 0x0068 |
| 35 | #define HMATRIX2_SCFG11 0x006c |
| 36 | #define HMATRIX2_SCFG12 0x0070 |
| 37 | #define HMATRIX2_SCFG13 0x0074 |
| 38 | #define HMATRIX2_SCFG14 0x0078 |
| 39 | #define HMATRIX2_SCFG15 0x007c |
| 40 | #define HMATRIX2_PRAS0 0x0080 |
| 41 | #define HMATRIX2_PRBS0 0x0084 |
| 42 | #define HMATRIX2_PRAS1 0x0088 |
| 43 | #define HMATRIX2_PRBS1 0x008c |
| 44 | #define HMATRIX2_PRAS2 0x0090 |
| 45 | #define HMATRIX2_PRBS2 0x0094 |
| 46 | #define HMATRIX2_PRAS3 0x0098 |
| 47 | #define HMATRIX2_PRBS3 0x009c |
| 48 | #define HMATRIX2_PRAS4 0x00a0 |
| 49 | #define HMATRIX2_PRBS4 0x00a4 |
| 50 | #define HMATRIX2_PRAS5 0x00a8 |
| 51 | #define HMATRIX2_PRBS5 0x00ac |
| 52 | #define HMATRIX2_PRAS6 0x00b0 |
| 53 | #define HMATRIX2_PRBS6 0x00b4 |
| 54 | #define HMATRIX2_PRAS7 0x00b8 |
| 55 | #define HMATRIX2_PRBS7 0x00bc |
| 56 | #define HMATRIX2_PRAS8 0x00c0 |
| 57 | #define HMATRIX2_PRBS8 0x00c4 |
| 58 | #define HMATRIX2_PRAS9 0x00c8 |
| 59 | #define HMATRIX2_PRBS9 0x00cc |
| 60 | #define HMATRIX2_PRAS10 0x00d0 |
| 61 | #define HMATRIX2_PRBS10 0x00d4 |
| 62 | #define HMATRIX2_PRAS11 0x00d8 |
| 63 | #define HMATRIX2_PRBS11 0x00dc |
| 64 | #define HMATRIX2_PRAS12 0x00e0 |
| 65 | #define HMATRIX2_PRBS12 0x00e4 |
| 66 | #define HMATRIX2_PRAS13 0x00e8 |
| 67 | #define HMATRIX2_PRBS13 0x00ec |
| 68 | #define HMATRIX2_PRAS14 0x00f0 |
| 69 | #define HMATRIX2_PRBS14 0x00f4 |
| 70 | #define HMATRIX2_PRAS15 0x00f8 |
| 71 | #define HMATRIX2_PRBS15 0x00fc |
| 72 | #define HMATRIX2_MRCR 0x0100 |
| 73 | #define HMATRIX2_SFR0 0x0110 |
| 74 | #define HMATRIX2_SFR1 0x0114 |
| 75 | #define HMATRIX2_SFR2 0x0118 |
| 76 | #define HMATRIX2_SFR3 0x011c |
| 77 | #define HMATRIX2_SFR4 0x0120 |
| 78 | #define HMATRIX2_SFR5 0x0124 |
| 79 | #define HMATRIX2_SFR6 0x0128 |
| 80 | #define HMATRIX2_SFR7 0x012c |
| 81 | #define HMATRIX2_SFR8 0x0130 |
| 82 | #define HMATRIX2_SFR9 0x0134 |
| 83 | #define HMATRIX2_SFR10 0x0138 |
| 84 | #define HMATRIX2_SFR11 0x013c |
| 85 | #define HMATRIX2_SFR12 0x0140 |
| 86 | #define HMATRIX2_SFR13 0x0144 |
| 87 | #define HMATRIX2_SFR14 0x0148 |
| 88 | #define HMATRIX2_SFR15 0x014c |
| 89 | #define HMATRIX2_VERSION 0x01fc |
| 90 | |
| 91 | /* Bitfields in MCFG0 */ |
| 92 | #define HMATRIX2_ULBT_OFFSET 0 |
| 93 | #define HMATRIX2_ULBT_SIZE 3 |
| 94 | |
| 95 | /* Bitfields in SCFG0 */ |
| 96 | #define HMATRIX2_SLOT_CYCLE_OFFSET 0 |
| 97 | #define HMATRIX2_SLOT_CYCLE_SIZE 8 |
| 98 | #define HMATRIX2_DEFMSTR_TYPE_OFFSET 16 |
| 99 | #define HMATRIX2_DEFMSTR_TYPE_SIZE 2 |
| 100 | #define HMATRIX2_FIXED_DEFMSTR_OFFSET 18 |
| 101 | #define HMATRIX2_FIXED_DEFMSTR_SIZE 4 |
| 102 | #define HMATRIX2_ARBT_OFFSET 24 |
| 103 | #define HMATRIX2_ARBT_SIZE 2 |
| 104 | |
| 105 | /* Bitfields in PRAS0 */ |
| 106 | #define HMATRIX2_M0PR_OFFSET 0 |
| 107 | #define HMATRIX2_M0PR_SIZE 4 |
| 108 | #define HMATRIX2_M1PR_OFFSET 4 |
| 109 | #define HMATRIX2_M1PR_SIZE 4 |
| 110 | #define HMATRIX2_M2PR_OFFSET 8 |
| 111 | #define HMATRIX2_M2PR_SIZE 4 |
| 112 | #define HMATRIX2_M3PR_OFFSET 12 |
| 113 | #define HMATRIX2_M3PR_SIZE 4 |
| 114 | #define HMATRIX2_M4PR_OFFSET 16 |
| 115 | #define HMATRIX2_M4PR_SIZE 4 |
| 116 | #define HMATRIX2_M5PR_OFFSET 20 |
| 117 | #define HMATRIX2_M5PR_SIZE 4 |
| 118 | #define HMATRIX2_M6PR_OFFSET 24 |
| 119 | #define HMATRIX2_M6PR_SIZE 4 |
| 120 | #define HMATRIX2_M7PR_OFFSET 28 |
| 121 | #define HMATRIX2_M7PR_SIZE 4 |
| 122 | |
| 123 | /* Bitfields in PRBS0 */ |
| 124 | #define HMATRIX2_M8PR_OFFSET 0 |
| 125 | #define HMATRIX2_M8PR_SIZE 4 |
| 126 | #define HMATRIX2_M9PR_OFFSET 4 |
| 127 | #define HMATRIX2_M9PR_SIZE 4 |
| 128 | #define HMATRIX2_M10PR_OFFSET 8 |
| 129 | #define HMATRIX2_M10PR_SIZE 4 |
| 130 | #define HMATRIX2_M11PR_OFFSET 12 |
| 131 | #define HMATRIX2_M11PR_SIZE 4 |
| 132 | #define HMATRIX2_M12PR_OFFSET 16 |
| 133 | #define HMATRIX2_M12PR_SIZE 4 |
| 134 | #define HMATRIX2_M13PR_OFFSET 20 |
| 135 | #define HMATRIX2_M13PR_SIZE 4 |
| 136 | #define HMATRIX2_M14PR_OFFSET 24 |
| 137 | #define HMATRIX2_M14PR_SIZE 4 |
| 138 | #define HMATRIX2_M15PR_OFFSET 28 |
| 139 | #define HMATRIX2_M15PR_SIZE 4 |
| 140 | |
| 141 | /* Bitfields in MRCR */ |
| 142 | #define HMATRIX2_RBC0_OFFSET 0 |
| 143 | #define HMATRIX2_RBC0_SIZE 1 |
| 144 | #define HMATRIX2_RBC1_OFFSET 1 |
| 145 | #define HMATRIX2_RBC1_SIZE 1 |
| 146 | #define HMATRIX2_RBC2_OFFSET 2 |
| 147 | #define HMATRIX2_RBC2_SIZE 1 |
| 148 | #define HMATRIX2_RBC3_OFFSET 3 |
| 149 | #define HMATRIX2_RBC3_SIZE 1 |
| 150 | #define HMATRIX2_RBC4_OFFSET 4 |
| 151 | #define HMATRIX2_RBC4_SIZE 1 |
| 152 | #define HMATRIX2_RBC5_OFFSET 5 |
| 153 | #define HMATRIX2_RBC5_SIZE 1 |
| 154 | #define HMATRIX2_RBC6_OFFSET 6 |
| 155 | #define HMATRIX2_RBC6_SIZE 1 |
| 156 | #define HMATRIX2_RBC7_OFFSET 7 |
| 157 | #define HMATRIX2_RBC7_SIZE 1 |
| 158 | #define HMATRIX2_RBC8_OFFSET 8 |
| 159 | #define HMATRIX2_RBC8_SIZE 1 |
| 160 | #define HMATRIX2_RBC9_OFFSET 9 |
| 161 | #define HMATRIX2_RBC9_SIZE 1 |
| 162 | #define HMATRIX2_RBC10_OFFSET 10 |
| 163 | #define HMATRIX2_RBC10_SIZE 1 |
| 164 | #define HMATRIX2_RBC11_OFFSET 11 |
| 165 | #define HMATRIX2_RBC11_SIZE 1 |
| 166 | #define HMATRIX2_RBC12_OFFSET 12 |
| 167 | #define HMATRIX2_RBC12_SIZE 1 |
| 168 | #define HMATRIX2_RBC13_OFFSET 13 |
| 169 | #define HMATRIX2_RBC13_SIZE 1 |
| 170 | #define HMATRIX2_RBC14_OFFSET 14 |
| 171 | #define HMATRIX2_RBC14_SIZE 1 |
| 172 | #define HMATRIX2_RBC15_OFFSET 15 |
| 173 | #define HMATRIX2_RBC15_SIZE 1 |
| 174 | |
| 175 | /* Bitfields in SFR0 */ |
| 176 | #define HMATRIX2_SFR_OFFSET 0 |
| 177 | #define HMATRIX2_SFR_SIZE 32 |
| 178 | |
| 179 | /* Bitfields in SFR4 */ |
| 180 | #define HMATRIX2_CS1A_OFFSET 1 |
| 181 | #define HMATRIX2_CS1A_SIZE 1 |
| 182 | #define HMATRIX2_CS3A_OFFSET 3 |
| 183 | #define HMATRIX2_CS3A_SIZE 1 |
| 184 | #define HMATRIX2_CS4A_OFFSET 4 |
| 185 | #define HMATRIX2_CS4A_SIZE 1 |
| 186 | #define HMATRIX2_CS5A_OFFSET 5 |
| 187 | #define HMATRIX2_CS5A_SIZE 1 |
| 188 | #define HMATRIX2_DBPUC_OFFSET 8 |
| 189 | #define HMATRIX2_DBPUC_SIZE 1 |
| 190 | |
| 191 | /* Bitfields in VERSION */ |
| 192 | #define HMATRIX2_VERSION_OFFSET 0 |
| 193 | #define HMATRIX2_VERSION_SIZE 12 |
| 194 | #define HMATRIX2_MFN_OFFSET 16 |
| 195 | #define HMATRIX2_MFN_SIZE 3 |
| 196 | |
| 197 | /* Constants for ULBT */ |
| 198 | #define HMATRIX2_ULBT_INFINITE 0 |
| 199 | #define HMATRIX2_ULBT_SINGLE 1 |
| 200 | #define HMATRIX2_ULBT_FOUR_BEAT 2 |
| 201 | #define HMATRIX2_ULBT_SIXTEEN_BEAT 4 |
| 202 | |
| 203 | /* Constants for DEFMSTR_TYPE */ |
| 204 | #define HMATRIX2_DEFMSTR_TYPE_NO_DEFAULT 0 |
| 205 | #define HMATRIX2_DEFMSTR_TYPE_LAST_DEFAULT 1 |
| 206 | #define HMATRIX2_DEFMSTR_TYPE_FIXED_DEFAULT 2 |
| 207 | |
| 208 | /* Constants for ARBT */ |
| 209 | #define HMATRIX2_ARBT_ROUND_ROBIN 0 |
| 210 | #define HMATRIX2_ARBT_FIXED_PRIORITY 1 |
| 211 | |
| 212 | /* Bit manipulation macros */ |
| 213 | #define HMATRIX2_BIT(name) \ |
| 214 | (1 << HMATRIX2_##name##_OFFSET) |
| 215 | #define HMATRIX2_BF(name,value) \ |
| 216 | (((value) & ((1 << HMATRIX2_##name##_SIZE) - 1)) \ |
| 217 | << HMATRIX2_##name##_OFFSET) |
| 218 | #define HMATRIX2_BFEXT(name,value) \ |
| 219 | (((value) >> HMATRIX2_##name##_OFFSET) \ |
| 220 | & ((1 << HMATRIX2_##name##_SIZE) - 1)) |
| 221 | #define HMATRIX2_BFINS(name,value,old) \ |
| 222 | (((old) & ~(((1 << HMATRIX2_##name##_SIZE) - 1) \ |
| 223 | << HMATRIX2_##name##_OFFSET)) \ |
| 224 | | HMATRIX2_BF(name,value)) |
| 225 | |
| 226 | /* Register access macros */ |
| 227 | #define hmatrix2_readl(port,reg) \ |
| 228 | readl((port)->regs + HMATRIX2_##reg) |
| 229 | #define hmatrix2_writel(port,reg,value) \ |
| 230 | writel((value), (port)->regs + HMATRIX2_##reg) |
| 231 | |
| 232 | #endif /* __ASM_AVR32_HMATRIX2_H__ */ |