Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11015
b: refs/heads/master
c: c4ed38a
h: refs/heads/master
i:
  11013: 3d703b4
  11011: d42e6b3
  11007: 52697f9
v: v3
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent 9566b6d commit 11794a2
Show file tree
Hide file tree
Showing 15 changed files with 277 additions and 224 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 049b13c358f0187cf3c5003d5fb9848dbcb28bc3
refs/heads/master: c4ed38a0c6e2e5c4906296758f816ee71373792f
1 change: 1 addition & 0 deletions trunk/arch/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ load-$(CONFIG_MIPS_XXS1500) += 0xffffffff80100000
# Cobalt Server
#
core-$(CONFIG_MIPS_COBALT) += arch/mips/cobalt/
cflags-$(CONFIG_MIPS_COBALT) += -Iinclude/asm-mips/cobalt
load-$(CONFIG_MIPS_COBALT) += 0xffffffff80080000

#
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/mips/cobalt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Makefile for the Cobalt micro systems family specific parts of the kernel
#

obj-y := irq.o int-handler.o reset.o setup.o promcon.o
obj-y := irq.o int-handler.o reset.o setup.o

EXTRA_AFLAGS := $(CFLAGS)
4 changes: 2 additions & 2 deletions trunk/arch/mips/cobalt/int-handler.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
SAVE_ALL
CLI

la ra, ret_from_irq
move a1, sp
PTR_LA ra, ret_from_irq
move a0, sp
j cobalt_irq

END(cobalt_handle_int)
111 changes: 73 additions & 38 deletions trunk/arch/mips/cobalt/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/pci.h>

#include <asm/i8259.h>
#include <asm/irq_cpu.h>
Expand All @@ -25,8 +27,8 @@ extern void cobalt_handle_int(void);
* the CPU interrupt lines, and ones that come in on the via chip. The CPU
* mappings are:
*
* 16, - Software interrupt 0 (unused) IE_SW0
* 17 - Software interrupt 1 (unused) IE_SW0
* 16 - Software interrupt 0 (unused) IE_SW0
* 17 - Software interrupt 1 (unused) IE_SW1
* 18 - Galileo chip (timer) IE_IRQ0
* 19 - Tulip 0 + NCR SCSI IE_IRQ1
* 20 - Tulip 1 IE_IRQ2
Expand All @@ -42,61 +44,94 @@ extern void cobalt_handle_int(void);
* 15 - IDE1
*/

