Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / mtd / maps / ebony.c
index 00e87e2..60a6e51 100644 (file)
@@ -1,11 +1,11 @@
 /*
- * $Id: ebony.c,v 1.8 2003/06/23 11:48:18 dwmw2 Exp $
- * 
+ * $Id: ebony.c,v 1.16 2005/11/07 11:14:26 gleixner Exp $
+ *
  * Mapping for Ebony user flash
  *
- * Matt Porter <mporter@mvista.com>
+ * Matt Porter <mporter@kernel.crashing.org>
  *
- * Copyright 2002 MontaVista Software Inc.
+ * Copyright 2002-2004 MontaVista Software Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
 #include <linux/mtd/partitions.h>
 #include <linux/config.h>
 #include <asm/io.h>
-#include <asm/ibm440.h>
-#include <platforms/ebony.h>
+#include <asm/ibm44x.h>
+#include <platforms/4xx/ebony.h>
 
 static struct mtd_info *flash;
 
 static struct map_info ebony_small_map = {
        .name =         "Ebony small flash",
        .size =         EBONY_SMALL_FLASH_SIZE,
-       .buswidth =     1,
+       .bankwidth =    1,
 };
 
 static struct map_info ebony_large_map = {
        .name =         "Ebony large flash",
        .size =         EBONY_LARGE_FLASH_SIZE,
-       .buswidth =     1,
+       .bankwidth =    1,
 };
 
 static struct mtd_partition ebony_small_partitions[] = {
@@ -63,7 +63,7 @@ static struct mtd_partition ebony_large_partitions[] = {
 int __init init_ebony(void)
 {
        u8 fpga0_reg;
-       unsigned long fpga0_adr;
+       u8 __iomem *fpga0_adr;
        unsigned long long small_flash_base, large_flash_base;
 
        fpga0_adr = ioremap64(EBONY_FPGA_ADDR, 16);
@@ -71,7 +71,7 @@ int __init init_ebony(void)
                return -ENOMEM;
 
        fpga0_reg = readb(fpga0_adr);
-       iounmap64(fpga0_adr);
+       iounmap(fpga0_adr);
 
        if (EBONY_BOOT_SMALL_FLASH(fpga0_reg) &&
                        !EBONY_FLASH_SEL(fpga0_reg))
@@ -84,7 +84,7 @@ int __init init_ebony(void)
                small_flash_base = EBONY_SMALL_FLASH_LOW2;
        else
                small_flash_base = EBONY_SMALL_FLASH_LOW1;
-                       
+
        if (EBONY_BOOT_SMALL_FLASH(fpga0_reg) &&
                        !EBONY_ONBRD_FLASH_EN(fpga0_reg))
                large_flash_base = EBONY_LARGE_FLASH_LOW;
@@ -92,8 +92,7 @@ int __init init_ebony(void)
                large_flash_base = EBONY_LARGE_FLASH_HIGH;
 
        ebony_small_map.phys = small_flash_base;
-       ebony_small_map.virt =
-               (unsigned long)ioremap64(small_flash_base,
+       ebony_small_map.virt = ioremap64(small_flash_base,
                                         ebony_small_map.size);
 
        if (!ebony_small_map.virt) {
@@ -103,7 +102,7 @@ int __init init_ebony(void)
 
        simple_map_init(&ebony_small_map);
 
-       flash = do_map_probe("map_rom", &ebony_small_map);
+       flash = do_map_probe("jedec_probe", &ebony_small_map);
        if (flash) {
                flash->owner = THIS_MODULE;
                add_mtd_partitions(flash, ebony_small_partitions,
@@ -114,8 +113,7 @@ int __init init_ebony(void)
        }
 
        ebony_large_map.phys = large_flash_base;
-       ebony_large_map.virt =
-               (unsigned long)ioremap64(large_flash_base,
+       ebony_large_map.virt = ioremap64(large_flash_base,
                                         ebony_large_map.size);
 
        if (!ebony_large_map.virt) {
@@ -125,7 +123,7 @@ int __init init_ebony(void)
 
        simple_map_init(&ebony_large_map);
 
-       flash = do_map_probe("cfi_probe", &ebony_large_map);
+       flash = do_map_probe("jedec_probe", &ebony_large_map);
        if (flash) {
                flash->owner = THIS_MODULE;
                add_mtd_partitions(flash, ebony_large_partitions,
@@ -146,13 +144,13 @@ static void __exit cleanup_ebony(void)
        }
 
        if (ebony_small_map.virt) {
-               iounmap((void *)ebony_small_map.virt);
-               ebony_small_map.virt = 0;
+               iounmap(ebony_small_map.virt);
+               ebony_small_map.virt = NULL;
        }
 
        if (ebony_large_map.virt) {
-               iounmap((void *)ebony_large_map.virt);
-               ebony_large_map.virt = 0;
+               iounmap(ebony_large_map.virt);
+               ebony_large_map.virt = NULL;
        }
 }
 
@@ -160,5 +158,5 @@ module_init(init_ebony);
 module_exit(cleanup_ebony);
 
 MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Matt Porter <mporter@mvista.com>");
+MODULE_AUTHOR("Matt Porter <mporter@kernel.crashing.org>");
 MODULE_DESCRIPTION("MTD map and partitions for IBM 440GP Ebony boards");