vserver 1.9.5.x5
[linux-2.6.git] / include / asm-mips / mach-db1x00 / db1x00.h
index 3b03b0b..4691398 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright 2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
  *             ppopov@mvista.com or source@mvista.com
+ * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
  *
  * ########################################################################
  *
 #ifndef __ASM_DB1X00_H
 #define __ASM_DB1X00_H
 
+#include <linux/config.h>
+
 #ifdef CONFIG_MIPS_DB1550
 #define BCSR_KSEG1_ADDR 0xAF000000
+#define NAND_PHYS_ADDR  0x20000000
 #else
 #define BCSR_KSEG1_ADDR 0xAE000000
 #endif
@@ -130,15 +134,6 @@ typedef volatile struct
 #define SET_VCC_VPP(VCC, VPP, SLOT)\
        ((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
 
-/* MTD CONFIG OPTIONS */
-#if defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
-#define DB1X00_BOTH_BANKS
-#elif defined(CONFIG_MTD_DB1X00_BOOT) && !defined(CONFIG_MTD_DB1X00_USER)
-#define DB1X00_BOOT_ONLY
-#elif !defined(CONFIG_MTD_DB1X00_BOOT) && defined(CONFIG_MTD_DB1X00_USER)
-#define DB1X00_USER_ONLY
-#endif
-
 /* SD controller macros */
 /*
  * Detect card.
@@ -182,5 +177,29 @@ typedef volatile struct
                } \
        } while (0)
 
+
+/* NAND defines */
+/* Timing values as described in databook, * ns value stripped of
+ * lower 2 bits.
+ * These defines are here rather than an SOC1550 generic file because
+ * the parts chosen on another board may be different and may require
+ * different timings.
+ */
+#define NAND_T_H                       (18 >> 2)
+#define NAND_T_PUL                     (30 >> 2)
+#define NAND_T_SU                      (30 >> 2)
+#define NAND_T_WH                      (30 >> 2)
+
+/* Bitfield shift amounts */
+#define NAND_T_H_SHIFT         0
+#define NAND_T_PUL_SHIFT       4
+#define NAND_T_SU_SHIFT                8
+#define NAND_T_WH_SHIFT                12
+
+#define NAND_TIMING    ((NAND_T_H   & 0xF)     << NAND_T_H_SHIFT)   | \
+                       ((NAND_T_PUL & 0xF)     << NAND_T_PUL_SHIFT) | \
+                       ((NAND_T_SU  & 0xF)     << NAND_T_SU_SHIFT)  | \
+                       ((NAND_T_WH  & 0xF)     << NAND_T_WH_SHIFT)
+
 #endif /* __ASM_DB1X00_H */