aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorMiquel Raynal2018-09-06 02:08:46 -0500
committerJagan Teki2018-09-20 09:41:01 -0500
commitd60aea94e92a8783e95591b7eeaf733903eeaec7 (patch)
tree5a1df177603bd200eb50e9a634fd4b684826b396 /cmd
parent00ac922db4085982011438e9471e0fcacca2e8fc (diff)
downloadu-boot-d60aea94e92a8783e95591b7eeaf733903eeaec7.tar.gz
u-boot-d60aea94e92a8783e95591b7eeaf733903eeaec7.tar.xz
u-boot-d60aea94e92a8783e95591b7eeaf733903eeaec7.zip
cmd: mtdparts: remove mandatory 'mtdparts=' prefix
All U-Boot users must define the mtdparts environment variable with: setenv mtdparts mtdparts=... While this may ease the partition declaration job to be passed to Linux, this is a pure software limitation and forcing this prefix is a complete non-sense. Let the user to declare manually the mtdparts variable without the prefix. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Jagan Teki <jagan@openedev.com> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mtdparts.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c
index 2e547894c6..f7ed1a0779 100644
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -44,7 +44,7 @@
44 * 44 *
45 * 'mtdparts' - partition list 45 * 'mtdparts' - partition list
46 * 46 *
47 * mtdparts=mtdparts=<mtd-def>[;<mtd-def>...] 47 * mtdparts=[mtdparts=]<mtd-def>[;<mtd-def>...]
48 * 48 *
49 * <mtd-def> := <mtd-id>:<part-def>[,<part-def>...] 49 * <mtd-def> := <mtd-id>:<part-def>[,<part-def>...]
50 * <mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name) 50 * <mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)
@@ -62,11 +62,11 @@
62 * 62 *
63 * 1 NOR Flash, with 1 single writable partition: 63 * 1 NOR Flash, with 1 single writable partition:
64 * mtdids=nor0=edb7312-nor 64 * mtdids=nor0=edb7312-nor
65 * mtdparts=mtdparts=edb7312-nor:- 65 * mtdparts=[mtdparts=]edb7312-nor:-
66 * 66 *
67 * 1 NOR Flash with 2 partitions, 1 NAND with one 67 * 1 NOR Flash with 2 partitions, 1 NAND with one
68 * mtdids=nor0=edb7312-nor,nand0=edb7312-nand 68 * mtdids=nor0=edb7312-nor,nand0=edb7312-nand
69 * mtdparts=mtdparts=edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home) 69 * mtdparts=[mtdparts=]edb7312-nor:256k(ARMboot)ro,-(root);edb7312-nand:-(home)
70 * 70 *
71 */ 71 */
72 72
@@ -1099,9 +1099,6 @@ static int generate_mtdparts(char *buf, u32 buflen)
1099 return 0; 1099 return 0;
1100 } 1100 }
1101 1101
1102 strcpy(p, "mtdparts=");
1103 p += 9;
1104
1105 list_for_each(dentry, &devices) { 1102 list_for_each(dentry, &devices) {
1106 dev = list_entry(dentry, struct mtd_device, link); 1103 dev = list_entry(dentry, struct mtd_device, link);
1107 1104
@@ -1572,11 +1569,9 @@ static int parse_mtdparts(const char *const mtdparts)
1572 if (!p) 1569 if (!p)
1573 p = mtdparts; 1570 p = mtdparts;
1574 1571
1575 if (strncmp(p, "mtdparts=", 9) != 0) { 1572 /* Skip the useless prefix, if any */
1576 printf("mtdparts variable doesn't start with 'mtdparts='\n"); 1573 if (strncmp(p, "mtdparts=", 9) == 0)
1577 return err; 1574 p += 9;
1578 }
1579 p += 9;
1580 1575
1581 while (*p != '\0') { 1576 while (*p != '\0') {
1582 err = 1; 1577 err = 1;