diff mbox

[17/20] pxa3xx_nand: add cmdline part parser support

Message ID h2l771cded01005060212k39b41e4aqa57cc6e5072bfe3b@mail.gmail.com
State New, archived
Headers show

Commit Message

Haojian Zhuang May 6, 2010, 9:12 a.m. UTC
From c81c53e24bbbe29ab4bf9767d24de8c45a4470b9 Mon Sep 17 00:00:00 2001
From: Lei Wen <leiwen@marvell.com>
Date: Thu, 6 May 2010 10:42:13 +0800
Subject: [PATCH] pxa3xx_nand: add cmdline part parser support

Signed-off-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
---
 drivers/mtd/nand/pxa3xx_nand.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

 /* convert nano-seconds to nand flash controller clock cycles */
@@ -1726,6 +1729,10 @@ static int __devinit pxa3xx_nand_probe(struct
platform_device *pdev)
 	struct pxa3xx_nand *nand;
 	struct mtd_info *mtd;
 	int ret, cs, probe_success = 0;
+#ifdef CONFIG_MTD_PARTITIONS
+	struct mtd_partition *partitions = NULL;
+	int num_part = 0;
+#endif

 	pdata = pdev->dev.platform_data;
 	if (!pdata) {
@@ -1747,8 +1754,23 @@ static int __devinit pxa3xx_nand_probe(struct
platform_device *pdev)
 			dev_err(&pdev->dev, "failed to scan cs#%d nand\n", cs);
 			continue;
 		}
-		ret = add_mtd_partitions(mtd, pdata->parts[cs],
-				pdata->nr_parts[cs]);
+		mtd->name = mtd_names[cs];
+#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+		num_part = parse_mtd_partitions(mtd, part_probes, &partitions, 0);
+#endif
+		if (num_part <= 0) {
+			num_part = pdata->nr_parts[cs];
+			partitions = pdata->parts[cs];
+		}
+
+		if (partitions && num_part > 0)
+			ret = add_mtd_partitions(mtd, partitions, num_part);
+		else
+			ret = add_mtd_device(mtd);
+#else
+		ret = add_mtd_device(mtd);
+#endif
 		if (!ret)
 			probe_success = 1;
 	}

Comments

David Woodhouse May 14, 2010, 2:32 a.m. UTC | #1
On Thu, 2010-05-06 at 05:12 -0400, Haojian Zhuang wrote:
> From c81c53e24bbbe29ab4bf9767d24de8c45a4470b9 Mon Sep 17 00:00:00 2001
> From: Lei Wen <leiwen@marvell.com>
> Date: Thu, 6 May 2010 10:42:13 +0800
> Subject: [PATCH] pxa3xx_nand: add cmdline part parser support
> 
> Signed-off-by: Lei Wen <leiwen@marvell.com>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
> ---
>  drivers/mtd/nand/pxa3xx_nand.c |   26 ++++++++++++++++++++++++--
>  1 files changed, 24 insertions(+), 2 deletions(-)

This conflicts with commit bff3c10d369440bc87ba612b45ba2777d2bf017f.

Some of the other patches in this sequence don't apply cleanly to the
current mtd-2.6.git tree either; please could you refresh?
Haojian Zhuang May 14, 2010, 6:08 a.m. UTC | #2
On Fri, May 14, 2010 at 10:32 AM, David Woodhouse <dwmw2@infradead.org> wrote:
> On Thu, 2010-05-06 at 05:12 -0400, Haojian Zhuang wrote:
>> From c81c53e24bbbe29ab4bf9767d24de8c45a4470b9 Mon Sep 17 00:00:00 2001
>> From: Lei Wen <leiwen@marvell.com>
>> Date: Thu, 6 May 2010 10:42:13 +0800
>> Subject: [PATCH] pxa3xx_nand: add cmdline part parser support
>>
>> Signed-off-by: Lei Wen <leiwen@marvell.com>
>> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
>> ---
>>  drivers/mtd/nand/pxa3xx_nand.c |   26 ++++++++++++++++++++++++--
>>  1 files changed, 24 insertions(+), 2 deletions(-)
>
> This conflicts with commit bff3c10d369440bc87ba612b45ba2777d2bf017f.
>
> Some of the other patches in this sequence don't apply cleanly to the
> current mtd-2.6.git tree either; please could you refresh?
>

