Skip to content

Commit

Permalink
[MTD] Add support for more SharpSL machines and fix missing mapping init
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Richard Purdie authored and Thomas Gleixner committed May 23, 2005
1 parent 3cceb9f commit ba38069
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions drivers/mtd/maps/sharpsl-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (C) 2001 Lineo Japan, Inc.
* Copyright (C) 2002 SHARP
*
* $Id: sharpsl-flash.c,v 1.2 2004/11/24 20:38:06 rpurdie Exp $
* $Id: sharpsl-flash.c,v 1.3 2005/03/21 00:10:21 rpurdie Exp $
*
* based on rpxlite.c,v 1.15 2001/10/02 15:05:14 dwmw2 Exp
* Handle mapping of the flash on the RPX Lite and CLLF boards
Expand All @@ -24,13 +24,14 @@
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <asm/io.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <asm/mach-types.h>

#define WINDOW_ADDR 0x00000000
#define WINDOW_SIZE 0x01000000
#define WINDOW_SIZE 0x00800000
#define BANK_WIDTH 2

static struct mtd_info *mymtd;
Expand All @@ -44,9 +45,7 @@ struct map_info sharpsl_map = {

static struct mtd_partition sharpsl_partitions[1] = {
{
name: "Filesystem",
size: 0x006d0000,
offset: 0x00120000
name: "Boot PROM Filesystem",
}
};

Expand All @@ -64,6 +63,9 @@ int __init init_sharpsl(void)
printk("Failed to ioremap\n");
return -EIO;
}

simple_map_init(&sharpsl_map);

mymtd = do_map_probe("map_rom", &sharpsl_map);
if (!mymtd) {
iounmap(sharpsl_map.virt);
Expand All @@ -72,6 +74,18 @@ int __init init_sharpsl(void)

mymtd->owner = THIS_MODULE;

if (machine_is_corgi() || machine_is_shepherd() || machine_is_husky() || machine_is_poodle()) {
sharpsl_partitions[0].size=0x006d0000;
sharpsl_partitions[0].offset=0x00120000;
} else if (machine_is_tosa()) {
sharpsl_partitions[0].size=0x006a0000;
sharpsl_partitions[0].offset=0x00160000;
} else if (machine_is_spitz()) {
sharpsl_partitions[0].size=0x006b0000;
sharpsl_partitions[0].offset=0x00140000;
} else
return -ENODEV;

parts = sharpsl_partitions;
nb_parts = NB_OF(sharpsl_partitions);

Expand Down

0 comments on commit ba38069

Please sign in to comment.