Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Manish Lachwani <mlachwani@mvista.com>
To: linux-mips@linux-mips.org
Cc: ralf@linux-mips.org
Subject: [PATCH] Support 8-bit and 16-bit PCI ops on TX4927 in BE
Date: Sat, 22 Jan 2005 09:57:35 -0800	[thread overview]
Message-ID: <20050122175735.GA26945@prometheus.mvista.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]

Hi Ralf,

Attached patch supports 8-bit and 16-bit PCI operations on TX4927 in big endian mode. Please review and/or apply

Thanks
Manish Lachwani

[-- Attachment #2: common_mips_tx4927_BE.patch --]
[-- Type: text/plain, Size: 1739 bytes --]

Source: MontaVista Software, Inc. | URL | Manish Lachwani <mlachwani@mvista.com>
MR: 9909
Type: Defect Fix
Disposition: Submitted to linux-mips.org
Keywords:
Signed-off-by: Manish Lachwani <mlachwani@mvista.com>
Description:
	Support for BE mode on Tx4927 based board

Index: linux-2.6.10/arch/mips/pci/ops-tx4927.c
===================================================================
--- linux-2.6.10.orig/arch/mips/pci/ops-tx4927.c
+++ linux-2.6.10/arch/mips/pci/ops-tx4927.c
@@ -130,11 +130,21 @@
 	switch (size) {
 	case 1:
 		*val = *(volatile u8 *) ((ulong) & tx4927_pcicptr->
-                              g2pcfgdata | (where & 3));
+                              g2pcfgdata | 
+#ifdef __LITTLE_ENDIAN
+						(where & 3));
+#else
+						((where & 0x3) ^ 0x3));
+#endif
 		break;
 	case 2:
 		*val = *(volatile u16 *) ((ulong) & tx4927_pcicptr->
-                               g2pcfgdata | (where & 3));
+                               g2pcfgdata | 
+#ifdef __LITTLE_ENDIAN
+						(where & 3));
+#else
+						((where & 0x3) ^ 0x2));
+#endif
 		break;
 	case 4:
 		*val = tx4927_pcicptr->g2pcfgdata;
@@ -179,12 +189,22 @@
 	switch (size) {
 	case 1:
 		 *(volatile u8 *) ((ulong) & tx4927_pcicptr->
-                          g2pcfgdata | (where & 3)) = val;
+                          g2pcfgdata | 
+#ifdef __LITTLE_ENDIAN
+					(where & 3)) = val;
+#else
+					((where & 0x3) ^ 0x3)) = val;
+#endif
 		break;
 
 	case 2:
 		*(volatile u16 *) ((ulong) & tx4927_pcicptr->
-                           g2pcfgdata | (where & 3)) = val;
+                           g2pcfgdata | 
+#ifdef __LITTLE_ENDIAN
+					(where & 3)) = val;
+#else
+					((where & 0x3) ^ 0x2)) = val;
+#endif
 		break;
 	case 4:
 		tx4927_pcicptr->g2pcfgdata = val;

             reply	other threads:[~2005-01-22 17:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-22 17:57 Manish Lachwani [this message]
2005-01-22 21:14 ` [PATCH] Support 8-bit and 16-bit PCI ops on TX4927 in BE Steven J. Hill

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=20050122175735.GA26945@prometheus.mvista.com \
    --to=mlachwani@mvista.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.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