[PATCH] Support 8-bit and 16-bit PCI ops on TX4927 in BE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
Source: MontaVista Software, Inc. | URL | Manish Lachwani <mlachwani@xxxxxxxxxx>
MR: 9909
Type: Defect Fix
Disposition: Submitted to linux-mips.org
Keywords:
Signed-off-by: Manish Lachwani <mlachwani@xxxxxxxxxx>
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;

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux