Skip to contentSkip to conversation

What pokes the ISA IO port of 0x211 ?

DISCUSSION Frantisek Rysanek 4 participants 7 messages Apr 21, 2008 – Apr 23, 2008

lore
Share & tools
lore
#0 lore raw

Dear Everyone,

I'm dealing with an embedded PC motherboard that contains some custom circuitry (GPIO), accessible via an ISA IO range between 0x200 and 0x218.

There's an interesting issue with this in recent Linux (tried 2.6.22.6 and 2.6.24.2): something probes IO port 0x211 on boot, which happens to be an add-on buzzer control port - effectively the kernel boot launches an accoustic alarm :-)

Any ideas what this could be?

Obviously it's no problem for me to write a tiny kernel module to disable the alarm again, and I've actually verified the problem using ioperm()+outb() from user space, but still I'd be interested to know which particular piece of code could be probing that address...

The address decode might be implemented using some general-purpose features of the Winbond W83627HF SuperIO (as there's no ISA in the system, just ICH4 LPC) - but it seems quite unlikely that this would be caused by something fiddling with the W83627 config registers. It really seems like something writes 0xFF to IO port 0x211.

Thanks for your time and attention :-)

Frank Rysanek

#1 lore raw
Quoted 10 lines · Frantisek Rysanek

I'm dealing with an embedded PC motherboard that contains some custom circuitry (GPIO), accessible via an ISA IO range between 0x200 and 0x218.

There's an interesting issue with this in recent Linux (tried 2.6.22.6 and 2.6.24.2): something probes IO port 0x211 on boot, which happens to be an add-on buzzer control port - effectively the kernel boot launches an accoustic alarm :-)

Any ideas what this could be?

Did you already have a look at /proc/ioports ? This file should contain every range of ISA bus address in use by any kernel component.

Bart.

#2 lore raw
Quoted 11 lines · Bart Van Assche
Quoted 9 lines · Frantisek Rysanek

I'm dealing with an embedded PC motherboard that contains some custom circuitry (GPIO), accessible via an ISA IO range between 0x200 and 0x218.

There's an interesting issue with this in recent Linux (tried 2.6.22.6 and 2.6.24.2): something probes IO port 0x211 on boot, which happens to be an add-on buzzer control port - effectively the kernel boot launches an accoustic alarm :-)

Quoted 5 lines
Quoted 1 line

Any ideas what this could be?

Did you already have a look at /proc/ioports ? This file should contain every range of ISA bus address in use by any kernel component.

This might not be the case if a probe fails and the driver unload itself. It might be easiest to put in a hack in the kernel by hacking outb/outw/outl and print stack trace when called when trying to poke this port.

For what it's worth, this port is specified as "Game Blaster" in the Interrupt List.

-hpa

#3 lore raw
In reply to Frantisek Rysanek
Quoted 7 lines · Frantisek Rysanek

Dear Everyone,

I'm dealing with an embedded PC motherboard that contains some custom circuitry (GPIO), accessible via an ISA IO range between 0x200 and 0x218.

There's an interesting issue with this in recent Linux (tried 2.6.22.6 and 2.6.24.2): something probes IO port 0x211 on boot, which happens to be an add-on buzzer control port - effectively the kernel boot launches an accoustic alarm :-)

Any ideas what this could be?

ISAPnP default read data port is close at 0x213...

I haven't checked but this also reminds me of sensor chips. Do you have sensor drivers builtin?

Rene.

#4 lore raw
Quoted 8 lines · Rene Herman
Quoted 3 lines · Frantisek Rysanek

Dear Everyone,

I'm dealing with an embedded PC motherboard that contains some custom circuitry (GPIO), accessible via an ISA IO range between 0x200 and 0x218. There's an interesting issue with this in recent Linux (tried 2.6.22.6 and 2.6.24.2): something probes IO port 0x211 on boot, which happens to be an add-on buzzer control port - effectively the kernel boot launches an accoustic alarm :-) Any ideas what this could be?

ISAPnP default read data port is close at 0x213...

I haven't checked but this also reminds me of sensor chips. Do you have sensor drivers builtin?

Ah, it's the old analog gameport: ns558_init.

Rene.

#5 lore raw
Quoted 3 lines · H. Peter Anvin

It might be easiest to put in a hack in the kernel by hacking outb/outw/outl and print stack trace when called when trying to poke this port.

Quoted 1 line · Rene Herman

Ah, it's the old analog gameport: ns558_init.

Well my immediate initial idea was indeed the game port, IO port 0x201 immediately started jumping up and down in the dark recesses of my memory from teenage years, when I was trying this and that in Borland C in DOS...

So even before I wrote to LKML, I went into "make menuconfig" and made sure that any entries related to the game port were disabled:

Device Drivers -->
Input device support -->
Joystick interface = disabled
Joysticks/Gamepads = disabled

I've been having all of that disabled in my kernel for ages, I haven't met a game port since I abandoned my 486+SB16.

So, after Rene's response and HPA's responses, I resorted to the suggested hacking on include/asm/io.h .

After some grepping through the kernel sources, I could come up with a simple call to dump_stack(). I added
if (port == 0x211) dump_stack();\
into <asm/io.h>, on a second line below
#define BUILDIO(bwl,bw,type)
into the definition of
static inline void out##bwl##_local()
That gave me a linker error in the final stages of "make bzImage". Clearly arch/i386/boot/compressed/misc.c doesn't get linked directly to the rest of the kernel binary image, so it doesn't have access to the kernel's symbols.
I solved that by making a clipboard copy of the whole huge BUILDIO "template" macro definition and wrapping the first copy in an
#ifndef SKIP_STACK_DUMP
and I only defined SKIP_STACK_DUMP in compressed/misc.c to avoid the linking problem...

Much to my amazement, this time it worked, and I was even more amazed to find out, that in fact Rene Herman was right :-)))

The poke is indeed performed by a function called ns558_init and it's indeed related to the generic game port.

What I missed in the menuconfig was this entry:

Device Drivers -->
Input device support -->
Hardware I/O ports -->
Gameport support -->
Classic ISA and PnP gameport support

Also known as CONFIG_GAMEPORT_NS558, which enables compilation of drivers/input/gameport/ns558.c

It's always fun to learn about multiple menuconfig entries for the same piece hardware or functionality in general :-)

Thanks to all those who replied, thanks for your time, and have a nice, productive day :-)

Frank Rysanek

#6 lore raw
Quoted 2 lines · Frantisek Rysanek

Much to my amazement, this time it worked, and I was even more amazed to find out, that in fact Rene Herman was right :-)))

You know -- that one always gets me by surprise as well.

Rene.