Skip to contentSkip to conversation

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

PATCH Applied Manish Lachwani 2 participants 2 messages Jan 22, 2005 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Support 8-bit and 16-bit PCI ops on TX4927 in BE

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 <[email protected]>
MR: 9909
Type: Defect Fix
Disposition: Submitted to linux-mips.org
Keywords:

Description:
Support for BE mode on Tx4927 based board

arch/mips/pci/ops-tx4927.c +24 -4
Index: 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;
#1 lore raw
Quoted 3 lines · Manish Lachwani

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

Applied.

-Steve