Ignore:
Timestamp:
Jun 13, 2003, 5:40:41 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
641fb28
Parents:
7a848b40
Message:

2003-06-13 Greg Menke <gregory.menke@…>

PR 405/bsps

  • bootloader/pci.c: Added support for configuring devices for pci busses > 0
  • pci/pci.c, pci/pci.h: Added FixupPCI() to store vectors in the INTERRUPT_LINE register of pci devices any # of hops away from the host processor.
  • motorola/motorola.c, motorola/motorola.h: Added interrupt routing tables in support of FixupPCI. This is board-specific, each board will have to supply information for FixupPCI() to do anything for it.
  • startup/bspstart.c: Extended bat2 to cover entire PCI address space.
  • irq/irq.c, irq/irq.h: Added support for shared interrupts. Existing single hander vectors are undisturbed, a new function added to allow adding/removing handlers from a vector.
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  
    1818#include <libcpu/io.h>
    1919#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
     72static 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
     91static 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 */
     131static 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
     139static 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
    20151
    21152typedef struct {
     
    25156   * 0x200 if this board has a Hawk chip.
    26157   */
    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);
    30164} mot_info_t;
    31165
    32166
    33167static 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},
    54188  {0x000, 0x00, ""}
    55189};
     190
     191
    56192
    57193prep_t currentPrepType;
     
    115251}
    116252
     253
    117254const char* motorolaBoardToString(motorolaBoard board)
    118255{
     
    121258}
    122259
     260
     261const struct _int_map *motorolaIntMap(motorolaBoard board)
     262{
     263  if (board == MOTOROLA_UNKNOWN) return NULL;
     264  return mot_boards[board].intmap;
     265}
     266
     267
     268const 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  
    1717
    1818#include <bsp/residual.h>
     19#include <bsp/pci.h>
     20
     21
     22
     23
     24
     25
     26
    1927
    2028typedef enum {
     
    6270extern motorolaBoard            currentBoard;
    6371extern const char*              motorolaBoardToString(motorolaBoard);
     72extern const struct _int_map    *motorolaIntMap(motorolaBoard board);
     73extern const void               *motorolaIntSwizzle(motorolaBoard board);
    6474
    6575
Note: See TracChangeset for help on using the changeset viewer.