From 30da38104d18097dd1cb82f9cd42d98a60d4f992 Mon Sep 17 00:00:00 2001 From: Oliver Schinagl Date: Fri, 18 Mar 2011 23:11:58 +0000 Subject: W90N745 or rather Winbond 83977 parallel support --- uClinux-2.4.20-uc1/drivers/parport/ieee1284_ops.c | 2 ++ uClinux-2.4.20-uc1/drivers/parport/parport_pc.c | 43 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/uClinux-2.4.20-uc1/drivers/parport/ieee1284_ops.c b/uClinux-2.4.20-uc1/drivers/parport/ieee1284_ops.c index aee6e00..0d4320f 100644 --- a/uClinux-2.4.20-uc1/drivers/parport/ieee1284_ops.c +++ b/uClinux-2.4.20-uc1/drivers/parport/ieee1284_ops.c @@ -49,7 +49,9 @@ size_t parport_ieee1284_write_compat (struct parport *port, | PARPORT_CONTROL_INIT); if (port->irq != PARPORT_IRQ_NONE) { +#ifndef WINBOND_83977 //schen add 2004-2-17 09:49 parport_enable_irq (port); +#endif //schen add 2004-2-17 09:49 no_irq = 0; } diff --git a/uClinux-2.4.20-uc1/drivers/parport/parport_pc.c b/uClinux-2.4.20-uc1/drivers/parport/parport_pc.c index 001c195..098d554 100644 --- a/uClinux-2.4.20-uc1/drivers/parport/parport_pc.c +++ b/uClinux-2.4.20-uc1/drivers/parport/parport_pc.c @@ -62,6 +62,12 @@ #include #include +#ifdef WINBOND_83977 +#include //schen add 2004-2-6 13:50 +#include //schen add 2004-2-6 13:50 +#include //schen add 2004-2-12 17:58 +#endif + #define PARPORT_PC_MAX_PORTS PARPORT_MAX /* ECR modes */ @@ -76,6 +82,10 @@ #define ECR_MODE_MASK 0xe0 #define ECR_WRITE(p,v) frob_econtrol((p),0xff,(v)) +#ifdef WINBOND_83977 +#define EFIR_REG (W83977AF_BASE + 0x3F0) //W83977AF EFIR Register address, schen add 2004-2-9 10:32 +#endif + #undef DEBUG #ifdef DEBUG @@ -1288,6 +1298,7 @@ struct parport_operations parport_pc_ops = }; #ifdef CONFIG_PARPORT_PC_SUPERIO +#ifndef WINBOND_83977 //schen add 2004-2-6 15:18 /* Super-IO chipset detection, Winbond, SMSC */ static void __devinit show_parconfig_smsc37c669(int io, int key) { @@ -1364,6 +1375,7 @@ static void __devinit show_parconfig_smsc37c669(int io, int key) } } } +#endif /*WINBOND_83977*/ //schen add 2004-2-6 15:18 static void __devinit show_parconfig_winbond(int io, int key) @@ -1421,8 +1433,13 @@ static void __devinit show_parconfig_winbond(int io, int key) if(i==NR_SUPERIOS) printk(KERN_INFO "Super-IO: too many chips!\n"); else { +#ifdef WINBOND_83977 + superios[i].io = W83977AF_BASE + ((cr60<<8)|cr61); + superios[i].irq = 0x04; //schen add 2004-2-9 15:28 +#else superios[i].io = (cr60<<8)|cr61; superios[i].irq = cr70&0x0f; +#endif superios[i].dma = (((cr74 & 0x07) > 3) ? PARPORT_DMA_NONE : (cr74 & 0x07)); } @@ -1465,6 +1482,7 @@ static void __devinit decode_winbond(int efer, int key, int devid, int devrev, i show_parconfig_winbond(efer,key); } +#ifndef WINBOND_83977 //schen add 2004-2-6 15:17 static void __devinit decode_smsc(int efer, int key, int devid, int devrev) { const char *type = "unknown"; @@ -1584,10 +1602,12 @@ static void __devinit smsc_check(int io, int key) decode_smsc(io,key,oldid,oldrev); } +#endif /*WINBOND_83977*/ //schen add 2004-2-6 15:17 static void __devinit detect_and_report_winbond (void) { +#ifndef WINBOND_83977 //schen add 2004-2-9 11:42 if (verbose_probing) printk(KERN_DEBUG "Winbond Super-IO detection, now testing ports 3F0,370,250,4E,2E ...\n"); winbond_check(0x3f0,0x87); @@ -1597,8 +1617,12 @@ static void __devinit detect_and_report_winbond (void) winbond_check(0x3f0,0x86); winbond_check2(0x250,0x88); winbond_check2(0x250,0x89); +#else + show_parconfig_winbond(EFIR_REG, 0x87); +#endif } +#ifndef WINBOND_83977 //schen add 2004-2-6 15:19 static void __devinit detect_and_report_smsc (void) { if (verbose_probing) @@ -1608,6 +1632,7 @@ static void __devinit detect_and_report_smsc (void) smsc_check(0x3f0,0x44); smsc_check(0x370,0x44); } +#endif /*WINBOND_83977*/ //schen add 2004-2-6 15:20 #endif /* CONFIG_PARPORT_PC_SUPERIO */ static int __devinit get_superio_dma (struct parport *p) @@ -2354,6 +2379,16 @@ struct parport *parport_pc_probe_port (unsigned long int base, request_region (p->base_hi, 3, p->name); if (p->irq != PARPORT_IRQ_NONE) { +#ifdef WINBOND_83977 + if (request_irq (p->irq, parport_pc_interrupt, + SA_SHIRQ, p->name, p)) { //schen modify 0 to SA_SHIRQ 2004-2-12 15:11 + printk (KERN_WARNING "%s: irq %d in use, " + "resorting to polled operation\n", + p->name, p->irq); + p->irq = PARPORT_IRQ_NONE; + p->dma = PARPORT_DMA_NONE; + } +#else if (request_irq (p->irq, parport_pc_interrupt, 0, p->name, p)) { printk (KERN_WARNING "%s: irq %d in use, " @@ -2362,6 +2397,7 @@ struct parport *parport_pc_probe_port (unsigned long int base, p->irq = PARPORT_IRQ_NONE; p->dma = PARPORT_DMA_NONE; } +#endif #ifdef CONFIG_PARPORT_PC_FIFO if (p->dma != PARPORT_DMA_NONE) { @@ -2922,12 +2958,17 @@ parport_pc_find_isa_ports (int autoirq, int autodma) { int count = 0; +#ifndef WINBOND_83977 //schen add 2004-2-17 13:51 if (parport_pc_probe_port(0x3bc, 0x7bc, autoirq, autodma, NULL)) count++; if (parport_pc_probe_port(0x378, 0x778, autoirq, autodma, NULL)) count++; if (parport_pc_probe_port(0x278, 0x678, autoirq, autodma, NULL)) count++; +#else //schen add 2004-2-17 13:51 + if (parport_pc_probe_port(superios[0].io, superios[0].io + 0x400, superios[0].irq, superios[0].dma, NULL)) + count++; +#endif //schen add 2004-2-17 13:51 return count; } @@ -2948,7 +2989,9 @@ static int __init parport_pc_find_ports (int autoirq, int autodma) #ifdef CONFIG_PARPORT_PC_SUPERIO detect_and_report_winbond (); +#ifndef WINBOND_83977 //schen add 2004-2-6 15:25 detect_and_report_smsc (); +#endif /*WINBOND_83977*/ //schen add 2004-2-6 15:25 #endif /* Onboard SuperIO chipsets that show themselves on the PCI bus. */ -- cgit v0.12