New patches are rebased for mtd-2.6 master branch. There're contained
in another mail loop.

Thanks
Haojian
David Woodhouse May 14, 2010, 8:16 a.m. UTC | #3
On Fri, 2010-05-14 at 14:08 +0800, Haojian Zhuang wrote:
> On Fri, May 14, 2010 at 10:32 AM, David Woodhouse <dwmw2@infradead.org> wrote:
> > On Thu, 2010-05-06 at 05:12 -0400, Haojian Zhuang wrote:
> >> From c81c53e24bbbe29ab4bf9767d24de8c45a4470b9 Mon Sep 17 00:00:00 2001
> >> From: Lei Wen <leiwen@marvell.com>
> >> Date: Thu, 6 May 2010 10:42:13 +0800
> >> Subject: [PATCH] pxa3xx_nand: add cmdline part parser support
> >>
> >> Signed-off-by: Lei Wen <leiwen@marvell.com>
> >> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
> >> ---
> >>  drivers/mtd/nand/pxa3xx_nand.c |   26 ++++++++++++++++++++++++--
> >>  1 files changed, 24 insertions(+), 2 deletions(-)
> >
> > This conflicts with commit bff3c10d369440bc87ba612b45ba2777d2bf017f.
> >
> > Some of the other patches in this sequence don't apply cleanly to the
> > current mtd-2.6.git tree either; please could you refresh?
> >
> 
> New patches are rebased for mtd-2.6 master branch. There're contained
> in another mail loop.

Hm, please test these by sending to yourself first, saving the patches
and checking that they apply.

[dwmw2@macbook mtd-2.6]$ git describe HEAD
v2.6.34-rc7-142-gf6b173c

[dwmw2@macbook mtd-2.6]$ for a in `seq -w 1 20` ; do echo Patch $a ; patch -p1 < pxa$a.patch ; done
Patch 01
patching file arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
patching file drivers/mtd/nand/Kconfig
patching file drivers/mtd/nand/pxa3xx_nand.c
patch: **** malformed patch at line 203: transfering to/from NAND HW");

Patch 02
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 225.
patch: **** malformed patch at line 96: pxa3xx_nand_info *info,

Patch 03
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 succeeded at 117 (offset -35 lines).
Hunk #2 succeeded at 130 (offset -35 lines).
Hunk #3 succeeded at 149 (offset -35 lines).
Hunk #4 succeeded at 159 (offset -35 lines).
patch: **** malformed patch at line 116: pxa3xx_nand_info *info,

Patch 04
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 succeeded at 126 (offset -34 lines).
Hunk #2 FAILED at 1097.
patch: **** malformed patch at line 106: platform_device *pdev)

Patch 05
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #4 succeeded at 108 with fuzz 1.
patch: **** malformed patch at line 130: pxa3xx_nand_info *info,

Patch 06
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 28.
Hunk #2 succeeded at 74 (offset -4 lines).
Hunk #3 FAILED at 335.
Hunk #4 FAILED at 364.
Hunk #5 FAILED at 556.
patch: **** malformed patch at line 391: *mtd, unsigned command,

Patch 07
patching file drivers/mtd/nand/pxa3xx_nand.c
patch: **** malformed patch at line 78: builtin_flash_types[] = {

Patch 08
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 218.
patch: **** malformed patch at line 97: pxa3xx_nand_info *info,

Patch 09
patching file arch/arm/mach-mmp/aspenite.c
patching file arch/arm/mach-mmp/avengers_lite.c
patch: **** malformed patch at line 104: avengers_lite_pin_config_V16F[] __initdata = {

Patch 10
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 29.
Hunk #2 succeeded at 36 (offset -2 lines).
Hunk #3 succeeded at 89 (offset -6 lines).
Hunk #4 FAILED at 132.
Hunk #5 FAILED at 159.
Hunk #6 FAILED at 182.
patch: **** malformed patch at line 164: 60, 10, }, },

Patch 11
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 30.
Hunk #2 FAILED at 411.
Hunk #3 FAILED at 456.
patch: **** malformed patch at line 107: *nand, int dir_out)

