aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/rpxlite.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/rpxlite.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/rpxlite.c')
-rw-r--r--drivers/mtd/maps/rpxlite.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/drivers/mtd/maps/rpxlite.c b/drivers/mtd/maps/rpxlite.c
new file mode 100644
index 000000000000..809a0c8e7aaf
--- /dev/null
+++ b/drivers/mtd/maps/rpxlite.c
@@ -0,0 +1,66 @@
1/*
2 * $Id: rpxlite.c,v 1.22 2004/11/04 13:24:15 gleixner Exp $
3 *
4 * Handle mapping of the flash on the RPX Lite and CLLF boards
5 */
6
7#include <linux/module.h>
8#include <linux/types.h>
9#include <linux/kernel.h>
10#include <linux/init.h>
11#include <asm/io.h>
12#include <linux/mtd/mtd.h>
13#include <linux/mtd/map.h>
14
15
16#define WINDOW_ADDR 0xfe000000
17#define WINDOW_SIZE 0x800000
18
19static struct mtd_info *mymtd;
20
21static struct map_info rpxlite_map = {
22 .name = "RPX",
23 .size = WINDOW_SIZE,
24 .bankwidth = 4,
25 .phys = WINDOW_ADDR,
26};
27
28int __init init_rpxlite(void)
29{
30 printk(KERN_NOTICE "RPX Lite or CLLF flash device: %x at %x\n", WINDOW_SIZE*4, WINDOW_ADDR);
31 rpxlite_map.virt = ioremap(WINDOW_ADDR, WINDOW_SIZE * 4);
32
33 if (!rpxlite_map.virt) {
34 printk("Failed to ioremap\n");
35 return -EIO;
36 }
37 simple_map_init(&rpxlite_map);
38 mymtd = do_map_probe("cfi_probe", &rpxlite_map);
39 if (mymtd) {
40 mymtd->owner = THIS_MODULE;
41 add_mtd_device(mymtd);
42 return 0;
43 }
44
45 iounmap((void *)rpxlite_map.virt);
46 return -ENXIO;
47}
48
49static void __exit cleanup_rpxlite(void)
50{
51 if (mymtd) {
52 del_mtd_device(mymtd);
53 map_destroy(mymtd);
54 }
55 if (rpxlite_map.virt) {
56 iounmap((void *)rpxlite_map.virt);
57 rpxlite_map.virt = 0;
58 }
59}
60
61module_init(init_rpxlite);
62module_exit(cleanup_rpxlite);
63
64MODULE_LICENSE("GPL");
65MODULE_AUTHOR("Arnold Christensen <AKC@pel.dk>");
66MODULE_DESCRIPTION("MTD map driver for RPX Lite and CLLF boards");