[parisc-linux-cvs] SuckyIO parport support, minixfs-fixes

Helge Deller deller@gmx.de
Sun, 10 Jun 2001 18:22:21 +0200


Higlights:
- added SuckyIO parport support,
- minixfs fixes
_________________________________________________________
EXTRAVERSION = -pa16

defconfig:
- re-enabled CONFIG_CHASSIS_LCD_LED=y (should work now on all machines)
- CONFIG_JOLIET=y
- CONFIG_PARPORT_PC=y (needed by SuperIO aka SuckyIO parport support)

superio.c/superio.h:
- added lots of KERN_WARNINGs and KERN_ERRs to printk()s
- added SuckyIO parport support (tested on C3k)
- added __init's

parport_gsc.c:
- support for SuckyIO's parport
- added __init and __devinit

bitops.h:
- added some missing minix_xxx_bit() functions; makes minix compileable
____________________________________________________________
Index: Makefile
===================================================================
RCS file: /home/cvs/parisc/linux/Makefile,v
retrieving revision 1.48
diff -u -r1.48 Makefile
--- Makefile	2001/06/08 13:58:03	1.48
+++ Makefile	2001/06/10 15:59:49
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 0
-EXTRAVERSION = -pa15
+EXTRAVERSION = -pa16
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: arch/parisc/defconfig
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/defconfig,v
retrieving revision 1.34
diff -u -r1.34 defconfig
--- defconfig	2001/05/15 22:53:46	1.34
+++ defconfig	2001/06/10 15:59:50
@@ -32,7 +32,7 @@
 CONFIG_IOSAPIC=y
 CONFIG_IOMMU_SBA=y
 CONFIG_PCI_NAMES=y
-# CONFIG_CHASSIS_LCD_LED is not set
+CONFIG_CHASSIS_LCD_LED=y
 
 #
 # General setup
@@ -52,7 +52,7 @@
 # Parallel port support
 #
 CONFIG_PARPORT=y
-# CONFIG_PARPORT_PC is not set
+CONFIG_PARPORT_PC=y
 # CONFIG_PARPORT_AMIGA is not set
 # CONFIG_PARPORT_MFC3 is not set
 # CONFIG_PARPORT_ATARI is not set
@@ -404,7 +404,7 @@
 # CONFIG_CRAMFS is not set
 # CONFIG_RAMFS is not set
 CONFIG_ISO9660_FS=y
-# CONFIG_JOLIET is not set
+CONFIG_JOLIET=y
 # CONFIG_MINIX_FS is not set
 # CONFIG_NTFS_FS is not set
 # CONFIG_NTFS_RW is not set
Index: arch/parisc/kernel/superio.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/superio.c,v
retrieving revision 1.2
diff -u -r1.2 superio.c
--- superio.c	2001/03/29 10:32:49	1.2
+++ superio.c	2001/06/10 15:59:50
@@ -68,6 +68,8 @@
 #include <linux/serial.h>
 #include <linux/pci.h>
 #include <linux/ioport.h>
+#include <linux/parport.h>
+#include <linux/parport_pc.h>
 #include <asm/serial.h>
 #include <linux/serial_reg.h>
 #include <asm/io.h>
@@ -84,7 +86,7 @@
 superio_inform_irq(int irq)
 {
     if (sio_dev.iosapic_irq != -1) {
-	printk("SuperIO: superio_inform_irq called twice! (more than one 
SuperIO?)\n");
+	printk(KERN_ERR "SuperIO: superio_inform_irq called twice! (more than one 
SuperIO?)\n");
 	BUG();
 	return;
     }
@@ -116,7 +118,7 @@
 	local_irq = results & 0x7;
 
 	if (local_irq == 2 || local_irq > 7) {
-		printk("superio: slave interrupted!\n");
+		printk(KERN_ERR "SuperIO: slave interrupted!\n");
 		BUG();
 		return;
 	}
@@ -128,7 +130,7 @@
 		outb(OCW3_ISR,IC_PIC1+0);
 		results = inb(IC_PIC1+0);
 		if ((results & 0x80) == 0) { /* if ISR7 not set: spurious */
-			printk("spurious interrupt!\n");
+			printk(KERN_WARNING "SuperIO: spurious interrupt!\n");
 			return;
 		}
 	}
@@ -147,7 +149,7 @@
 
 /* Initialize Super I/O device */
 
