[ARM] Support register switch in nommu mode
[linux-2.6/verdex.git] / drivers / mtd / maps / pq2fads.c
blobfb78d87cc130ddd30e58b2fe8cc2271b9962df53
1 /*
2 * drivers/mtd/maps/pq2fads.c
4 * Mapping for the flash SIMM on 8272ADS and PQ2FADS board
6 * Author: Vitaly Bordug <vbordug@ru.mvista.com>
8 * 2005 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
11 * or implied.
14 #include <linux/module.h>
15 #include <linux/types.h>
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <asm/io.h>
19 #include <asm/ppcboot.h>
20 #include <linux/mtd/mtd.h>
21 #include <linux/mtd/map.h>
22 #include <linux/mtd/partitions.h>
23 #include <linux/mtd/physmap.h>
26 NOTE: bank width and interleave relative to the installed flash
27 should have been chosen within MTD_CFI_GEOMETRY options.
29 #define PQ2FADS_BANK_WIDTH 4
31 static struct mtd_partition pq2fads_partitions[] = {
33 #ifdef CONFIG_ADS8272
34 .name = "HRCW",
35 .size = 0x40000,
36 .offset = 0,
37 .mask_flags = MTD_WRITEABLE, /* force read-only */
38 }, {
39 .name = "User FS",
40 .size = 0x5c0000,
41 .offset = 0x40000,
42 #else
43 .name = "User FS",
44 .size = 0x600000,
45 .offset = 0,
46 #endif
47 }, {
48 .name = "uImage",
49 .size = 0x100000,
50 .offset = 0x600000,
51 .mask_flags = MTD_WRITEABLE, /* force read-only */
52 }, {
53 .name = "bootloader",
54 .size = 0x40000,
55 .offset = 0x700000,
56 .mask_flags = MTD_WRITEABLE, /* force read-only */
57 }, {
58 .name = "bootloader env",
59 .size = 0x40000,
60 .offset = 0x740000,
61 .mask_flags = MTD_WRITEABLE, /* force read-only */
66 /* pointer to MPC885ADS board info data */
67 extern unsigned char __res[];
69 static int __init init_pq2fads_mtd(void)
71 bd_t *bd = (bd_t *)__res;
72 physmap_configure(bd->bi_flashstart, bd->bi_flashsize, PQ2FADS_BANK_WIDTH, NULL);
74 physmap_set_partitions(pq2fads_partitions,
75 sizeof (pq2fads_partitions) /
76 sizeof (pq2fads_partitions[0]));
77 return 0;
80 static void __exit cleanup_pq2fads_mtd(void)
84 module_init(init_pq2fads_mtd);
85 module_exit(cleanup_pq2fads_mtd);
87 MODULE_LICENSE("GPL");
88 MODULE_DESCRIPTION("MTD map and partitions for MPC8272ADS boards");