]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/mtd/cfi.h
Merge branch 'cpus4096-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-omap-h63xx.git] / include / linux / mtd / cfi.h
index 09bfae6938b3eb855f5a7b0b21f94eb5c4588a4a..b0ddf4b25862392d90443a8ad88a9d6c7ad68b95 100644 (file)
 #define cfi_interleave_is_8(cfi) (0)
 #endif
 
+#ifndef cfi_interleave
+#warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work.
+static inline int cfi_interleave(void *cfi)
+{
+       BUG();
+       return 0;
+}
+#endif
+
 static inline int cfi_interleave_supported(int i)
 {
        switch (i) {
@@ -89,6 +98,18 @@ static inline int cfi_interleave_supported(int i)
 #define CFI_DEVICETYPE_X32 (32 / 8)
 #define CFI_DEVICETYPE_X64 (64 / 8)
 
+
+/* Device Interface Code Assignments from the "Common Flash Memory Interface
+ * Publication 100" dated December 1, 2001.
+ */
+#define CFI_INTERFACE_X8_ASYNC         0x0000
+#define CFI_INTERFACE_X16_ASYNC                0x0001
+#define CFI_INTERFACE_X8_BY_X16_ASYNC  0x0002
+#define CFI_INTERFACE_X32_ASYNC                0x0003
+#define CFI_INTERFACE_X16_BY_X32_ASYNC 0x0005
+#define CFI_INTERFACE_NOT_ALLOWED      0xffff
+
+
 /* NB: We keep these structures in memory in HOST byteorder, except
  * where individually noted.
  */
@@ -199,6 +220,18 @@ struct cfi_pri_amdstd {
        uint8_t  TopBottom;
 } __attribute__((packed));
 
+/* Vendor-Specific PRI for Atmel chips (command set 0x0002) */
+
+struct cfi_pri_atmel {
+       uint8_t pri[3];
+       uint8_t MajorVersion;
+       uint8_t MinorVersion;
+       uint8_t Features;
+       uint8_t BottomBoot;
+       uint8_t BurstMode;
+       uint8_t PageMode;
+} __attribute__((packed));
+
 struct cfi_pri_query {
        uint8_t  NumFields;
        uint32_t ProtField[1]; /* Not host ordered */
@@ -464,6 +497,7 @@ struct cfi_fixup {
 #define CFI_ID_ANY  0xffff
 
 #define CFI_MFR_AMD 0x0001
+#define CFI_MFR_ATMEL 0x001F
 #define CFI_MFR_ST  0x0020     /* STMicroelectronics */
 
 void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);