Patch 12
patching file arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
Hunk #1 succeeded at 12 with fuzz 2 (offset -1 lines).
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 30.
Hunk #2 FAILED at 45.
Hunk #3 FAILED at 59.
Hunk #4 FAILED at 89.
Hunk #5 succeeded at 93 with fuzz 2 (offset -46 lines).
Hunk #6 FAILED at 154.
Hunk #7 FAILED at 186.
Hunk #8 FAILED at 209.
patch: **** malformed patch at line 222: using naked command set");

Patch 13
patching file arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
Hunk #1 succeeded at 14 with fuzz 2 (offset -1 lines).
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 succeeded at 60 with fuzz 2 (offset -30 lines).
Hunk #2 FAILED at 187.
Hunk #3 FAILED at 194.
Hunk #4 FAILED at 275.
patch: **** malformed patch at line 215: long nand_clk)

Patch 14
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 26.
Hunk #2 FAILED at 298.
2 out of 2 hunks FAILED -- saving rejects to file drivers/mtd/nand/pxa3xx_nand.c.rej
Patch 15
patching file arch/arm/mach-mmp/include/mach/mmp2.h
patch: **** malformed patch at line 92: i2c_pxa_platform_data *data,

Patch 16
patching file drivers/mtd/nand/pxa3xx_nand.c
patch: **** malformed patch at line 80: pxa3xx_nand *nand, int command,

Patch 17
patching file drivers/mtd/nand/pxa3xx_nand.c
patch: **** malformed patch at line 74: builtin_flash_types[] = {

Patch 18
patching file arch/arm/configs/pxa168_defconfig
patch: **** malformed patch at line 82: nfsroot=192.168.2.100:/nfsroot/

Patch 19
patching file drivers/mtd/nand/pxa3xx_nand.c
Hunk #1 FAILED at 129.
Hunk #2 FAILED at 257.
Hunk #3 FAILED at 646.
patch: **** malformed patch at line 119: void *data)

Patch 20
patching file drivers/mtd/nand/pxa3xx_nand.c
patch: **** malformed patch at line 74: platform_device *pdev)
Daniel Mack May 14, 2010, 8:41 a.m. UTC | #4
On Fri, May 14, 2010 at 09:16:11AM +0100, David Woodhouse wrote:
> On Fri, 2010-05-14 at 14:08 +0800, Haojian Zhuang wrote:
> > New patches are rebased for mtd-2.6 master branch. There're contained
> > in another mail loop.
> 
> Hm, please test these by sending to yourself first, saving the patches
> and checking that they apply.
> 
> [dwmw2@macbook mtd-2.6]$ git describe HEAD
> v2.6.34-rc7-142-gf6b173c
> 
> [dwmw2@macbook mtd-2.6]$ for a in `seq -w 1 20` ; do echo Patch $a ; patch -p1 < pxa$a.patch ; done
> Patch 01
> patching file arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
> patching file drivers/mtd/nand/Kconfig
> patching file drivers/mtd/nand/pxa3xx_nand.c
> patch: **** malformed patch at line 203: transfering to/from NAND HW");

Jep, they're line-wrapped, just like the version before.

Haojian, you can avoid this to happen by using 'git send-email'.

Thanks,
Daniel
Haojian Zhuang May 14, 2010, 10:56 a.m. UTC | #5
On Fri, May 14, 2010 at 4:41 PM, Daniel Mack <daniel@caiaq.de> wrote:
> On Fri, May 14, 2010 at 09:16:11AM +0100, David Woodhouse wrote:
>> On Fri, 2010-05-14 at 14:08 +0800, Haojian Zhuang wrote:
>> > New patches are rebased for mtd-2.6 master branch. There're contained
>> > in another mail loop.
>>
>> Hm, please test these by sending to yourself first, saving the patches
>> and checking that they apply.
>>
>> [dwmw2@macbook mtd-2.6]$ git describe HEAD
>> v2.6.34-rc7-142-gf6b173c
>>
>> [dwmw2@macbook mtd-2.6]$ for a in `seq -w 1 20` ; do echo Patch $a ; patch -p1 < pxa$a.patch ; done
>> Patch 01
>> patching file arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
>> patching file drivers/mtd/nand/Kconfig
>> patching file drivers/mtd/nand/pxa3xx_nand.c
>> patch: **** malformed patch at line 203: transfering to/from NAND HW");
>
> Jep, they're line-wrapped, just like the version before.
>
> Haojian, you can avoid this to happen by using 'git send-email'.
>
> Thanks,
> Daniel
>

