2b54aaef7a
I have been prime author and maintainer of block2mtd from day one, but neither MAINTAINERS nor the module source makes this fact clear. And while I'm at it, update my email addresses tree-wide, as the old address currently bounces and change my name to "joern" as unicode will likely continue to cause trouble until the end of this century. Signed-off-by: Joern Engel <joern@lazybastard.org> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
95 lines
2 KiB
C
95 lines
2 KiB
C
/*
|
|
* Flash memory access on 4G Systems MTX-1 boards
|
|
*
|
|
* $Id: mtx-1_flash.c,v 1.2 2005/11/07 11:14:27 gleixner Exp $
|
|
*
|
|
* (C) 2005 Bruno Randolf <bruno.randolf@4g-systems.biz>
|
|
* (C) 2005 Joern Engel <joern@wohnheim.fh-wedel.de>
|
|
*
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/types.h>
|
|
#include <linux/init.h>
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/mtd/mtd.h>
|
|
#include <linux/mtd/map.h>
|
|
#include <linux/mtd/partitions.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
static struct map_info mtx1_map = {
|
|
.name = "MTX-1 flash",
|
|
.bankwidth = 4,
|
|
.size = 0x2000000,
|
|
.phys = 0x1E000000,
|
|
};
|
|
|
|
static struct mtd_partition mtx1_partitions[] = {
|
|
{
|
|
.name = "filesystem",
|
|
.size = 0x01C00000,
|
|
.offset = 0,
|
|
},{
|
|
.name = "yamon",
|
|
.size = 0x00100000,
|
|
.offset = MTDPART_OFS_APPEND,
|
|
.mask_flags = MTD_WRITEABLE,
|
|
},{
|
|
.name = "kernel",
|
|
.size = 0x002c0000,
|
|
.offset = MTDPART_OFS_APPEND,
|
|
},{
|
|
.name = "yamon env",
|
|
.size = 0x00040000,
|
|
.offset = MTDPART_OFS_APPEND,
|
|
}
|
|
};
|
|
|
|
static struct mtd_info *mtx1_mtd;
|
|
|
|
int __init mtx1_mtd_init(void)
|
|
{
|
|
int ret = -ENXIO;
|
|
|
|
simple_map_init(&mtx1_map);
|
|
|
|
mtx1_map.virt = ioremap(mtx1_map.phys, mtx1_map.size);
|
|
if (!mtx1_map.virt)
|
|
return -EIO;
|
|
|
|
mtx1_mtd = do_map_probe("cfi_probe", &mtx1_map);
|
|
if (!mtx1_mtd)
|
|
goto err;
|
|
|
|
mtx1_mtd->owner = THIS_MODULE;
|
|
|
|
ret = add_mtd_partitions(mtx1_mtd, mtx1_partitions,
|
|
ARRAY_SIZE(mtx1_partitions));
|
|
if (ret)
|
|
goto err;
|
|
|
|
return 0;
|
|
|
|
err:
|
|
iounmap(mtx1_map.virt);
|
|
return ret;
|
|
}
|
|
|
|
static void __exit mtx1_mtd_cleanup(void)
|
|
{
|
|
if (mtx1_mtd) {
|
|
del_mtd_partitions(mtx1_mtd);
|
|
map_destroy(mtx1_mtd);
|
|
}
|
|
if (mtx1_map.virt)
|
|
iounmap(mtx1_map.virt);
|
|
}
|
|
|
|
module_init(mtx1_mtd_init);
|
|
module_exit(mtx1_mtd_cleanup);
|
|
|
|
MODULE_AUTHOR("Bruno Randolf <bruno.randolf@4g-systems.biz>");
|
|
MODULE_DESCRIPTION("MTX-1 flash map");
|
|
MODULE_LICENSE("GPL");
|