aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/mpc1211.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/mtd/maps/mpc1211.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/mtd/maps/mpc1211.c')
-rw-r--r--drivers/mtd/maps/mpc1211.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/drivers/mtd/maps/mpc1211.c b/drivers/mtd/maps/mpc1211.c
new file mode 100644
index 000000000000..4685e8e13460
--- /dev/null
+++ b/drivers/mtd/maps/mpc1211.c
@@ -0,0 +1,81 @@
1/*
2 * Flash on MPC-1211
3 *
4 * $Id: mpc1211.c,v 1.4 2004/09/16 23:27:13 gleixner Exp $
5 *
6 * (C) 2002 Interface, Saito.K & Jeanne
7 *
8 * GPL'd
9 */
10
11#include <linux/module.h>
12#include <linux/types.h>
13#include <linux/kernel.h>
14#include <asm/io.h>
15#include <linux/mtd/mtd.h>
16#include <linux/mtd/map.h>
17#include <linux/mtd/partitions.h>
18#include <linux/config.h>
19
20static struct mtd_info *flash_mtd;
21static struct mtd_partition *parsed_parts;
22
23struct map_info mpc1211_flash_map = {
24 .name = "MPC-1211 FLASH",
25 .size = 0x80000,
26 .bankwidth = 1,
27};
28
29static struct mtd_partition mpc1211_partitions[] = {
30 {
31 .name = "IPL & ETH-BOOT",
32 .offset = 0x00000000,
33 .size = 0x10000,
34 },
35 {
36 .name = "Flash FS",
37 .offset = 0x00010000,
38 .size = MTDPART_SIZ_FULL,
39 }
40};
41
42static int __init init_mpc1211_maps(void)
43{
44 int nr_parts;
45
46 mpc1211_flash_map.phys = 0;
47 mpc1211_flash_map.virt = (void __iomem *)P2SEGADDR(0);
48
49 simple_map_init(&mpc1211_flash_map);
50
51 printk(KERN_NOTICE "Probing for flash chips at 0x00000000:\n");
52 flash_mtd = do_map_probe("jedec_probe", &mpc1211_flash_map);
53 if (!flash_mtd) {
54 printk(KERN_NOTICE "Flash chips not detected at either possible location.\n");
55 return -ENXIO;
56 }
57 printk(KERN_NOTICE "MPC-1211: Flash at 0x%08lx\n", mpc1211_flash_map.virt & 0x1fffffff);
58 flash_mtd->module = THIS_MODULE;
59
60 parsed_parts = mpc1211_partitions;
61 nr_parts = ARRAY_SIZE(mpc1211_partitions);
62
63 add_mtd_partitions(flash_mtd, parsed_parts, nr_parts);
64 return 0;
65}
66
67static void __exit cleanup_mpc1211_maps(void)
68{
69 if (parsed_parts)
70 del_mtd_partitions(flash_mtd);
71 else
72 del_mtd_device(flash_mtd);
73 map_destroy(flash_mtd);
74}
75
76module_init(init_mpc1211_maps);
77module_exit(cleanup_mpc1211_maps);
78
79MODULE_LICENSE("GPL");
80MODULE_AUTHOR("Saito.K & Jeanne <ksaito@interface.co.jp>");
81MODULE_DESCRIPTION("MTD map driver for MPC-1211 boards. Interface");