From: "Conke Hu" <conke.hu@gmail.com>
To: "Russell King - ARM Linux" <linux@arm.linux.org.uk>
Cc: Linux-arm-kernel@lists.arm.linux.org.uk,
"Ben Dooks" <ben-linux@fluff.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: s3c24xx nand: add command line partition table parsing support (resend)
Date: Thu, 18 Sep 2008 23:58:14 +0800 [thread overview]
Message-ID: <5767b9100809180858r3bb9952el3bc76dab18930713@mail.gmail.com> (raw)
In-Reply-To: <5767b9100809180855j58150b4ct4e2a4b9bb5ac7885@mail.gmail.com>
Add mtd id and command line partition table parsing support for
s3c24xx nand driver.
Signed-off-by: Conke Hu <conke.hu@gmail.com>
Signed-off-by: Linke Wang <linke.wang@gmail.com>
------------------
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 556139e..db0d331 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -48,6 +48,8 @@
#include <asm/plat-s3c/regs-nand.h>
#include <asm/plat-s3c/nand.h>
+#define S3C_NAND_NAME_LEN 16
+
#ifdef CONFIG_MTD_NAND_S3C2410_HWECC
static int hardware_ecc = 1;
#else
@@ -60,6 +62,9 @@ static int clock_stop = 1;
static const int clock_stop = 0;
#endif
+#ifdef CONFIG_MTD_PARTITIONS
+static const char *s3c_part_probes[] = {"cmdlinepart", NULL};
+#endif
/* new oob placement block for use with hardware ecc generation
*/
@@ -80,6 +85,7 @@ struct s3c2410_nand_mtd {
struct s3c2410_nand_set *set;
struct s3c2410_nand_info *info;
int scan_res;
+ char name[S3C_NAND_NAME_LEN];
};
enum s3c_cpu_type {
@@ -649,6 +655,15 @@ static int s3c2410_nand_add_partition(struct
s3c2410_nand_info *info,
struct s3c2410_nand_mtd *mtd,
struct s3c2410_nand_set *set)
{
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+ int nr_parts;
+ struct mtd_partition *partitions;
+
+ nr_parts = parse_mtd_partitions(&mtd->mtd, s3c_part_probes, &partitions, 0);
+ if (nr_parts > 0 && partitions != NULL)
+ return add_mtd_partitions(&mtd->mtd, partitions, nr_parts);
+#endif
+
if (set == NULL)
return add_mtd_device(&mtd->mtd);
@@ -892,6 +907,9 @@ static int s3c24xx_nand_probe(struct platform_device *pdev,
for (setno = 0; setno < nr_sets; setno++, nmtd++) {
pr_debug("initialising set %d (%p, info %p)\n", setno, nmtd, info);
+ snprintf(nmtd->name, sizeof(nmtd->name), "s3c_nand%d", setno);
+ nmtd->mtd.name = nmtd->name;
+
s3c2410_nand_init_chip(info, nmtd, sets);
nmtd->scan_res = nand_scan_ident(&nmtd->mtd,
next prev parent reply other threads:[~2008-09-18 15:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-18 1:13 Conke Hu
2008-09-18 11:27 ` Russell King - ARM Linux
2008-09-18 15:55 ` Conke Hu
2008-09-18 15:58 ` Conke Hu [this message]
2008-10-09 15:48 ` Conke Hu
2008-10-09 16:26 ` Russell King - ARM Linux
2008-10-09 19:25 ` Conke Hu
2008-10-12 20:09 ` Conke Hu
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=5767b9100809180858r3bb9952el3bc76dab18930713@mail.gmail.com \
--to=conke.hu@gmail.com \
--cc=Linux-arm-kernel@lists.arm.linux.org.uk \
--cc=ben-linux@fluff.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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
all inboxes | Powered by JetHome®