-static void
+static void __devinit
 superio_init(struct superio_device *sio)
 {
 	u8  i;
@@ -155,30 +157,30 @@
 	struct pci_dev *pdev = sio->lio_pdev;
 
 	if (!pdev || sio->iosapic_irq == -1) {
-		printk("All SuperIO functions not found!\n");
+		printk(KERN_ERR "All SuperIO functions not found!\n");
 		BUG();
 		return;
 	}
 
-	printk ("SuperIO: Found NS87560 legacy I/O device at %s. iosapic irq = %i 
\n",
+	printk (KERN_INFO "SuperIO: Found NS87560 legacy I/O device at %s. iosapic 
irq = %i \n",
 		pdev->slot_name,sio->iosapic_irq);
 
 	/* Find our I/O devices */
 	pci_read_config_word (pdev, SIO_SP1BAR, &sio->sp1_base);
 	sio->sp1_base &= ~1;
-	printk ("SuperIO: Serial port 1 at 0x%x\n", sio->sp1_base);
+	printk (KERN_INFO "SuperIO: Serial port 1 at 0x%x\n", sio->sp1_base);
 
 	pci_read_config_word (pdev, SIO_SP2BAR, &sio->sp2_base);
 	sio->sp2_base &= ~1;
-	printk ("SuperIO: Serial port 2 at 0x%x\n", sio->sp2_base);
+	printk (KERN_INFO "SuperIO: Serial port 2 at 0x%x\n", sio->sp2_base);
 
 	pci_read_config_word (pdev, SIO_PPBAR, &sio->pp_base);
 	sio->pp_base &= ~1;
-	printk ("SuperIO: Parallel port at 0x%x\n", sio->pp_base);
+	printk (KERN_INFO "SuperIO: Parallel port at 0x%x\n", sio->pp_base);
 
 	pci_read_config_word (pdev, SIO_FDCBAR, &sio->fdc_base);
 	sio->fdc_base &= ~1;
-	printk ("SuperIO: Floppy controller at 0x%x\n", sio->fdc_base);
+	printk (KERN_INFO "SuperIO: Floppy controller at 0x%x\n", sio->fdc_base);
 
 	request_region (IC_PIC1, 0x1f, "pic1");
 	request_region (IC_PIC2, 0x1f, "pic2");
@@ -241,12 +243,13 @@
 	if (request_irq(sio->iosapic_irq,superio_interrupt,SA_INTERRUPT,
 			"SuperIO",(void *)sio)) {
 
-		printk("SuperIO: could not get irq\n");
+		printk(KERN_ERR "SuperIO: could not get irq\n");
 		BUG();
 		return;
 	}
 
 	sio->iosapic_irq_enabled = 1;
+	
 }
 
 static void
@@ -255,7 +258,7 @@
 	u8 r8;
 
 	if ((local_irq < 1) || (local_irq == 2) || (local_irq > 7)) {
-	    printk("SuperIO: Illegal irq number.\n");
+	    printk(KERN_ERR "SuperIO: Illegal irq number.\n");
 	    BUG();
 	    return;
 	}
@@ -274,7 +277,7 @@
 	u8 r8;
 
 	if ((local_irq < 1) || (local_irq == 2) || (local_irq > 7)) {
-	    printk("SuperIO: Illegal irq number.\n");
+	    printk(KERN_ERR "SuperIO: Illegal irq number.\n");
 	    BUG();
 	    return;
 	}
@@ -342,7 +345,7 @@
 						IRQ_REG_DIS|IRQ_REG_MASK,
 						"SuperIO", (void *) &sio_dev);
 		if (!sio_dev.irq_region) {
-			printk(KERN_WARNING "SuperIO alloc_irq_region failed\n");
+			printk(KERN_WARNING "SuperIO: alloc_irq_region failed\n");
 			return -1;
 		}
 	}
@@ -366,7 +369,7 @@
 	return(sio_dev.irq_region->data.irqbase + local_irq);
 }
 
