Skip to content

Commit

Permalink
mtd-physmap: add support users can assign the probe type in board files
Browse files Browse the repository at this point in the history
There are three 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.
3. For a new probe which is not listed in the rom_probe_types, if users
assign it in board files, physmap can still probe it.

Signed-off-by: Barry Song <21cnbao@gmail.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Barry Song authored and David Woodhouse committed Aug 8, 2010
1 parent 73ee576 commit 78ef7fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/mtd/maps/physmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ static int physmap_flash_probe(struct platform_device *dev)
simple_map_init(&info->map[i]);

probe_type = rom_probe_types;
for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++)
info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
if (physmap_data->probe_type == NULL) {
for (; info->mtd[i] == NULL && *probe_type != NULL; probe_type++)
info->mtd[i] = do_map_probe(*probe_type, &info->map[i]);
} else
info->mtd[i] = do_map_probe(physmap_data->probe_type, &info->map[i]);

if (info->mtd[i] == NULL) {
dev_err(&dev->dev, "map_probe failed\n");
err = -ENXIO;
Expand Down
1 change: 1 addition & 0 deletions include/linux/mtd/physmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ struct physmap_flash_data {
void (*set_vpp)(struct map_info *, int);
unsigned int nr_parts;
unsigned int pfow_base;
char *probe_type;
struct mtd_partition *parts;
};

Expand Down

0 comments on commit 78ef7fa

Please sign in to comment.