Skip to contentSkip to conversation

add config options for phys mapping

PATCH New Jun Sun 1 participant 1 message Jun 11, 2004 Memory technology devices (MTD)

lore
Share & tools
lore

Jun Sun

author
#0 lore raw

PATCH 1/1 add config options for phys mapping

Due to popular demand, this patch adds back config time options for configuring phys mapping.

The run-time configuration, if present, overrides the config-time options.

Jun

drivers/mtd/maps/physmap.c renamed from drivers/mtd/maps/physmap.c.orig +6 -1
diff -Nru mtd/drivers/mtd/maps/physmap.c.orig mtd/drivers/mtd/maps/physmap.c
@@ -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,
+	.buswidth = CONFIG_MTD_PHYSMAP_BUSWIDTH,
+};
 
 #ifdef CONFIG_MTD_PARTITIONS
 static struct mtd_partition *mtd_parts;
drivers/mtd/maps/Kconfig renamed from drivers/mtd/maps/Kconfig.orig +11 -1
diff -Nru mtd/drivers/mtd/maps/Kconfig.orig mtd/drivers/mtd/maps/Kconfig
@@ -19,7 +19,8 @@
 	  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"
@@ -31,6 +32,9 @@
 	  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"
 	depends on MTD_PHYSMAP
@@ -43,6 +47,9 @@
 	  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"
 	depends on MTD_PHYSMAP
@@ -53,6 +60,9 @@
 	  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"
 	depends on (SPARC32 || SPARC64) && MTD_CFI
drivers/mtd/maps/Config.in renamed from drivers/mtd/maps/Config.in.orig +5 -0
diff -Nru mtd/drivers/mtd/maps/Config.in.orig mtd/drivers/mtd/maps/Config.in
@@ -9,6 +9,11 @@
 bool '  Support for non-linear mappings of flash chips' CONFIG_MTD_COMPLEX_MAPPINGS
 
 bool '  CFI Flash device in physical memory map' CONFIG_MTD_PHYSMAP $CONFIG_MTD_GEN_PROBE
+if [ "$CONFIG_MTD_PHYSMAP" = "y" ]; then
+   hex '    Physical start address of flash mapping' CONFIG_MTD_PHYSMAP_START 0x8000000
+   hex '    Physical length of flash mapping' CONFIG_MTD_PHYSMAP_LEN 0x4000000
+   int '    Bus width in octets' CONFIG_MTD_PHYSMAP_BUSWIDTH 2
+fi
 
 if [ "$CONFIG_SPARC" = "y" -o "$CONFIG_SPARC64" = "y" ]; then
    dep_tristate '  Sun Microsystems userflash support' CONFIG_MTD_SUN_UFLASH $CONFIG_MTD_CFI