From: Barry Song <21cnbao@gmail.com>
To: dwmw2@infradead.org
Cc: uclinux-dist-devel@blackfin.uclinux.org,
linux-mtd@lists.infradead.org,
Mike Frysinger <vapier.adi@gmail.com>,
Barry Song <21cnbao@gmail.com>
Subject: [PATCH 2/2] mtd-physmap: add support users can assign the probe type in board files
Date: Fri, 15 Jan 2010 15:50:14 +0800 [thread overview]
Message-ID: <1263541814-6642-2-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1263541814-6642-1-git-send-email-21cnbao@gmail.com>
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>
---
drivers/mtd/maps/physmap.c | 8 ++++++--
include/linux/mtd/physmap.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index d9603f7..3b89099 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -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;
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index 76f7cab..bcfd9f7 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -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;
};
--
1.5.6.3
next prev parent reply other threads:[~2010-01-15 7:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-15 7:50 [PATCH 1/2] let MTD_XIP depend on XIP_KERNEL or ROMKERNEL Barry Song
2010-01-15 7:50 ` Barry Song [this message]
2010-05-23 7:23 ` [PATCH 2/2] mtd-physmap: add support users can assign the probe type in board files Mike Frysinger
2010-01-15 10:29 ` [PATCH 1/2] let MTD_XIP depend on XIP_KERNEL or ROMKERNEL David Woodhouse
2010-01-15 10:34 ` [Uclinux-dist-devel] " Mike Frysinger
2010-01-16 6:35 ` Barry Song
2010-02-02 5:48 ` Artem Bityutskiy
2010-03-22 5:40 ` Barry Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263541814-6642-2-git-send-email-21cnbao@gmail.com \
--to=21cnbao@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=uclinux-dist-devel@blackfin.uclinux.org \
--cc=vapier.adi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox