Hardware Environment: LPC chip ITE IT8705, mainboard ECS K7S5A, SIS735 Problem Description: Low pin controller IT8705 has special function, which sends data from POST port 0x80 (default) to pins of parallel port. This function is default enabled, but BIOS disables it before boot. While booting, kernel probably resets this chip again and doesn't disable POST function. Then all programs, that have outb delay send data to parallel port and make noise on it. This makes PLIP connection works very bad with this chip, but doesn't affect printing (probably beacause printer using handshake wires). Reference: datasheet page 63 and 64 http://www.alldatasheet.com/datasheet-pdf/pdf/117633/ETC/IT8705F.html Very simple (and I don't know how it's correct) C source below makes example. It inverts bit disable/enable POST. /*Program for disabling/enabling IT8705 parallel port POST mode, Petr Cvek, petr.cvek@tul.cz*/ #include <stdio.h> #include <unistd.h> #include <asm/io.h> #define IT8705 0x2e /*first SuperIO index=0x2e, second SuperIO index=0x4e*/ int write8705(int index,int data) { outb(index, IT8705); usleep(100); outb(data, IT8705+1); usleep(100); return(0); } int read8705(int index) { outb(index, IT8705); usleep(100); return(inb(IT8705+1)); usleep(100); } int main() { /*ALOCATE IT8705 PORTS*/ if (ioperm(IT8705, 3, 1)) { perror("ioperm"); exit(1); } if (ioperm(IT8705+1, 3, 1)) { perror("ioperm"); exit(1); } /*ENTER IT8705 CONFIG MODE*/ outb(0x87, IT8705); usleep(100); outb(0x01, IT8705); usleep(100); outb(0x55, IT8705); usleep(100); if (IT8705==0x2e) { outb(0x55, IT8705); usleep(100); printf("First SuperIO\n"); } else if (IT8705==0x4e) { outb(0xaa, IT8705); usleep(100); printf("Second SuperIO\n"); } /*POINT TO PART OF IT8705 TO BE MODIFICATED*/ write8705(0x7, 0x3); /*parport*/ /*READ DATA BEFORE CHANGE*/ printf("Parport config reg before change: %d\n", read8705(0xf0)); /*PARALEL PORT CONFIG ENABLE/DISABLE POST ON PARPORT*/ write8705(0xf0,(read8705(0xf0) + 0x8)); /*bit 3 POST, bits 4-7 reserved*/ /*READ DATA AFTER CHANGE*/ printf("Parport config reg after change: %d\n", read8705(0xf0)); /*EXIT CONFIG MODE*/ write8705(0x2,0x2); /*UNALOCATE IT8705 PORTS*/ if (ioperm(IT8705+1, 3, 0)) { perror("ioperm"); exit(1); } if (ioperm(IT8705, 3, 0)) { perror("ioperm"); exit(1); } /*END*/ exit(0); }
Peter, Can you test with current kernel (2.6.23+) by any chance. Thanks.
Grabbing this one as it doesn't really have an owner and it should be easy to sorted
Interesting: Scanning the code we don't reset the device anywhere or touch the chip. What happens if you build a kernel without parport_pc and without hwmon/it87 - can you tell which of the two if either is enabling it ?
I tried to test this bug with kernel 2.6.24-rc2 and it makes noise, whether I compiled it with all parport/it87 or without parport/it87 modules support. The noise allways starts somewhere between exit bootmanager and detecting procesor.
Ok thanks - that means the BIOS is not properly configuring this port, not that we are messing it up - which is good news. I'll upload a test patch in a bit which tries to detect the port in question and turn off the debug stuff even if the BIOS forgot
Created attachment 13839 [details] Test patch Test patch
Created attachment 13896 [details] Working patch After correction some warnings and errors (just undefined variables, etc...), here is tested and working patch. Chip is detected properly and after loading parport_pc module noise is stopped.
Petr can you send the patch to akpm@osdl.org with a Signed-off-by: line as per http://old.linux-foundation.org/newsroom/press_releases/2004/2004_05_24_dco.html Alan
OK patch has been resent.