[acc25ee] | 1 | /* motorola.h |
---|
| 2 | * |
---|
| 3 | * This include file describe the data structure and the functions implemented |
---|
| 4 | * by rtems to identify motorola boards. |
---|
| 5 | * |
---|
[e79a1947] | 6 | * Copyright (C) 1999 valette@crf.canon.fr |
---|
[acc25ee] | 7 | * |
---|
| 8 | * The license and distribution terms for this file may be |
---|
[0c875c6a] | 9 | * found in the file LICENSE in this distribution or at |
---|
[c499856] | 10 | * http://www.rtems.org/license/LICENSE. |
---|
[acc25ee] | 11 | */ |
---|
| 12 | |
---|
[e79a1947] | 13 | #include <bsp.h> |
---|
[7657233d] | 14 | #include <bsp/motorola.h> |
---|
| 15 | #include <rtems/bspIo.h> |
---|
| 16 | #include <libcpu/io.h> |
---|
| 17 | #include <string.h> |
---|
[d59cae9] | 18 | #include <libcpu/cpuIdent.h> |
---|
[acc25ee] | 19 | |
---|
[3a3e0b0e] | 20 | /* |
---|
[e79a1947] | 21 | ** Board-specific table that maps interrupt names to onboard PCI |
---|
| 22 | ** peripherals as well as local PCI busses. This table is used at |
---|
[3a3e0b0e] | 23 | ** bspstart() to configure the interrupt name & pin for all devices that |
---|
| 24 | ** do not have it already specified. If the device is already |
---|
| 25 | ** configured, we leave it alone but sanity check & print a warning if |
---|
| 26 | ** we don't know about the pin/line the card gives us. |
---|
| 27 | ** |
---|
| 28 | ** bus = the bus number of the slot/device in question |
---|
| 29 | ** |
---|
| 30 | ** slot : |
---|
| 31 | ** |
---|
| 32 | ** If slot != -1, it indicates a device on the given bus in that slot |
---|
| 33 | ** is to use one of the listed interrupt names given an interrupt pin. |
---|
| 34 | ** |
---|
| 35 | ** If slot == -1, it means devices on this bus can occupy any slot- |
---|
| 36 | ** and for pci, this means the particular interrupt pin that the |
---|
| 37 | ** device signals is therefore dependent on the particular slot. To |
---|
| 38 | ** work from the slot to the interrupt pin, the swizzle table is used. |
---|
| 39 | ** Once the bus and interrupt pin is known, the correct interrupt name |
---|
| 40 | ** can be pulled from the table. The swizzle table relates the |
---|
| 41 | ** interrupt pin from the device to the particular interrupt |
---|
| 42 | ** controller interrupt pin- so it is quite reasonable for a device on |
---|
| 43 | ** bus 1 signalling interrupt pin 1 to show up at the interrupt |
---|
| 44 | ** controller as pin 4- this is why the int pin field varies for |
---|
| 45 | ** bridged pci busses. |
---|
| 46 | ** |
---|
| 47 | ** |
---|
| 48 | ** opts = bitmap of options that control the configuration of this |
---|
| 49 | ** slot/bus. |
---|
| 50 | ** |
---|
| 51 | ** pin_routes[] = array of pin & vectors that may serve this slot; |
---|
| 52 | ** |
---|
| 53 | ** pin = the pin # which delivers an interrupt on this route, A=1, |
---|
| 54 | ** B=2, C=3, D=4 |
---|
| 55 | ** |
---|
| 56 | ** int_name[4] = an array of up to 4 bsp-specific interrupt name |
---|
| 57 | ** that can be used by this route. Unused entries should be -1. |
---|
| 58 | ** The array is of primary use for slots that can be vectored thru |
---|
| 59 | ** multiple interrupt lines over the interrupt pin supplied by the |
---|
| 60 | ** record. If more than one entry is present, the most preferable |
---|
| 61 | ** should supplied first. |
---|
[6128a4a] | 62 | ** |
---|
[3a3e0b0e] | 63 | */ |
---|
| 64 | |
---|
| 65 | #define NULL_PINMAP {-1,{-1,-1,-1,-1}} |
---|
| 66 | #define NULL_INTMAP {-1,-1,-1,{}} |
---|
| 67 | |
---|
[58127230] | 68 | #ifdef qemu |
---|
| 69 | static struct _int_map qemu_prep_intmap[] = { |
---|
[9ec86ede] | 70 | { 0, -1, 0, { { 1, { 9, -1, -1, -1}}, |
---|
[58127230] | 71 | { 2, {11, -1 -1, -1}}, |
---|
| 72 | NULL_PINMAP }}, |
---|
| 73 | NULL_INTMAP |
---|
| 74 | }; |
---|
| 75 | #endif |
---|
| 76 | |
---|
[6128a4a] | 77 | static struct _int_map mcp750_intmap[] = { |
---|
[3a3e0b0e] | 78 | |
---|
| 79 | { 0, 16, 0, {{1, {5, 19,-1,-1}}, /* pmc slot */ |
---|
| 80 | NULL_PINMAP}}, |
---|
| 81 | |
---|
| 82 | { 0, 14, 0, {{1, {10,18,-1,-1}}, /* onboard ethernet */ |
---|
| 83 | NULL_PINMAP}}, |
---|
| 84 | |
---|
| 85 | { 1, -1, 0, {{1, {24,-1,-1,-1}}, |
---|
| 86 | {2, {25,-1,-1,-1}}, |
---|
| 87 | {3, {26,-1,-1,-1}}, |
---|
| 88 | {4, {27,-1,-1,-1}}, |
---|
| 89 | NULL_PINMAP}}, |
---|
| 90 | |
---|
| 91 | NULL_INTMAP }; |
---|
| 92 | |
---|
| 93 | static struct _int_map mtx603_intmap[] = { |
---|
| 94 | |
---|
| 95 | {0, 14, 0, {{1, {10,16,-1,-1}}, /* onboard ethernet */ |
---|
| 96 | NULL_PINMAP}}, |
---|
| 97 | |
---|
| 98 | {0, 12, 0, {{1, {14,18,-1,-1}}, /* onboard scsi */ |
---|
| 99 | NULL_PINMAP}}, |
---|
| 100 | |
---|
| 101 | {0, 16, 0, {{1, {25,-1,-1,-1}}, /* pci/pmc slot 1 */ |
---|
| 102 | {2, {26,-1,-1,-1}}, |
---|
| 103 | {3, {27,-1,-1,-1}}, |
---|
| 104 | {4, {28,-1,-1,-1}}, |
---|
| 105 | NULL_PINMAP}}, |
---|
| 106 | |
---|
| 107 | {0, 17, 0, {{1, {26,-1,-1,-1}}, /* pci/pmc slot 2 */ |
---|
| 108 | {2, {27,-1,-1,-1}}, |
---|
| 109 | {3, {28,-1,-1,-1}}, |
---|
| 110 | {4, {25,-1,-1,-1}}, |
---|
| 111 | NULL_PINMAP}}, |
---|
| 112 | |
---|
| 113 | {0, 18, 0, {{1, {27,-1,-1,-1}}, /* pci slot 3 */ |
---|
| 114 | {2, {28,-1,-1,-1}}, |
---|
| 115 | {3, {25,-1,-1,-1}}, |
---|
| 116 | {4, {26,-1,-1,-1}}, |
---|
| 117 | NULL_PINMAP}}, |
---|
| 118 | |
---|
| 119 | NULL_INTMAP }; |
---|
| 120 | |
---|
[98afe31] | 121 | static struct _int_map mvme23xx_intmap[] = { |
---|
| 122 | /* Raven Hostbridge; has int_pin == 0 |
---|
[ac7af4a] | 123 | {0, 0, 0, {{0, {-1,-1,-1,-1}}, |
---|
[98afe31] | 124 | NULL_PINMAP}}, |
---|
| 125 | */ |
---|
| 126 | |
---|
| 127 | /* Winbond PCI/ISA 83c553; has int_pin == 0 |
---|
[ac7af4a] | 128 | {0, 11, 0, {{0, {-1,-1,-1,-1}}, |
---|
[98afe31] | 129 | NULL_PINMAP}}, |
---|
| 130 | */ |
---|
| 131 | |
---|
| 132 | #if 0 /* Leave as ISA interrupts for now */ |
---|
| 133 | {0, 13, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 134 | {{1, {11,21,-1,-1,-1}}, /* Universe ISA/PCI */ |
---|
| 135 | /* strictly speaking, a non-multi function device |
---|
| 136 | * must only use pin A |
---|
| 137 | */ |
---|
| 138 | {2, {22,-1,-1,-1,-1}}, /* Universe */ |
---|
| 139 | {3, {23,-1,-1,-1,-1}}, /* Universe */ |
---|
| 140 | {4, {24,-1,-1,-1,-1}}, /* Universe */ |
---|
| 141 | NULL_PINMAP}}, |
---|
| 142 | |
---|
| 143 | {0, 14, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 144 | {{1, {10,18,-1,-1}}, /* DEC Tulip enet (ISA/PCI) */ |
---|
| 145 | NULL_PINMAP}}, |
---|
| 146 | #endif |
---|
| 147 | |
---|
| 148 | {0, 16, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 149 | {{1, {25,-1,-1,-1}}, /* pci/pmc slot 1 */ |
---|
| 150 | {2, {26,-1,-1,-1}}, |
---|
| 151 | {3, {27,-1,-1,-1}}, |
---|
| 152 | {4, {28,-1,-1,-1}}, |
---|
| 153 | NULL_PINMAP}}, |
---|
| 154 | |
---|
| 155 | {0, 17, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 156 | {{1, {28,-1,-1,-1}}, /* pci/pmc slot 2 */ /* orig: 0xf */ |
---|
| 157 | {2, {25,-1,-1,-1}}, |
---|
| 158 | {3, {26,-1,-1,-1}}, |
---|
| 159 | {4, {27,-1,-1,-1}}, |
---|
| 160 | NULL_PINMAP}}, |
---|
| 161 | |
---|
| 162 | NULL_INTMAP }; |
---|
| 163 | |
---|
[d59cae9] | 164 | static struct _int_map mvme24xx_intmap[] = { |
---|
| 165 | /* Raven Hostbridge; has int_pin == 0 |
---|
[ac7af4a] | 166 | {0, 0, 0, {{0, {-1,-1,-1,-1}}, |
---|
[d59cae9] | 167 | NULL_PINMAP}}, |
---|
| 168 | */ |
---|
| 169 | |
---|
| 170 | /* Winbond PCI/ISA 83c553; has int_pin == 0 |
---|
[ac7af4a] | 171 | {0, 11, 0, {{0, {-1,-1,-1,-1}}, |
---|
[d59cae9] | 172 | NULL_PINMAP}}, |
---|
| 173 | */ |
---|
| 174 | |
---|
| 175 | {0, 13, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
[4f38270a] | 176 | {{1, {11,21,-1,-1}}, /* Universe ISA/PCI */ |
---|
[d59cae9] | 177 | /* strictly speaking, a non-multi function device |
---|
| 178 | * must only use pin A |
---|
| 179 | */ |
---|
[4f38270a] | 180 | {2, {22,-1,-1,-1}}, /* Universe */ |
---|
| 181 | {3, {23,-1,-1,-1}}, /* Universe */ |
---|
| 182 | {4, {24,-1,-1,-1}}, /* Universe */ |
---|
[d59cae9] | 183 | NULL_PINMAP}}, |
---|
| 184 | |
---|
| 185 | {0, 14, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 186 | {{1, {10,18,-1,-1}}, /* DEC Tulip enet (ISA/PCI) */ |
---|
| 187 | NULL_PINMAP}}, |
---|
| 188 | {0, 16, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 189 | {{1, {25,-1,-1,-1}}, /* pci/pmc slot 1 */ |
---|
| 190 | {2, {26,-1,-1,-1}}, |
---|
| 191 | {3, {27,-1,-1,-1}}, |
---|
| 192 | {4, {28,-1,-1,-1}}, |
---|
| 193 | NULL_PINMAP}}, |
---|
| 194 | |
---|
| 195 | {0, 17, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 196 | {{1, {28,-1,-1,-1}}, /* pci/pmc slot 2 */ /* orig: 0xf */ |
---|
| 197 | {2, {25,-1,-1,-1}}, |
---|
| 198 | {3, {26,-1,-1,-1}}, |
---|
| 199 | {4, {27,-1,-1,-1}}, |
---|
| 200 | NULL_PINMAP}}, |
---|
| 201 | NULL_INTMAP }; |
---|
| 202 | |
---|
[819ca0e1] | 203 | static struct _int_map mvme27xx_intmap[] = { |
---|
| 204 | /* Raven Hostbridge; has int_pin == 0 */ |
---|
[ac7af4a] | 205 | {0, 0, 0, {{0, {-1,-1,-1,-1}}, |
---|
[819ca0e1] | 206 | NULL_PINMAP}}, |
---|
| 207 | |
---|
| 208 | |
---|
| 209 | /* Winbond PCI/ISA 83c553; has int_pin == 0 */ |
---|
[ac7af4a] | 210 | {0, 11, 0, {{0, {-1,-1,-1,-1}}, |
---|
[819ca0e1] | 211 | NULL_PINMAP}}, |
---|
| 212 | |
---|
| 213 | {0, 13, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 214 | {{1, {11,21,-1,-1}}, /* Universe ISA/PCI */ |
---|
| 215 | /* strictly speaking, a non-multi function device |
---|
| 216 | * must only use pin A |
---|
| 217 | */ |
---|
| 218 | {2, {22,-1,-1,-1}}, /* Universe */ |
---|
| 219 | {3, {23,-1,-1,-1}}, /* Universe */ |
---|
| 220 | {4, {24,-1,-1,-1}}, /* Universe */ |
---|
| 221 | NULL_PINMAP}}, |
---|
| 222 | |
---|
| 223 | {0, 14, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 224 | {{1, {10,18,-1,-1}}, /* DEC Tulip enet (ISA/PCI) */ |
---|
| 225 | NULL_PINMAP}}, |
---|
| 226 | {0, 16, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 227 | {{1, {25,-1,-1,-1}}, /* pci/pmc slot 1 */ |
---|
| 228 | {2, {26,-1,-1,-1}}, |
---|
| 229 | {3, {27,-1,-1,-1}}, |
---|
| 230 | {4, {28,-1,-1,-1}}, |
---|
| 231 | NULL_PINMAP}}, |
---|
| 232 | |
---|
| 233 | {0, 17, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 234 | {{1, {28,-1,-1,-1}}, /* pci/pmc slot 2 */ /* orig: 0xf */ |
---|
| 235 | {2, {25,-1,-1,-1}}, |
---|
| 236 | {3, {26,-1,-1,-1}}, |
---|
| 237 | {4, {27,-1,-1,-1}}, |
---|
| 238 | NULL_PINMAP}}, |
---|
| 239 | NULL_INTMAP }; |
---|
| 240 | |
---|
[e79a1947] | 241 | static struct _int_map mvme2100_intmap[] = { |
---|
[98afe31] | 242 | {0, 0, 0, {{1, {16,-1,-1,-1}}, /* something shows up in slot 0 and OpenPIC */ |
---|
| 243 | /* 0 is unused. This hushes the init code. */ |
---|
[e79a1947] | 244 | NULL_PINMAP}}, |
---|
| 245 | |
---|
[98afe31] | 246 | {0, 13, 0, {{1, {23,-1,-1,-1}}, /* Universe Lint[0-3]; not quite legal */ |
---|
| 247 | {2, {24,-1,-1,-1}}, /* since the universe is a single-function */ |
---|
| 248 | {3, {25,-1,-1,-1}}, /* device. We leave it for info purposes */ |
---|
| 249 | {4, {26,-1,-1,-1}}, |
---|
[e79a1947] | 250 | NULL_PINMAP}}, |
---|
| 251 | |
---|
| 252 | {0, 14, 0, {{1, {17,-1,-1,-1}}, /* onboard ethernet */ |
---|
| 253 | NULL_PINMAP}}, |
---|
| 254 | |
---|
[98afe31] | 255 | {0, 16, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 256 | {{1, {18,-1,-1,-1}}, /* PMC slot; all pins are routed to 18 */ |
---|
| 257 | {2, {18,-1,-1,-1}}, /* I give the OVERRIDE option since I had */ |
---|
| 258 | {3, {18,-1,-1,-1}}, /* problems with devices behind a bridge */ |
---|
| 259 | {4, {18,-1,-1,-1}}, /* on a PMC card reading irq line 0... */ |
---|
| 260 | NULL_PINMAP}}, |
---|
| 261 | |
---|
| 262 | /* FIXME: I don't know how MIP works or what it is; these probably won't work */ |
---|
| 263 | |
---|
| 264 | {0, -1, PCI_FIXUP_OPT_OVERRIDE_NAME, |
---|
| 265 | {{1, {23,-1,-1,-1}}, /* PCI INT[A-D] expansion */ |
---|
| 266 | {2, {24,-1,-1,-1}}, |
---|
| 267 | {3, {25,-1,-1,-1}}, |
---|
| 268 | {4, {26,-1,-1,-1}}, |
---|
| 269 | NULL_PINMAP}}, |
---|
| 270 | |
---|
[e79a1947] | 271 | NULL_INTMAP }; |
---|
| 272 | |
---|
[3a3e0b0e] | 273 | /* |
---|
| 274 | * This table represents the standard PCI swizzle defined in the |
---|
| 275 | * PCI bus specification. Table taken from Linux 2.4.18, prep_pci.c, |
---|
| 276 | * the values in this table are interrupt_pin values (1 based). |
---|
| 277 | */ |
---|
| 278 | static unsigned char prep_pci_intpins[4][4] = |
---|
| 279 | { |
---|
| 280 | { 1, 2, 3, 4 }, /* Buses 0, 4, 8, ... */ |
---|
| 281 | { 2, 3, 4, 1 }, /* Buses 1, 5, 9, ... */ |
---|
| 282 | { 3, 4, 1, 2 }, /* Buses 2, 6, 10 ... */ |
---|
| 283 | { 4, 1, 2, 3 }, /* Buses 3, 7, 11 ... */ |
---|
| 284 | }; |
---|
| 285 | |
---|
| 286 | static int prep_pci_swizzle(int slot, int pin) |
---|
| 287 | { |
---|
| 288 | return prep_pci_intpins[ slot % 4 ][ pin-1 ]; |
---|
| 289 | } |
---|
| 290 | |
---|
[acc25ee] | 291 | typedef struct { |
---|
| 292 | /* |
---|
| 293 | * 0x100 mask assumes for Raven and Hawk boards |
---|
| 294 | * that the level/edge are set. |
---|
| 295 | * 0x200 if this board has a Hawk chip. |
---|
| 296 | */ |
---|
[3a3e0b0e] | 297 | int cpu_type; |
---|
| 298 | int base_type; |
---|
[d59cae9] | 299 | ppc_cpu_id_t proc_type; |
---|
[3a3e0b0e] | 300 | const char *name; |
---|
| 301 | |
---|
| 302 | struct _int_map *intmap; |
---|
| 303 | int (*swizzler)(int, int); |
---|
[acc25ee] | 304 | } mot_info_t; |
---|
| 305 | |
---|
[e7f95e8] | 306 | /* NOTE: When adding boards here the 'motorolaBoard' enums MUST be |
---|
| 307 | * updated accordingly! |
---|
| 308 | */ |
---|
[acc25ee] | 309 | static const mot_info_t mot_boards[] = { |
---|
[e7f95e8] | 310 | {0x0E0, 0xF9, PPC_604, "MVME 2400", mvme24xx_intmap,prep_pci_swizzle}, |
---|
| 311 | {0x3E0, 0x00, PPC_750, "MVME 2400 (PPC 750)", mvme24xx_intmap,prep_pci_swizzle}, |
---|
[d59cae9] | 312 | {0x010, 0x00, PPC_UNKNOWN, "Genesis", NULL, NULL}, |
---|
| 313 | {0x020, 0x00, PPC_UNKNOWN, "Powerstack (Series E)", NULL, NULL}, |
---|
| 314 | {0x040, 0x00, PPC_UNKNOWN, "Blackhawk (Powerstack)", NULL, NULL}, |
---|
| 315 | {0x050, 0x00, PPC_UNKNOWN, "Omaha (PowerStack II Pro3000)", NULL, NULL}, |
---|
| 316 | {0x060, 0x00, PPC_UNKNOWN, "Utah (Powerstack II Pro4000)", NULL, NULL}, |
---|
| 317 | {0x0A0, 0x00, PPC_UNKNOWN, "Powerstack (Series EX)", NULL, NULL}, |
---|
[58127230] | 318 | #ifdef qemu |
---|
| 319 | {0x1E0, 0xE0, PPC_UNKNOWN, "QEMU", qemu_prep_intmap, prep_pci_swizzle}, |
---|
| 320 | #else |
---|
[d59cae9] | 321 | {0x1E0, 0xE0, PPC_UNKNOWN, "Mesquite cPCI (MCP750)", mcp750_intmap, prep_pci_swizzle}, |
---|
[58127230] | 322 | #endif |
---|
[d59cae9] | 323 | {0x1E0, 0xE1, PPC_UNKNOWN, "Sitka cPCI (MCPN750)", mcp750_intmap, prep_pci_swizzle}, |
---|
| 324 | {0x1E0, 0xE2, PPC_UNKNOWN, "Mesquite cPCI (MCP750) w/ HAC", mcp750_intmap, prep_pci_swizzle}, |
---|
| 325 | {0x1E0, 0xF6, PPC_UNKNOWN, "MTX Plus", NULL, NULL}, |
---|
| 326 | {0x1E0, 0xF7, PPC_UNKNOWN, "MTX w/o Parallel Port", mtx603_intmap, prep_pci_swizzle}, |
---|
| 327 | {0x1E0, 0xF8, PPC_UNKNOWN, "MTX w/ Parallel Port", mtx603_intmap, prep_pci_swizzle}, |
---|
| 328 | {0x1E0, 0xF9, PPC_604, "MVME 2300", mvme23xx_intmap, prep_pci_swizzle}, |
---|
| 329 | {0x1E0, 0xFA, PPC_UNKNOWN, "MVME 2300SC/2600", mvme23xx_intmap, prep_pci_swizzle}, |
---|
| 330 | {0x1E0, 0xFB, PPC_UNKNOWN, "MVME 2600 with MVME712M", NULL, NULL}, |
---|
[819ca0e1] | 331 | {0x1E0, 0xFC, PPC_750, "MVME 2600/2700 with MVME761", mvme27xx_intmap, prep_pci_swizzle}, |
---|
[d59cae9] | 332 | {0x1E0, 0xFD, PPC_UNKNOWN, "MVME 3600 with MVME712M", NULL, NULL}, |
---|
| 333 | {0x1E0, 0xFE, PPC_UNKNOWN, "MVME 3600 with MVME761", NULL, NULL}, |
---|
| 334 | {0x1E0, 0xFF, PPC_UNKNOWN, "MVME 1600-001 or 1600-011", NULL, NULL}, |
---|
| 335 | {0x000, 0x00, PPC_UNKNOWN, ""}, /* end of probeable values for automatic scan */ |
---|
| 336 | {0x000, 0x00, PPC_UNKNOWN, "MVME 2100", mvme2100_intmap, prep_pci_swizzle}, |
---|
[acc25ee] | 337 | }; |
---|
| 338 | |
---|
| 339 | prep_t currentPrepType; |
---|
[e79a1947] | 340 | motorolaBoard currentBoard; |
---|
| 341 | |
---|
[acc25ee] | 342 | prep_t checkPrepBoardType(RESIDUAL *res) |
---|
| 343 | { |
---|
| 344 | prep_t PREP_type; |
---|
| 345 | /* figure out what kind of prep workstation we are */ |
---|
| 346 | if ( res->ResidualLength != 0 ) { |
---|
[98afe31] | 347 | if ( !strncmp((char*)res->VitalProductData.PrintableModel,"IBM",3) ) |
---|
[acc25ee] | 348 | PREP_type = PREP_IBM; |
---|
[98afe31] | 349 | else if (!strncmp((char*)res->VitalProductData.PrintableModel, |
---|
[acc25ee] | 350 | "Radstone",8)){ |
---|
| 351 | PREP_type = PREP_Radstone; |
---|
| 352 | } |
---|
| 353 | else |
---|
| 354 | PREP_type = PREP_Motorola; |
---|
| 355 | } |
---|
| 356 | else /* assume motorola if no residual (netboot?) */ { |
---|
| 357 | PREP_type = PREP_Motorola; |
---|
| 358 | } |
---|
| 359 | currentPrepType = PREP_type; |
---|
| 360 | return PREP_type; |
---|
| 361 | } |
---|
| 362 | |
---|
[92868024] | 363 | motorolaBoard getMotorolaBoard(void) |
---|
[acc25ee] | 364 | { |
---|
[e79a1947] | 365 | /* |
---|
| 366 | * At least the MVME2100 does not have the CPU Type and Base Type Registers, |
---|
| 367 | * so it cannot be probed. |
---|
| 368 | * |
---|
| 369 | * NOTE: Every path must set currentBoard. |
---|
| 370 | */ |
---|
| 371 | #if defined(mvme2100) |
---|
| 372 | currentBoard = (motorolaBoard) MVME_2100; |
---|
| 373 | #else |
---|
[acc25ee] | 374 | unsigned char cpu_type; |
---|
| 375 | unsigned char base_mod; |
---|
[d59cae9] | 376 | ppc_cpu_id_t proc_type; |
---|
[acc25ee] | 377 | int entry; |
---|
| 378 | int mot_entry = -1; |
---|
| 379 | |
---|
[d59cae9] | 380 | cpu_type = inb(MOTOROLA_CPUTYPE_REG) & 0xF0; |
---|
| 381 | base_mod = inb(MOTOROLA_BASETYPE_REG); |
---|
| 382 | proc_type = get_ppc_cpu_type (); |
---|
[acc25ee] | 383 | |
---|
| 384 | for (entry = 0; mot_boards[entry].cpu_type != 0; entry++) { |
---|
| 385 | if ((mot_boards[entry].cpu_type & 0xff) != cpu_type) |
---|
| 386 | continue; |
---|
[ac7af4a] | 387 | |
---|
[d59cae9] | 388 | if ((mot_boards[entry].proc_type != PPC_UNKNOWN) && |
---|
| 389 | (mot_boards[entry].proc_type != proc_type)) |
---|
| 390 | /* |
---|
[ac7af4a] | 391 | * IMD: processor type does not match |
---|
[d59cae9] | 392 | * (here we distinguish a MVME2300 and a MVME2400) |
---|
| 393 | */ |
---|
| 394 | continue; |
---|
[6128a4a] | 395 | |
---|
[acc25ee] | 396 | if (mot_boards[entry].base_type != base_mod) |
---|
| 397 | continue; |
---|
[e79a1947] | 398 | else { |
---|
[acc25ee] | 399 | mot_entry = entry; |
---|
| 400 | break; |
---|
| 401 | } |
---|
| 402 | } |
---|
| 403 | if (mot_entry == -1) { |
---|
[30a1617] | 404 | printk("Unknown motorola board Please update libbsp/powerpc/shared/motorola/motorola.c\n"); |
---|
[acc25ee] | 405 | printk("cpu_type = %x\n", (unsigned) cpu_type); |
---|
| 406 | printk("base_mod = %x\n", (unsigned) base_mod); |
---|
| 407 | currentBoard = MOTOROLA_UNKNOWN; |
---|
| 408 | return currentBoard; |
---|
| 409 | } |
---|
| 410 | currentBoard = (motorolaBoard) mot_entry; |
---|
[e79a1947] | 411 | #endif |
---|
[acc25ee] | 412 | return currentBoard; |
---|
| 413 | } |
---|
| 414 | |
---|
| 415 | const char* motorolaBoardToString(motorolaBoard board) |
---|
| 416 | { |
---|
| 417 | if (board == MOTOROLA_UNKNOWN) return "Unknown motorola board"; |
---|
| 418 | return (mot_boards[board].name); |
---|
| 419 | } |
---|
| 420 | |
---|
[3a3e0b0e] | 421 | const struct _int_map *motorolaIntMap(motorolaBoard board) |
---|
| 422 | { |
---|
| 423 | if (board == MOTOROLA_UNKNOWN) return NULL; |
---|
[e79a1947] | 424 | /* printk( "IntMap board %d 0x%08x\n", board, mot_boards[board].intmap ); */ |
---|
[3a3e0b0e] | 425 | return mot_boards[board].intmap; |
---|
| 426 | } |
---|
| 427 | |
---|
| 428 | const void *motorolaIntSwizzle(motorolaBoard board) |
---|
| 429 | { |
---|
| 430 | if (board == MOTOROLA_UNKNOWN) return NULL; |
---|
| 431 | return (void *)mot_boards[board].swizzler; |
---|
| 432 | } |
---|