summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2005-10-20 18:38:26 +0000
committerEric Norum <WENorum@lbl.gov>2005-10-20 18:38:26 +0000
commitcc2fcc1655fb5e0b6d9faefa2e1c8f7c0f4376fe (patch)
treedc8535e4fe9ac154e0c2ca37a4c9a5d0bb399d28 /c/src/lib/libbsp/powerpc/shared
parentCosmetics (diff)
downloadrtems-cc2fcc1655fb5e0b6d9faefa2e1c8f7c0f4376fe.tar.bz2
Numerous changes and cleanups to support MVME2100.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/pci/detect_raven_bridge.c52
-rw-r--r--c/src/lib/libbsp/powerpc/shared/startup/bspstart.c2
-rw-r--r--c/src/lib/libbsp/powerpc/shared/vme/VMEConfig.h6
3 files changed, 45 insertions, 15 deletions
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 aa5da28060..1f02d4d2f6 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
@@ -32,26 +32,50 @@ extern unsigned int EUMBBAR;
extern const pci_config_access_functions pci_direct_functions;
extern const pci_config_access_functions pci_indirect_functions;
+#define PCI_ERR_BITS 0xf900
+#define PCI_STATUS_OK(x) (!((x)&PCI_ERR_BITS))
+
+/* For now, just clear errors in the PCI status reg.
+ *
+ * Returns: (for diagnostic purposes)
+ * original settings (i.e. before applying the clearing
+ * sequence) or the error bits or 0 if there were no errors.
+ *
+ */
+
unsigned long
_BSP_clear_hostbridge_errors(int enableMCP, int quiet)
{
-unsigned merst;
+unsigned long rval;
+unsigned short pcistat;
+int count;
- merst = in_be32(RAVEN_MPIC_MERST);
- /* write back value to clear status */
- out_be32(RAVEN_MPIC_MERST, merst);
+ if (enableMCP)
+ return -1; /* exceptions not supported / MCP not wired */
- if (enableMCP) {
- if (!quiet)
- printk("Enabling MCP generation on hostbridge errors\n");
- out_be32(RAVEN_MPIC_MEREN, MEREN_VAL);
- } else {
- out_be32(RAVEN_MPIC_MEREN, 0);
- if ( !quiet && enableMCP ) {
- printk("leaving MCP interrupt disabled\n");
- }
+ /* read error status for info return */
+ pci_read_config_word(0,0,0,PCI_STATUS,&pcistat);
+ rval = pcistat;
+
+ count=10;
+ do {
+ /* clear error reporting registers */
+
+ /* clear PCI status register */
+ pci_write_config_word(0,0,0,PCI_STATUS, PCI_ERR_BITS);
+
+ /* read new status */
+ pci_read_config_word(0,0,0,PCI_STATUS, &pcistat);
+
+ } while ( ! PCI_STATUS_OK(pcistat) && count-- );
+
+ if ( !PCI_STATUS_OK(rval) && !quiet) {
+ printk("Cleared PCI errors: pci_stat was 0x%04x\n", rval);
+ }
+ if ( !PCI_STATUS_OK(pcistat) ) {
+ printk("Unable to clear PCI errors: still 0x%04x after 10 attempts\n", pcistat);
}
- return (merst & 0xffff);
+ return rval & PCI_ERR_BITS;
}
void detect_host_bridge()
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c b/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c
index e0b87d6825..73b02117b7 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/bspstart.c
@@ -333,7 +333,7 @@ void bsp_start( void )
*
* T. Straumann: give more PCI address space
*/
- setdbat(2, PCI_MEM_BASE, PCI_MEM_BASE, 0x10000000, IO_PAGE);
+ setdbat(2, PCI_MEM_BASE+PCI_MEM_WIN0, PCI_MEM_BASE+PCI_MEM_WIN0, 0x10000000, IO_PAGE);
/*
* Must have acces to open pic PCI ACK registers provided by the RAVEN
diff --git a/c/src/lib/libbsp/powerpc/shared/vme/VMEConfig.h b/c/src/lib/libbsp/powerpc/shared/vme/VMEConfig.h
index 482e0bfc39..6f89457273 100644
--- a/c/src/lib/libbsp/powerpc/shared/vme/VMEConfig.h
+++ b/c/src/lib/libbsp/powerpc/shared/vme/VMEConfig.h
@@ -11,9 +11,15 @@
* hardcoded window lengths that match this
* layout:
*/
+#if defined(mvme2100)
+#define _VME_A32_WIN0_ON_PCI 0x90000000
+#define _VME_A24_ON_PCI 0x9f000000
+#define _VME_A16_ON_PCI 0x9fff0000
+#else
#define _VME_A32_WIN0_ON_PCI 0x10000000
#define _VME_A24_ON_PCI 0x1f000000
#define _VME_A16_ON_PCI 0x1fff0000
+#endif
/* start of the A32 window on the VME bus
* TODO: this should perhaps be a configuration option