[BACK]Return to dmv182.c CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / drivers / mtd / maps

File: [Development] / linux-2.6-xfs / drivers / mtd / maps / dmv182.c (download)

Revision 1.18, Wed Sep 12 17:09:56 2007 UTC (10 years, 1 month ago) by tes.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.17: +0 -0 lines

Update 2.6.x-xfs to 2.6.23-rc4.

Also update fs/xfs with external mainline changes.
There were 12 such missing commits that I detected:

--------
commit ad690ef9e690f6c31f7d310b09ef1314bcec9033
Author: Al Viro <viro@ftp.linux.org.uk>
    xfs ioctl __user annotations

commit 20c2df83d25c6a95affe6157a4c9cac4cf5ffaac
Author: Paul Mundt <lethal@linux-sh.org>
    mm: Remove slab destructors from kmem_cache_create().

commit d0217ac04ca6591841e5665f518e38064f4e65bd
Author: Nick Piggin <npiggin@suse.de>
    mm: fault feedback #1

commit 54cb8821de07f2ffcd28c380ce9b93d5784b40d7
Author: Nick Piggin <npiggin@suse.de>
    mm: merge populate and nopage into fault (fixes nonlinear)

commit d00806b183152af6d24f46f0c33f14162ca1262a
Author: Nick Piggin <npiggin@suse.de>
    mm: fix fault vs invalidate race for linear mappings

commit a569425512253992cc64ebf8b6d00a62f986db3e
Author: Christoph Hellwig <hch@infradead.org>
    knfsd: exportfs: add exportfs.h header

commit 831441862956fffa17b9801db37e6ea1650b0f69
Author: Rafael J. Wysocki <rjw@sisk.pl>
    Freezer: make kernel threads nonfreezable by default

commit 8e1f936b73150f5095448a0fee6d4f30a1f9001d
Author: Rusty Russell <rusty@rustcorp.com.au>
    mm: clean up and kernelify shrinker registration

commit 5ffc4ef45b3b0a57872f631b4e4ceb8ace0d7496
Author: Jens Axboe <jens.axboe@oracle.com>
    sendfile: remove .sendfile from filesystems that use generic_file_sendfile()

commit 8bb7844286fb8c9fce6f65d8288aeb09d03a5e0d
Author: Rafael J. Wysocki <rjw@sisk.pl>
    Add suspend-related notifications for CPU hotplug

commit 59c51591a0ac7568824f541f57de967e88adaa07
Author: Michael Opdenacker <michael@free-electrons.com>
    Fix occurrences of "the the "

commit 0ceb331433e8aad9c5f441a965d7c681f8b9046f
Author: Dmitriy Monakhov <dmonakhov@openvz.org>
    mm: move common segment checks to separate helper function
--------
Merge of 2.6.x-xfs-melb:linux:29656b by kenmcd.

/*
 * drivers/mtd/maps/dmv182.c
 *
 * Flash map driver for the Dy4 SVME182 board
 *
 * $Id: dmv182.c,v 1.18 2007/09/12 17:09:56 tes.longdrop.melbourne.sgi.com Exp $
 *
 * Copyright 2003-2004, TimeSys Corporation
 *
 * Based on the SVME181 flash map, by Tom Nelson, Dot4, Inc. for TimeSys Corp.
 *
 * 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
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#include <linux/module.h>
#include <linux/init.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 <linux/errno.h>

/*
 * This driver currently handles only the 16MiB user flash bank 1 on the
 * board.  It does not provide access to bank 0 (contains the Dy4 FFW), bank 2
 * (VxWorks boot), or the optional 48MiB expansion flash.
 *
 * scott.wood@timesys.com: On the newer boards with 128MiB flash, it
 * now supports the first 96MiB (the boot flash bank containing FFW
 * is excluded).  The VxWorks loader is in partition 1.
 */

#define FLASH_BASE_ADDR 0xf0000000
#define FLASH_BANK_SIZE (128*1024*1024)

MODULE_AUTHOR("Scott Wood, TimeSys Corporation <scott.wood@timesys.com>");
MODULE_DESCRIPTION("User-programmable flash device on the Dy4 SVME182 board");
MODULE_LICENSE("GPL");

static struct map_info svme182_map = {
	.name		= "Dy4 SVME182",
	.bankwidth	= 32,
	.size		=  128 * 1024 * 1024
};

#define BOOTIMAGE_PART_SIZE		((6*1024*1024)-RESERVED_PART_SIZE)

// Allow 6MiB for the kernel
#define NEW_BOOTIMAGE_PART_SIZE  (6 * 1024 * 1024)
// Allow 1MiB for the bootloader
#define NEW_BOOTLOADER_PART_SIZE (1024 * 1024)
// Use the remaining 9MiB at the end of flash for the RFS
#define NEW_RFS_PART_SIZE        (0x01000000 - NEW_BOOTLOADER_PART_SIZE - \
                                  NEW_BOOTIMAGE_PART_SIZE)

static struct mtd_partition svme182_partitions[] = {
	// The Lower PABS is only 128KiB, but the partition code doesn't
	// like partitions that don't end on the largest erase block
	// size of the device, even if all of the erase blocks in the
	// partition are small ones.  The hardware should prevent
	// writes to the actual PABS areas.
	{
		name:       "Lower PABS and CPU 0 bootloader or kernel",
		size:       6*1024*1024,
		offset:     0,
	},
	{
		name:       "Root Filesystem",
		size:       10*1024*1024,
		offset:     MTDPART_OFS_NXTBLK
	},
	{
		name:       "CPU1 Bootloader",
		size:       1024*1024,
		offset:     MTDPART_OFS_NXTBLK,
	},
	{
		name:       "Extra",
		size:       110*1024*1024,
		offset:     MTDPART_OFS_NXTBLK
	},
	{
		name:       "Foundation Firmware and Upper PABS",
		size:       1024*1024,
		offset:     MTDPART_OFS_NXTBLK,
		mask_flags: MTD_WRITEABLE // read-only
	}
};

static struct mtd_info *this_mtd;

static int __init init_svme182(void)
{
	struct mtd_partition *partitions;
	int num_parts = ARRAY_SIZE(svme182_partitions);

	partitions = svme182_partitions;

	svme182_map.virt = ioremap(FLASH_BASE_ADDR, svme182_map.size);

	if (svme182_map.virt == 0) {
		printk("Failed to ioremap FLASH memory area.\n");
		return -EIO;
	}

	simple_map_init(&svme182_map);

	this_mtd = do_map_probe("cfi_probe", &svme182_map);
	if (!this_mtd)
	{
		iounmap((void *)svme182_map.virt);
		return -ENXIO;
	}

	printk(KERN_NOTICE "SVME182 flash device: %dMiB at 0x%08x\n",
		   this_mtd->size >> 20, FLASH_BASE_ADDR);

	this_mtd->owner = THIS_MODULE;
	add_mtd_partitions(this_mtd, partitions, num_parts);

	return 0;
}

static void __exit cleanup_svme182(void)
{
	if (this_mtd)
	{
		del_mtd_partitions(this_mtd);
		map_destroy(this_mtd);
	}

	if (svme182_map.virt)
	{
		iounmap((void *)svme182_map.virt);
		svme182_map.virt = 0;
	}

	return;
}

module_init(init_svme182);
module_exit(cleanup_svme182);