ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / mtd / devices / ms02-nv.h
1 /*
2  *      Copyright (c) 2001 Maciej W. Rozycki
3  *
4  *      This program is free software; you can redistribute it and/or
5  *      modify it under the terms of the GNU General Public License
6  *      as published by the Free Software Foundation; either version
7  *      2 of the License, or (at your option) any later version.
8  *
9  *      $Id: ms02-nv.h,v 1.1 2002/09/13 13:46:55 dwmw2 Exp $
10  */
11
12 #include <linux/ioport.h>
13 #include <linux/mtd/mtd.h>
14
15 /* MS02-NV iomem register offsets. */
16 #define MS02NV_CSR              0x400000        /* control & status register */
17
18 /* MS02-NV memory offsets. */
19 #define MS02NV_DIAG             0x0003f8        /* diagnostic status */
20 #define MS02NV_MAGIC            0x0003fc        /* MS02-NV magic ID */
21 #define MS02NV_RAM              0x000400        /* general-purpose RAM start */
22
23 /* MS02-NV diagnostic status constants. */
24 #define MS02NV_DIAG_SIZE_MASK   0xf0            /* RAM size mask */
25 #define MS02NV_DIAG_SIZE_SHIFT  0x10            /* RAM size shift (left) */
26
27 /* MS02-NV general constants. */
28 #define MS02NV_ID               0x03021966      /* MS02-NV magic ID value */
29 #define MS02NV_SLOT_SIZE        0x800000        /* size of the address space
30                                                    decoded by the module */
31
32 typedef volatile u32 ms02nv_uint;
33
34 struct ms02nv_private {
35         struct mtd_info *next;
36         struct {
37                 struct resource *module;
38                 struct resource *diag_ram;
39                 struct resource *user_ram;
40                 struct resource *csr;
41         } resource;
42         u_char *addr;
43         size_t size;
44         u_char *uaddr;
45 };