Changeset 12838559 in rtems for c/src/lib/libbsp/powerpc/shared/motorola
- Timestamp:
- Jun 13, 2003, 5:40:41 PM (18 years ago)
- Children:
- 641fb28
- Parents:
- 7a848b40
- Location:
- c/src/lib/libbsp/powerpc/shared/motorola
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/powerpc/shared/motorola/motorola.c
r7a848b40 r12838559 18 18 #include <libcpu/io.h> 19 19 #include <string.h> 20 21 22 /* 23 ** Board-specific table that maps interrupt names to onboard pci 24 ** peripherals as well as local pci busses. This table is used at 25 ** bspstart() to configure the interrupt name & pin for all devices that 26 ** do not have it already specified. If the device is already 27 ** configured, we leave it alone but sanity check & print a warning if 28 ** we don't know about the pin/line the card gives us. 29 ** 30 ** bus = the bus number of the slot/device in question 31 ** 32 ** slot : 33 ** 34 ** If slot != -1, it indicates a device on the given bus in that slot 35 ** is to use one of the listed interrupt names given an interrupt pin. 36 ** 37 ** If slot == -1, it means devices on this bus can occupy any slot- 38 ** and for pci, this means the particular interrupt pin that the 39 ** device signals is therefore dependent on the particular slot. To 40 ** work from the slot to the interrupt pin, the swizzle table is used. 41 ** Once the bus and interrupt pin is known, the correct interrupt name 42 ** can be pulled from the table. The swizzle table relates the 43 ** interrupt pin from the device to the particular interrupt 44 ** controller interrupt pin- so it is quite reasonable for a device on 45 ** bus 1 signalling interrupt pin 1 to show up at the interrupt 46 ** controller as pin 4- this is why the int pin field varies for 47 ** bridged pci busses. 48 ** 49 ** 50 ** opts = bitmap of options that control the configuration of this 51 ** slot/bus. 52 ** 53 ** pin_routes[] = array of pin & vectors that may serve this slot; 54 ** 55 ** pin = the pin # which delivers an interrupt on this route, A=1, 56 ** B=2, C=3, D=4 57 ** 58 ** int_name[4] = an array of up to 4 bsp-specific interrupt name 59 ** that can be used by this route. Unused entries should be -1. 60 ** The array is of primary use for slots that can be vectored thru 61 ** multiple interrupt lines over the interrupt pin supplied by the 62 ** record. If more than one entry is present, the most preferable 63 ** should supplied first. 64 ** 65 */ 66 67 #define NULL_PINMAP {-1,{-1,-1,-1,-1}} 68 #define NULL_INTMAP {-1,-1,-1,{}} 69 70 71 72 static struct _int_map mcp750_intmap[] = { 73 74 { 0, 16, 0, {{1, {5, 19,-1,-1}}, /* pmc slot */ 75 NULL_PINMAP}}, 76 77 { 0, 14, 0, {{1, {10,18,-1,-1}}, /* onboard ethernet */ 78 NULL_PINMAP}}, 79 80 { 1, -1, 0, {{1, {24,-1,-1,-1}}, 81 {2, {25,-1,-1,-1}}, 82 {3, {26,-1,-1,-1}}, 83 {4, {27,-1,-1,-1}}, 84 NULL_PINMAP}}, 85 86 NULL_INTMAP }; 87 88 89 90 91 static struct _int_map mtx603_intmap[] = { 92 93 {0, 14, 0, {{1, {10,16,-1,-1}}, /* onboard ethernet */ 94 NULL_PINMAP}}, 95 96 {0, 12, 0, {{1, {14,18,-1,-1}}, /* onboard scsi */ 97 NULL_PINMAP}}, 98 99 {0, 16, 0, {{1, {25,-1,-1,-1}}, /* pci/pmc slot 1 */ 100 {2, {26,-1,-1,-1}}, 101 {3, {27,-1,-1,-1}}, 102 {4, {28,-1,-1,-1}}, 103 NULL_PINMAP}}, 104 105 {0, 17, 0, {{1, {26,-1,-1,-1}}, /* pci/pmc slot 2 */ 106 {2, {27,-1,-1,-1}}, 107 {3, {28,-1,-1,-1}}, 108 {4, {25,-1,-1,-1}}, 109 NULL_PINMAP}}, 110 111 {0, 18, 0, {{1, {27,-1,-1,-1}}, /* pci slot 3 */ 112 {2, {28,-1,-1,-1}}, 113 {3, {25,-1,-1,-1}}, 114 {4, {26,-1,-1,-1}}, 115 NULL_PINMAP}}, 116 117 NULL_INTMAP }; 118 119 120 121 122 123 124 125 126 /* 127 * This table represents the standard PCI swizzle defined in the 128 * PCI bus specification. Table taken from Linux 2.4.18, prep_pci.c, 129 * the values in this table are interrupt_pin values (1 based). 130 */ 131 static unsigned char prep_pci_intpins[4][4] = 132 { 133 { 1, 2, 3, 4 }, /* Buses 0, 4, 8, ... */ 134 { 2, 3, 4, 1 }, /* Buses 1, 5, 9, ... */ 135 { 3, 4, 1, 2 }, /* Buses 2, 6, 10 ... */ 136 { 4, 1, 2, 3 }, /* Buses 3, 7, 11 ... */ 137 }; 138 139 static int prep_pci_swizzle(int slot, int pin) 140 { 141 return prep_pci_intpins[ slot % 4 ][ pin-1 ]; 142 } 143 144 145 146 147 148 149 150 20 151 21 152 typedef struct { … … 25 156 * 0x200 if this board has a Hawk chip. 26 157 */ 27 int cpu_type; 28 int base_type; 29 const char *name; 158 int cpu_type; 159 int base_type; 160 const char *name; 161 162 struct _int_map *intmap; 163 int (*swizzler)(int, int); 30 164 } mot_info_t; 31 165 32 166 33 167 static const mot_info_t mot_boards[] = { 34 {0x300, 0x00, "MVME 2400" },35 {0x010, 0x00, "Genesis" },36 {0x020, 0x00, "Powerstack (Series E)" },37 {0x040, 0x00, "Blackhawk (Powerstack)" },38 {0x050, 0x00, "Omaha (PowerStack II Pro3000)" },39 {0x060, 0x00, "Utah (Powerstack II Pro4000)" },40 {0x0A0, 0x00, "Powerstack (Series EX)" },41 {0x1E0, 0xE0, "Mesquite cPCI (MCP750)" },42 {0x1E0, 0xE1, "Sitka cPCI (MCPN750)" },43 {0x1E0, 0xE2, "Mesquite cPCI (MCP750) w/ HAC" },44 {0x1E0, 0xF6, "MTX Plus" },45 {0x1E0, 0xF7, "MTX w/o Parallel Port" },46 {0x1E0, 0xF8, "MTX w/ Parallel Port" },47 {0x1E0, 0xF9, "MVME 2300" },48 {0x1E0, 0xFA, "MVME 2300SC/2600" },49 {0x1E0, 0xFB, "MVME 2600 with MVME712M" },50 {0x1E0, 0xFC, "MVME 2600/2700 with MVME761" },51 {0x1E0, 0xFD, "MVME 3600 with MVME712M" },52 {0x1E0, 0xFE, "MVME 3600 with MVME761" },53 {0x1E0, 0xFF, "MVME 1600-001 or 1600-011" },168 {0x300, 0x00, "MVME 2400", NULL, NULL}, 169 {0x010, 0x00, "Genesis", NULL, NULL}, 170 {0x020, 0x00, "Powerstack (Series E)", NULL, NULL}, 171 {0x040, 0x00, "Blackhawk (Powerstack)", NULL, NULL}, 172 {0x050, 0x00, "Omaha (PowerStack II Pro3000)", NULL, NULL}, 173 {0x060, 0x00, "Utah (Powerstack II Pro4000)", NULL, NULL}, 174 {0x0A0, 0x00, "Powerstack (Series EX)", NULL, NULL}, 175 {0x1E0, 0xE0, "Mesquite cPCI (MCP750)", mcp750_intmap, prep_pci_swizzle}, 176 {0x1E0, 0xE1, "Sitka cPCI (MCPN750)", mcp750_intmap, prep_pci_swizzle}, 177 {0x1E0, 0xE2, "Mesquite cPCI (MCP750) w/ HAC", mcp750_intmap, prep_pci_swizzle}, 178 {0x1E0, 0xF6, "MTX Plus", NULL, NULL}, 179 {0x1E0, 0xF7, "MTX w/o Parallel Port", mtx603_intmap, prep_pci_swizzle}, 180 {0x1E0, 0xF8, "MTX w/ Parallel Port", mtx603_intmap, prep_pci_swizzle}, 181 {0x1E0, 0xF9, "MVME 2300", NULL, NULL}, 182 {0x1E0, 0xFA, "MVME 2300SC/2600", NULL, NULL}, 183 {0x1E0, 0xFB, "MVME 2600 with MVME712M", NULL, NULL}, 184 {0x1E0, 0xFC, "MVME 2600/2700 with MVME761", NULL, NULL}, 185 {0x1E0, 0xFD, "MVME 3600 with MVME712M", NULL, NULL}, 186 {0x1E0, 0xFE, "MVME 3600 with MVME761", NULL, NULL}, 187 {0x1E0, 0xFF, "MVME 1600-001 or 1600-011", NULL, NULL}, 54 188 {0x000, 0x00, ""} 55 189 }; 190 191 56 192 57 193 prep_t currentPrepType; … … 115 251 } 116 252 253 117 254 const char* motorolaBoardToString(motorolaBoard board) 118 255 { … … 121 258 } 122 259 260 261 const struct _int_map *motorolaIntMap(motorolaBoard board) 262 { 263 if (board == MOTOROLA_UNKNOWN) return NULL; 264 return mot_boards[board].intmap; 265 } 266 267 268 const void *motorolaIntSwizzle(motorolaBoard board) 269 { 270 if (board == MOTOROLA_UNKNOWN) return NULL; 271 return (void *)mot_boards[board].swizzler; 272 } 273 -
c/src/lib/libbsp/powerpc/shared/motorola/motorola.h
r7a848b40 r12838559 17 17 18 18 #include <bsp/residual.h> 19 #include <bsp/pci.h> 20 21 22 23 24 25 26 19 27 20 28 typedef enum { … … 62 70 extern motorolaBoard currentBoard; 63 71 extern const char* motorolaBoardToString(motorolaBoard); 72 extern const struct _int_map *motorolaIntMap(motorolaBoard board); 73 extern const void *motorolaIntSwizzle(motorolaBoard board); 64 74 65 75
Note: See TracChangeset
for help on using the changeset viewer.