linux-mips
[Top] [All Lists]

Re: EISA support

To: Linux SGI <linux@cthulhu.engr.sgi.com>
Subject: Re: EISA support
From: "Andrew R. Baker" <andrewb@uab.edu>
Date: Wed, 4 Aug 1999 23:19:27 -0500 (CDT)
In-reply-to: <19990803011720.C29946@uni-koblenz.de>
Reply-to: "Andrew R. Baker" <andrewb@uab.edu>
Sender: owner-linux@cthulhu.engr.sgi.com
Here is my first patch for moving around interrupts for future support of
EISA.  I want reassurance that I've done all of this step before I send
out the code that actually moves them around.  I have defined everything
in the form of "SGI_XXXX_IRQ" to match the definition for the keyboard irq
that used to be in sgihpc.h.  These patches go against the linux_2_2
branch but should apply to the 2.3 branch as well.  Let me know what you
think.

-Andrew 
--- linux/include/asm-mips/sgihpc.h.orig        Wed Aug  4 20:11:53 1999
+++ linux/include/asm-mips/sgihpc.h     Wed Aug  4 20:10:52 1999
@@ -330,8 +330,6 @@
 /* We need software copies of these because they are write only. */
 extern unsigned long sgi_hpc_write1, sgi_hpc_write2;
 
-#define SGI_KEYBOARD_IRQ 20
-
 struct hpc_keyb {
 #ifdef __MIPSEB__
        unsigned char _unused0[3];
--- linux/include/asm-mips/sgint23.h.orig       Wed Aug  4 20:19:27 1999
+++ linux/include/asm-mips/sgint23.h    Wed Aug  4 22:54:39 1999
@@ -20,6 +20,19 @@
 #define SGINT_HPCDMA   41  /* INDY has 11 HPCDMA irq _sources_ */
 #define SGINT_END      52  /* End of 'spaces' */
 
+/* Individual interrupt definitions for the INDY and Indigo2
+ */
+
+#define SGI_WD93_0_IRQ SGINT_LOCAL0 + 1        /* 1st onboard WD93 */
+#define SGI_WD93_1_IRQ SGINT_LOCAL0 + 2        /* 2nd onboard WD93 */
+#define SGI_ENET_IRQ   SGINT_LOCAL0 + 3        /* onboard ethernet */
+
+#define SGI_PANEL_IRQ  SGINT_LOCAL1 + 1        /* front panel */
+
+#define SGI_EISA_IRQ   SGINT_LOCAL2 + 3        /* EISA interrupts */
+#define SGI_KEYBOARD_IRQ       SGINT_LOCAL2 + 4        /* keyboard */
+#define SGI_SERIAL_IRQ SGINT_LOCAL2 + 5        /* onboard serial */
+
 /* INT2 occupies HPC PBUS slot 4, INT3 uses slot 6. */
 #define SGI_INT2_BASE 0x1fbd9000 /* physical */
 #define SGI_INT3_BASE 0x1fbd9880 /* physical */
--- linux/drivers/net/sgiseeq.c.orig    Wed Aug  4 22:28:46 1999
+++ linux/drivers/net/sgiseeq.c Wed Aug  4 21:59:15 1999
@@ -738,5 +738,5 @@
        str2eaddr(onboard_eth_addr, ep);
        return sgiseeq_init(dev,
                            (struct sgiseeq_regs *) (KSEG1ADDR(0x1fbd4000)),
-                           &hpc3c0->ethregs, 3);
+                           &hpc3c0->ethregs, SGI_ENET_IRQ);
 }
--- linux/drivers/scsi/sgiwd93.c.orig   Wed Aug  4 21:59:51 1999
+++ linux/drivers/scsi/sgiwd93.c        Wed Aug  4 22:02:22 1999
@@ -281,7 +281,7 @@
 
        sgiwd93_host = scsi_register(HPsUX, sizeof(struct WD33C93_hostdata));
        sgiwd93_host->base = (unsigned char *) hregs;
-       sgiwd93_host->irq = 1;
+       sgiwd93_host->irq = SGI_WD93_0_IRQ;
 
        buf = (uchar *) get_free_page(GFP_KERNEL);
        init_hpc_chain(buf);
@@ -295,12 +295,12 @@
        hdata->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
        dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
 
-       request_irq(1, sgiwd93_intr, 0, "SGI WD93", (void *) sgiwd93_host);
+       request_irq(SGI_WD93_0_IRQ, sgiwd93_intr, 0, "SGI WD93", (void *) 
sgiwd93_host);
         /* set up second controller on the Indigo2 */
        if(!sgi_guiness) {
                sgiwd93_host1 = scsi_register(HPsUX, sizeof(struct 
WD33C93_hostdata));
                sgiwd93_host1->base = (unsigned char *) hregs1;
-               sgiwd93_host1->irq = 2;
+               sgiwd93_host1->irq = SGI_WD93_1_IRQ;
 
                buf = (uchar *) get_free_page(GFP_KERNEL);
                init_hpc_chain(buf);
@@ -314,7 +314,7 @@
                hdata1->dma_bounce_buffer = (uchar *) (KSEG1ADDR(buf));
                dma_cache_wback_inv((unsigned long) buf, PAGE_SIZE);
 
-               request_irq(2, sgiwd93_intr, 0, "SGI WD93", (void *) 
sgiwd93_host1);
+               request_irq(SGI_WD93_1_IRQ, sgiwd93_intr, 0, "SGI WD93", (void 
*) sgiwd93_host1);
        }
        
        called = 1;
@@ -337,9 +337,14 @@
 int sgiwd93_release(struct Scsi_Host *instance)
 {
 #ifdef MODULE
-       free_irq(1, sgiwd93_intr);
+       free_irq(SGI_WD93_0_IRQ, sgiwd93_intr);
        free_page(KSEG0ADDR(hdata->dma_bounce_buffer));
        wd33c93_release();
+       if (!sgi_guiness) {
+               free_irq(SGI_WD93_1_IRQ, sgiwd93_intr);
+               free_page(KSEG0ADDR(hdata1->dma_bounce_buffer));
+               wd33c93_release();
+       }
 #endif
        return 1;
 }
--- linux/arch/mips/sgi/kernel/reset.c.orig     Wed Aug  4 22:52:59 1999
+++ linux/arch/mips/sgi/kernel/reset.c  Wed Aug  4 21:45:59 1999
@@ -108,7 +108,7 @@
        if (has_paniced)
                prom_reboot();
 
-       enable_irq(9);
+       enable_irq(SGI_PANEL_IRQ);
 }
 
 static inline void power_button(void)
@@ -185,7 +185,7 @@
        hpc3mregs->panel = 3; /* power_interrupt | power_supply_on */
 
        if (ioc_icontrol->istat1 & 2) { /* Wait until interrupt goes away */
-               disable_irq(9);
+               disable_irq(SGI_PANEL_IRQ);
                init_timer(&debounce_timer);
                debounce_timer.function = debounce;
                debounce_timer.expires = jiffies + 5;
@@ -239,7 +239,7 @@
        _machine_halt = sgi_machine_halt;
        _machine_power_off = sgi_machine_power_off;
 
-       request_irq(9, panel_int, 0, "Front Panel", NULL);
+       request_irq(SGI_PANEL_IRQ, panel_int, 0, "Front Panel", NULL);
        init_timer(&blink_timer);
        blink_timer.function = blink_timeout;
        notifier_chain_register(&panic_notifier_list, &panic_block);
<Prev in Thread] Current Thread [Next in Thread>