From: Otto Moerbeek <otto@cable.a2000.nl>
To: linuxppc-dev@lists.linuxppc.org
Subject: Design issues Keyspan serial PCI driver
Date: Fri, 13 Aug 1999 20:48:36 +0200 [thread overview]
Message-ID: <37B46883.9EAFF03@cable.a2000.nl> (raw)
In-Reply-To: 199908130501.AAA18955@lists.linuxppc.org
Hi to you all,
after some struggling I now have a very first working version of the
Keyspan SX
serial card driver, but I do not think the code I wrote is ready for
publishing. To make a neat driver I have some design issues I want to
share with you. Hopefully this will help me making the right decisions
for the real driver.
The Keyspan SX cards use a PLX9050 as PCI bridge to connect to an
ST16C654 UART. I found some patches for char/serial.c that support the
UART directly. So this part of the problem was solved easily.
But Keyspan choose to map the UART to PCI memory space using the 9050,
not PCI I/O space. Furthermore, for some unknown reason, the registers
of the UART are separated 0x80 apart. Since char/serial.c uses I/O
instructions to access the UART, I had to hack the driver to use readb()
and friends. I am also multiplying the offset to compensate for the
strange offsets.
I would really like to use the char/serial.c driver and keep it
compatible with existing cards, because I do not want to write a
complete driver myself for a UART that is supported by standard code.
But then I have to decide runtime to use inb() and outb() or readb() and
writeb(), since the driver also may be used for other cards that use I/O
based access. Do you think that this would cause too much overhead in
the interrupt handlers? It means that every I/O access will be slowed
down by some extra memory references and a test.
Another point is that the serial structs use an int as the type for the
port field. Since cannot change the struct in include/linux/serial.h to
use u8 * as a type for compatibility reasons, I have to find some way to
use the port as an offset added to some memory mapped base pointer of
type u8 *, instead of using port as an absolute (I/O or mem) address.
Just using the int port as a memory address value is dangerous, since it
won't work on 64 bits architectures. Do you think this is the way to
go: keeping compatibility with applications that expect port to be an
int, while still be able to do memory mapped PCI access?
The good news of course is, if I can resolve the above issues, I have a
driver that can access both I/O based and memory based PCI cards. The
start of proper PCI serial card support in the standard serial driver?
You can find some more background info on my home page, <http://people.a2000.nl/omoerbe/>
Sorry for the long winding story, but I really would like some feedback,
Otto
--
Otto Moerbeek
otto@cable.a2000.nl
[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]
next parent reply other threads:[~1999-08-13 18:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199908130501.AAA18955@lists.linuxppc.org>
1999-08-13 18:48 ` Otto Moerbeek [this message]
1999-08-14 15:30 ` Design issues Keyspan serial PCI driver Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=37B46883.9EAFF03@cable.a2000.nl \
--to=otto@cable.a2000.nl \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.