This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
i82559 driver tweak
- From: Mark Salter <msalter at redhat dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Tue, 17 Dec 2002 17:11:38 -0500 (EST)
- Subject: i82559 driver tweak
Index: devs/eth/intel/i82559/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/eth/intel/i82559/current/ChangeLog,v
retrieving revision 1.15
diff -u -p -5 -r1.15 ChangeLog
--- devs/eth/intel/i82559/current/ChangeLog 6 Oct 2002 13:18:28 -0000 1.15
+++ devs/eth/intel/i82559/current/ChangeLog 17 Dec 2002 22:04:44 -0000
@@ -1,5 +1,11 @@
+2002-12-17 Mark Salter <msalter@redhat.com>
+
+ * src/if_i82559.c (CYGHWR_DEVS_ETH_INTEL_I82559_ENDIAN_NEUTRAL_IO): New
+ flag to support systems where PCI IO operations are not affected by
+ CPU endianess.
+
2002-10-06 Andrew Lunn <andrew.lunn@ascom.ch>
* src/if_i82559.c (pci_init_find_82559s): Changed scope of
max_interrupt_handle since its needed in other places.
* src/if_i82559.c (i82559_stop): Corrected wrong name of variable
Index: devs/eth/intel/i82559/current/src/if_i82559.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/eth/intel/i82559/current/src/if_i82559.c,v
retrieving revision 1.15
diff -u -p -5 -r1.15 if_i82559.c
--- devs/eth/intel/i82559/current/src/if_i82559.c 6 Oct 2002 13:18:29 -0000 1.15
+++ devs/eth/intel/i82559/current/src/if_i82559.c 17 Dec 2002 22:04:53 -0000
@@ -129,10 +129,13 @@
// have been fixated on the same transmit operation for too
// long - we missed an interrupt or the device crashed. The
// int32 argument is used to hold a eg. the value of a
// fast-running hardware timer.
//
+// CYGHWR_DEVS_ETH_INTEL_I82559_ENDIAN_NEUTRAL_IO if PCI IO
+// access is not affected by CPU endianess.
+//
// FIXME: replace -1/-2 return values with proper E-defines
// FIXME: For 82557/8 compatibility i82559_configure() function
// probably needs some tweaking - config bits differ
// slightly but crucially.
// FIXME: EEPROM code not tested on a BE system.
@@ -328,10 +331,23 @@ static struct {
#define HAL_LE32TOC(x) ((((x) & 0xff) << 24) | (((x) & 0xff00) << 8) | (((x) & 0xff0000) >> 8) | (((x) >> 24) & 0xff))
#define HAL_CTOLE16(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))
#define HAL_LE16TOC(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8))
+#else
+// Maintaining the same styleee as above...
+#define HAL_CTOLE32(x) ((((x))))
+#define HAL_LE32TOC(x) ((((x))))
+
+#define HAL_CTOLE16(x) ((((x))))
+#define HAL_LE16TOC(x) ((((x))))
+
+#endif
+
+
+#if (CYG_BYTEORDER == CYG_MSBFIRST) && !defined(CYGHWR_DEVS_ETH_INTEL_I82559_ENDIAN_NEUTRAL_IO)
+
static inline void OUTB(cyg_uint8 value, cyg_uint32 io_address)
{
HAL_WRITE_UINT8( io_address, value);
}
@@ -365,17 +381,10 @@ static inline cyg_uint32 INL(cyg_uint32
cyg_uint32 d;
HAL_READ_UINT32( io_address, d );
return ((((d) & 0xff) << 24) | (((d) & 0xff00) << 8) | (((d) & 0xff0000) >> 8) | (((d) >> 24) & 0xff));
}
#else
-
-// Maintaining the same styleee as above...
-#define HAL_CTOLE32(x) ((((x))))
-#define HAL_LE32TOC(x) ((((x))))
-
-#define HAL_CTOLE16(x) ((((x))))
-#define HAL_LE16TOC(x) ((((x))))
static inline void OUTB(cyg_uint8 value, cyg_uint32 io_address)
{ HAL_WRITE_UINT8( io_address, value ); }
static inline void OUTW(cyg_uint16 value, cyg_uint32 io_address)