Title: [8168] trunk: mtd-physmap: add support users can assign the probe type in board files
Revision
8168
Author
bhsong
Date
2010-01-14 22:24:39 -0500 (Thu, 14 Jan 2010)

Log Message

mtd-physmap: add support users can assign the probe type in board files
 
There are two reasons to add this support:
1. users probably know the interface type of their flashs, then probe
can be faster if they give the right type in platform data since wrong
types will not be detected.
2. sometimes, detecting can cause destory to system. For example, for
kernel XIP, detecting can cause NOR enter a mode instructions can not
be fetched right, which will make kernel crash.

Modified Paths

Diff

Modified: trunk/arch/blackfin/mach-bf537/boards/stamp.c (8167 => 8168)


--- trunk/arch/blackfin/mach-bf537/boards/stamp.c	2010-01-15 03:20:46 UTC (rev 8167)
+++ trunk/arch/blackfin/mach-bf537/boards/stamp.c	2010-01-15 03:24:39 UTC (rev 8168)
@@ -460,6 +460,7 @@
 	.width      = 2,
 	.parts      = stamp_partitions,
 	.nr_parts   = ARRAY_SIZE(stamp_partitions),
+	.probe_type = "map_rom",
 };
 
 static struct resource stamp_flash_resource = {

Modified: trunk/drivers/mtd/maps/physmap.c (8167 => 8168)


--- trunk/drivers/mtd/maps/physmap.c	2010-01-15 03:20:46 UTC (rev 8167)
+++ trunk/drivers/mtd/maps/physmap.c	2010-01-15 03:24:39 UTC (rev 8168)
@@ -28,6 +28,7 @@
 	struct mtd_info		*mtd[MAX_RESOURCES];
 	struct mtd_info		*cmtd;
 	struct map_info		map[MAX_RESOURCES];
+	char                    *probe_type;
 #ifdef CONFIG_MTD_PARTITIONS
 	int			nr_parts;
 	struct mtd_partition	*parts;
@@ -140,6 +141,7 @@
 		info->map[i].bankwidth = physmap_data->width;
 		info->map[i].set_vpp = physmap_data->set_vpp;
 		info->map[i].pfow_base = physmap_data->pfow_base;
+		info->probe_type = physmap_data->probe_type;
 
 		info->map[i].virt = devm_ioremap(&dev->dev, info->map[i].phys,
 						 info->map[i].size);
@@ -152,8 +154,12 @@
 		simple_map_init(&info->map[i]);
 
 		probe_type = rom_probe_types;
-		for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++)
+		for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++) {
+			if (info->probe_type != NULL)
+				if (strcmp(info->probe_type, *probe_type) != 0)
+					continue;
 			info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
+		}
 		if (info->mtd[i] == NULL) {
 			dev_err(&dev->dev, "map_probe failed\n");
 			err = -ENXIO;

Modified: trunk/include/linux/mtd/physmap.h (8167 => 8168)


--- trunk/include/linux/mtd/physmap.h	2010-01-15 03:20:46 UTC (rev 8167)
+++ trunk/include/linux/mtd/physmap.h	2010-01-15 03:24:39 UTC (rev 8168)
@@ -25,6 +25,7 @@
 	void			(*set_vpp)(struct map_info *, int);
 	unsigned int		nr_parts;
 	unsigned int		pfow_base;
+	char                    *probe_type;
 	struct mtd_partition	*parts;
 };
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to