Subject: Can I access ISA bus and PGIO pins through /dev/mem?
To: None <port-arm@netbsd.org>
From: Anders Lindgren <ali@df.lth.se>
List: port-arm
Date: 06/11/2007 14:14:20
   Hi everyone, and especially Jesse Off if you're reading. :-)
Playing around with my TS7250 board and its TS7KV framebuffer, and NetBSD 
4.99.20.

   I am trying to access the fb on the PC/104 bus from user space by simply 
mmap:ing /dev/mem, following the board's [Linux] example code. This way, 
I've been able to identify the board on the bus, load the FPGA bitmask 
into the FPGA, ACK the loading, and activate the FPGA. It lights its green 
LED. :-) However, I get no visible video output apart from a brief flicker 
before the screen goes blank again.

   Before I dig any deeper into this -- is this method going to work at 
all? I've seen comments to the effect that some X drivers do pretty much 
this, and I'd like to use the same method to bang on some EP9302 GPIO pins 
as well. Or do I have to modify the tsarm startup or write a stub open + 
mmap driver somehow to tell NetBSD not to cache these address ranges?

   As long as the kernel realizes that the physical ISA addresses I mmap 
are non-cachable side effect memory locations, it should Just Work(tm)? I 
figured the tsarm "isaio" node somehow takes care of this somewhere during 
startup, but reading the code didn't tell me much, as I am not yet 
familiar with how the bus space framework works.

   I'd like to play around in user space before I venture into figuring out 
how to make a kernel driver for the card out of it. Please bring out ye 
olde cluebats for a NetBSD kernel newbie. :-)

Best regards,
ali:)