aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2005-03-20 19:10:24 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 07:03:24 -0400
commitba38069875a365a33b9b56e42dfdb71b5ce7a3a4 (patch)
treecedbbcf8107f8cf6cbdecdbcbb3b719bb1a90976 /drivers/mtd/maps
parent3cceb9f6cf433545b607451e5de7af2cd6cec0b5 (diff)
[MTD] Add support for more SharpSL machines and fix missing mapping init
Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/sharpsl-flash.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/mtd/maps/sharpsl-flash.c b/drivers/mtd/maps/sharpsl-flash.c
index b3b39cb7c608..c643d4c5124d 100644
--- a/drivers/mtd/maps/sharpsl-flash.c
+++ b/drivers/mtd/maps/sharpsl-flash.c
@@ -4,7 +4,7 @@
4 * Copyright (C) 2001 Lineo Japan, Inc. 4 * Copyright (C) 2001 Lineo Japan, Inc.
5 * Copyright (C) 2002 SHARP 5 * Copyright (C) 2002 SHARP
6 * 6 *
7 * $Id: sharpsl-flash.c,v 1.2 2004/11/24 20:38:06 rpurdie Exp $ 7 * $Id: sharpsl-flash.c,v 1.3 2005/03/21 00:10:21 rpurdie Exp $
8 * 8 *
9 * based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp 9 * based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp
10 * Handle mapping of the flash on the RPX Lite and CLLF boards 10 * Handle mapping of the flash on the RPX Lite and CLLF boards
@@ -24,13 +24,14 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <asm/io.h>
28#include <linux/mtd/mtd.h> 27#include <linux/mtd/mtd.h>
29#include <linux/mtd/map.h> 28#include <linux/mtd/map.h>
30#include <linux/mtd/partitions.h> 29#include <linux/mtd/partitions.h>
30#include <asm/io.h>
31#include <asm/mach-types.h>
31 32
32#define WINDOW_ADDR 0x00000000 33#define WINDOW_ADDR 0x00000000
33#define WINDOW_SIZE 0x01000000 34#define WINDOW_SIZE 0x00800000
34#define BANK_WIDTH 2 35#define BANK_WIDTH 2
35 36
36static struct mtd_info *mymtd; 37static struct mtd_info *mymtd;
@@ -44,9 +45,7 @@ struct map_info sharpsl_map = {
44 45
45static struct mtd_partition sharpsl_partitions[1] = { 46static struct mtd_partition sharpsl_partitions[1] = {
46 { 47 {
47 name: "Filesystem", 48 name: "Boot PROM Filesystem",
48 size: 0x006d0000,
49 offset: 0x00120000
50 } 49 }
51}; 50};
52 51
@@ -64,6 +63,9 @@ int __init init_sharpsl(void)
64 printk("Failed to ioremap\n"); 63 printk("Failed to ioremap\n");
65 return -EIO; 64 return -EIO;
66 } 65 }
66
67 simple_map_init(&sharpsl_map);
68
67 mymtd = do_map_probe("map_rom", &sharpsl_map); 69 mymtd = do_map_probe("map_rom", &sharpsl_map);
68 if (!mymtd) { 70 if (!mymtd) {
69 iounmap(sharpsl_map.virt); 71 iounmap(sharpsl_map.virt);
@@ -72,6 +74,18 @@ int __init init_sharpsl(void)
72 74
73 mymtd->owner = THIS_MODULE; 75 mymtd->owner = THIS_MODULE;
74 76
77 if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky() || machine_is_poodle()) {
78 sharpsl_partitions[0].size=0x006d0000;
79 sharpsl_partitions[0].offset=0x00120000;
80 } else if (machine_is_tosa()) {
81 sharpsl_partitions[0].size=0x006a0000;
82 sharpsl_partitions[0].offset=0x00160000;
83 } else if (machine_is_spitz()) {
84 sharpsl_partitions[0].size=0x006b0000;
85 sharpsl_partitions[0].offset=0x00140000;
86 } else
87 return -ENODEV;
88
75 parts = sharpsl_partitions; 89 parts = sharpsl_partitions;
76 nb_parts = NB_OF(sharpsl_partitions); 90 nb_parts = NB_OF(sharpsl_partitions);
77 91