summaryrefslogtreecommitdiff
path: root/target/linux/adm5120-2.6/files/drivers/mtd
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-03-19 17:34:37 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-03-19 17:34:37 +0000
commitd9dfd7341b4e1febcf37c7a973c1f2f13b60f54d (patch)
tree4a250ad2718a62180df562861b83777f2c4c5a85 /target/linux/adm5120-2.6/files/drivers/mtd
parentf04dd67969a38e54002c20828acf93090c4d10a4 (diff)
downloadmtk-20170518-d9dfd7341b4e1febcf37c7a973c1f2f13b60f54d.zip
mtk-20170518-d9dfd7341b4e1febcf37c7a973c1f2f13b60f54d.tar.gz
mtk-20170518-d9dfd7341b4e1febcf37c7a973c1f2f13b60f54d.tar.bz2
Preliminary ADM5120 support, marked as broken
SVN-Revision: 6614
Diffstat (limited to 'target/linux/adm5120-2.6/files/drivers/mtd')
-rw-r--r--target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c b/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c
new file mode 100644
index 0000000..a9e97cb
--- /dev/null
+++ b/target/linux/adm5120-2.6/files/drivers/mtd/maps/adm5120_mtd.c
@@ -0,0 +1,55 @@
+/*
+ * Flash device on the ADM5120 board
+ *
+ * Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2005
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation.
+ */
+
+#include <linux/autoconf.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+
+#define FLASH_PHYS_ADDR 0x1FC00000
+#define FLASH_SIZE 0x200000
+
+static struct mtd_info *adm5120_mtd;
+
+static struct map_info adm5120_mtd_map = {
+ .name = "ADM5120",
+ .size = FLASH_SIZE,
+ .bankwidth = 2,
+ .phys = FLASH_PHYS_ADDR,
+};
+
+static int __init adm5120_mtd_init(void)
+{
+ printk(KERN_INFO "ADM5120 board flash (0x%x at 0x%x)\n", FLASH_SIZE,
+ FLASH_PHYS_ADDR);
+ adm5120_mtd_map.virt = ioremap_nocache(FLASH_PHYS_ADDR, FLASH_SIZE);
+ simple_map_init(&adm5120_mtd_map);
+ adm5120_mtd = do_map_probe("cfi_probe", &adm5120_mtd_map);
+ if (adm5120_mtd) {
+ adm5120_mtd->owner = THIS_MODULE;
+ add_mtd_device(adm5120_mtd);
+ return 0;
+ }
+ return -ENXIO;
+}
+
+static void __exit adm5120_mtd_exit(void)
+{
+ del_mtd_device(adm5120_mtd);
+ map_destroy(adm5120_mtd);
+}
+
+module_init(adm5120_mtd_init);
+module_exit(adm5120_mtd_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Jeroen Vreeken (pe1rxq@amsat.org)");
+MODULE_DESCRIPTION("MTD map driver for ADM5120 boards");