From: David Howells <dhowells@redhat.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix FRV PCI config space write
Date: Mon, 22 Nov 2004 16:14:51 +0000 [thread overview]
Message-ID: <14527.1101140091@redhat.com> (raw)
The attached patch makes byte and word writes to PCI config space work. The
problem was that the pointer to the appropriate chunk of the config port needs
to be juggled to allow for the fact that FRV is big endian in this case.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat pci-write-2610rc2mm3.diff
pci-vdk.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff -uNr /warthog/kernels/linux-2.6.10-rc2-mm3/arch/frv/mb93090-mb00/pci-vdk.c linux-2.6.10-rc2-mm3-frv/arch/frv/mb93090-mb00/pci-vdk.c
--- /warthog/kernels/linux-2.6.10-rc2-mm3/arch/frv/mb93090-mb00/pci-vdk.c 2004-11-22 10:53:41.000000000 +0000
+++ linux-2.6.10-rc2-mm3-frv/arch/frv/mb93090-mb00/pci-vdk.c 2004-11-22 11:45:09.905240995 +0000
@@ -44,9 +44,14 @@
#define __get_PciCfgDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 2))
#define __get_PciCfgDataL(A) readl((volatile void __iomem *) __region_CS1 + 0x88)
-#define __set_PciCfgDataB(A,V) writeb((V), (volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 3))
-#define __set_PciCfgDataW(A,V) writew((V), (volatile void __iomem *) __region_CS1 + 0x88 + ((A) & 2))
-#define __set_PciCfgDataL(A,V) writel((V), (volatile void __iomem *) __region_CS1 + 0x88)
+#define __set_PciCfgDataB(A,V) \
+ writeb((V), (volatile void __iomem *) __region_CS1 + 0x88 + (3 - ((A) & 3)))
+
+#define __set_PciCfgDataW(A,V) \
+ writew((V), (volatile void __iomem *) __region_CS1 + 0x88 + (2 - ((A) & 2)))
+
+#define __set_PciCfgDataL(A,V) \
+ writel((V), (volatile void __iomem *) __region_CS1 + 0x88)
#define __get_PciBridgeDataB(A) readb((volatile void __iomem *) __region_CS1 + 0x800 + (A))
#define __get_PciBridgeDataW(A) readw((volatile void __iomem *) __region_CS1 + 0x800 + (A))
reply other threads:[~2004-11-23 4:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=14527.1101140091@redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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