2005-04-16 18:20:36 -04:00
|
|
|
/*
|
2005-11-07 06:15:31 -05:00
|
|
|
* For boards with physically mapped flash and using
|
2005-04-16 18:20:36 -04:00
|
|
|
* drivers/mtd/maps/physmap.c mapping driver.
|
|
|
|
*
|
2005-11-07 06:15:31 -05:00
|
|
|
* $Id: physmap.h,v 1.4 2005/11/07 11:14:55 gleixner Exp $
|
2005-04-16 18:20:36 -04:00
|
|
|
*
|
|
|
|
* Copyright (C) 2003 MontaVista Software Inc.
|
|
|
|
* Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_MTD_PHYSMAP__
|
2006-05-14 07:25:19 -04:00
|
|
|
#define __LINUX_MTD_PHYSMAP__
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
#include <linux/mtd/mtd.h>
|
|
|
|
#include <linux/mtd/partitions.h>
|
|
|
|
|
2007-02-09 09:30:29 -05:00
|
|
|
struct map_info;
|
|
|
|
|
[MTD] Convert physmap to platform driver
After dwmw2 let me know it ought to be done, I rewrote the physmap map
driver to be a platform driver. I know zilch about the driver model,
so I probably botched it in some way, but I've done some tests on an
ixp23xx board which uses physmap, and it all seems to work.
In order to not break existing physmap users, I've added some compat
code that will instantiate a platform device iff CONFIG_MTD_PHYSMAP_LEN
is defined and != 0. Also, I've changed the default value for
CONFIG_MTD_PHYSMAP_LEN to zero, so that people who inadvertently
compile in physmap (or new, platform-style, users of physmap) don't get
burned.
This works pretty well -- the new physmap driver is a drop-in replacement
for the old one, and works on said ixp23xx board without any code changes
needed. (This should hold as long as users don't touch 'physmap_map'
directly.)
Once all physmap users have been converted to instantiate their own
platform devices, the compat code can go. (Or we decide that we can
change all the in-tree users at the same time, and never merge the
compat code.)
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-07 12:16:36 -04:00
|
|
|
struct physmap_flash_data {
|
|
|
|
unsigned int width;
|
|
|
|
void (*set_vpp)(struct map_info *, int);
|
|
|
|
unsigned int nr_parts;
|
|
|
|
struct mtd_partition *parts;
|
|
|
|
};
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Board needs to specify the exact mapping during their setup time.
|
|
|
|
*/
|
[MTD] Convert physmap to platform driver
After dwmw2 let me know it ought to be done, I rewrote the physmap map
driver to be a platform driver. I know zilch about the driver model,
so I probably botched it in some way, but I've done some tests on an
ixp23xx board which uses physmap, and it all seems to work.
In order to not break existing physmap users, I've added some compat
code that will instantiate a platform device iff CONFIG_MTD_PHYSMAP_LEN
is defined and != 0. Also, I've changed the default value for
CONFIG_MTD_PHYSMAP_LEN to zero, so that people who inadvertently
compile in physmap (or new, platform-style, users of physmap) don't get
burned.
This works pretty well -- the new physmap driver is a drop-in replacement
for the old one, and works on said ixp23xx board without any code changes
needed. (This should hold as long as users don't touch 'physmap_map'
directly.)
Once all physmap users have been converted to instantiate their own
platform devices, the compat code can go. (Or we decide that we can
change all the in-tree users at the same time, and never merge the
compat code.)
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2006-05-07 12:16:36 -04:00
|
|
|
void physmap_configure(unsigned long addr, unsigned long size,
|
|
|
|
int bankwidth, void (*set_vpp)(struct map_info *, int) );
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-05-14 07:25:19 -04:00
|
|
|
#ifdef CONFIG_MTD_PARTITIONS
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*
|
2005-11-07 06:15:31 -05:00
|
|
|
* Machines that wish to do flash partition may want to call this function in
|
|
|
|
* their setup routine.
|
2005-04-16 18:20:36 -04:00
|
|
|
*
|
|
|
|
* physmap_set_partitions(mypartitions, num_parts);
|
|
|
|
*
|
2005-11-07 06:15:31 -05:00
|
|
|
* Note that one can always override this hard-coded partition with
|
2005-04-16 18:20:36 -04:00
|
|
|
* command line partition (you need to enable CONFIG_MTD_CMDLINE_PARTS).
|
|
|
|
*/
|
|
|
|
void physmap_set_partitions(struct mtd_partition *parts, int num_parts);
|
|
|
|
|
|
|
|
#endif /* defined(CONFIG_MTD_PARTITIONS) */
|
|
|
|
|
|
|
|
#endif /* __LINUX_MTD_PHYSMAP__ */
|