patch-2.4.11-dontuse linux/include/linux/mtd/cfi_endian.h

Next file: linux/include/linux/mtd/doc2000.h
Previous file: linux/include/linux/mtd/cfi.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.10/linux/include/linux/mtd/cfi_endian.h linux/include/linux/mtd/cfi_endian.h
@@ -1,16 +1,5 @@
 /*
- * $Id: cfi_endian.h,v 1.9 2001/04/23 21:19:11 nico Exp $
- *
- * It seems that some helpful people decided to make life easier
- * for software engineers who aren't capable of dealing with the 
- * concept of byteswapping, and advise engineers to swap the bytes
- * by wiring the data lines up to flash chips from BE hosts backwards.
- *
- * So we have ugly stuff here to disable the byteswapping where necessary.
- * I'm not going to try to do this dynamically.
- *
- * At first I thought these guys were on crack, but then I discovered the
- * LART. 
+ * $Id: cfi_endian.h,v 1.10 2001/06/18 11:00:46 abz Exp $
  *
  */
 
@@ -34,10 +23,6 @@
 #define CFI_BIG_ENDIAN
 #endif
 
-#ifdef CONFIG_MTD_CFI_LART_BIT_SWAP
-#define CFI_LART_ENDIAN
-#endif
-
 #endif
 
 #if defined(CFI_LITTLE_ENDIAN)
@@ -61,81 +46,6 @@
 #define cpu_to_cfi32(x) (x)
 #define cfi16_to_cpu(x) (x)
 #define cfi32_to_cpu(x) (x)
-#elif defined (CFI_LART_ENDIAN)
-/* 
-   Fuck me backwards. The data line mapping on LART is as follows:
-
-	U2	CPU	|	U3	CPU
-	 0	20	|	0	12
-	 1	22	|	1	14
-	 2	19	|	2	11
-	 3	17	|	3	9
-	 4	24	|	4	0
-	 5	26	|	5	2
-	 6	31	|	6	7
-	 7	29	|	7	5
-	 8	21	|	8	13
-	 9	23	|	9	15
-	 10	18	|	10	10
-	 11	16	|	11	8
-	 12	25	|	12	1
-	 13	27	|	13	3
-	 14	30	|	14	6
-	 15	28	|	15	4
-
-   For historical reference: the reason why the LART has this strange
-   mapping is that the designer of the board wanted address lines to
-   be as short as possible. Why? Because in that way you don't need
-   drivers in the address lines so the memory access time can be held
-   short. -- Erik Mouw <J.A.K.Mouw@its.tudelft.nl>
-*/
-/* cpu_to_cfi16() and cfi16_to_cpu() are not needed because the LART
- * only has 32 bit wide Flash memory. -- Erik
- */
-#define cpu_to_cfi16(x) (x)
-#define cfi16_to_cpu(x) (x)
-static inline __u32 cfi32_to_cpu(__u32 x)
-{
-	__u32 ret;
-
-	ret =  (x & 0x08009000) >> 11;
-	ret |= (x & 0x00002000) >> 10;
-	ret |= (x & 0x04004000) >> 8;
-	ret |= (x & 0x00000010) >> 4;
-	ret |= (x & 0x91000820) >> 3;
-	ret |= (x & 0x22080080) >> 2;
-	ret |= (x & 0x40000400);
-	ret |= (x & 0x00040040) << 1;
-	ret |= (x & 0x00110000) << 4;
-	ret |= (x & 0x00220100) << 5;
-	ret |= (x & 0x00800208) << 6;
-	ret |= (x & 0x00400004) << 9;
-	ret |= (x & 0x00000001) << 12;
-	ret |= (x & 0x00000002) << 13;
-
-	return ret;
-}
-static inline __u32 cpu_to_cfi32(__u32 x)
-{
-	__u32 ret;
-
-	ret =  (x & 0x00010012) << 11;
-	ret |= (x & 0x00000008) << 10;
-	ret |= (x & 0x00040040) << 8;
-	ret |= (x & 0x00000001) << 4;
-	ret |= (x & 0x12200104) << 3;
-	ret |= (x & 0x08820020) << 2;
-	ret |= (x & 0x40000400);
-	ret |= (x & 0x00080080) >> 1;
-	ret |= (x & 0x01100000) >> 4;
-	ret |= (x & 0x04402000) >> 5;
-	ret |= (x & 0x20008200) >> 6;
-	ret |= (x & 0x80000800) >> 9;
-	ret |= (x & 0x00001000) >> 12;
-	ret |= (x & 0x00004000) >> 13;
-
-	return ret;
-}
 #else
 #error No CFI endianness defined
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)