2  * ts5500_flash.c -- MTD map driver for Technology Systems TS-5500 board
 
   4  * Copyright (C) 2004 Sean Young <sean@mess.org>
 
   6  * This program is free software; you can redistribute it and/or modify
 
   7  * it under the terms of the GNU General Public License as published by
 
   8  * the Free Software Foundation; either version 2 of the License, or
 
   9  * (at your option) any later version.
 
  11  * This program is distributed in the hope that it will be useful,
 
  12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  14  * GNU General Public License for more details.
 
  16  * You should have received a copy of the GNU General Public License
 
  17  * along with this program; if not, write to the Free Software
 
  18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
  21  * - In order for detection to work, jumper 3 must be set.
 
  22  * - Drive A and B use the resident flash disk (RFD) flash translation layer.
 
  23  * - If you have created your own jffs file system and the bios overwrites
 
  24  *   it during boot, try disabling Drive A: and B: in the boot order.
 
  27 #include <linux/init.h>
 
  28 #include <linux/module.h>
 
  29 #include <linux/kernel.h>
 
  30 #include <linux/mtd/map.h>
 
  31 #include <linux/mtd/mtd.h>
 
  32 #include <linux/mtd/partitions.h>
 
  33 #include <linux/types.h>
 
  36 #define WINDOW_ADDR     0x09400000
 
  37 #define WINDOW_SIZE     0x00200000
 
  39 static struct map_info ts5500_map = {
 
  40         .name = "TS-5500 Flash",
 
  46 static struct mtd_partition ts5500_partitions[] = {
 
  64 #define NUM_PARTITIONS ARRAY_SIZE(ts5500_partitions)
 
  66 static struct mtd_info *mymtd;
 
  68 static int __init init_ts5500_map(void)
 
  72         ts5500_map.virt = ioremap_nocache(ts5500_map.phys, ts5500_map.size);
 
  74         if (!ts5500_map.virt) {
 
  75                 printk(KERN_ERR "Failed to ioremap_nocache\n");
 
  80         simple_map_init(&ts5500_map);
 
  82         mymtd = do_map_probe("jedec_probe", &ts5500_map);
 
  84                 mymtd = do_map_probe("map_rom", &ts5500_map);
 
  91         mymtd->owner = THIS_MODULE;
 
  92         add_mtd_partitions(mymtd, ts5500_partitions, NUM_PARTITIONS);
 
  98         iounmap(ts5500_map.virt);
 
 103 static void __exit cleanup_ts5500_map(void)
 
 106                 del_mtd_partitions(mymtd);
 
 110         if (ts5500_map.virt) {
 
 111                 iounmap(ts5500_map.virt);
 
 112                 ts5500_map.virt = NULL;
 
 116 module_init(init_ts5500_map);
 
 117 module_exit(cleanup_ts5500_map);
 
 119 MODULE_LICENSE("GPL");
 
 120 MODULE_AUTHOR("Sean Young <sean@mess.org>");
 
 121 MODULE_DESCRIPTION("MTD map driver for Techology Systems TS-5500 board");