mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
2003-06-13 Till Straumann <strauman@slac.stanford.edu>
PR 415/bsps * include/bsp.h, pci/detect_raven_bridge.c, startup/bspstart.c: Support enabling MCP exceptions on the host bridge. This can be used for memory probing on the VME bus.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2003-06-13 Till Straumann <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
|
PR 415/bsps
|
||||||
|
* include/bsp.h, pci/detect_raven_bridge.c, startup/bspstart.c:
|
||||||
|
Support enabling MCP exceptions on the host bridge. This can
|
||||||
|
be used for memory probing on the VME bus.
|
||||||
|
|
||||||
2003-04-15 Joel Sherrill <joel@OARcorp.com>
|
2003-04-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
PR 386/bsps
|
PR 386/bsps
|
||||||
|
|||||||
@@ -91,6 +91,21 @@ extern void rtemsReboot(void);
|
|||||||
extern int BSP_disconnect_clock_handler (void);
|
extern int BSP_disconnect_clock_handler (void);
|
||||||
extern int BSP_connect_clock_handler (void);
|
extern int BSP_connect_clock_handler (void);
|
||||||
|
|
||||||
|
/* clear hostbridge errors
|
||||||
|
*
|
||||||
|
* enableMCP: whether to enable MCP checkstop / machine check interrupts
|
||||||
|
* on the hostbridge and in HID0.
|
||||||
|
*
|
||||||
|
* NOTE: HID0 and MEREN are left alone if this flag is 0
|
||||||
|
*
|
||||||
|
* quiet : be silent
|
||||||
|
*
|
||||||
|
* RETURNS : raven MERST register contents (lowermost 16 bits), 0 if
|
||||||
|
* there were no errors
|
||||||
|
*/
|
||||||
|
extern unsigned long _BSP_clear_hostbridge_errors(int enableMCP, int quiet);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TM27 stuff
|
* TM27 stuff
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libcpu/io.h>
|
#include <libcpu/io.h>
|
||||||
|
#include <libcpu/spr.h>
|
||||||
|
|
||||||
#include <bsp.h>
|
#include <bsp.h>
|
||||||
#include <bsp/pci.h>
|
#include <bsp/pci.h>
|
||||||
@@ -12,6 +13,8 @@
|
|||||||
|
|
||||||
#include <rtems/bspIo.h>
|
#include <rtems/bspIo.h>
|
||||||
|
|
||||||
|
SPR_RW(HID0)
|
||||||
|
|
||||||
#define RAVEN_MPIC_IOSPACE_ENABLE 0x1
|
#define RAVEN_MPIC_IOSPACE_ENABLE 0x1
|
||||||
#define RAVEN_MPIC_MEMSPACE_ENABLE 0x2
|
#define RAVEN_MPIC_MEMSPACE_ENABLE 0x2
|
||||||
#define RAVEN_MASTER_ENABLE 0x4
|
#define RAVEN_MASTER_ENABLE 0x4
|
||||||
@@ -19,11 +22,43 @@
|
|||||||
#define RAVEN_SYSTEM_ERROR_ENABLE 0x100
|
#define RAVEN_SYSTEM_ERROR_ENABLE 0x100
|
||||||
#define RAVEN_CLEAR_EVENTS_MASK 0xf9000000
|
#define RAVEN_CLEAR_EVENTS_MASK 0xf9000000
|
||||||
|
|
||||||
|
#define RAVEN_MPIC_MEREN 0xfeff0020
|
||||||
|
#define RAVEN_MPIC_MERST 0xfeff0024
|
||||||
|
/* enable machine check on all conditions
|
||||||
|
* EXCEPT for signalled master abort (which
|
||||||
|
* can be caused by PCI configuration space
|
||||||
|
* accesses to non-present devices)
|
||||||
|
* - of course, this is sort of a hack :-(
|
||||||
|
*/
|
||||||
|
#define MEREN_VAL 0x2d00
|
||||||
|
|
||||||
#define pci BSP_pci_configuration
|
#define pci BSP_pci_configuration
|
||||||
|
|
||||||
extern const pci_config_access_functions pci_direct_functions;
|
extern const pci_config_access_functions pci_direct_functions;
|
||||||
extern const pci_config_access_functions pci_indirect_functions;
|
extern const pci_config_access_functions pci_indirect_functions;
|
||||||
|
|
||||||
|
unsigned long
|
||||||
|
_BSP_clear_hostbridge_errors(int enableMCP, int quiet)
|
||||||
|
{
|
||||||
|
unsigned merst;
|
||||||
|
|
||||||
|
merst = in_be32(RAVEN_MPIC_MERST);
|
||||||
|
/* write back value to clear status */
|
||||||
|
out_be32(RAVEN_MPIC_MERST, merst);
|
||||||
|
|
||||||
|
if (enableMCP) {
|
||||||
|
if (!quiet)
|
||||||
|
printk("Enabling MCP generation on hostbridge errors\n");
|
||||||
|
out_be32(RAVEN_MPIC_MEREN, MEREN_VAL);
|
||||||
|
_write_HID0(_read_HID0() | HID0_EMCP );
|
||||||
|
} else {
|
||||||
|
if ( !quiet && enableMCP ) {
|
||||||
|
printk("leaving MCP interrupt disabled\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (merst & 0xffff);
|
||||||
|
}
|
||||||
|
|
||||||
void detect_host_bridge()
|
void detect_host_bridge()
|
||||||
{
|
{
|
||||||
PPC_DEVICE *hostbridge;
|
PPC_DEVICE *hostbridge;
|
||||||
|
|||||||
@@ -323,6 +323,9 @@ void bsp_start( void )
|
|||||||
BSP_time_base_divisor = (residualCopy.VitalProductData.TimeBaseDivisor?
|
BSP_time_base_divisor = (residualCopy.VitalProductData.TimeBaseDivisor?
|
||||||
residualCopy.VitalProductData.TimeBaseDivisor : 4000);
|
residualCopy.VitalProductData.TimeBaseDivisor : 4000);
|
||||||
|
|
||||||
|
/* clear hostbridge errors and enable MCP */
|
||||||
|
_BSP_clear_hostbridge_errors(1/*enableMCP*/, 0/*quiet*/);
|
||||||
|
|
||||||
/* Allocate and set up the page table mappings
|
/* Allocate and set up the page table mappings
|
||||||
* This is only available on >604 CPUs.
|
* This is only available on >604 CPUs.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user