Now I attach these patches directly. Only 0011 patch is changed to
using dev_dbg for debug print.

Daniel,
Thanks for your advice.

Best Regards
Haojian
Marc Kleine-Budde May 14, 2010, 11:11 a.m. UTC | #6
Haojian Zhuang wrote:
> On Fri, May 14, 2010 at 4:41 PM, Daniel Mack <daniel@caiaq.de> wrote:
>> On Fri, May 14, 2010 at 09:16:11AM +0100, David Woodhouse wrote:
>>> On Fri, 2010-05-14 at 14:08 +0800, Haojian Zhuang wrote:
>>>> New patches are rebased for mtd-2.6 master branch. There're contained
>>>> in another mail loop.
>>> Hm, please test these by sending to yourself first, saving the patches
>>> and checking that they apply.
>>>
>>> [dwmw2@macbook mtd-2.6]$ git describe HEAD
>>> v2.6.34-rc7-142-gf6b173c
>>>
>>> [dwmw2@macbook mtd-2.6]$ for a in `seq -w 1 20` ; do echo Patch $a ; patch -p1 < pxa$a.patch ; done
>>> Patch 01
>>> patching file arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
>>> patching file drivers/mtd/nand/Kconfig
>>> patching file drivers/mtd/nand/pxa3xx_nand.c
>>> patch: **** malformed patch at line 203: transfering to/from NAND HW");
>> Jep, they're line-wrapped, just like the version before.
>>
>> Haojian, you can avoid this to happen by using 'git send-email'.
>>
>> Thanks,
>> Daniel
>>
> 
> Now I attach these patches directly. Only 0011 patch is changed to
> using dev_dbg for debug print.

I NACK patches 1 and 17. See my reply to these individual patches.

Cheers, Marc
Haojian Zhuang May 17, 2010, 5:05 a.m. UTC | #7
On Fri, May 14, 2010 at 7:11 PM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> Haojian Zhuang wrote:
>> On Fri, May 14, 2010 at 4:41 PM, Daniel Mack <daniel@caiaq.de> wrote:
>>> On Fri, May 14, 2010 at 09:16:11AM +0100, David Woodhouse wrote:
>>>> On Fri, 2010-05-14 at 14:08 +0800, Haojian Zhuang wrote:
>>>>> New patches are rebased for mtd-2.6 master branch. There're contained
>>>>> in another mail loop.
>>>> Hm, please test these by sending to yourself first, saving the patches
>>>> and checking that they apply.
>>>>
>>>> [dwmw2@macbook mtd-2.6]$ git describe HEAD
>>>> v2.6.34-rc7-142-gf6b173c
>>>>
>>>> [dwmw2@macbook mtd-2.6]$ for a in `seq -w 1 20` ; do echo Patch $a ; patch -p1 < pxa$a.patch ; done
>>>> Patch 01
>>>> patching file arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
>>>> patching file drivers/mtd/nand/Kconfig
>>>> patching file drivers/mtd/nand/pxa3xx_nand.c
>>>> patch: **** malformed patch at line 203: transfering to/from NAND HW");
>>> Jep, they're line-wrapped, just like the version before.
>>>
>>> Haojian, you can avoid this to happen by using 'git send-email'.
>>>
>>> Thanks,
>>> Daniel
>>>
>>
>> Now I attach these patches directly. Only 0011 patch is changed to
>> using dev_dbg for debug print.
>
> I NACK patches 1 and 17. See my reply to these individual patches.
>
> Cheers, Marc
>
> --

Now these patches are updated. Please review them.

Best Regards
Haojian
diff mbox

Patch

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 2eebd20..793b64c 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -349,6 +349,9 @@  static struct pxa3xx_nand_flash __devinitdata
builtin_flash_types[] = {
 	{ 0, 10, 35, 15, 25, 15, 25, 25000, 0, 60, 10, }, },
 };

+#ifdef CONFIG_MTD_CMDLINE_PARTS
+static const char *part_probes[] = { "cmdlinepart", NULL };
+#endif
 static const char *mtd_names[] = {"pxa3xx_nand-0", "pxa3xx_nand-1", NULL};