diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2007-04-09 14:30:49 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2007-04-09 14:30:49 +0000 |
commit | d59cae9773321be3163e3b0d79f676f1245c3092 (patch) | |
tree | ca7e8e21ca62be955cbbeefdb617e1d6c15b6cf1 /c/src | |
parent | 2007-04-09 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-d59cae9773321be3163e3b0d79f676f1245c3092.tar.bz2 |
adapted BSP "motorola_powerpc" to support MVME24xx
Diffstat (limited to 'c/src')
-rw-r--r-- | c/src/lib/libbsp/powerpc/ChangeLog | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/motorola_powerpc/ChangeLog | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/motorola_powerpc/README.MVME2400 | 29 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/motorola/motorola.c | 101 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/openpic/openpic.c | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/pci/detect_raven_bridge.c | 11 | ||||
-rw-r--r-- | c/src/lib/libbsp/powerpc/shared/pci/pci.c | 10 |
7 files changed, 136 insertions, 31 deletions
diff --git a/c/src/lib/libbsp/powerpc/ChangeLog b/c/src/lib/libbsp/powerpc/ChangeLog index 9e7f375392..433a205b77 100644 --- a/c/src/lib/libbsp/powerpc/ChangeLog +++ b/c/src/lib/libbsp/powerpc/ChangeLog @@ -1,3 +1,9 @@ +2007-04-09 Thomas Doerfler |Thomas.Doerfler@embedded-brains.de> + + * shared/motorola/motorola.c,shared/openpic/openpic.c, + * shared/pci/detect_raven_bridge.c, shared/pci/pci.c: + adapted to detect/use MVME2400 + 2007-04-02 Ralf Corsépius <ralf.corsepius@rtems.org> * shared/pci/pci.c: More stdint.h fixed-size types. diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/ChangeLog b/c/src/lib/libbsp/powerpc/motorola_powerpc/ChangeLog index 84e893f7b5..3dc1f8c808 100644 --- a/c/src/lib/libbsp/powerpc/motorola_powerpc/ChangeLog +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/ChangeLog @@ -1,3 +1,8 @@ +2007-04-09 Thomas Doerfler |Thomas.Doerfler@embedded-brains.de> + + * README.MVME2400: + Added file to describe setup of a MVME2432 board for use with RTEMS + 2007-01-30 Till Straumann <strauman@slac.stanford.edu> * Makefile.am, preinstall.am, include/bsp.h: diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/README.MVME2400 b/c/src/lib/libbsp/powerpc/motorola_powerpc/README.MVME2400 new file mode 100644 index 0000000000..575000216b --- /dev/null +++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/README.MVME2400 @@ -0,0 +1,29 @@ +The generic motorla_powerpc BSP was adapted to work on a MVME2432 by +Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>. + +The main steps needed were adaptions to the "Hawk" controller, which +replaces the MVME2300 Raven and Falcon chips. + +This board now runs with the same BSP configuration as the MCP750, so +select the mcp750 BSP. + +The following settings in the PPCBUG's ENV were also important (taken +from the "README.MVME2300" file:) + +VME3PCI Master Master Enable [Y/N] = Y? +PCI Slave Image 0 Control = 00000000? <----- +PCI Slave Image 0 Base Address Register = 00000000? +PCI Slave Image 0 Bound Address Register = 00000000? +PCI Slave Image 0 Translation Offset = 00000000? +PCI Slave Image 1 Control = 00000000? <----- +PCI Slave Image 1 Base Address Register = 01000000? +PCI Slave Image 1 Bound Address Register = 20000000? +PCI Slave Image 1 Translation Offset = 00000000? +PCI Slave Image 2 Control = 00000000? <----- +PCI Slave Image 2 Base Address Register = 20000000? +PCI Slave Image 2 Bound Address Register = 22000000? +PCI Slave Image 2 Translation Offset = D0000000? +PCI Slave Image 3 Control = 00000000? <----- +PCI Slave Image 3 Base Address Register = 2FFF0000? +PCI Slave Image 3 Bound Address Register = 30000000? +PCI Slave Image 3 Translation Offset = D0000000? diff --git a/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c b/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c index 7040a9860b..89382cad18 100644 --- a/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c +++ b/c/src/lib/libbsp/powerpc/shared/motorola/motorola.c @@ -17,6 +17,7 @@ #include <rtems/bspIo.h> #include <libcpu/io.h> #include <string.h> +#include <libcpu/cpuIdent.h> /* ** Board-specific table that maps interrupt names to onboard PCI @@ -153,6 +154,45 @@ static struct _int_map mvme23xx_intmap[] = { NULL_INTMAP }; +static struct _int_map mvme24xx_intmap[] = { +/* Raven Hostbridge; has int_pin == 0 + {0, 0, 0, {{0, {-1,-1,-1,-1}}, + NULL_PINMAP}}, +*/ + +/* Winbond PCI/ISA 83c553; has int_pin == 0 + {0, 11, 0, {{0, {-1,-1,-1,-1}}, + NULL_PINMAP}}, +*/ + + {0, 13, PCI_FIXUP_OPT_OVERRIDE_NAME, + {{1, {11,21,-1,-1,-1}}, /* Universe ISA/PCI */ + /* strictly speaking, a non-multi function device + * must only use pin A + */ + {2, {22,-1,-1,-1,-1}}, /* Universe */ + {3, {23,-1,-1,-1,-1}}, /* Universe */ + {4, {24,-1,-1,-1,-1}}, /* Universe */ + NULL_PINMAP}}, + + {0, 14, PCI_FIXUP_OPT_OVERRIDE_NAME, + {{1, {10,18,-1,-1}}, /* DEC Tulip enet (ISA/PCI) */ + NULL_PINMAP}}, + {0, 16, PCI_FIXUP_OPT_OVERRIDE_NAME, + {{1, {25,-1,-1,-1}}, /* pci/pmc slot 1 */ + {2, {26,-1,-1,-1}}, + {3, {27,-1,-1,-1}}, + {4, {28,-1,-1,-1}}, + NULL_PINMAP}}, + + {0, 17, PCI_FIXUP_OPT_OVERRIDE_NAME, + {{1, {28,-1,-1,-1}}, /* pci/pmc slot 2 */ /* orig: 0xf */ + {2, {25,-1,-1,-1}}, + {3, {26,-1,-1,-1}}, + {4, {27,-1,-1,-1}}, + NULL_PINMAP}}, + NULL_INTMAP }; + static struct _int_map mvme2100_intmap[] = { {0, 0, 0, {{1, {16,-1,-1,-1}}, /* something shows up in slot 0 and OpenPIC */ /* 0 is unused. This hushes the init code. */ @@ -211,6 +251,7 @@ typedef struct { */ int cpu_type; int base_type; + ppc_cpu_id_t proc_type; const char *name; struct _int_map *intmap; @@ -218,28 +259,28 @@ typedef struct { } mot_info_t; static const mot_info_t mot_boards[] = { - {0x300, 0x00, "MVME 2400", NULL, NULL}, - {0x010, 0x00, "Genesis", NULL, NULL}, - {0x020, 0x00, "Powerstack (Series E)", NULL, NULL}, - {0x040, 0x00, "Blackhawk (Powerstack)", NULL, NULL}, - {0x050, 0x00, "Omaha (PowerStack II Pro3000)", NULL, NULL}, - {0x060, 0x00, "Utah (Powerstack II Pro4000)", NULL, NULL}, - {0x0A0, 0x00, "Powerstack (Series EX)", NULL, NULL}, - {0x1E0, 0xE0, "Mesquite cPCI (MCP750)", mcp750_intmap, prep_pci_swizzle}, - {0x1E0, 0xE1, "Sitka cPCI (MCPN750)", mcp750_intmap, prep_pci_swizzle}, - {0x1E0, 0xE2, "Mesquite cPCI (MCP750) w/ HAC", mcp750_intmap, prep_pci_swizzle}, - {0x1E0, 0xF6, "MTX Plus", NULL, NULL}, - {0x1E0, 0xF7, "MTX w/o Parallel Port", mtx603_intmap, prep_pci_swizzle}, - {0x1E0, 0xF8, "MTX w/ Parallel Port", mtx603_intmap, prep_pci_swizzle}, - {0x1E0, 0xF9, "MVME 2300", mvme23xx_intmap, prep_pci_swizzle}, - {0x1E0, 0xFA, "MVME 2300SC/2600", mvme23xx_intmap, prep_pci_swizzle}, - {0x1E0, 0xFB, "MVME 2600 with MVME712M", NULL, NULL}, - {0x1E0, 0xFC, "MVME 2600/2700 with MVME761", NULL, NULL}, - {0x1E0, 0xFD, "MVME 3600 with MVME712M", NULL, NULL}, - {0x1E0, 0xFE, "MVME 3600 with MVME761", NULL, NULL}, - {0x1E0, 0xFF, "MVME 1600-001 or 1600-011", NULL, NULL}, - {0x000, 0x00, ""}, /* end of probeable values for automatic scan */ - {0x000, 0x00, "MVME 2100", mvme2100_intmap, prep_pci_swizzle}, + {0x3E0, 0x00, PPC_750, "MVME 2400", mvme24xx_intmap,prep_pci_swizzle}, + {0x010, 0x00, PPC_UNKNOWN, "Genesis", NULL, NULL}, + {0x020, 0x00, PPC_UNKNOWN, "Powerstack (Series E)", NULL, NULL}, + {0x040, 0x00, PPC_UNKNOWN, "Blackhawk (Powerstack)", NULL, NULL}, + {0x050, 0x00, PPC_UNKNOWN, "Omaha (PowerStack II Pro3000)", NULL, NULL}, + {0x060, 0x00, PPC_UNKNOWN, "Utah (Powerstack II Pro4000)", NULL, NULL}, + {0x0A0, 0x00, PPC_UNKNOWN, "Powerstack (Series EX)", NULL, NULL}, + {0x1E0, 0xE0, PPC_UNKNOWN, "Mesquite cPCI (MCP750)", mcp750_intmap, prep_pci_swizzle}, + {0x1E0, 0xE1, PPC_UNKNOWN, "Sitka cPCI (MCPN750)", mcp750_intmap, prep_pci_swizzle}, + {0x1E0, 0xE2, PPC_UNKNOWN, "Mesquite cPCI (MCP750) w/ HAC", mcp750_intmap, prep_pci_swizzle}, + {0x1E0, 0xF6, PPC_UNKNOWN, "MTX Plus", NULL, NULL}, + {0x1E0, 0xF7, PPC_UNKNOWN, "MTX w/o Parallel Port", mtx603_intmap, prep_pci_swizzle}, + {0x1E0, 0xF8, PPC_UNKNOWN, "MTX w/ Parallel Port", mtx603_intmap, prep_pci_swizzle}, + {0x1E0, 0xF9, PPC_604, "MVME 2300", mvme23xx_intmap, prep_pci_swizzle}, + {0x1E0, 0xFA, PPC_UNKNOWN, "MVME 2300SC/2600", mvme23xx_intmap, prep_pci_swizzle}, + {0x1E0, 0xFB, PPC_UNKNOWN, "MVME 2600 with MVME712M", NULL, NULL}, + {0x1E0, 0xFC, PPC_UNKNOWN, "MVME 2600/2700 with MVME761", NULL, NULL}, + {0x1E0, 0xFD, PPC_UNKNOWN, "MVME 3600 with MVME712M", NULL, NULL}, + {0x1E0, 0xFE, PPC_UNKNOWN, "MVME 3600 with MVME761", NULL, NULL}, + {0x1E0, 0xFF, PPC_UNKNOWN, "MVME 1600-001 or 1600-011", NULL, NULL}, + {0x000, 0x00, PPC_UNKNOWN, ""}, /* end of probeable values for automatic scan */ + {0x000, 0x00, PPC_UNKNOWN, "MVME 2100", mvme2100_intmap, prep_pci_swizzle}, }; prep_t currentPrepType; @@ -279,16 +320,26 @@ motorolaBoard getMotorolaBoard() #else unsigned char cpu_type; unsigned char base_mod; + ppc_cpu_id_t proc_type; int entry; int mot_entry = -1; - cpu_type = inb(MOTOROLA_CPUTYPE_REG) & 0xF0; - base_mod = inb(MOTOROLA_BASETYPE_REG); + cpu_type = inb(MOTOROLA_CPUTYPE_REG) & 0xF0; + base_mod = inb(MOTOROLA_BASETYPE_REG); + proc_type = get_ppc_cpu_type (); for (entry = 0; mot_boards[entry].cpu_type != 0; entry++) { if ((mot_boards[entry].cpu_type & 0xff) != cpu_type) continue; - + + if ((mot_boards[entry].proc_type != PPC_UNKNOWN) && + (mot_boards[entry].proc_type != proc_type)) + /* + * IMD: processor type does not match + * (here we distinguish a MVME2300 and a MVME2400) + */ + continue; + if (mot_boards[entry].base_type == 0) { mot_entry = entry; break; diff --git a/c/src/lib/libbsp/powerpc/shared/openpic/openpic.c b/c/src/lib/libbsp/powerpc/shared/openpic/openpic.c index ab9b8c49da..8c9562310a 100644 --- a/c/src/lib/libbsp/powerpc/shared/openpic/openpic.c +++ b/c/src/lib/libbsp/powerpc/shared/openpic/openpic.c @@ -200,6 +200,11 @@ void openpic_init(int main_pic, unsigned char *polarities, unsigned char *senses vendor = "Motorola"; device = "Raven"; NumSources += 1; + } + else if (t == PCI_VENDOR_ID_MOTOROLA + (PCI_DEVICE_ID_MOTOROLA_HAWK<<16)) { + vendor = "Motorola"; + device = "Hawk"; + NumSources += 1; } else { switch (vendorid) { case OPENPIC_VENDOR_ID_APPLE: diff --git a/c/src/lib/libbsp/powerpc/shared/pci/detect_raven_bridge.c b/c/src/lib/libbsp/powerpc/shared/pci/detect_raven_bridge.c index 96020518bc..265af0fe0f 100644 --- a/c/src/lib/libbsp/powerpc/shared/pci/detect_raven_bridge.c +++ b/c/src/lib/libbsp/powerpc/shared/pci/detect_raven_bridge.c @@ -14,6 +14,8 @@ #include <rtems/bspIo.h> #include <libcpu/cpuIdent.h> +#define SHOW_RAVEN_SETTINGS + #define RAVEN_MPIC_IOSPACE_ENABLE 0x0001 #define RAVEN_MPIC_MEMSPACE_ENABLE 0x0002 #define RAVEN_MASTER_ENABLE 0x0004 @@ -196,8 +198,13 @@ void detect_host_bridge() */ } pci_read_config_dword(0, 0, 0, 0, &id0); - if(id0 == PCI_VENDOR_ID_MOTOROLA + - (PCI_DEVICE_ID_MOTOROLA_RAVEN<<16)) { +#ifdef SHOW_RAVEN_SETTINGS + printk("idreg 0 = 0x%x\n",id0); +#endif + if((id0 == PCI_VENDOR_ID_MOTOROLA + + (PCI_DEVICE_ID_MOTOROLA_RAVEN<<16)) || + (id0 == PCI_VENDOR_ID_MOTOROLA + + (PCI_DEVICE_ID_MOTOROLA_HAWK<<16))) { /* * We have a Raven bridge. We will get information about its settings */ diff --git a/c/src/lib/libbsp/powerpc/shared/pci/pci.c b/c/src/lib/libbsp/powerpc/shared/pci/pci.c index db2f4d9997..9f997d703f 100644 --- a/c/src/lib/libbsp/powerpc/shared/pci/pci.c +++ b/c/src/lib/libbsp/powerpc/shared/pci/pci.c @@ -26,6 +26,8 @@ #include <bsp/pci.h> #include <rtems/bspIo.h> +#undef SHOW_PCI_SETTING + /* allow for overriding these definitions */ #ifndef PCI_CONFIG_ADDR #define PCI_CONFIG_ADDR 0xcf8 @@ -359,12 +361,12 @@ static int FindPCIbridge( int mybus, struct pcibridge *pb ) pci_read_config_byte(pbus, pslot, 0, PCI_PRIMARY_BUS, &buspri); pci_read_config_byte(pbus, pslot, 0, PCI_SECONDARY_BUS, &bussec); -#if 0 +#ifdef SHOW_PCI_SETTING printk("pci : Found bridge at %d:0x%02x, mybus %d, pribus %d, secbus %d ", pbus, pslot, mybus, buspri, bussec ); #endif if ( bussec == mybus ) { -#if 0 +#ifdef SHOW_PCI_SETTING printk("match\n"); #endif /* found our nearest bridge going towards the root */ @@ -373,7 +375,7 @@ static int FindPCIbridge( int mybus, struct pcibridge *pb ) return 0; } -#if 0 +#ifdef SHOW_PCI_SETTING printk("no match\n"); #endif } @@ -417,7 +419,7 @@ void FixupPCI( const struct _int_map *bspmap, int (*swizzler)(int,int) ) /* printk("pci : device %d:0x%02x:%i devid %04x, intpin %d, intline %d\n", pbus, pslot, pfun, devid, int_pin, int_name ); */ -#if 0 +#ifdef SHOW_PCI_SETTING { unsigned short cmd,stat; unsigned char lat, seclat, csize; |