cleanup
[linux-2.4.21-pre4.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
10 #include <linux/ioport.h>
11 #include <linux/mtd/mtd.h>
12
13 /* MS02-NV iomem register offsets. */
14 #define MS02NV_CSR              0x400000        /* control & status register */
15
16 /* MS02-NV memory offsets. */
17 #define MS02NV_DIAG             0x0003f8        /* diagnostic status */
18 #define MS02NV_MAGIC            0x0003fc        /* MS02-NV magic ID */
19 #define MS02NV_RAM              0x000400        /* general-purpose RAM start */
20
21 /* MS02-NV diagnostic status constants. */
22 #define MS02NV_DIAG_SIZE_MASK   0xf0            /* RAM size mask */
23 #define MS02NV_DIAG_SIZE_SHIFT  0x10            /* RAM size shift (left) */
24
25 /* MS02-NV general constants. */
26 #define MS02NV_ID               0x03021966      /* MS02-NV magic ID value */
27 #define MS02NV_SLOT_SIZE        0x800000        /* size of the address space
28                                                    decoded by the module */
29
30 typedef volatile u32 ms02nv_uint;
31
32 struct ms02nv_private {
33         struct mtd_info *next;
34         struct {
35                 struct resource *module;
36                 struct resource *diag_ram;
37                 struct resource *user_ram;
38                 struct resource *csr;
39         } resource;
40         u_char *addr;
41         size_t size;
42         u_char *uaddr;
43 };