Skip to content

Commit 2395133

Browse files
ralfbaechleLinus Torvalds
authored andcommitted
[PATCH] SGI IP22 bits
An update for the Indy aka IP22 support. Consolidates the 32-bit and 64-bit copies of the support code into one directory, so in total this patch deletes quite a bit of code.
1 parent f19e2d9 commit 2395133

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4672
-6642
lines changed

arch/mips/defconfig

Lines changed: 350 additions & 349 deletions
Large diffs are not rendered by default.

arch/mips/defconfig-ip22

Lines changed: 350 additions & 349 deletions
Large diffs are not rendered by default.

arch/mips/sgi-ip22/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Makefile for the SGI specific kernel interface routines
3+
# under Linux.
4+
#
5+
6+
obj-y += ip22-mc.o ip22-hpc.o ip22-int.o ip22-irq.o ip22-berr.o \
7+
ip22-time.o ip22-rtc.o ip22-nvram.o ip22-reset.o \
8+
ip22-setup.o ip22-ksyms.o
9+
10+
obj-$(CONFIG_EISA) += ip22-eisa.o
11+
12+
EXTRA_AFLAGS := $(CFLAGS)

arch/mips/sgi-ip22/ip22-berr.c

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* ip22-berr.c: Bus error handling.
3+
*
4+
* Copyright (C) 2002 Ladislav Michl
5+
*/
6+
7+
#include <linux/init.h>
8+
#include <linux/kernel.h>
9+
#include <linux/sched.h>
10+
11+
#include <asm/addrspace.h>
12+
#include <asm/system.h>
13+
#include <asm/traps.h>
14+
#include <asm/branch.h>
15+
#include <asm/sgi/mc.h>
16+
#include <asm/sgi/hpc3.h>
17+
18+
19+
static unsigned int cpu_err_stat; /* Status reg for CPU */
20+
static unsigned int gio_err_stat; /* Status reg for GIO */
21+
static unsigned int cpu_err_addr; /* Error address reg for CPU */
22+
static unsigned int gio_err_addr; /* Error address reg for GIO */
23+
24+
static void save_and_clear_buserr(void)
25+
{
26+
/* save memory controler's error status registers */
27+
cpu_err_addr = sgimc->cerr;
28+
cpu_err_stat = sgimc->cstat;
29+
gio_err_addr = sgimc->gerr;
30+
gio_err_stat = sgimc->gstat;
31+
32+
sgimc->cstat = sgimc->gstat = 0;
33+
}
34+
35+
#define GIO_ERRMASK 0xff00
36+
#define CPU_ERRMASK 0x3f00
37+
38+
static void print_buserr(void)
39+
{
40+
if (cpu_err_stat & CPU_ERRMASK)
41+
printk(KERN_ALERT "CPU error 0x%x<%s%s%s%s%s%s> @ 0x%08x\n",
42+
cpu_err_stat,
43+
cpu_err_stat & SGIMC_CSTAT_RD ? "RD " : "",
44+
cpu_err_stat & SGIMC_CSTAT_PAR ? "PAR " : "",
45+
cpu_err_stat & SGIMC_CSTAT_ADDR ? "ADDR " : "",
46+
cpu_err_stat & SGIMC_CSTAT_SYSAD_PAR ? "SYSAD " : "",
47+
cpu_err_stat & SGIMC_CSTAT_SYSCMD_PAR ? "SYSCMD " : "",
48+
cpu_err_stat & SGIMC_CSTAT_BAD_DATA ? "BAD_DATA " : "",
49+
cpu_err_addr);
50+
if (gio_err_stat & GIO_ERRMASK)
51+
printk(KERN_ALERT "GIO error 0x%x:<%s%s%s%s%s%s%s%s> @ 0x08%x\n",
52+
gio_err_stat,
53+
gio_err_stat & SGIMC_GSTAT_RD ? "RD " : "",
54+
gio_err_stat & SGIMC_GSTAT_WR ? "WR " : "",
55+
gio_err_stat & SGIMC_GSTAT_TIME ? "TIME " : "",
56+
gio_err_stat & SGIMC_GSTAT_PROM ? "PROM " : "",
57+
gio_err_stat & SGIMC_GSTAT_ADDR ? "ADDR " : "",
58+
gio_err_stat & SGIMC_GSTAT_BC ? "BC " : "",
59+
gio_err_stat & SGIMC_GSTAT_PIO_RD ? "PIO_RD " : "",
60+
gio_err_stat & SGIMC_GSTAT_PIO_WR ? "PIO_WR " : "",
61+
gio_err_addr);
62+
}
63+
64+
/*
65+
* MC sends an interrupt whenever bus or parity errors occur. In addition,
66+
* if the error happened during a CPU read, it also asserts the bus error
67+
* pin on the R4K. Code in bus error handler save the MC bus error registers
68+
* and then clear the interrupt when this happens.
69+
*/
70+
71+
void ip22_be_interrupt(int irq, struct pt_regs *regs)
72+
{
73+
save_and_clear_buserr();
74+
print_buserr();
75+
panic("Bus error, epc == %08lx, ra == %08lx",
76+
regs->cp0_epc, regs->regs[31]);
77+
}
78+
79+
int ip22_be_handler(struct pt_regs *regs, int is_fixup)
80+
{
81+
save_and_clear_buserr();
82+
if (is_fixup)
83+
return MIPS_BE_FIXUP;
84+
print_buserr();
85+
return MIPS_BE_FATAL;
86+
}
87+
88+
void __init ip22_be_init(void)
89+
{
90+
board_be_handler = ip22_be_handler;
91+
}

0 commit comments

Comments
 (0)