asmlinkage void cobalt_irq(struct pt_regs *regs)
static inline void galileo_irq(struct pt_regs *regs)
{
unsigned int pending = read_c0_status() & read_c0_cause();

if (pending & CAUSEF_IP2) { /* int 18 */
unsigned long irq_src = GALILEO_INL(GT_INTRCAUSE_OFS);

/* Check for timer irq ... */
if (irq_src & GALILEO_T0EXP) {
/* Clear the int line */
GALILEO_OUTL(0, GT_INTRCAUSE_OFS);
do_IRQ(COBALT_TIMER_IRQ, regs);
}
return;
}
unsigned int mask, pending, devfn;

if (pending & CAUSEF_IP6) { /* int 22 */
int irq = i8259_irq();
mask = GALILEO_INL(GT_INTRMASK_OFS);
pending = GALILEO_INL(GT_INTRCAUSE_OFS) & mask;

if (irq >= 0)
do_IRQ(irq, regs);
return;
}
if (pending & GALILEO_INTR_T0EXP) {

if (pending & CAUSEF_IP3) { /* int 19 */
do_IRQ(COBALT_ETH0_IRQ, regs);
return;
}
GALILEO_OUTL(~GALILEO_INTR_T0EXP, GT_INTRCAUSE_OFS);
do_IRQ(COBALT_GALILEO_IRQ, regs);

if (pending & CAUSEF_IP4) { /* int 20 */
do_IRQ(COBALT_ETH1_IRQ, regs);
return;
}
} else if (pending & GALILEO_INTR_RETRY_CTR) {

if (pending & CAUSEF_IP5) { /* int 21 */
do_IRQ(COBALT_SERIAL_IRQ, regs);
return;
}
devfn = GALILEO_INL(GT_PCI0_CFGADDR_OFS) >> 8;
GALILEO_OUTL(~GALILEO_INTR_RETRY_CTR, GT_INTRCAUSE_OFS);
printk(KERN_WARNING "Galileo: PCI retry count exceeded (%02x.%u)\n",
PCI_SLOT(devfn), PCI_FUNC(devfn));

} else {

if (pending & CAUSEF_IP7) { /* int 23 */
do_IRQ(COBALT_QUBE_SLOT_IRQ, regs);
return;
GALILEO_OUTL(mask & ~pending, GT_INTRMASK_OFS);
printk(KERN_WARNING "Galileo: masking unexpected interrupt %08x\n", pending);
}
}

static inline void via_pic_irq(struct pt_regs *regs)
{
int irq;

irq = i8259_irq();
if (irq >= 0)
do_IRQ(irq, regs);
}

asmlinkage void cobalt_irq(struct pt_regs *regs)
{
unsigned pending;

pending = read_c0_status() & read_c0_cause();

if (pending & CAUSEF_IP2) /* COBALT_GALILEO_IRQ (18) */

galileo_irq(regs);

else if (pending & CAUSEF_IP6) /* COBALT_VIA_IRQ (22) */

via_pic_irq(regs);

else if (pending & CAUSEF_IP3) /* COBALT_ETH0_IRQ (19) */

do_IRQ(COBALT_CPU_IRQ + 3, regs);

else if (pending & CAUSEF_IP4) /* COBALT_ETH1_IRQ (20) */

do_IRQ(COBALT_CPU_IRQ + 4, regs);

else if (pending & CAUSEF_IP5) /* COBALT_SERIAL_IRQ (21) */

do_IRQ(COBALT_CPU_IRQ + 5, regs);

else if (pending & CAUSEF_IP7) /* IRQ 23 */

do_IRQ(COBALT_CPU_IRQ + 7, regs);
}

static struct irqaction irq_via = {
no_action, 0, { { 0, } }, "cascade", NULL, NULL
};

void __init arch_init_irq(void)
{
/*
* Mask all Galileo interrupts. The Galileo
* handler is set in cobalt_timer_setup()
*/
GALILEO_OUTL(0, GT_INTRMASK_OFS);

set_except_vector(0, cobalt_handle_int);

init_i8259_irqs(); /* 0 ... 15 */
mips_cpu_irq_init(16); /* 16 ... 23 */
mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */

/*
* Mask all cpu interrupts
* (except IE4, we already masked those at VIA level)
*/
change_c0_status(ST0_IM, IE_IRQ4);

setup_irq(COBALT_VIA_IRQ, &irq_via);
}
87 changes: 0 additions & 87 deletions trunk/arch/mips/cobalt/promcon.c

This file was deleted.

59 changes: 28 additions & 31 deletions trunk/arch/mips/cobalt/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,45 @@
#include <asm/reboot.h>
#include <asm/system.h>
#include <asm/mipsregs.h>
#include <asm/cobalt/cobalt.h>

void cobalt_machine_restart(char *command)
void cobalt_machine_halt(void)
{
*(volatile char *)0xbc000000 = 0x0f;
int state, last, diff;
unsigned long mark;

/*
* Ouch, we're still alive ... This time we take the silver bullet ...
* ... and find that we leave the hardware in a state in which the
* kernel in the flush locks up somewhen during of after the PCI
* detection stuff.
* turn off bar on Qube, flash power off LED on RaQ (0.5Hz)
*
* restart if ENTER and SELECT are pressed
*/
set_c0_status(ST0_BEV | ST0_ERL);
change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED);
flush_cache_all();
write_c0_wired(0);
__asm__ __volatile__(
"jr\t%0"
:
: "r" (0xbfc00000));
}

extern int led_state;
#define kLED 0xBC000000
#define LEDSet(x) (*(volatile unsigned char *) kLED) = (( unsigned char)x)
last = COBALT_KEY_PORT;

void cobalt_machine_halt(void)
{
int mark;
for (state = 0;;) {

state ^= COBALT_LED_POWER_OFF;
COBALT_LED_PORT = state;

diff = COBALT_KEY_PORT ^ last;
last ^= diff;

/* Blink our cute? little LED (number 3)... */
while (1) {
led_state = led_state | ( 1 << 3 );
LEDSet(led_state);
mark = jiffies;
while (jiffies<(mark+HZ));
led_state = led_state & ~( 1 << 3 );
LEDSet(led_state);
mark = jiffies;
while (jiffies<(mark+HZ));
if((diff & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)) && !(~last & (COBALT_KEY_ENTER | COBALT_KEY_SELECT)))
COBALT_LED_PORT = COBALT_LED_RESET;

for (mark = jiffies; jiffies - mark < HZ;)
;
}
}

void cobalt_machine_restart(char *command)
{
COBALT_LED_PORT = COBALT_LED_RESET;

/* we should never get here */
cobalt_machine_halt();
}

/*
* This triggers the luser mode device driver for the power switch ;-)
*/
Expand Down
Loading

0 comments on commit 11794a2

Please sign in to comment.