-void
+void __init
 superio_serial_init(void)
 {
 	struct serial_struct *serial;
@@ -381,7 +384,7 @@
 	serial = kmalloc(2 * sizeof (struct serial_struct), GFP_KERNEL);
 
 	if (!serial) {
-		printk("superio: Could not get memory for serial struct.\n");
+		printk(KERN_WARNING "SuperIO: Could not get memory for serial struct.\n");
 		return;
 	}
 
@@ -400,7 +403,7 @@
 	retval = register_serial(serial);
 
 	if (retval < 0) {
-		printk("superio: Register Serial failed.\n");
+		printk(KERN_WARNING "SuperIO: Register Serial #0 failed.\n");
 		kfree (serial);
 		return;
 	}
@@ -419,5 +422,25 @@
 
 	retval = register_serial(serial);
 	if (retval < 0)
-		printk("superio: Register Serial failed.\n");
+		printk(KERN_WARNING "SuperIO: Register Serial #1 failed.\n");
+}
+
+#ifdef CONFIG_PARPORT_PC
+void __init
+superio_parport_init(void)
+{
+	if (!sio_dev.irq_region)
+		return; /* superio not present */
+
+	if (!sio_dev.iosapic_irq_enabled)
+		superio_init(&sio_dev);
+
+	if (!parport_pc_probe_port(sio_dev.pp_base, 
+		0 /*base_hi*/,
+		sio_dev.irq_region->data.irqbase + PAR_IRQ, 
+		PARPORT_DMA_NONE /* dma */,
+		NULL /*struct pci_dev* */))
+
+		printk(KERN_WARNING "SuperIO: Probing parallel port failed.\n");
 }
+#endif
Index: drivers/parport/parport_gsc.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/parport/parport_gsc.c,v
retrieving revision 1.10
diff -u -r1.10 parport_gsc.c
--- parport_gsc.c	2001/04/03 11:25:39	1.10
+++ parport_gsc.c	2001/06/10 15:59:54
@@ -7,7 +7,7 @@
  *      the Free Software Foundation; either version 2 of the License, or
  *      (at your option) any later version.
  *
- *	by Helge Deller <deller@gmx.de>
+ *	(C) 1999-2001 by Helge Deller <deller@gmx.de>
  *
  * 
  * based on parport_pc.c by 
@@ -36,6 +36,7 @@
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/uaccess.h>
+#include <asm/superio.h>
 
 #include <linux/parport.h>
 #include <asm/gsc.h>
@@ -461,7 +462,7 @@
 
 static int __initdata parport_count;
 
-static int __init parport_init_chip(struct hp_device *d, struct 
pa_iodc_driver *dri)
+static int __devinit parport_init_chip(struct hp_device *d, struct 
pa_iodc_driver *dri)
 {
 	unsigned long port;
 	int irq;
@@ -501,7 +502,7 @@
   { 0 }
 };
 
-int __init parport_gsc_init(void)
+int __devinit parport_gsc_init(void)
 {
 	parport_count = 0;
 	
@@ -511,12 +512,15 @@
 }
 
 
-static int __init parport_gsc_init_module(void)
+static int __devinit parport_gsc_init_module(void)
 {	
+#if defined(CONFIG_SUPERIO) && defined(CONFIG_PARPORT_PC)
+	superio_parport_init();
+#endif
 	return !parport_gsc_init();
 }
 
-static void __exit parport_gsc_exit_module(void)
+static void __devexit parport_gsc_exit_module(void)
 {
 	struct parport *p = parport_enumerate(), *tmp;
 	while (p) {
Index: include/asm-parisc/bitops.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/bitops.h,v
retrieving revision 1.10
diff -u -r1.10 bitops.h
--- bitops.h	2000/12/06 14:19:03	1.10
+++ bitops.h	2001/06/10 15:59:58
@@ -244,8 +244,9 @@
 }
 
 /* Bitmap functions for the minix filesystem.  */
-#define minix_set_bit(nr,addr) ext2_set_bit(nr,addr)
-#define minix_clear_bit(nr,addr) ext2_clear_bit(nr,addr)
+#define minix_test_and_set_bit(nr,addr) ext2_set_bit(nr,addr)
+#define minix_set_bit(nr,addr) ((void)ext2_set_bit(nr,addr))
+#define minix_test_and_clear_bit(nr,addr) ext2_clear_bit(nr,addr)
 #define minix_test_bit(nr,addr) ext2_test_bit(nr,addr)
 #define minix_find_first_zero_bit(addr,size) 
ext2_find_first_zero_bit(addr,size)
 
Index: include/asm-parisc/superio.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/superio.h,v
retrieving revision 1.1
diff -u -r1.1 superio.h
--- superio.h	2001/03/29 10:32:52	1.1
+++ superio.h	2001/06/10 15:59:58
@@ -70,6 +70,7 @@
 
 extern void superio_inform_irq(int irq);
 extern void superio_serial_init(void);
+extern void superio_parport_init(void);
 extern int superio_fixup_irq(struct pci_dev *pcidev);
 
 #endif /* _PARISC_SUPERIO_H */