From be3a60978fdb757ff8fab31b8c43a09a156b092c Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Tue, 10 Aug 2004 18:13:52 +0100 Subject: [PATCH] Restore physmap configure-time settings according to user requests. Patch from Jun Sun. Signed-Off-By: David Woodhouse --- drivers/mtd/maps/Kconfig | 15 +++++++++++---- drivers/mtd/maps/physmap.c | 9 +++++++-- include/linux/mtd/physmap.h | 6 +++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index b1ad6567b735..cdc5bbd166a3 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig @@ -1,5 +1,5 @@ # drivers/mtd/maps/Kconfig -# $Id: Kconfig,v 1.29 2004/07/15 15:29:17 dwmw2 Exp $ +# $Id: Kconfig,v 1.30 2004/07/21 00:16:14 jwboyer Exp $ menu "Mapping drivers for chip access" depends on MTD!=n @@ -19,7 +19,8 @@ config MTD_PHYSMAP command set driver code to communicate with flash chips which are mapped physically into the CPU's memory. You will need to configure the physical address and size of the flash chips on - your particular board as well as the bus width. + your particular board as well as the bus width, either statically + with config options or at run-time. config MTD_PHYSMAP_START hex "Physical start address of flash mapping" @@ -30,6 +31,8 @@ config MTD_PHYSMAP_START are mapped on your particular target board. Refer to the memory map which should hopefully be in the documentation for your board. + Ignore this option if you use run-time physmap configuration + (i.e., run-time calling physmap_configure()). config MTD_PHYSMAP_LEN hex "Physical length of flash mapping" @@ -42,9 +45,11 @@ config MTD_PHYSMAP_LEN than the total amount of flash present. Refer to the memory map which should hopefully be in the documentation for your board. + Ignore this option if you use run-time physmap configuration + (i.e., run-time calling physmap_configure()). -config MTD_PHYSMAP_BUSWIDTH - int "Bus width in octets" +config MTD_PHYSMAP_BANKWIDTH + int "Bank width in octets" depends on MTD_PHYSMAP default "2" help @@ -52,6 +57,8 @@ config MTD_PHYSMAP_BUSWIDTH in octets. For example, if you have a data bus width of 32 bits, you would set the bus width octect value to 4. This is used internally by the CFI drivers. + Ignore this option if you use run-time physmap configuration + (i.e., run-time calling physmap_configure()). config MTD_SUN_UFLASH tristate "Sun Microsystems userflash support" diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 8dfd0b233616..5822ba99c195 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c @@ -1,5 +1,5 @@ /* - * $Id: physmap.c,v 1.33 2004/07/12 14:37:24 dwmw2 Exp $ + * $Id: physmap.c,v 1.34 2004/07/21 00:16:14 jwboyer Exp $ * * Normal mappings of chips in physical memory * @@ -22,7 +22,12 @@ static struct mtd_info *mymtd; -struct map_info physmap_map = {.name = "phys_mapped_flash"}; +struct map_info physmap_map = { + .name = "phys_mapped_flash", + .phys = CONFIG_MTD_PHYSMAP_START, + .size = CONFIG_MTD_PHYSMAP_LEN, + .bankwidth = CONFIG_MTD_PHYSMAP_BANKWIDTH, +}; #ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition *mtd_parts; diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index d522d43d410d..05aa4970677f 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h @@ -2,7 +2,7 @@ * For boards with physically mapped flash and using * drivers/mtd/maps/physmap.c mapping driver. * - * $Id: physmap.h,v 1.2 2004/07/14 17:48:46 dwmw2 Exp $ + * $Id: physmap.h,v 1.3 2004/07/21 00:16:15 jwboyer Exp $ * * Copyright (C) 2003 MontaVista Software Inc. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net @@ -33,11 +33,11 @@ extern struct map_info physmap_map; /* * Board needs to specify the exact mapping during their setup time. */ -static inline void physmap_configure(unsigned long addr, unsigned long size, int buswidth, void (*set_vpp)(struct map_info *, int) ) +static inline void physmap_configure(unsigned long addr, unsigned long size, int bankwidth, void (*set_vpp)(struct map_info *, int) ) { physmap_map.phys = addr; physmap_map.size = size; - physmap_map.buswidth = buswidth; + physmap_map.bankwidth = bankwidth; physmap_map.set_vpp = set_vpp; } -- 2.39.5