linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What pokes the ISA IO port of 0x211 ?
@ 2008-04-21 11:12 Frantisek Rysanek
  2008-04-21 15:51 ` Bart Van Assche
  2008-04-21 20:05 ` Rene Herman
  0 siblings, 2 replies; 7+ messages in thread
From: Frantisek Rysanek @ 2008-04-21 11:12 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What pokes the ISA IO port of 0x211 ?
  2008-04-21 11:12 What pokes the ISA IO port of 0x211 ? Frantisek Rysanek
@ 2008-04-21 15:51 ` Bart Van Assche
  2008-04-21 17:40   ` H. Peter Anvin
  2008-04-21 20:05 ` Rene Herman
  1 sibling, 1 reply; 7+ messages in thread
From: Bart Van Assche @ 2008-04-21 15:51 UTC (permalink / raw)
  To: Frantisek Rysanek; +Cc: linux-kernel

On Mon, Apr 21, 2008 at 1:12 PM, Frantisek Rysanek
<Frantisek.Rysanek@post.cz> wrote:
>  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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What pokes the ISA IO port of 0x211 ?
  2008-04-21 15:51 ` Bart Van Assche
@ 2008-04-21 17:40   ` H. Peter Anvin
  0 siblings, 0 replies; 7+ messages in thread
From: H. Peter Anvin @ 2008-04-21 17:40 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Frantisek Rysanek, linux-kernel

Bart Van Assche wrote:
> On Mon, Apr 21, 2008 at 1:12 PM, Frantisek Rysanek
> <Frantisek.Rysanek@post.cz> wrote:
>>  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.
>

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What pokes the ISA IO port of 0x211 ?
  2008-04-21 11:12 What pokes the ISA IO port of 0x211 ? Frantisek Rysanek
  2008-04-21 15:51 ` Bart Van Assche
@ 2008-04-21 20:05 ` Rene Herman
  2008-04-21 20:34   ` Rene Herman
  1 sibling, 1 reply; 7+ messages in thread
From: Rene Herman @ 2008-04-21 20:05 UTC (permalink / raw)
  To: Frantisek Rysanek; +Cc: linux-kernel

On 21-04-08 13:12, Frantisek Rysanek wrote:
> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What pokes the ISA IO port of 0x211 ?
  2008-04-21 20:05 ` Rene Herman
@ 2008-04-21 20:34   ` Rene Herman
  2008-04-23 12:19     ` Frantisek Rysanek
  0 siblings, 1 reply; 7+ messages in thread
From: Rene Herman @ 2008-04-21 20:34 UTC (permalink / raw)
  To: Frantisek Rysanek; +Cc: linux-kernel

On 21-04-08 22:05, Rene Herman wrote:

> On 21-04-08 13:12, Frantisek Rysanek wrote:
>> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What pokes the ISA IO port of 0x211 ?
  2008-04-21 20:34   ` Rene Herman
@ 2008-04-23 12:19     ` Frantisek Rysanek
  2008-04-23 13:56       ` Rene Herman
  0 siblings, 1 reply; 7+ messages in thread
From: Frantisek Rysanek @ 2008-04-23 12:19 UTC (permalink / raw)
  To: linux-kernel

On 21 Apr 2008 at 19:40, H. Peter Anvin wrote:
> 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. 

On 21 Apr 2008 at 22:34, Rene Herman wrote:
> 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What pokes the ISA IO port of 0x211 ?
  2008-04-23 12:19     ` Frantisek Rysanek
@ 2008-04-23 13:56       ` Rene Herman
  0 siblings, 0 replies; 7+ messages in thread
From: Rene Herman @ 2008-04-23 13:56 UTC (permalink / raw)
  To: Frantisek Rysanek; +Cc: linux-kernel

On 23-04-08 14:19, Frantisek Rysanek wrote:

> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-04-23 13:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-21 11:12 What pokes the ISA IO port of 0x211 ? Frantisek Rysanek
2008-04-21 15:51 ` Bart Van Assche
2008-04-21 17:40   ` H. Peter Anvin
2008-04-21 20:05 ` Rene Herman
2008-04-21 20:34   ` Rene Herman
2008-04-23 12:19     ` Frantisek Rysanek
2008-04-23 13:56       ` Rene Herman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).