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

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

Revision 1.14, Wed Sep 12 17:09:56 2007 UTC (10 years, 1 month ago) by tes.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.13: +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.

/*
 * $Id: walnut.c,v 1.14 2007/09/12 17:09:56 tes.longdrop.melbourne.sgi.com Exp $
 *
 * Mapping for Walnut flash
 * (used ebony.c as a "framework")
 *
 * Heikki Lindholm <holindho@infradead.org>
 *
 *
 * 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/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>
#include <asm/ibm4xx.h>
#include <platforms/4xx/walnut.h>

/* these should be in platforms/4xx/walnut.h ? */
#define WALNUT_FLASH_ONBD_N(x)		(x & 0x02)
#define WALNUT_FLASH_SRAM_SEL(x)	(x & 0x01)
#define WALNUT_FLASH_LOW		0xFFF00000
#define WALNUT_FLASH_HIGH		0xFFF80000
#define WALNUT_FLASH_SIZE		0x80000

static struct mtd_info *flash;

static struct map_info walnut_map = {
	.name =		"Walnut flash",
	.size =		WALNUT_FLASH_SIZE,
	.bankwidth =	1,
};

/* Actually, OpenBIOS is the last 128 KiB of the flash - better
 * partitioning could be made */
static struct mtd_partition walnut_partitions[] = {
	{
		.name =   "OpenBIOS",
		.offset = 0x0,
		.size =   WALNUT_FLASH_SIZE,
		/*.mask_flags = MTD_WRITEABLE, */ /* force read-only */
	}
};

int __init init_walnut(void)
{
	u8 fpga_brds1;
	void *fpga_brds1_adr;
	void *fpga_status_adr;
	unsigned long flash_base;

	/* this should already be mapped (platform/4xx/walnut.c) */
	fpga_status_adr = ioremap(WALNUT_FPGA_BASE, 8);
	if (!fpga_status_adr)
		return -ENOMEM;

	fpga_brds1_adr = fpga_status_adr+5;
	fpga_brds1 = readb(fpga_brds1_adr);
	/* iounmap(fpga_status_adr); */

	if (WALNUT_FLASH_ONBD_N(fpga_brds1)) {
		printk("The on-board flash is disabled (U79 sw 5)!");
		iounmap(fpga_status_adr);
		return -EIO;
	}
	if (WALNUT_FLASH_SRAM_SEL(fpga_brds1))
		flash_base = WALNUT_FLASH_LOW;
	else
		flash_base = WALNUT_FLASH_HIGH;

	walnut_map.phys = flash_base;
	walnut_map.virt =
		(void __iomem *)ioremap(flash_base, walnut_map.size);

	if (!walnut_map.virt) {
		printk("Failed to ioremap flash.\n");
		iounmap(fpga_status_adr);
		return -EIO;
	}

	simple_map_init(&walnut_map);

	flash = do_map_probe("jedec_probe", &walnut_map);
	if (flash) {
		flash->owner = THIS_MODULE;
		add_mtd_partitions(flash, walnut_partitions,
					ARRAY_SIZE(walnut_partitions));
	} else {
		printk("map probe failed for flash\n");
		iounmap(fpga_status_adr);
		return -ENXIO;
	}

	iounmap(fpga_status_adr);
	return 0;
}

static void __exit cleanup_walnut(void)
{
	if (flash) {
		del_mtd_partitions(flash);
		map_destroy(flash);
	}

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

module_init(init_walnut);
module_exit(cleanup_walnut);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Heikki Lindholm <holindho@infradead.org>");
MODULE_DESCRIPTION("MTD map and partitions for IBM 405GP Walnut boards");