[PARPORT] Superio-4 for Linux-2.3-99pre6, some tests

From: stef (svoltz@wanadoo.fr)
Date: Thu May 04 2000 - 01:13:52 EDT

  • Next message: Jochen Hoenicke: "Re: [PARPORT] 7 switches connected to parport"

            Hello,
    I did some tests of Superio-4 patch on a FIC VA503+ mainboard which has
    a
    W83877TF superio chip. I made a few changes in
    show_parconfig_winbond_877 :

            - "power bit" of cr4 is inverted
            - EPP version is bit 1 of cr3
            - use ECPIRQ for IRQ (high part of cr27) when available

            I tested this with all the settings the BIOS allowed, and all is
    correctly detected.

            The patch against Superio-4 for Linux-2.3-99pre6 is attached.

    --- parport_pc.c.sio Tue May 2 07:19:37 2000
    +++ parport_pc.c Thu May 4 07:06:53 2000
    @@ -1116,6 +1116,8 @@
             int cr0,cr3,cr4,cr5,cr9,cr17,cr23,cr26,cr27,cr31=0,cr32=0;
             int efir,efdr;
             char *modes[]= { "reserved", "EPP", "ECP", "ECP+EPP"};
    + int irqs[]={7,9,10,11,14,15,5};
    + int irq;
     
             if(io==0x3f0) {
                     outb(key,io);
    @@ -1145,22 +1147,43 @@
             outb(0xaa,io);
     
             printk("Winbond 83877xx LPT Config cr0=%02x cr3=%02x"
    - "cr4=%02x cr5=%02x cr9=%02x cr17=%02x cr23=%02x"
    - " cr26=%02x cr27=%02x cr31=%02x",
    + " cr4=%02x cr5=%02x cr9=%02x cr17=%02x cr23=%02x"
    + " cr26=%02x cr27=%02x cr31=%02x\n",
                     cr0,cr3,cr4,cr5,cr9,cr17,cr23,cr26,cr27,cr31);
    +
    + printk ("W83877 LPT Config: io=0x%04x, " , cr23*4);
     
    - printk ("W83877 LPT Config: io=0x%04x, irq=%c, dma=%c, "
    - "fifo threshold=%d\n", cr23*4,
    - (cr27 &0x0f) ? 'A'-1+(cr27 &0x0f): '-',
    - (cr26 &0x0f) ? 'A'-1+(cr26 &0x0f): '-', cr5 & 0x0f);
    + /* IQR may be held in two places in cr27, wee look at b7-b5 first */
    + if(cr27 & 0xe0) {
    + /* ECP IRQ */
    + irq=irqs[((cr27 & 0xe0) >>5)-1];
    + printk("irq=%d, ",irq);
    + }
    + else {
    + /* if b7-b5 holds no irq number, look at cr27 for PRTIRQ */
    + if((oldid>0x0b) && (cr31 & 0x04)) {
    + /* 'serial IRQ mode' : couldn't reach that branch */
    + /* with any BIOS setting -> untested */
    + printk("irq(serial mode)=%c, ",
    + (cr27 & 0x0f) ? 'A'-1+(cr27 &0x0f): '-');
    + }
    + else {
    + printk("irq=%c, ", (cr27 & 0x0f) ? 'A'-1+(cr27 &0x0f): '-');
    + irq=cr27 & 0x0f;
    + }
    + }
    +
    + /* DMA_A=1, DMA_C=3 */
    + printk ("dma=%c, fifo threshold=%d\n",
    + (cr26 &0x0f) ? '0'+(cr26 &0x0f): '-', cr5 & 0x0f);
             printk("W83877 LPT Config: enabled=%s power=%s\n",
    - (cr23*4 >=0x100) ?"yes":"no", (cr4 & 0x80) ? "yes" : "no");
    + (cr23*4 >=0x100) ?"yes":"no", (cr4 & 0x80) ? "no" : "yes");
             printk("W83877 LPT Config: Port mode=%s, EPP version =%s\n",
                    (cr9 & 0x80 ) ? modes[(cr0>>2) & 0x03] :
                                    (((cr0>>2) & 0x03)?"non parallel": "SPP"),
    - (cr3 & 0x10) ? "1.7" : "1.9");
    + (cr3 & 0x20) ? "1.7" : "1.9");
             printk("W83877 LPT Config: IRQ line is totem pole in %s",
    - cr17 & 0x10 ? "all modes": "SPP mode/open drain in ECP/EPP");
    + cr17 & 0x10 ? "all modes": "SPP mode/open drain in ECP/EPP\n");
             printk("W83877 LPT Config: IRQ %ss AckIntEnable Bit\n",
                     cr17 &0x04 ? "ignore" : "obey");
     

    -- To unsubscribe, send mail to: linux-parport-request@torque.net --
    -- with the single word "unsubscribe" in the body of the message. --



    This archive was generated by hypermail 2b29 : Thu May 04 2000 - 01:15:11 EDT