From: "Steven J. Hill" <sjhill@realitydiluted.com>
To: linuxppc-dev@lists.linuxppc.org
Subject: 750 and Discovery II coherency with PCI....
Date: Mon, 02 Aug 2004 22:26:36 -0500 [thread overview]
Message-ID: <410F05EC.1040405@realitydiluted.com> (raw)
Greetings.
I am writing a device driver for a PMC card that is nothing
fancy. It is not a PCI-X card though. My Linux driver properly
detects the device, 'ioremaps' the PCI IO and MEM regions then
attempts to start writing the devices registers for setup
and configuration. I am not getting valid reads and there
appears to be some coherency issues. I have verified that no
other drivers or resources in the system are utilizing the
addresses that are returned to me from 'ioremap'. I have the
following code snippet:
#define shunt_read_8(offset) \
*((volatile u8 *) (shunt_dev->ctrl_base + offset))
[SNIP]
svalue[0] = shunt_read_8(SHUNT_ADDRESS + 0x220);
svalue[1] = shunt_read_8(SHUNT_ADDRESS + 0x221);
svalue[2] = shunt_read_8(SHUNT_ADDRESS + 0x222);
svalue[3] = shunt_read_8(SHUNT_ADDRESS + 0x223);
printk("0x%02x\n", svalue[0]);
printk("0x%02x\n", svalue[1]);
printk("0x%02x\n", svalue[2]);
printk("0x%02x\n", svalue[3]);
If I read the byte addresses above, which are in the remapped PCI I/O address
space and I get the following output:
0x00
0x00
0x00
0x00
which is of course, incorrect. I even tried using the 'in_8' macro functions
in 'asm-ppc/io.h'. I get the same results. Now, if I instead do the following
code snippet:
printk("0x%02x\n", shunt_read_8(SHUNT_ADDRESS + 0x220));
printk("0x%02x\n", shunt_read_8(SHUNT_ADDRESS + 0x220));
printk("0x%02x\n", shunt_read_8(SHUNT_ADDRESS + 0x220));
printk("0x%02x\n", shunt_read_8(SHUNT_ADDRESS + 0x221));
printk("0x%02x\n", shunt_read_8(SHUNT_ADDRESS + 0x222));
printk("0x%02x\n", shunt_read_8(SHUNT_ADDRESS + 0x223));
I now get the output of:
0x00
0x81
0x81
0x02
0x0e
0x0e
The first time I read 0x220, it is incorrect, but the following two times and
the other remaining values are now correct. Unfortunately, this device is the
only PMC device that I have to test. I do not have any other PMC cards. This
behavior exists in both the 2.4 kernel and in my 2.6 kernel. The virtual
addresses received from the 'ioremap' call are identical on both 2.4 and 2.6,
just for reference. I tried adding in memory barriers and 'eieio' calls, but
I did not expect those to make a difference...and it did not. Has anyone ever
seen similar behavior? Preferably I would like to hear from people working
with Discovery II parts. I have documentation under NDA, but I am still working
my way through it. Thanks in advance.
-Steve
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next reply other threads:[~2004-08-03 3:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-03 3:26 Steven J. Hill [this message]
2004-08-03 11:56 ` 750 and Discovery II coherency with PCI Brian Waite
2004-08-03 17:23 ` Mark A. Greer
2004-08-04 0:42 ` Benjamin Herrenschmidt
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=410F05EC.1040405@realitydiluted.com \
--to=sjhill@realitydiluted.com \
--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 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).