Advertisement
Guest User

Stefan Roese

a guest
Mar 18th, 2009
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 112.33 KB | None | 0 0
  1. From fe4b165c629a8de5c56f6dfcd0a2e0397bcb0b7b Mon Sep 17 00:00:00 2001
  2. From: Stefan Roese <sr@denx.de>
  3. Date: Tue, 18 Mar 2009 07:02:17 +0100
  4. Subject: [PATCH v2] Separate mtdparts command from jffs2
  5.  
  6. Currently the mtdparts commands are included in the jffs2 command support.
  7. This doesn't make sense anymore since other commands (e.g. UBI) use this
  8. infrastructure as well now. This patch separates the mtdparts commands from
  9. the jffs2 commands making it possible to only select mtdparts when no JFFS2
  10. support is needed.
  11.  
  12. Signed-off-by: Stefan Roese <sr@denx.de>
  13. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
  14. ---
  15. v2:
  16. This patch is based in the original version by Kyungmin Park with some
  17. additional changes by Jean-Christophe Plagniol-Villard. Changes are
  18. the patch description and removal of the compilation errors/warnings.
  19.  
  20. README | 1 +
  21. board/fads/fads.h | 4 +-
  22. common/Makefile | 1 +
  23. common/cmd_flash.c | 12 +-
  24. common/cmd_jffs2.c | 1725 +-------------------------------
  25. common/{cmd_jffs2.c => cmd_mtdparts.c} | 378 +-------
  26. common/cmd_nand.c | 10 +-
  27. include/config_cmd_all.h | 1 +
  28. include/configs/ADNPESC1.h | 4 +-
  29. include/configs/Alaska8220.h | 4 +-
  30. include/configs/BAB7xx.h | 4 +-
  31. include/configs/BC3450.h | 2 +-
  32. include/configs/CATcenter.h | 4 +-
  33. include/configs/DB64360.h | 4 +-
  34. include/configs/DB64460.h | 4 +-
  35. include/configs/DK1C20.h | 4 +-
  36. include/configs/DK1S10.h | 4 +-
  37. include/configs/ELPPC.h | 4 +-
  38. include/configs/FPS850L.h | 2 +-
  39. include/configs/FPS860L.h | 2 +-
  40. include/configs/LANTEC.h | 4 +-
  41. include/configs/MHPC.h | 4 +-
  42. include/configs/MIP405.h | 4 +-
  43. include/configs/ML2.h | 4 +-
  44. include/configs/MPC8266ADS.h | 4 +-
  45. include/configs/NC650.h | 4 +-
  46. include/configs/NETTA.h | 4 +-
  47. include/configs/PPChameleonEVB.h | 4 +-
  48. include/configs/R360MPI.h | 4 +-
  49. include/configs/RBC823.h | 4 +-
  50. include/configs/Rattler.h | 4 +-
  51. include/configs/SIMPC8313.h | 2 +-
  52. include/configs/SXNI855T.h | 4 +-
  53. include/configs/TB5200.h | 2 +-
  54. include/configs/TQM5200.h | 2 +-
  55. include/configs/TQM823L.h | 2 +-
  56. include/configs/TQM823M.h | 2 +-
  57. include/configs/TQM834x.h | 2 +-
  58. include/configs/TQM850L.h | 2 +-
  59. include/configs/TQM850M.h | 2 +-
  60. include/configs/TQM855L.h | 2 +-
  61. include/configs/TQM855M.h | 2 +-
  62. include/configs/TQM85xx.h | 4 +-
  63. include/configs/TQM860L.h | 2 +-
  64. include/configs/TQM860M.h | 2 +-
  65. include/configs/TQM862L.h | 2 +-
  66. include/configs/TQM862M.h | 2 +-
  67. include/configs/TQM866M.h | 2 +-
  68. include/configs/ZUMA.h | 4 +-
  69. include/configs/apollon.h | 2 +-
  70. include/configs/cm5200.h | 2 +-
  71. include/configs/debris.h | 4 +-
  72. include/configs/ep7312.h | 4 +-
  73. include/configs/ep8260.h | 4 +-
  74. include/configs/fx12mm.h | 2 +-
  75. include/configs/hymod.h | 4 +-
  76. include/configs/idmr.h | 2 +-
  77. include/configs/impa7.h | 4 +-
  78. include/configs/imx31_litekit.h | 2 +-
  79. include/configs/imx31_phycore.h | 2 +-
  80. include/configs/incaip.h | 4 +-
  81. include/configs/innokom.h | 4 +-
  82. include/configs/microblaze-generic.h | 2 +-
  83. include/configs/modnet50.h | 4 +-
  84. include/configs/motionpro.h | 2 +-
  85. include/configs/mx1fs2.h | 4 +-
  86. include/configs/mx31ads.h | 2 +-
  87. include/configs/netstar.h | 2 +-
  88. include/configs/omap2420h4.h | 4 +-
  89. include/configs/qong.h | 2 +-
  90. include/configs/sc3.h | 2 +-
  91. include/configs/sc520_cdp.h | 4 +-
  92. include/configs/sc520_spunk.h | 4 +-
  93. include/configs/smmaco4.h | 2 +-
  94. include/configs/trab.h | 2 +-
  95. include/configs/v37.h | 4 +-
  96. include/configs/vct.h | 2 +-
  97. include/configs/virtlab2.h | 2 +-
  98. include/configs/voiceblue.h | 2 +-
  99. include/configs/xilinx-ppc.h | 4 +-
  100. include/configs/xsengine.h | 4 +-
  101. 81 files changed, 131 insertions(+), 2223 deletions(-)
  102. copy common/{cmd_jffs2.c => cmd_mtdparts.c} (84%)
  103.  
  104. diff --git a/README b/README
  105. index 43fb1c0..c59652d 100644
  106. --- a/README
  107. +++ b/README
  108. @@ -633,6 +633,7 @@ The following options need to be configured:
  109. CONFIG_CMD_MII * MII utility commands
  110. CONFIG_CMD_NAND * NAND support
  111. CONFIG_CMD_NET bootp, tftpboot, rarpboot
  112. + CONFIG_CMD_MTDPARTS * MTD partition support
  113. CONFIG_CMD_PCA953X * PCA953x I2C gpio commands
  114. CONFIG_CMD_PCA953X_INFO * PCA953x I2C gpio info command
  115. CONFIG_CMD_PCI * pciinfo
  116. diff --git a/board/fads/fads.h b/board/fads/fads.h
  117. index 24e43ea..4ab4b26 100644
  118. --- a/board/fads/fads.h
  119. +++ b/board/fads/fads.h
  120. @@ -241,7 +241,7 @@
  121. *
  122. */
  123. /* No command line, one static partition, whole device */
  124. -#undef CONFIG_JFFS2_CMDLINE
  125. +#undef CONFIG_CMD_MTDPARTS
  126. #define CONFIG_JFFS2_DEV "nor0"
  127. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  128. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  129. @@ -249,7 +249,7 @@
  130. /* mtdparts command line support */
  131. /* Note: fake mtd_id used, no linux mtd map file */
  132. /*
  133. -#define CONFIG_JFFS2_CMDLINE
  134. +#define CONFIG_CMD_MTDPARTS
  135. #define MTDIDS_DEFAULT "nor0=fads0,nor1=fads-1,nor2=fads-2,nor3=fads-3"
  136. #define MTDPARTS_DEFAULT "mtdparts=fads-0:-@1m(user1),fads-1:-(user2),fads-2:-(user3),fads-3:-(user4)"
  137. */
  138. diff --git a/common/Makefile b/common/Makefile
  139. index f13cd11..6a8a541 100644
  140. --- a/common/Makefile
  141. +++ b/common/Makefile
  142. @@ -98,6 +98,7 @@ COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
  143. COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
  144. COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
  145. COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
  146. +COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
  147. COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
  148. COBJS-y += cmd_load.o
  149. COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
  150. diff --git a/common/cmd_flash.c b/common/cmd_flash.c
  151. index 510654e..7c2668c 100644
  152. --- a/common/cmd_flash.c
  153. +++ b/common/cmd_flash.c
  154. @@ -31,7 +31,7 @@
  155. #include <dataflash.h>
  156. #endif
  157.  
  158. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  159. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  160. #include <jffs2/jffs2.h>
  161.  
  162. /* parition handling routines */
  163. @@ -325,7 +325,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  164. flash_info_t *info;
  165. ulong bank, addr_first, addr_last;
  166. int n, sect_first, sect_last;
  167. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  168. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  169. struct mtd_device *dev;
  170. struct part_info *part;
  171. u8 dev_type, dev_num, pnum;
  172. @@ -357,7 +357,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  173. return rcode;
  174. }
  175.  
  176. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  177. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  178. /* erase <part-id> - erase partition */
  179. if ((argc == 2) && (id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) {
  180. mtdparts_init();
  181. @@ -470,7 +470,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  182. #endif /* CONFIG_SYS_NO_FLASH */
  183. ulong addr_first, addr_last;
  184. int p;
  185. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  186. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  187. struct mtd_device *dev;
  188. struct part_info *part;
  189. u8 dev_type, dev_num, pnum;
  190. @@ -563,7 +563,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  191. return rcode;
  192. }
  193.  
  194. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  195. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  196. /* protect on/off <part-id> */
  197. if ((argc == 3) && (id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) {
  198. mtdparts_init();
  199. @@ -698,7 +698,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
  200.  
  201.  
  202. /**************************************************/
  203. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  204. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  205. # define TMP_ERASE "erase <part-id>\n - erase partition\n"
  206. # define TMP_PROT_ON "protect on <part-id>\n - protect partition\n"
  207. # define TMP_PROT_OFF "protect off <part-id>\n - make partition writable\n"
  208. diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
  209. index d0a7cea..05aaca5 100644
  210. --- a/common/cmd_jffs2.c
  211. +++ b/common/cmd_jffs2.c
  212. @@ -136,40 +136,6 @@
  213. * field for read-only partitions */
  214. #define MTD_WRITEABLE_CMD 1
  215.  
  216. -#ifdef CONFIG_JFFS2_CMDLINE
  217. -/* default values for mtdids and mtdparts variables */
  218. -#if defined(MTDIDS_DEFAULT)
  219. -static const char *const mtdids_default = MTDIDS_DEFAULT;
  220. -#else
  221. -#warning "MTDIDS_DEFAULT not defined!"
  222. -static const char *const mtdids_default = NULL;
  223. -#endif
  224. -
  225. -#if defined(MTDPARTS_DEFAULT)
  226. -static const char *const mtdparts_default = MTDPARTS_DEFAULT;
  227. -#else
  228. -#warning "MTDPARTS_DEFAULT not defined!"
  229. -static const char *const mtdparts_default = NULL;
  230. -#endif
  231. -
  232. -/* copies of last seen 'mtdids', 'mtdparts' and 'partition' env variables */
  233. -#define MTDIDS_MAXLEN 128
  234. -#define MTDPARTS_MAXLEN 512
  235. -#define PARTITION_MAXLEN 16
  236. -static char last_ids[MTDIDS_MAXLEN];
  237. -static char last_parts[MTDPARTS_MAXLEN];
  238. -static char last_partition[PARTITION_MAXLEN];
  239. -
  240. -/* low level jffs2 cache cleaning routine */
  241. -extern void jffs2_free_cache(struct part_info *part);
  242. -
  243. -/* mtdids mapping list, filled by parse_ids() */
  244. -struct list_head mtdids;
  245. -
  246. -/* device/partition list, parse_cmdline() parses into here */
  247. -struct list_head devices;
  248. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  249. -
  250. /* current active device and partition number */
  251. static struct mtd_device *current_dev = NULL;
  252. static u8 current_partnum = 0;
  253. @@ -188,594 +154,7 @@ extern int cramfs_info (struct part_info *info);
  254. #define cramfs_info(x) (0)
  255. #endif
  256.  
  257. -static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int part_num);
  258. -
  259. -/* command line only routines */
  260. -#ifdef CONFIG_JFFS2_CMDLINE
  261. -
  262. -static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_len);
  263. -static int device_del(struct mtd_device *dev);
  264. -
  265. -/**
  266. - * Parses a string into a number. The number stored at ptr is
  267. - * potentially suffixed with K (for kilobytes, or 1024 bytes),
  268. - * M (for megabytes, or 1048576 bytes), or G (for gigabytes, or
  269. - * 1073741824). If the number is suffixed with K, M, or G, then
  270. - * the return value is the number multiplied by one kilobyte, one
  271. - * megabyte, or one gigabyte, respectively.
  272. - *
  273. - * @param ptr where parse begins
  274. - * @param retptr output pointer to next char after parse completes (output)
  275. - * @return resulting unsigned int
  276. - */
  277. -static unsigned long memsize_parse (const char *const ptr, const char **retptr)
  278. -{
  279. - unsigned long ret = simple_strtoul(ptr, (char **)retptr, 0);
  280. -
  281. - switch (**retptr) {
  282. - case 'G':
  283. - case 'g':
  284. - ret <<= 10;
  285. - case 'M':
  286. - case 'm':
  287. - ret <<= 10;
  288. - case 'K':
  289. - case 'k':
  290. - ret <<= 10;
  291. - (*retptr)++;
  292. - default:
  293. - break;
  294. - }
  295. -
  296. - return ret;
  297. -}
  298. -
  299. -/**
  300. - * Format string describing supplied size. This routine does the opposite job
  301. - * to memsize_parse(). Size in bytes is converted to string and if possible
  302. - * shortened by using k (kilobytes), m (megabytes) or g (gigabytes) suffix.
  303. - *
  304. - * Note, that this routine does not check for buffer overflow, it's the caller
  305. - * who must assure enough space.
  306. - *
  307. - * @param buf output buffer
  308. - * @param size size to be converted to string
  309. - */
  310. -static void memsize_format(char *buf, u32 size)
  311. -{
  312. -#define SIZE_GB ((u32)1024*1024*1024)
  313. -#define SIZE_MB ((u32)1024*1024)
  314. -#define SIZE_KB ((u32)1024)
  315. -
  316. - if ((size % SIZE_GB) == 0)
  317. - sprintf(buf, "%ug", size/SIZE_GB);
  318. - else if ((size % SIZE_MB) == 0)
  319. - sprintf(buf, "%um", size/SIZE_MB);
  320. - else if (size % SIZE_KB == 0)
  321. - sprintf(buf, "%uk", size/SIZE_KB);
  322. - else
  323. - sprintf(buf, "%u", size);
  324. -}
  325. -
  326. -/**
  327. - * This routine does global indexing of all partitions. Resulting index for
  328. - * current partition is saved in 'mtddevnum'. Current partition name in
  329. - * 'mtddevname'.
  330. - */
  331. -static void index_partitions(void)
  332. -{
  333. - char buf[16];
  334. - u16 mtddevnum;
  335. - struct part_info *part;
  336. - struct list_head *dentry;
  337. - struct mtd_device *dev;
  338. -
  339. - DEBUGF("--- index partitions ---\n");
  340. -
  341. - if (current_dev) {
  342. - mtddevnum = 0;
  343. - list_for_each(dentry, &devices) {
  344. - dev = list_entry(dentry, struct mtd_device, link);
  345. - if (dev == current_dev) {
  346. - mtddevnum += current_partnum;
  347. - sprintf(buf, "%d", mtddevnum);
  348. - setenv("mtddevnum", buf);
  349. - break;
  350. - }
  351. - mtddevnum += dev->num_parts;
  352. - }
  353. -
  354. - part = jffs2_part_info(current_dev, current_partnum);
  355. - setenv("mtddevname", part->name);
  356. -
  357. - DEBUGF("=> mtddevnum %d,\n=> mtddevname %s\n", mtddevnum, part->name);
  358. - } else {
  359. - setenv("mtddevnum", NULL);
  360. - setenv("mtddevname", NULL);
  361. -
  362. - DEBUGF("=> mtddevnum NULL\n=> mtddevname NULL\n");
  363. - }
  364. -}
  365. -
  366. -/**
  367. - * Save current device and partition in environment variable 'partition'.
  368. - */
  369. -static void current_save(void)
  370. -{
  371. - char buf[16];
  372. -
  373. - DEBUGF("--- current_save ---\n");
  374. -
  375. - if (current_dev) {
  376. - sprintf(buf, "%s%d,%d", MTD_DEV_TYPE(current_dev->id->type),
  377. - current_dev->id->num, current_partnum);
  378. -
  379. - setenv("partition", buf);
  380. - strncpy(last_partition, buf, 16);
  381. -
  382. - DEBUGF("=> partition %s\n", buf);
  383. - } else {
  384. - setenv("partition", NULL);
  385. - last_partition[0] = '\0';
  386. -
  387. - DEBUGF("=> partition NULL\n");
  388. - }
  389. - index_partitions();
  390. -}
  391. -
  392. -/**
  393. - * Performs sanity check for supplied NOR flash partition. Table of existing
  394. - * NOR flash devices is searched and partition device is located. Alignment
  395. - * with the granularity of NOR flash sectors is verified.
  396. - *
  397. - * @param id of the parent device
  398. - * @param part partition to validate
  399. - * @return 0 if partition is valid, 1 otherwise
  400. - */
  401. -static int part_validate_nor(struct mtdids *id, struct part_info *part)
  402. -{
  403. -#if defined(CONFIG_CMD_FLASH)
  404. - /* info for FLASH chips */
  405. - extern flash_info_t flash_info[];
  406. - flash_info_t *flash;
  407. - int offset_aligned;
  408. - u32 end_offset, sector_size = 0;
  409. - int i;
  410. -
  411. - flash = &flash_info[id->num];
  412. -
  413. - /* size of last sector */
  414. - part->sector_size = flash->size -
  415. - (flash->start[flash->sector_count-1] - flash->start[0]);
  416. -
  417. - offset_aligned = 0;
  418. - for (i = 0; i < flash->sector_count; i++) {
  419. - if ((flash->start[i] - flash->start[0]) == part->offset) {
  420. - offset_aligned = 1;
  421. - break;
  422. - }
  423. - }
  424. - if (offset_aligned == 0) {
  425. - printf("%s%d: partition (%s) start offset alignment incorrect\n",
  426. - MTD_DEV_TYPE(id->type), id->num, part->name);
  427. - return 1;
  428. - }
  429. -
  430. - end_offset = part->offset + part->size;
  431. - offset_aligned = 0;
  432. - for (i = 0; i < flash->sector_count; i++) {
  433. - if (i) {
  434. - sector_size = flash->start[i] - flash->start[i-1];
  435. - if (part->sector_size < sector_size)
  436. - part->sector_size = sector_size;
  437. - }
  438. - if ((flash->start[i] - flash->start[0]) == end_offset)
  439. - offset_aligned = 1;
  440. - }
  441. -
  442. - if (offset_aligned || flash->size == end_offset)
  443. - return 0;
  444. -
  445. - printf("%s%d: partition (%s) size alignment incorrect\n",
  446. - MTD_DEV_TYPE(id->type), id->num, part->name);
  447. -#endif
  448. - return 1;
  449. -}
  450. -
  451. -/**
  452. - * Performs sanity check for supplied NAND flash partition. Table of existing
  453. - * NAND flash devices is searched and partition device is located. Alignment
  454. - * with the granularity of nand erasesize is verified.
  455. - *
  456. - * @param id of the parent device
  457. - * @param part partition to validate
  458. - * @return 0 if partition is valid, 1 otherwise
  459. - */
  460. -static int part_validate_nand(struct mtdids *id, struct part_info *part)
  461. -{
  462. -#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
  463. - /* info for NAND chips */
  464. - nand_info_t *nand;
  465. -
  466. - nand = &nand_info[id->num];
  467. -
  468. - part->sector_size = nand->erasesize;
  469. -
  470. - if ((unsigned long)(part->offset) % nand->erasesize) {
  471. - printf("%s%d: partition (%s) start offset alignment incorrect\n",
  472. - MTD_DEV_TYPE(id->type), id->num, part->name);
  473. - return 1;
  474. - }
  475. -
  476. - if (part->size % nand->erasesize) {
  477. - printf("%s%d: partition (%s) size alignment incorrect\n",
  478. - MTD_DEV_TYPE(id->type), id->num, part->name);
  479. - return 1;
  480. - }
  481. -
  482. - return 0;
  483. -#else
  484. - return 1;
  485. -#endif
  486. -}
  487. -
  488. -/**
  489. - * Performs sanity check for supplied OneNAND flash partition.
  490. - * Table of existing OneNAND flash devices is searched and partition device
  491. - * is located. Alignment with the granularity of nand erasesize is verified.
  492. - *
  493. - * @param id of the parent device
  494. - * @param part partition to validate
  495. - * @return 0 if partition is valid, 1 otherwise
  496. - */
  497. -static int part_validate_onenand(struct mtdids *id, struct part_info *part)
  498. -{
  499. -#if defined(CONFIG_CMD_ONENAND)
  500. - /* info for OneNAND chips */
  501. - struct mtd_info *mtd;
  502. -
  503. - mtd = &onenand_mtd;
  504. -
  505. - part->sector_size = mtd->erasesize;
  506. -
  507. - if ((unsigned long)(part->offset) % mtd->erasesize) {
  508. - printf("%s%d: partition (%s) start offset"
  509. - "alignment incorrect\n",
  510. - MTD_DEV_TYPE(id->type), id->num, part->name);
  511. - return 1;
  512. - }
  513. -
  514. - if (part->size % mtd->erasesize) {
  515. - printf("%s%d: partition (%s) size alignment incorrect\n",
  516. - MTD_DEV_TYPE(id->type), id->num, part->name);
  517. - return 1;
  518. - }
  519. -
  520. - return 0;
  521. -#else
  522. - return 1;
  523. -#endif
  524. -}
  525. -
  526. -
  527. -/**
  528. - * Performs sanity check for supplied partition. Offset and size are verified
  529. - * to be within valid range. Partition type is checked and either
  530. - * parts_validate_nor() or parts_validate_nand() is called with the argument
  531. - * of part.
  532. - *
  533. - * @param id of the parent device
  534. - * @param part partition to validate
  535. - * @return 0 if partition is valid, 1 otherwise
  536. - */
  537. -static int part_validate(struct mtdids *id, struct part_info *part)
  538. -{
  539. - if (part->size == SIZE_REMAINING)
  540. - part->size = id->size - part->offset;
  541. -
  542. - if (part->offset > id->size) {
  543. - printf("%s: offset %08x beyond flash size %08x\n",
  544. - id->mtd_id, part->offset, id->size);
  545. - return 1;
  546. - }
  547. -
  548. - if ((part->offset + part->size) <= part->offset) {
  549. - printf("%s%d: partition (%s) size too big\n",
  550. - MTD_DEV_TYPE(id->type), id->num, part->name);
  551. - return 1;
  552. - }
  553. -
  554. - if (part->offset + part->size > id->size) {
  555. - printf("%s: partitioning exceeds flash size\n", id->mtd_id);
  556. - return 1;
  557. - }
  558. -
  559. - if (id->type == MTD_DEV_TYPE_NAND)
  560. - return part_validate_nand(id, part);
  561. - else if (id->type == MTD_DEV_TYPE_NOR)
  562. - return part_validate_nor(id, part);
  563. - else if (id->type == MTD_DEV_TYPE_ONENAND)
  564. - return part_validate_onenand(id, part);
  565. - else
  566. - DEBUGF("part_validate: invalid dev type\n");
  567. -
  568. - return 1;
  569. -}
  570. -
  571. -/**
  572. - * Delete selected partition from the partion list of the specified device.
  573. - *
  574. - * @param dev device to delete partition from
  575. - * @param part partition to delete
  576. - * @return 0 on success, 1 otherwise
  577. - */
  578. -static int part_del(struct mtd_device *dev, struct part_info *part)
  579. -{
  580. - u8 current_save_needed = 0;
  581. -
  582. - /* if there is only one partition, remove whole device */
  583. - if (dev->num_parts == 1)
  584. - return device_del(dev);
  585. -
  586. - /* otherwise just delete this partition */
  587. -
  588. - if (dev == current_dev) {
  589. - /* we are modyfing partitions for the current device,
  590. - * update current */
  591. - struct part_info *curr_pi;
  592. - curr_pi = jffs2_part_info(current_dev, current_partnum);
  593. -
  594. - if (curr_pi) {
  595. - if (curr_pi == part) {
  596. - printf("current partition deleted, resetting current to 0\n");
  597. - current_partnum = 0;
  598. - } else if (part->offset <= curr_pi->offset) {
  599. - current_partnum--;
  600. - }
  601. - current_save_needed = 1;
  602. - }
  603. - }
  604. -
  605. -#ifdef CONFIG_NAND_LEGACY
  606. - jffs2_free_cache(part);
  607. -#endif
  608. - list_del(&part->link);
  609. - free(part);
  610. - dev->num_parts--;
  611. -
  612. - if (current_save_needed > 0)
  613. - current_save();
  614. - else
  615. - index_partitions();
  616. -
  617. - return 0;
  618. -}
  619. -
  620. -/**
  621. - * Delete all partitions from parts head list, free memory.
  622. - *
  623. - * @param head list of partitions to delete
  624. - */
  625. -static void part_delall(struct list_head *head)
  626. -{
  627. - struct list_head *entry, *n;
  628. - struct part_info *part_tmp;
  629. -
  630. - /* clean tmp_list and free allocated memory */
  631. - list_for_each_safe(entry, n, head) {
  632. - part_tmp = list_entry(entry, struct part_info, link);
  633. -
  634. -#ifdef CONFIG_NAND_LEGACY
  635. - jffs2_free_cache(part_tmp);
  636. -#endif
  637. - list_del(entry);
  638. - free(part_tmp);
  639. - }
  640. -}
  641. -
  642. -/**
  643. - * Add new partition to the supplied partition list. Make sure partitions are
  644. - * sorted by offset in ascending order.
  645. - *
  646. - * @param head list this partition is to be added to
  647. - * @param new partition to be added
  648. - */
  649. -static int part_sort_add(struct mtd_device *dev, struct part_info *part)
  650. -{
  651. - struct list_head *entry;
  652. - struct part_info *new_pi, *curr_pi;
  653. -
  654. - /* link partition to parrent dev */
  655. - part->dev = dev;
  656. -
  657. - if (list_empty(&dev->parts)) {
  658. - DEBUGF("part_sort_add: list empty\n");
  659. - list_add(&part->link, &dev->parts);
  660. - dev->num_parts++;
  661. - index_partitions();
  662. - return 0;
  663. - }
  664. -
  665. - new_pi = list_entry(&part->link, struct part_info, link);
  666. -
  667. - /* get current partition info if we are updating current device */
  668. - curr_pi = NULL;
  669. - if (dev == current_dev)
  670. - curr_pi = jffs2_part_info(current_dev, current_partnum);
  671. -
  672. - list_for_each(entry, &dev->parts) {
  673. - struct part_info *pi;
  674. -
  675. - pi = list_entry(entry, struct part_info, link);
  676. -
  677. - /* be compliant with kernel cmdline, allow only one partition at offset zero */
  678. - if ((new_pi->offset == pi->offset) && (pi->offset == 0)) {
  679. - printf("cannot add second partition at offset 0\n");
  680. - return 1;
  681. - }
  682. -
  683. - if (new_pi->offset <= pi->offset) {
  684. - list_add_tail(&part->link, entry);
  685. - dev->num_parts++;
  686. -
  687. - if (curr_pi && (pi->offset <= curr_pi->offset)) {
  688. - /* we are modyfing partitions for the current
  689. - * device, update current */
  690. - current_partnum++;
  691. - current_save();
  692. - } else {
  693. - index_partitions();
  694. - }
  695. - return 0;
  696. - }
  697. - }
  698. -
  699. - list_add_tail(&part->link, &dev->parts);
  700. - dev->num_parts++;
  701. - index_partitions();
  702. - return 0;
  703. -}
  704. -
  705. -/**
  706. - * Add provided partition to the partition list of a given device.
  707. - *
  708. - * @param dev device to which partition is added
  709. - * @param part partition to be added
  710. - * @return 0 on success, 1 otherwise
  711. - */
  712. -static int part_add(struct mtd_device *dev, struct part_info *part)
  713. -{
  714. - /* verify alignment and size */
  715. - if (part_validate(dev->id, part) != 0)
  716. - return 1;
  717. -
  718. - /* partition is ok, add it to the list */
  719. - if (part_sort_add(dev, part) != 0)
  720. - return 1;
  721. -
  722. - return 0;
  723. -}
  724. -
  725. -/**
  726. - * Parse one partition definition, allocate memory and return pointer to this
  727. - * location in retpart.
  728. - *
  729. - * @param partdef pointer to the partition definition string i.e. <part-def>
  730. - * @param ret output pointer to next char after parse completes (output)
  731. - * @param retpart pointer to the allocated partition (output)
  732. - * @return 0 on success, 1 otherwise
  733. - */
  734. -static int part_parse(const char *const partdef, const char **ret, struct part_info **retpart)
  735. -{
  736. - struct part_info *part;
  737. - unsigned long size;
  738. - unsigned long offset;
  739. - const char *name;
  740. - int name_len;
  741. - unsigned int mask_flags;
  742. - const char *p;
  743. -
  744. - p = partdef;
  745. - *retpart = NULL;
  746. - *ret = NULL;
  747. -
  748. - /* fetch the partition size */
  749. - if (*p == '-') {
  750. - /* assign all remaining space to this partition */
  751. - DEBUGF("'-': remaining size assigned\n");
  752. - size = SIZE_REMAINING;
  753. - p++;
  754. - } else {
  755. - size = memsize_parse(p, &p);
  756. - if (size < MIN_PART_SIZE) {
  757. - printf("partition size too small (%lx)\n", size);
  758. - return 1;
  759. - }
  760. - }
  761. -
  762. - /* check for offset */
  763. - offset = OFFSET_NOT_SPECIFIED;
  764. - if (*p == '@') {
  765. - p++;
  766. - offset = memsize_parse(p, &p);
  767. - }
  768. -
  769. - /* now look for the name */
  770. - if (*p == '(') {
  771. - name = ++p;
  772. - if ((p = strchr(name, ')')) == NULL) {
  773. - printf("no closing ) found in partition name\n");
  774. - return 1;
  775. - }
  776. - name_len = p - name + 1;
  777. - if ((name_len - 1) == 0) {
  778. - printf("empty partition name\n");
  779. - return 1;
  780. - }
  781. - p++;
  782. - } else {
  783. - /* 0x00000000@0x00000000 */
  784. - name_len = 22;
  785. - name = NULL;
  786. - }
  787. -
  788. - /* test for options */
  789. - mask_flags = 0;
  790. - if (strncmp(p, "ro", 2) == 0) {
  791. - mask_flags |= MTD_WRITEABLE_CMD;
  792. - p += 2;
  793. - }
  794. -
  795. - /* check for next partition definition */
  796. - if (*p == ',') {
  797. - if (size == SIZE_REMAINING) {
  798. - *ret = NULL;
  799. - printf("no partitions allowed after a fill-up partition\n");
  800. - return 1;
  801. - }
  802. - *ret = ++p;
  803. - } else if ((*p == ';') || (*p == '\0')) {
  804. - *ret = p;
  805. - } else {
  806. - printf("unexpected character '%c' at the end of partition\n", *p);
  807. - *ret = NULL;
  808. - return 1;
  809. - }
  810. -
  811. - /* allocate memory */
  812. - part = (struct part_info *)malloc(sizeof(struct part_info) + name_len);
  813. - if (!part) {
  814. - printf("out of memory\n");
  815. - return 1;
  816. - }
  817. - memset(part, 0, sizeof(struct part_info) + name_len);
  818. - part->size = size;
  819. - part->offset = offset;
  820. - part->mask_flags = mask_flags;
  821. - part->name = (char *)(part + 1);
  822. -
  823. - if (name) {
  824. - /* copy user provided name */
  825. - strncpy(part->name, name, name_len - 1);
  826. - part->auto_name = 0;
  827. - } else {
  828. - /* auto generated name in form of size@offset */
  829. - sprintf(part->name, "0x%08lx@0x%08lx", size, offset);
  830. - part->auto_name = 1;
  831. - }
  832. -
  833. - part->name[name_len - 1] = '\0';
  834. - INIT_LIST_HEAD(&part->link);
  835. -
  836. - DEBUGF("+ partition: name %-22s size 0x%08x offset 0x%08x mask flags %d\n",
  837. - part->name, part->size,
  838. - part->offset, part->mask_flags);
  839. -
  840. - *retpart = part;
  841. - return 0;
  842. -}
  843. -#endif/* #ifdef CONFIG_JFFS2_CMDLINE */
  844. -
  845. +#ifndef CONFIG_CMD_MTDPARTS
  846. /**
  847. * Check device number to be within valid range for given device type.
  848. *
  849. @@ -828,310 +207,6 @@ static int device_validate(u8 type, u8 num, u32 *size)
  850. return 1;
  851. }
  852.  
  853. -#ifdef CONFIG_JFFS2_CMDLINE
  854. -/**
  855. - * Delete all mtd devices from a supplied devices list, free memory allocated for
  856. - * each device and delete all device partitions.
  857. - *
  858. - * @return 0 on success, 1 otherwise
  859. - */
  860. -static int device_delall(struct list_head *head)
  861. -{
  862. - struct list_head *entry, *n;
  863. - struct mtd_device *dev_tmp;
  864. -
  865. - /* clean devices list */
  866. - list_for_each_safe(entry, n, head) {
  867. - dev_tmp = list_entry(entry, struct mtd_device, link);
  868. - list_del(entry);
  869. - part_delall(&dev_tmp->parts);
  870. - free(dev_tmp);
  871. - }
  872. - INIT_LIST_HEAD(&devices);
  873. -
  874. - return 0;
  875. -}
  876. -
  877. -/**
  878. - * If provided device exists it's partitions are deleted, device is removed
  879. - * from device list and device memory is freed.
  880. - *
  881. - * @param dev device to be deleted
  882. - * @return 0 on success, 1 otherwise
  883. - */
  884. -static int device_del(struct mtd_device *dev)
  885. -{
  886. - part_delall(&dev->parts);
  887. - list_del(&dev->link);
  888. - free(dev);
  889. -
  890. - if (dev == current_dev) {
  891. - /* we just deleted current device */
  892. - if (list_empty(&devices)) {
  893. - current_dev = NULL;
  894. - } else {
  895. - /* reset first partition from first dev from the
  896. - * devices list as current */
  897. - current_dev = list_entry(devices.next, struct mtd_device, link);
  898. - current_partnum = 0;
  899. - }
  900. - current_save();
  901. - return 0;
  902. - }
  903. -
  904. - index_partitions();
  905. - return 0;
  906. -}
  907. -
  908. -/**
  909. - * Search global device list and return pointer to the device of type and num
  910. - * specified.
  911. - *
  912. - * @param type device type
  913. - * @param num device number
  914. - * @return NULL if requested device does not exist
  915. - */
  916. -static struct mtd_device* device_find(u8 type, u8 num)
  917. -{
  918. - struct list_head *entry;
  919. - struct mtd_device *dev_tmp;
  920. -
  921. - list_for_each(entry, &devices) {
  922. - dev_tmp = list_entry(entry, struct mtd_device, link);
  923. -
  924. - if ((dev_tmp->id->type == type) && (dev_tmp->id->num == num))
  925. - return dev_tmp;
  926. - }
  927. -
  928. - return NULL;
  929. -}
  930. -
  931. -/**
  932. - * Add specified device to the global device list.
  933. - *
  934. - * @param dev device to be added
  935. - */
  936. -static void device_add(struct mtd_device *dev)
  937. -{
  938. - u8 current_save_needed = 0;
  939. -
  940. - if (list_empty(&devices)) {
  941. - current_dev = dev;
  942. - current_partnum = 0;
  943. - current_save_needed = 1;
  944. - }
  945. -
  946. - list_add_tail(&dev->link, &devices);
  947. -
  948. - if (current_save_needed > 0)
  949. - current_save();
  950. - else
  951. - index_partitions();
  952. -}
  953. -
  954. -/**
  955. - * Parse device type, name and mtd-id. If syntax is ok allocate memory and
  956. - * return pointer to the device structure.
  957. - *
  958. - * @param mtd_dev pointer to the device definition string i.e. <mtd-dev>
  959. - * @param ret output pointer to next char after parse completes (output)
  960. - * @param retdev pointer to the allocated device (output)
  961. - * @return 0 on success, 1 otherwise
  962. - */
  963. -static int device_parse(const char *const mtd_dev, const char **ret, struct mtd_device **retdev)
  964. -{
  965. - struct mtd_device *dev;
  966. - struct part_info *part;
  967. - struct mtdids *id;
  968. - const char *mtd_id;
  969. - unsigned int mtd_id_len;
  970. - const char *p, *pend;
  971. - LIST_HEAD(tmp_list);
  972. - struct list_head *entry, *n;
  973. - u16 num_parts;
  974. - u32 offset;
  975. - int err = 1;
  976. -
  977. - p = mtd_dev;
  978. - *retdev = NULL;
  979. - *ret = NULL;
  980. -
  981. - DEBUGF("===device_parse===\n");
  982. -
  983. - /* fetch <mtd-id> */
  984. - mtd_id = p;
  985. - if (!(p = strchr(mtd_id, ':'))) {
  986. - printf("no <mtd-id> identifier\n");
  987. - return 1;
  988. - }
  989. - mtd_id_len = p - mtd_id + 1;
  990. - p++;
  991. -
  992. - /* verify if we have a valid device specified */
  993. - if ((id = id_find_by_mtd_id(mtd_id, mtd_id_len - 1)) == NULL) {
  994. - printf("invalid mtd device '%.*s'\n", mtd_id_len - 1, mtd_id);
  995. - return 1;
  996. - }
  997. -
  998. - DEBUGF("dev type = %d (%s), dev num = %d, mtd-id = %s\n",
  999. - id->type, MTD_DEV_TYPE(id->type),
  1000. - id->num, id->mtd_id);
  1001. - pend = strchr(p, ';');
  1002. - DEBUGF("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p);
  1003. -
  1004. -
  1005. - /* parse partitions */
  1006. - num_parts = 0;
  1007. -
  1008. - offset = 0;
  1009. - if ((dev = device_find(id->type, id->num)) != NULL) {
  1010. - /* if device already exists start at the end of the last partition */
  1011. - part = list_entry(dev->parts.prev, struct part_info, link);
  1012. - offset = part->offset + part->size;
  1013. - }
  1014. -
  1015. - while (p && (*p != '\0') && (*p != ';')) {
  1016. - err = 1;
  1017. - if ((part_parse(p, &p, &part) != 0) || (!part))
  1018. - break;
  1019. -
  1020. - /* calculate offset when not specified */
  1021. - if (part->offset == OFFSET_NOT_SPECIFIED)
  1022. - part->offset = offset;
  1023. - else
  1024. - offset = part->offset;
  1025. -
  1026. - /* verify alignment and size */
  1027. - if (part_validate(id, part) != 0)
  1028. - break;
  1029. -
  1030. - offset += part->size;
  1031. -
  1032. - /* partition is ok, add it to the list */
  1033. - list_add_tail(&part->link, &tmp_list);
  1034. - num_parts++;
  1035. - err = 0;
  1036. - }
  1037. - if (err == 1) {
  1038. - part_delall(&tmp_list);
  1039. - return 1;
  1040. - }
  1041. -
  1042. - if (num_parts == 0) {
  1043. - printf("no partitions for device %s%d (%s)\n",
  1044. - MTD_DEV_TYPE(id->type), id->num, id->mtd_id);
  1045. - return 1;
  1046. - }
  1047. -
  1048. - DEBUGF("\ntotal partitions: %d\n", num_parts);
  1049. -
  1050. - /* check for next device presence */
  1051. - if (p) {
  1052. - if (*p == ';') {
  1053. - *ret = ++p;
  1054. - } else if (*p == '\0') {
  1055. - *ret = p;
  1056. - } else {
  1057. - printf("unexpected character '%c' at the end of device\n", *p);
  1058. - *ret = NULL;
  1059. - return 1;
  1060. - }
  1061. - }
  1062. -
  1063. - /* allocate memory for mtd_device structure */
  1064. - if ((dev = (struct mtd_device *)malloc(sizeof(struct mtd_device))) == NULL) {
  1065. - printf("out of memory\n");
  1066. - return 1;
  1067. - }
  1068. - memset(dev, 0, sizeof(struct mtd_device));
  1069. - dev->id = id;
  1070. - dev->num_parts = 0; /* part_sort_add increments num_parts */
  1071. - INIT_LIST_HEAD(&dev->parts);
  1072. - INIT_LIST_HEAD(&dev->link);
  1073. -
  1074. - /* move partitions from tmp_list to dev->parts */
  1075. - list_for_each_safe(entry, n, &tmp_list) {
  1076. - part = list_entry(entry, struct part_info, link);
  1077. - list_del(entry);
  1078. - if (part_sort_add(dev, part) != 0) {
  1079. - device_del(dev);
  1080. - return 1;
  1081. - }
  1082. - }
  1083. -
  1084. - *retdev = dev;
  1085. -
  1086. - DEBUGF("===\n\n");
  1087. - return 0;
  1088. -}
  1089. -
  1090. -/**
  1091. - * Initialize global device list.
  1092. - *
  1093. - * @return 0 on success, 1 otherwise
  1094. - */
  1095. -static int jffs2_devices_init(void)
  1096. -{
  1097. - last_parts[0] = '\0';
  1098. - current_dev = NULL;
  1099. - current_save();
  1100. -
  1101. - return device_delall(&devices);
  1102. -}
  1103. -
  1104. -/*
  1105. - * Search global mtdids list and find id of requested type and number.
  1106. - *
  1107. - * @return pointer to the id if it exists, NULL otherwise
  1108. - */
  1109. -static struct mtdids* id_find(u8 type, u8 num)
  1110. -{
  1111. - struct list_head *entry;
  1112. - struct mtdids *id;
  1113. -
  1114. - list_for_each(entry, &mtdids) {
  1115. - id = list_entry(entry, struct mtdids, link);
  1116. -
  1117. - if ((id->type == type) && (id->num == num))
  1118. - return id;
  1119. - }
  1120. -
  1121. - return NULL;
  1122. -}
  1123. -
  1124. -/**
  1125. - * Search global mtdids list and find id of a requested mtd_id.
  1126. - *
  1127. - * Note: first argument is not null terminated.
  1128. - *
  1129. - * @param mtd_id string containing requested mtd_id
  1130. - * @param mtd_id_len length of supplied mtd_id
  1131. - * @return pointer to the id if it exists, NULL otherwise
  1132. - */
  1133. -static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_len)
  1134. -{
  1135. - struct list_head *entry;
  1136. - struct mtdids *id;
  1137. -
  1138. - DEBUGF("--- id_find_by_mtd_id: '%.*s' (len = %d)\n",
  1139. - mtd_id_len, mtd_id, mtd_id_len);
  1140. -
  1141. - list_for_each(entry, &mtdids) {
  1142. - id = list_entry(entry, struct mtdids, link);
  1143. -
  1144. - DEBUGF("entry: '%s' (len = %d)\n",
  1145. - id->mtd_id, strlen(id->mtd_id));
  1146. -
  1147. - if (mtd_id_len != strlen(id->mtd_id))
  1148. - continue;
  1149. - if (strncmp(id->mtd_id, mtd_id, mtd_id_len) == 0)
  1150. - return id;
  1151. - }
  1152. -
  1153. - return NULL;
  1154. -}
  1155. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  1156. -
  1157. /**
  1158. * Parse device id string <dev-id> := 'nand'|'nor'|'onenand'<dev-num>,
  1159. * return device type and number.
  1160. @@ -1142,7 +217,7 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
  1161. * @param dev_num parsed device number (output)
  1162. * @return 0 on success, 1 otherwise
  1163. */
  1164. -int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
  1165. +static int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
  1166. {
  1167. const char *p = id;
  1168.  
  1169. @@ -1172,606 +247,6 @@ int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
  1170. return 0;
  1171. }
  1172.  
  1173. -#ifdef CONFIG_JFFS2_CMDLINE
  1174. -/**
  1175. - * Process all devices and generate corresponding mtdparts string describing
  1176. - * all partitions on all devices.
  1177. - *
  1178. - * @param buf output buffer holding generated mtdparts string (output)
  1179. - * @param buflen buffer size
  1180. - * @return 0 on success, 1 otherwise
  1181. - */
  1182. -static int generate_mtdparts(char *buf, u32 buflen)
  1183. -{
  1184. - struct list_head *pentry, *dentry;
  1185. - struct mtd_device *dev;
  1186. - struct part_info *part, *prev_part;
  1187. - char *p = buf;
  1188. - char tmpbuf[32];
  1189. - u32 size, offset, len, part_cnt;
  1190. - u32 maxlen = buflen - 1;
  1191. -
  1192. - DEBUGF("--- generate_mtdparts ---\n");
  1193. -
  1194. - if (list_empty(&devices)) {
  1195. - buf[0] = '\0';
  1196. - return 0;
  1197. - }
  1198. -
  1199. - sprintf(p, "mtdparts=");
  1200. - p += 9;
  1201. -
  1202. - list_for_each(dentry, &devices) {
  1203. - dev = list_entry(dentry, struct mtd_device, link);
  1204. -
  1205. - /* copy mtd_id */
  1206. - len = strlen(dev->id->mtd_id) + 1;
  1207. - if (len > maxlen)
  1208. - goto cleanup;
  1209. - memcpy(p, dev->id->mtd_id, len - 1);
  1210. - p += len - 1;
  1211. - *(p++) = ':';
  1212. - maxlen -= len;
  1213. -
  1214. - /* format partitions */
  1215. - prev_part = NULL;
  1216. - part_cnt = 0;
  1217. - list_for_each(pentry, &dev->parts) {
  1218. - part = list_entry(pentry, struct part_info, link);
  1219. - size = part->size;
  1220. - offset = part->offset;
  1221. - part_cnt++;
  1222. -
  1223. - /* partition size */
  1224. - memsize_format(tmpbuf, size);
  1225. - len = strlen(tmpbuf);
  1226. - if (len > maxlen)
  1227. - goto cleanup;
  1228. - memcpy(p, tmpbuf, len);
  1229. - p += len;
  1230. - maxlen -= len;
  1231. -
  1232. -
  1233. - /* add offset only when there is a gap between
  1234. - * partitions */
  1235. - if ((!prev_part && (offset != 0)) ||
  1236. - (prev_part && ((prev_part->offset + prev_part->size) != part->offset))) {
  1237. -
  1238. - memsize_format(tmpbuf, offset);
  1239. - len = strlen(tmpbuf) + 1;
  1240. - if (len > maxlen)
  1241. - goto cleanup;
  1242. - *(p++) = '@';
  1243. - memcpy(p, tmpbuf, len - 1);
  1244. - p += len - 1;
  1245. - maxlen -= len;
  1246. - }
  1247. -
  1248. - /* copy name only if user supplied */
  1249. - if(!part->auto_name) {
  1250. - len = strlen(part->name) + 2;
  1251. - if (len > maxlen)
  1252. - goto cleanup;
  1253. -
  1254. - *(p++) = '(';
  1255. - memcpy(p, part->name, len - 2);
  1256. - p += len - 2;
  1257. - *(p++) = ')';
  1258. - maxlen -= len;
  1259. - }
  1260. -
  1261. - /* ro mask flag */
  1262. - if (part->mask_flags && MTD_WRITEABLE_CMD) {
  1263. - len = 2;
  1264. - if (len > maxlen)
  1265. - goto cleanup;
  1266. - *(p++) = 'r';
  1267. - *(p++) = 'o';
  1268. - maxlen -= 2;
  1269. - }
  1270. -
  1271. - /* print ',' separator if there are other partitions
  1272. - * following */
  1273. - if (dev->num_parts > part_cnt) {
  1274. - if (1 > maxlen)
  1275. - goto cleanup;
  1276. - *(p++) = ',';
  1277. - maxlen--;
  1278. - }
  1279. - prev_part = part;
  1280. - }
  1281. - /* print ';' separator if there are other devices following */
  1282. - if (dentry->next != &devices) {
  1283. - if (1 > maxlen)
  1284. - goto cleanup;
  1285. - *(p++) = ';';
  1286. - maxlen--;
  1287. - }
  1288. - }
  1289. -
  1290. - /* we still have at least one char left, as we decremented maxlen at
  1291. - * the begining */
  1292. - *p = '\0';
  1293. -
  1294. - return 0;
  1295. -
  1296. -cleanup:
  1297. - last_parts[0] = '\0';
  1298. - return 1;
  1299. -}
  1300. -
  1301. -/**
  1302. - * Call generate_mtdparts to process all devices and generate corresponding
  1303. - * mtdparts string, save it in mtdparts environment variable.
  1304. - *
  1305. - * @param buf output buffer holding generated mtdparts string (output)
  1306. - * @param buflen buffer size
  1307. - * @return 0 on success, 1 otherwise
  1308. - */
  1309. -static int generate_mtdparts_save(char *buf, u32 buflen)
  1310. -{
  1311. - int ret;
  1312. -
  1313. - ret = generate_mtdparts(buf, buflen);
  1314. -
  1315. - if ((buf[0] != '\0') && (ret == 0))
  1316. - setenv("mtdparts", buf);
  1317. - else
  1318. - setenv("mtdparts", NULL);
  1319. -
  1320. - return ret;
  1321. -}
  1322. -
  1323. -/**
  1324. - * Format and print out a partition list for each device from global device
  1325. - * list.
  1326. - */
  1327. -static void list_partitions(void)
  1328. -{
  1329. - struct list_head *dentry, *pentry;
  1330. - struct part_info *part;
  1331. - struct mtd_device *dev;
  1332. - int part_num;
  1333. -
  1334. - DEBUGF("\n---list_partitions---\n");
  1335. - list_for_each(dentry, &devices) {
  1336. - dev = list_entry(dentry, struct mtd_device, link);
  1337. - printf("\ndevice %s%d <%s>, # parts = %d\n",
  1338. - MTD_DEV_TYPE(dev->id->type), dev->id->num,
  1339. - dev->id->mtd_id, dev->num_parts);
  1340. - printf(" #: name\t\t\tsize\t\toffset\t\tmask_flags\n");
  1341. -
  1342. - /* list partitions for given device */
  1343. - part_num = 0;
  1344. - list_for_each(pentry, &dev->parts) {
  1345. - part = list_entry(pentry, struct part_info, link);
  1346. - printf("%2d: %-20s0x%08x\t0x%08x\t%d\n",
  1347. - part_num, part->name, part->size,
  1348. - part->offset, part->mask_flags);
  1349. -
  1350. - part_num++;
  1351. - }
  1352. - }
  1353. - if (list_empty(&devices))
  1354. - printf("no partitions defined\n");
  1355. -
  1356. - /* current_dev is not NULL only when we have non empty device list */
  1357. - if (current_dev) {
  1358. - part = jffs2_part_info(current_dev, current_partnum);
  1359. - if (part) {
  1360. - printf("\nactive partition: %s%d,%d - (%s) 0x%08x @ 0x%08x\n",
  1361. - MTD_DEV_TYPE(current_dev->id->type),
  1362. - current_dev->id->num, current_partnum,
  1363. - part->name, part->size, part->offset);
  1364. - } else {
  1365. - printf("could not get current partition info\n\n");
  1366. - }
  1367. - }
  1368. -
  1369. - printf("\ndefaults:\n");
  1370. - printf("mtdids : %s\n", mtdids_default);
  1371. - printf("mtdparts: %s\n", mtdparts_default);
  1372. -}
  1373. -
  1374. -/**
  1375. - * Given partition identifier in form of <dev_type><dev_num>,<part_num> find
  1376. - * corresponding device and verify partition number.
  1377. - *
  1378. - * @param id string describing device and partition or partition name
  1379. - * @param dev pointer to the requested device (output)
  1380. - * @param part_num verified partition number (output)
  1381. - * @param part pointer to requested partition (output)
  1382. - * @return 0 on success, 1 otherwise
  1383. - */
  1384. -int find_dev_and_part(const char *id, struct mtd_device **dev,
  1385. - u8 *part_num, struct part_info **part)
  1386. -{
  1387. - struct list_head *dentry, *pentry;
  1388. - u8 type, dnum, pnum;
  1389. - const char *p;
  1390. -
  1391. - DEBUGF("--- find_dev_and_part ---\nid = %s\n", id);
  1392. -
  1393. - list_for_each(dentry, &devices) {
  1394. - *part_num = 0;
  1395. - *dev = list_entry(dentry, struct mtd_device, link);
  1396. - list_for_each(pentry, &(*dev)->parts) {
  1397. - *part = list_entry(pentry, struct part_info, link);
  1398. - if (strcmp((*part)->name, id) == 0)
  1399. - return 0;
  1400. - (*part_num)++;
  1401. - }
  1402. - }
  1403. -
  1404. - p = id;
  1405. - *dev = NULL;
  1406. - *part = NULL;
  1407. - *part_num = 0;
  1408. -
  1409. - if (id_parse(p, &p, &type, &dnum) != 0)
  1410. - return 1;
  1411. -
  1412. - if ((*p++ != ',') || (*p == '\0')) {
  1413. - printf("no partition number specified\n");
  1414. - return 1;
  1415. - }
  1416. - pnum = simple_strtoul(p, (char **)&p, 0);
  1417. - if (*p != '\0') {
  1418. - printf("unexpected trailing character '%c'\n", *p);
  1419. - return 1;
  1420. - }
  1421. -
  1422. - if ((*dev = device_find(type, dnum)) == NULL) {
  1423. - printf("no such device %s%d\n", MTD_DEV_TYPE(type), dnum);
  1424. - return 1;
  1425. - }
  1426. -
  1427. - if ((*part = jffs2_part_info(*dev, pnum)) == NULL) {
  1428. - printf("no such partition\n");
  1429. - *dev = NULL;
  1430. - return 1;
  1431. - }
  1432. -
  1433. - *part_num = pnum;
  1434. -
  1435. - return 0;
  1436. -}
  1437. -
  1438. -/**
  1439. - * Find and delete partition. For partition id format see find_dev_and_part().
  1440. - *
  1441. - * @param id string describing device and partition
  1442. - * @return 0 on success, 1 otherwise
  1443. - */
  1444. -static int delete_partition(const char *id)
  1445. -{
  1446. - u8 pnum;
  1447. - struct mtd_device *dev;
  1448. - struct part_info *part;
  1449. -
  1450. - if (find_dev_and_part(id, &dev, &pnum, &part) == 0) {
  1451. -
  1452. - DEBUGF("delete_partition: device = %s%d, partition %d = (%s) 0x%08lx@0x%08lx\n",
  1453. - MTD_DEV_TYPE(dev->id->type), dev->id->num, pnum,
  1454. - part->name, part->size, part->offset);
  1455. -
  1456. - if (part_del(dev, part) != 0)
  1457. - return 1;
  1458. -
  1459. - if (generate_mtdparts_save(last_parts, MTDPARTS_MAXLEN) != 0) {
  1460. - printf("generated mtdparts too long, reseting to null\n");
  1461. - return 1;
  1462. - }
  1463. - return 0;
  1464. - }
  1465. -
  1466. - printf("partition %s not found\n", id);
  1467. - return 1;
  1468. -}
  1469. -
  1470. -/**
  1471. - * Accept character string describing mtd partitions and call device_parse()
  1472. - * for each entry. Add created devices to the global devices list.
  1473. - *
  1474. - * @param mtdparts string specifing mtd partitions
  1475. - * @return 0 on success, 1 otherwise
  1476. - */
  1477. -static int parse_mtdparts(const char *const mtdparts)
  1478. -{
  1479. - const char *p = mtdparts;
  1480. - struct mtd_device *dev;
  1481. - int err = 1;
  1482. -
  1483. - DEBUGF("\n---parse_mtdparts---\nmtdparts = %s\n\n", p);
  1484. -
  1485. - /* delete all devices and partitions */
  1486. - if (jffs2_devices_init() != 0) {
  1487. - printf("could not initialise device list\n");
  1488. - return err;
  1489. - }
  1490. -
  1491. - /* re-read 'mtdparts' variable, jffs2_devices_init may be updating env */
  1492. - p = getenv("mtdparts");
  1493. -
  1494. - if (strncmp(p, "mtdparts=", 9) != 0) {
  1495. - printf("mtdparts variable doesn't start with 'mtdparts='\n");
  1496. - return err;
  1497. - }
  1498. - p += 9;
  1499. -
  1500. - while (p && (*p != '\0')) {
  1501. - err = 1;
  1502. - if ((device_parse(p, &p, &dev) != 0) || (!dev))
  1503. - break;
  1504. -
  1505. - DEBUGF("+ device: %s\t%d\t%s\n", MTD_DEV_TYPE(dev->id->type),
  1506. - dev->id->num, dev->id->mtd_id);
  1507. -
  1508. - /* check if parsed device is already on the list */
  1509. - if (device_find(dev->id->type, dev->id->num) != NULL) {
  1510. - printf("device %s%d redefined, please correct mtdparts variable\n",
  1511. - MTD_DEV_TYPE(dev->id->type), dev->id->num);
  1512. - break;
  1513. - }
  1514. -
  1515. - list_add_tail(&dev->link, &devices);
  1516. - err = 0;
  1517. - }
  1518. - if (err == 1) {
  1519. - device_delall(&devices);
  1520. - return 1;
  1521. - }
  1522. -
  1523. - return 0;
  1524. -}
  1525. -
  1526. -/**
  1527. - * Parse provided string describing mtdids mapping (see file header for mtdids
  1528. - * variable format). Allocate memory for each entry and add all found entries
  1529. - * to the global mtdids list.
  1530. - *
  1531. - * @param ids mapping string
  1532. - * @return 0 on success, 1 otherwise
  1533. - */
  1534. -static int parse_mtdids(const char *const ids)
  1535. -{
  1536. - const char *p = ids;
  1537. - const char *mtd_id;
  1538. - int mtd_id_len;
  1539. - struct mtdids *id;
  1540. - struct list_head *entry, *n;
  1541. - struct mtdids *id_tmp;
  1542. - u8 type, num;
  1543. - u32 size;
  1544. - int ret = 1;
  1545. -
  1546. - DEBUGF("\n---parse_mtdids---\nmtdids = %s\n\n", ids);
  1547. -
  1548. - /* clean global mtdids list */
  1549. - list_for_each_safe(entry, n, &mtdids) {
  1550. - id_tmp = list_entry(entry, struct mtdids, link);
  1551. - DEBUGF("mtdids del: %d %d\n", id_tmp->type, id_tmp->num);
  1552. - list_del(entry);
  1553. - free(id_tmp);
  1554. - }
  1555. - last_ids[0] = '\0';
  1556. - INIT_LIST_HEAD(&mtdids);
  1557. -
  1558. - while(p && (*p != '\0')) {
  1559. -
  1560. - ret = 1;
  1561. - /* parse 'nor'|'nand'|'onenand'<dev-num> */
  1562. - if (id_parse(p, &p, &type, &num) != 0)
  1563. - break;
  1564. -
  1565. - if (*p != '=') {
  1566. - printf("mtdids: incorrect <dev-num>\n");
  1567. - break;
  1568. - }
  1569. - p++;
  1570. -
  1571. - /* check if requested device exists */
  1572. - if (device_validate(type, num, &size) != 0)
  1573. - return 1;
  1574. -
  1575. - /* locate <mtd-id> */
  1576. - mtd_id = p;
  1577. - if ((p = strchr(mtd_id, ',')) != NULL) {
  1578. - mtd_id_len = p - mtd_id + 1;
  1579. - p++;
  1580. - } else {
  1581. - mtd_id_len = strlen(mtd_id) + 1;
  1582. - }
  1583. - if (mtd_id_len == 0) {
  1584. - printf("mtdids: no <mtd-id> identifier\n");
  1585. - break;
  1586. - }
  1587. -
  1588. - /* check if this id is already on the list */
  1589. - int double_entry = 0;
  1590. - list_for_each(entry, &mtdids) {
  1591. - id_tmp = list_entry(entry, struct mtdids, link);
  1592. - if ((id_tmp->type == type) && (id_tmp->num == num)) {
  1593. - double_entry = 1;
  1594. - break;
  1595. - }
  1596. - }
  1597. - if (double_entry) {
  1598. - printf("device id %s%d redefined, please correct mtdids variable\n",
  1599. - MTD_DEV_TYPE(type), num);
  1600. - break;
  1601. - }
  1602. -
  1603. - /* allocate mtdids structure */
  1604. - if (!(id = (struct mtdids *)malloc(sizeof(struct mtdids) + mtd_id_len))) {
  1605. - printf("out of memory\n");
  1606. - break;
  1607. - }
  1608. - memset(id, 0, sizeof(struct mtdids) + mtd_id_len);
  1609. - id->num = num;
  1610. - id->type = type;
  1611. - id->size = size;
  1612. - id->mtd_id = (char *)(id + 1);
  1613. - strncpy(id->mtd_id, mtd_id, mtd_id_len - 1);
  1614. - id->mtd_id[mtd_id_len - 1] = '\0';
  1615. - INIT_LIST_HEAD(&id->link);
  1616. -
  1617. - DEBUGF("+ id %s%d\t%16d bytes\t%s\n",
  1618. - MTD_DEV_TYPE(id->type), id->num,
  1619. - id->size, id->mtd_id);
  1620. -
  1621. - list_add_tail(&id->link, &mtdids);
  1622. - ret = 0;
  1623. - }
  1624. - if (ret == 1) {
  1625. - /* clean mtdids list and free allocated memory */
  1626. - list_for_each_safe(entry, n, &mtdids) {
  1627. - id_tmp = list_entry(entry, struct mtdids, link);
  1628. - list_del(entry);
  1629. - free(id_tmp);
  1630. - }
  1631. - return 1;
  1632. - }
  1633. -
  1634. - return 0;
  1635. -}
  1636. -
  1637. -/**
  1638. - * Parse and initialize global mtdids mapping and create global
  1639. - * device/partition list.
  1640. - *
  1641. - * @return 0 on success, 1 otherwise
  1642. - */
  1643. -int mtdparts_init(void)
  1644. -{
  1645. - static int initialized = 0;
  1646. - const char *ids, *parts;
  1647. - const char *current_partition;
  1648. - int ids_changed;
  1649. - char tmp_ep[PARTITION_MAXLEN];
  1650. -
  1651. - DEBUGF("\n---mtdparts_init---\n");
  1652. - if (!initialized) {
  1653. - INIT_LIST_HEAD(&mtdids);
  1654. - INIT_LIST_HEAD(&devices);
  1655. - memset(last_ids, 0, MTDIDS_MAXLEN);
  1656. - memset(last_parts, 0, MTDPARTS_MAXLEN);
  1657. - memset(last_partition, 0, PARTITION_MAXLEN);
  1658. - initialized = 1;
  1659. - }
  1660. -
  1661. - /* get variables */
  1662. - ids = getenv("mtdids");
  1663. - parts = getenv("mtdparts");
  1664. - current_partition = getenv("partition");
  1665. -
  1666. - /* save it for later parsing, cannot rely on current partition pointer
  1667. - * as 'partition' variable may be updated during init */
  1668. - tmp_ep[0] = '\0';
  1669. - if (current_partition)
  1670. - strncpy(tmp_ep, current_partition, PARTITION_MAXLEN);
  1671. -
  1672. - DEBUGF("last_ids : %s\n", last_ids);
  1673. - DEBUGF("env_ids : %s\n", ids);
  1674. - DEBUGF("last_parts: %s\n", last_parts);
  1675. - DEBUGF("env_parts : %s\n\n", parts);
  1676. -
  1677. - DEBUGF("last_partition : %s\n", last_partition);
  1678. - DEBUGF("env_partition : %s\n", current_partition);
  1679. -
  1680. - /* if mtdids varible is empty try to use defaults */
  1681. - if (!ids) {
  1682. - if (mtdids_default) {
  1683. - DEBUGF("mtdids variable not defined, using default\n");
  1684. - ids = mtdids_default;
  1685. - setenv("mtdids", (char *)ids);
  1686. - } else {
  1687. - printf("mtdids not defined, no default present\n");
  1688. - return 1;
  1689. - }
  1690. - }
  1691. - if (strlen(ids) > MTDIDS_MAXLEN - 1) {
  1692. - printf("mtdids too long (> %d)\n", MTDIDS_MAXLEN);
  1693. - return 1;
  1694. - }
  1695. -
  1696. - /* do no try to use defaults when mtdparts variable is not defined,
  1697. - * just check the length */
  1698. - if (!parts)
  1699. - printf("mtdparts variable not set, see 'help mtdparts'\n");
  1700. -
  1701. - if (parts && (strlen(parts) > MTDPARTS_MAXLEN - 1)) {
  1702. - printf("mtdparts too long (> %d)\n", MTDPARTS_MAXLEN);
  1703. - return 1;
  1704. - }
  1705. -
  1706. - /* check if we have already parsed those mtdids */
  1707. - if ((last_ids[0] != '\0') && (strcmp(last_ids, ids) == 0)) {
  1708. - ids_changed = 0;
  1709. - } else {
  1710. - ids_changed = 1;
  1711. -
  1712. - if (parse_mtdids(ids) != 0) {
  1713. - jffs2_devices_init();
  1714. - return 1;
  1715. - }
  1716. -
  1717. - /* ok it's good, save new ids */
  1718. - strncpy(last_ids, ids, MTDIDS_MAXLEN);
  1719. - }
  1720. -
  1721. - /* parse partitions if either mtdparts or mtdids were updated */
  1722. - if (parts && ((last_parts[0] == '\0') || ((strcmp(last_parts, parts) != 0)) || ids_changed)) {
  1723. - if (parse_mtdparts(parts) != 0)
  1724. - return 1;
  1725. -
  1726. - if (list_empty(&devices)) {
  1727. - printf("mtdparts_init: no valid partitions\n");
  1728. - return 1;
  1729. - }
  1730. -
  1731. - /* ok it's good, save new parts */
  1732. - strncpy(last_parts, parts, MTDPARTS_MAXLEN);
  1733. -
  1734. - /* reset first partition from first dev from the list as current */
  1735. - current_dev = list_entry(devices.next, struct mtd_device, link);
  1736. - current_partnum = 0;
  1737. - current_save();
  1738. -
  1739. - DEBUGF("mtdparts_init: current_dev = %s%d, current_partnum = %d\n",
  1740. - MTD_DEV_TYPE(current_dev->id->type),
  1741. - current_dev->id->num, current_partnum);
  1742. - }
  1743. -
  1744. - /* mtdparts variable was reset to NULL, delete all devices/partitions */
  1745. - if (!parts && (last_parts[0] != '\0'))
  1746. - return jffs2_devices_init();
  1747. -
  1748. - /* do not process current partition if mtdparts variable is null */
  1749. - if (!parts)
  1750. - return 0;
  1751. -
  1752. - /* is current partition set in environment? if so, use it */
  1753. - if ((tmp_ep[0] != '\0') && (strcmp(tmp_ep, last_partition) != 0)) {
  1754. - struct part_info *p;
  1755. - struct mtd_device *cdev;
  1756. - u8 pnum;
  1757. -
  1758. - DEBUGF("--- getting current partition: %s\n", tmp_ep);
  1759. -
  1760. - if (find_dev_and_part(tmp_ep, &cdev, &pnum, &p) == 0) {
  1761. - current_dev = cdev;
  1762. - current_partnum = pnum;
  1763. - current_save();
  1764. - }
  1765. - } else if (getenv("partition") == NULL) {
  1766. - DEBUGF("no partition variable set, setting...\n");
  1767. - current_save();
  1768. - }
  1769. -
  1770. - return 0;
  1771. -}
  1772. -#else /* #ifdef CONFIG_JFFS2_CMDLINE */
  1773. /*
  1774. * 'Static' version of command line mtdparts_init() routine. Single partition on
  1775. * a single device configuration.
  1776. @@ -1958,7 +433,7 @@ int mtdparts_init(void)
  1777.  
  1778. return 0;
  1779. }
  1780. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  1781. +#endif /* #ifndef CONFIG_CMD_MTDPARTS */
  1782.  
  1783. /**
  1784. * Return pointer to the partition of a requested number from a requested
  1785. @@ -2145,155 +620,6 @@ int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  1786. return 1;
  1787. }
  1788.  
  1789. -/* command line only */
  1790. -#ifdef CONFIG_JFFS2_CMDLINE
  1791. -/**
  1792. - * Routine implementing u-boot chpart command. Sets new current partition based
  1793. - * on the user supplied partition id. For partition id format see find_dev_and_part().
  1794. - *
  1795. - * @param cmdtp command internal data
  1796. - * @param flag command flag
  1797. - * @param argc number of arguments supplied to the command
  1798. - * @param argv arguments list
  1799. - * @return 0 on success, 1 otherwise
  1800. - */
  1801. -int do_jffs2_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  1802. -{
  1803. -/* command line only */
  1804. - struct mtd_device *dev;
  1805. - struct part_info *part;
  1806. - u8 pnum;
  1807. -
  1808. - if (mtdparts_init() !=0)
  1809. - return 1;
  1810. -
  1811. - if (argc < 2) {
  1812. - printf("no partition id specified\n");
  1813. - return 1;
  1814. - }
  1815. -
  1816. - if (find_dev_and_part(argv[1], &dev, &pnum, &part) != 0)
  1817. - return 1;
  1818. -
  1819. - current_dev = dev;
  1820. - current_partnum = pnum;
  1821. - current_save();
  1822. -
  1823. - printf("partition changed to %s%d,%d\n",
  1824. - MTD_DEV_TYPE(dev->id->type), dev->id->num, pnum);
  1825. -
  1826. - return 0;
  1827. -}
  1828. -
  1829. -/**
  1830. - * Routine implementing u-boot mtdparts command. Initialize/update default global
  1831. - * partition list and process user partition request (list, add, del).
  1832. - *
  1833. - * @param cmdtp command internal data
  1834. - * @param flag command flag
  1835. - * @param argc number of arguments supplied to the command
  1836. - * @param argv arguments list
  1837. - * @return 0 on success, 1 otherwise
  1838. - */
  1839. -int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  1840. -{
  1841. - if (argc == 2) {
  1842. - if (strcmp(argv[1], "default") == 0) {
  1843. - setenv("mtdids", (char *)mtdids_default);
  1844. - setenv("mtdparts", (char *)mtdparts_default);
  1845. - setenv("partition", NULL);
  1846. -
  1847. - mtdparts_init();
  1848. - return 0;
  1849. - } else if (strcmp(argv[1], "delall") == 0) {
  1850. - /* this may be the first run, initialize lists if needed */
  1851. - mtdparts_init();
  1852. -
  1853. - setenv("mtdparts", NULL);
  1854. -
  1855. - /* jffs2_devices_init() calls current_save() */
  1856. - return jffs2_devices_init();
  1857. - }
  1858. - }
  1859. -
  1860. - /* make sure we are in sync with env variables */
  1861. - if (mtdparts_init() != 0)
  1862. - return 1;
  1863. -
  1864. - if (argc == 1) {
  1865. - list_partitions();
  1866. - return 0;
  1867. - }
  1868. -
  1869. - /* mtdparts add <mtd-dev> <size>[@<offset>] <name> [ro] */
  1870. - if (((argc == 5) || (argc == 6)) && (strcmp(argv[1], "add") == 0)) {
  1871. -#define PART_ADD_DESC_MAXLEN 64
  1872. - char tmpbuf[PART_ADD_DESC_MAXLEN];
  1873. - u8 type, num, len;
  1874. - struct mtd_device *dev;
  1875. - struct mtd_device *dev_tmp;
  1876. - struct mtdids *id;
  1877. - struct part_info *p;
  1878. -
  1879. - if (id_parse(argv[2], NULL, &type, &num) != 0)
  1880. - return 1;
  1881. -
  1882. - if ((id = id_find(type, num)) == NULL) {
  1883. - printf("no such device %s defined in mtdids variable\n", argv[2]);
  1884. - return 1;
  1885. - }
  1886. -
  1887. - len = strlen(id->mtd_id) + 1; /* 'mtd_id:' */
  1888. - len += strlen(argv[3]); /* size@offset */
  1889. - len += strlen(argv[4]) + 2; /* '(' name ')' */
  1890. - if (argv[5] && (strlen(argv[5]) == 2))
  1891. - len += 2; /* 'ro' */
  1892. -
  1893. - if (len >= PART_ADD_DESC_MAXLEN) {
  1894. - printf("too long partition description\n");
  1895. - return 1;
  1896. - }
  1897. - sprintf(tmpbuf, "%s:%s(%s)%s",
  1898. - id->mtd_id, argv[3], argv[4], argv[5] ? argv[5] : "");
  1899. - DEBUGF("add tmpbuf: %s\n", tmpbuf);
  1900. -
  1901. - if ((device_parse(tmpbuf, NULL, &dev) != 0) || (!dev))
  1902. - return 1;
  1903. -
  1904. - DEBUGF("+ %s\t%d\t%s\n", MTD_DEV_TYPE(dev->id->type),
  1905. - dev->id->num, dev->id->mtd_id);
  1906. -
  1907. - if ((dev_tmp = device_find(dev->id->type, dev->id->num)) == NULL) {
  1908. - device_add(dev);
  1909. - } else {
  1910. - /* merge new partition with existing ones*/
  1911. - p = list_entry(dev->parts.next, struct part_info, link);
  1912. - if (part_add(dev_tmp, p) != 0) {
  1913. - device_del(dev);
  1914. - return 1;
  1915. - }
  1916. - }
  1917. -
  1918. - if (generate_mtdparts_save(last_parts, MTDPARTS_MAXLEN) != 0) {
  1919. - printf("generated mtdparts too long, reseting to null\n");
  1920. - return 1;
  1921. - }
  1922. -
  1923. - return 0;
  1924. - }
  1925. -
  1926. - /* mtdparts del part-id */
  1927. - if ((argc == 3) && (strcmp(argv[1], "del") == 0)) {
  1928. - DEBUGF("del: part-id = %s\n", argv[2]);
  1929. -
  1930. - return delete_partition(argv[2]);
  1931. - }
  1932. -
  1933. - cmd_usage(cmdtp);
  1934. - return 1;
  1935. -}
  1936. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  1937. -
  1938. /***************************************************/
  1939. U_BOOT_CMD(
  1940. fsload, 3, 0, do_jffs2_fsload,
  1941. @@ -2314,49 +640,4 @@ U_BOOT_CMD(
  1942. "print information about filesystems",
  1943. " - print information about filesystems\n"
  1944. );
  1945. -
  1946. -#ifdef CONFIG_JFFS2_CMDLINE
  1947. -U_BOOT_CMD(
  1948. - chpart, 2, 0, do_jffs2_chpart,
  1949. - "change active partition",
  1950. - "part-id\n"
  1951. - " - change active partition (e.g. part-id = nand0,1)\n"
  1952. -);
  1953. -
  1954. -U_BOOT_CMD(
  1955. - mtdparts, 6, 0, do_jffs2_mtdparts,
  1956. - "define flash/nand partitions",
  1957. - "\n"
  1958. - " - list partition table\n"
  1959. - "mtdparts delall\n"
  1960. - " - delete all partitions\n"
  1961. - "mtdparts del part-id\n"
  1962. - " - delete partition (e.g. part-id = nand0,1)\n"
  1963. - "mtdparts add <mtd-dev> <size>[@<offset>] [<name>] [ro]\n"
  1964. - " - add partition\n"
  1965. - "mtdparts default\n"
  1966. - " - reset partition table to defaults\n\n"
  1967. - "-----\n\n"
  1968. - "this command uses three environment variables:\n\n"
  1969. - "'partition' - keeps current partition identifier\n\n"
  1970. - "partition := <part-id>\n"
  1971. - "<part-id> := <dev-id>,part_num\n\n"
  1972. - "'mtdids' - linux kernel mtd device id <-> u-boot device id mapping\n\n"
  1973. - "mtdids=<idmap>[,<idmap>,...]\n\n"
  1974. - "<idmap> := <dev-id>=<mtd-id>\n"
  1975. - "<dev-id> := 'nand'|'nor'|'onenand'<dev-num>\n"
  1976. - "<dev-num> := mtd device number, 0...\n"
  1977. - "<mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)\n\n"
  1978. - "'mtdparts' - partition list\n\n"
  1979. - "mtdparts=mtdparts=<mtd-def>[;<mtd-def>...]\n\n"
  1980. - "<mtd-def> := <mtd-id>:<part-def>[,<part-def>...]\n"
  1981. - "<mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)\n"
  1982. - "<part-def> := <size>[@<offset>][<name>][<ro-flag>]\n"
  1983. - "<size> := standard linux memsize OR '-' to denote all remaining space\n"
  1984. - "<offset> := partition start offset within the device\n"
  1985. - "<name> := '(' NAME ')'\n"
  1986. - "<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)\n"
  1987. -);
  1988. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  1989. -
  1990. /***************************************************/
  1991. diff --git a/common/cmd_jffs2.c b/common/cmd_mtdparts.c
  1992. similarity index 84%
  1993. copy from common/cmd_jffs2.c
  1994. copy to common/cmd_mtdparts.c
  1995. index d0a7cea..b38bc0c 100644
  1996. --- a/common/cmd_jffs2.c
  1997. +++ b/common/cmd_mtdparts.c
  1998. @@ -136,7 +136,6 @@
  1999. * field for read-only partitions */
  2000. #define MTD_WRITEABLE_CMD 1
  2001.  
  2002. -#ifdef CONFIG_JFFS2_CMDLINE
  2003. /* default values for mtdids and mtdparts variables */
  2004. #if defined(MTDIDS_DEFAULT)
  2005. static const char *const mtdids_default = MTDIDS_DEFAULT;
  2006. @@ -168,31 +167,14 @@ struct list_head mtdids;
  2007.  
  2008. /* device/partition list, parse_cmdline() parses into here */
  2009. struct list_head devices;
  2010. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  2011.  
  2012. /* current active device and partition number */
  2013. static struct mtd_device *current_dev = NULL;
  2014. static u8 current_partnum = 0;
  2015.  
  2016. -#if defined(CONFIG_CMD_CRAMFS)
  2017. -extern int cramfs_check (struct part_info *info);
  2018. -extern int cramfs_load (char *loadoffset, struct part_info *info, char *filename);
  2019. -extern int cramfs_ls (struct part_info *info, char *filename);
  2020. -extern int cramfs_info (struct part_info *info);
  2021. -#else
  2022. -/* defining empty macros for function names is ugly but avoids ifdef clutter
  2023. - * all over the code */
  2024. -#define cramfs_check(x) (0)
  2025. -#define cramfs_load(x,y,z) (-1)
  2026. -#define cramfs_ls(x,y) (0)
  2027. -#define cramfs_info(x) (0)
  2028. -#endif
  2029. -
  2030. static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int part_num);
  2031.  
  2032. /* command line only routines */
  2033. -#ifdef CONFIG_JFFS2_CMDLINE
  2034. -
  2035. static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_len);
  2036. static int device_del(struct mtd_device *dev);
  2037.  
  2038. @@ -774,7 +756,6 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i
  2039. *retpart = part;
  2040. return 0;
  2041. }
  2042. -#endif/* #ifdef CONFIG_JFFS2_CMDLINE */
  2043.  
  2044. /**
  2045. * Check device number to be within valid range for given device type.
  2046. @@ -782,7 +763,7 @@ static int part_parse(const char *const partdef, const char **ret, struct part_i
  2047. * @param dev device to validate
  2048. * @return 0 if device is valid, 1 otherwise
  2049. */
  2050. -static int device_validate(u8 type, u8 num, u32 *size)
  2051. +int device_validate(u8 type, u8 num, u32 *size)
  2052. {
  2053. if (type == MTD_DEV_TYPE_NOR) {
  2054. #if defined(CONFIG_CMD_FLASH)
  2055. @@ -828,7 +809,6 @@ static int device_validate(u8 type, u8 num, u32 *size)
  2056. return 1;
  2057. }
  2058.  
  2059. -#ifdef CONFIG_JFFS2_CMDLINE
  2060. /**
  2061. * Delete all mtd devices from a supplied devices list, free memory allocated for
  2062. * each device and delete all device partitions.
  2063. @@ -1130,7 +1110,6 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
  2064.  
  2065. return NULL;
  2066. }
  2067. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  2068.  
  2069. /**
  2070. * Parse device id string <dev-id> := 'nand'|'nor'|'onenand'<dev-num>,
  2071. @@ -1172,7 +1151,6 @@ int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
  2072. return 0;
  2073. }
  2074.  
  2075. -#ifdef CONFIG_JFFS2_CMDLINE
  2076. /**
  2077. * Process all devices and generate corresponding mtdparts string describing
  2078. * all partitions on all devices.
  2079. @@ -1771,194 +1749,6 @@ int mtdparts_init(void)
  2080.  
  2081. return 0;
  2082. }
  2083. -#else /* #ifdef CONFIG_JFFS2_CMDLINE */
  2084. -/*
  2085. - * 'Static' version of command line mtdparts_init() routine. Single partition on
  2086. - * a single device configuration.
  2087. - */
  2088. -
  2089. -/**
  2090. - * Calculate sector size.
  2091. - *
  2092. - * @return sector size
  2093. - */
  2094. -static inline u32 get_part_sector_size_nand(struct mtdids *id)
  2095. -{
  2096. -#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
  2097. -#if defined(CONFIG_NAND_LEGACY)
  2098. - extern struct nand_chip nand_dev_desc[CONFIG_SYS_MAX_NAND_DEVICE];
  2099. -
  2100. - return nand_dev_desc[id->num].erasesize;
  2101. -#else
  2102. - nand_info_t *nand;
  2103. -
  2104. - nand = &nand_info[id->num];
  2105. -
  2106. - return nand->erasesize;
  2107. -#endif
  2108. -#else
  2109. - BUG();
  2110. - return 0;
  2111. -#endif
  2112. -}
  2113. -
  2114. -static inline u32 get_part_sector_size_nor(struct mtdids *id, struct part_info *part)
  2115. -{
  2116. -#if defined(CONFIG_CMD_FLASH)
  2117. - extern flash_info_t flash_info[];
  2118. -
  2119. - u32 end_phys, start_phys, sector_size = 0, size = 0;
  2120. - int i;
  2121. - flash_info_t *flash;
  2122. -
  2123. - flash = &flash_info[id->num];
  2124. -
  2125. - start_phys = flash->start[0] + part->offset;
  2126. - end_phys = start_phys + part->size;
  2127. -
  2128. - for (i = 0; i < flash->sector_count; i++) {
  2129. - if (flash->start[i] >= end_phys)
  2130. - break;
  2131. -
  2132. - if (flash->start[i] >= start_phys) {
  2133. - if (i == flash->sector_count - 1) {
  2134. - size = flash->start[0] + flash->size - flash->start[i];
  2135. - } else {
  2136. - size = flash->start[i+1] - flash->start[i];
  2137. - }
  2138. -
  2139. - if (sector_size < size)
  2140. - sector_size = size;
  2141. - }
  2142. - }
  2143. -
  2144. - return sector_size;
  2145. -#else
  2146. - BUG();
  2147. - return 0;
  2148. -#endif
  2149. -}
  2150. -
  2151. -static inline u32 get_part_sector_size_onenand(void)
  2152. -{
  2153. -#if defined(CONFIG_CMD_ONENAND)
  2154. - struct mtd_info *mtd;
  2155. -
  2156. - mtd = &onenand_mtd;
  2157. -
  2158. - return mtd->erasesize;
  2159. -#else
  2160. - BUG();
  2161. - return 0;
  2162. -#endif
  2163. -}
  2164. -
  2165. -static inline u32 get_part_sector_size(struct mtdids *id, struct part_info *part)
  2166. -{
  2167. - if (id->type == MTD_DEV_TYPE_NAND)
  2168. - return get_part_sector_size_nand(id);
  2169. - else if (id->type == MTD_DEV_TYPE_NOR)
  2170. - return get_part_sector_size_nor(id, part);
  2171. - else if (id->type == MTD_DEV_TYPE_ONENAND)
  2172. - return get_part_sector_size_onenand();
  2173. - else
  2174. - DEBUGF("Error: Unknown device type.\n");
  2175. -
  2176. - return 0;
  2177. -}
  2178. -
  2179. -/**
  2180. - * Parse and initialize global mtdids mapping and create global
  2181. - * device/partition list.
  2182. - *
  2183. - * @return 0 on success, 1 otherwise
  2184. - */
  2185. -int mtdparts_init(void)
  2186. -{
  2187. - static int initialized = 0;
  2188. - u32 size;
  2189. - char *dev_name;
  2190. -
  2191. - DEBUGF("\n---mtdparts_init---\n");
  2192. - if (!initialized) {
  2193. - struct mtdids *id;
  2194. - struct part_info *part;
  2195. -
  2196. - initialized = 1;
  2197. - current_dev = (struct mtd_device *)
  2198. - malloc(sizeof(struct mtd_device) +
  2199. - sizeof(struct part_info) +
  2200. - sizeof(struct mtdids));
  2201. - if (!current_dev) {
  2202. - printf("out of memory\n");
  2203. - return 1;
  2204. - }
  2205. - memset(current_dev, 0, sizeof(struct mtd_device) +
  2206. - sizeof(struct part_info) + sizeof(struct mtdids));
  2207. -
  2208. - id = (struct mtdids *)(current_dev + 1);
  2209. - part = (struct part_info *)(id + 1);
  2210. -
  2211. - /* id */
  2212. - id->mtd_id = "single part";
  2213. -
  2214. -#if defined(CONFIG_JFFS2_DEV)
  2215. - dev_name = CONFIG_JFFS2_DEV;
  2216. -#else
  2217. - dev_name = "nor0";
  2218. -#endif
  2219. -
  2220. - if ((id_parse(dev_name, NULL, &id->type, &id->num) != 0) ||
  2221. - (device_validate(id->type, id->num, &size) != 0)) {
  2222. - printf("incorrect device: %s%d\n", MTD_DEV_TYPE(id->type), id->num);
  2223. - free(current_dev);
  2224. - return 1;
  2225. - }
  2226. - id->size = size;
  2227. - INIT_LIST_HEAD(&id->link);
  2228. -
  2229. - DEBUGF("dev id: type = %d, num = %d, size = 0x%08lx, mtd_id = %s\n",
  2230. - id->type, id->num, id->size, id->mtd_id);
  2231. -
  2232. - /* partition */
  2233. - part->name = "static";
  2234. - part->auto_name = 0;
  2235. -
  2236. -#if defined(CONFIG_JFFS2_PART_SIZE)
  2237. - part->size = CONFIG_JFFS2_PART_SIZE;
  2238. -#else
  2239. - part->size = SIZE_REMAINING;
  2240. -#endif
  2241. -
  2242. -#if defined(CONFIG_JFFS2_PART_OFFSET)
  2243. - part->offset = CONFIG_JFFS2_PART_OFFSET;
  2244. -#else
  2245. - part->offset = 0x00000000;
  2246. -#endif
  2247. -
  2248. - part->sector_size = get_part_sector_size(id, part);
  2249. -
  2250. - part->dev = current_dev;
  2251. - INIT_LIST_HEAD(&part->link);
  2252. -
  2253. - /* recalculate size if needed */
  2254. - if (part->size == SIZE_REMAINING)
  2255. - part->size = id->size - part->offset;
  2256. -
  2257. - DEBUGF("part : name = %s, size = 0x%08lx, offset = 0x%08lx\n",
  2258. - part->name, part->size, part->offset);
  2259. -
  2260. - /* device */
  2261. - current_dev->id = id;
  2262. - INIT_LIST_HEAD(&current_dev->link);
  2263. - current_dev->num_parts = 1;
  2264. - INIT_LIST_HEAD(&current_dev->parts);
  2265. - list_add(&part->link, &current_dev->parts);
  2266. - }
  2267. -
  2268. - return 0;
  2269. -}
  2270. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  2271.  
  2272. /**
  2273. * Return pointer to the partition of a requested number from a requested
  2274. @@ -2004,149 +1794,7 @@ static struct part_info* jffs2_part_info(struct mtd_device *dev, unsigned int pa
  2275. /***************************************************/
  2276. /* U-boot commands */
  2277. /***************************************************/
  2278. -
  2279. -/**
  2280. - * Routine implementing fsload u-boot command. This routine tries to load
  2281. - * a requested file from jffs2/cramfs filesystem on a current partition.
  2282. - *
  2283. - * @param cmdtp command internal data
  2284. - * @param flag command flag
  2285. - * @param argc number of arguments supplied to the command
  2286. - * @param argv arguments list
  2287. - * @return 0 on success, 1 otherwise
  2288. - */
  2289. -int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  2290. -{
  2291. - char *fsname;
  2292. - char *filename;
  2293. - int size;
  2294. - struct part_info *part;
  2295. - ulong offset = load_addr;
  2296. -
  2297. - /* pre-set Boot file name */
  2298. - if ((filename = getenv("bootfile")) == NULL) {
  2299. - filename = "uImage";
  2300. - }
  2301. -
  2302. - if (argc == 2) {
  2303. - filename = argv[1];
  2304. - }
  2305. - if (argc == 3) {
  2306. - offset = simple_strtoul(argv[1], NULL, 16);
  2307. - load_addr = offset;
  2308. - filename = argv[2];
  2309. - }
  2310. -
  2311. - /* make sure we are in sync with env variables */
  2312. - if (mtdparts_init() !=0)
  2313. - return 1;
  2314. -
  2315. - if ((part = jffs2_part_info(current_dev, current_partnum))){
  2316. -
  2317. - /* check partition type for cramfs */
  2318. - fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");
  2319. - printf("### %s loading '%s' to 0x%lx\n", fsname, filename, offset);
  2320. -
  2321. - if (cramfs_check(part)) {
  2322. - size = cramfs_load ((char *) offset, part, filename);
  2323. - } else {
  2324. - /* if this is not cramfs assume jffs2 */
  2325. - size = jffs2_1pass_load((char *)offset, part, filename);
  2326. - }
  2327. -
  2328. - if (size > 0) {
  2329. - char buf[10];
  2330. - printf("### %s load complete: %d bytes loaded to 0x%lx\n",
  2331. - fsname, size, offset);
  2332. - sprintf(buf, "%x", size);
  2333. - setenv("filesize", buf);
  2334. - } else {
  2335. - printf("### %s LOAD ERROR<%x> for %s!\n", fsname, size, filename);
  2336. - }
  2337. -
  2338. - return !(size > 0);
  2339. - }
  2340. - return 1;
  2341. -}
  2342. -
  2343. -/**
  2344. - * Routine implementing u-boot ls command which lists content of a given
  2345. - * directory on a current partition.
  2346. - *
  2347. - * @param cmdtp command internal data
  2348. - * @param flag command flag
  2349. - * @param argc number of arguments supplied to the command
  2350. - * @param argv arguments list
  2351. - * @return 0 on success, 1 otherwise
  2352. - */
  2353. -int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  2354. -{
  2355. - char *filename = "/";
  2356. - int ret;
  2357. - struct part_info *part;
  2358. -
  2359. - if (argc == 2)
  2360. - filename = argv[1];
  2361. -
  2362. - /* make sure we are in sync with env variables */
  2363. - if (mtdparts_init() !=0)
  2364. - return 1;
  2365. -
  2366. - if ((part = jffs2_part_info(current_dev, current_partnum))){
  2367. -
  2368. - /* check partition type for cramfs */
  2369. - if (cramfs_check(part)) {
  2370. - ret = cramfs_ls (part, filename);
  2371. - } else {
  2372. - /* if this is not cramfs assume jffs2 */
  2373. - ret = jffs2_1pass_ls(part, filename);
  2374. - }
  2375. -
  2376. - return ret ? 0 : 1;
  2377. - }
  2378. - return 1;
  2379. -}
  2380. -
  2381. -/**
  2382. - * Routine implementing u-boot fsinfo command. This routine prints out
  2383. - * miscellaneous filesystem informations/statistics.
  2384. - *
  2385. - * @param cmdtp command internal data
  2386. - * @param flag command flag
  2387. - * @param argc number of arguments supplied to the command
  2388. - * @param argv arguments list
  2389. - * @return 0 on success, 1 otherwise
  2390. - */
  2391. -int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  2392. -{
  2393. - struct part_info *part;
  2394. - char *fsname;
  2395. - int ret;
  2396. -
  2397. - /* make sure we are in sync with env variables */
  2398. - if (mtdparts_init() !=0)
  2399. - return 1;
  2400. -
  2401. - if ((part = jffs2_part_info(current_dev, current_partnum))){
  2402. -
  2403. - /* check partition type for cramfs */
  2404. - fsname = (cramfs_check(part) ? "CRAMFS" : "JFFS2");
  2405. - printf("### filesystem type is %s\n", fsname);
  2406. -
  2407. - if (cramfs_check(part)) {
  2408. - ret = cramfs_info (part);
  2409. - } else {
  2410. - /* if this is not cramfs assume jffs2 */
  2411. - ret = jffs2_1pass_info(part);
  2412. - }
  2413. -
  2414. - return ret ? 0 : 1;
  2415. - }
  2416. - return 1;
  2417. -}
  2418. -
  2419. /* command line only */
  2420. -#ifdef CONFIG_JFFS2_CMDLINE
  2421. /**
  2422. * Routine implementing u-boot chpart command. Sets new current partition based
  2423. * on the user supplied partition id. For partition id format see find_dev_and_part().
  2424. @@ -2292,31 +1940,9 @@ int do_jffs2_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  2425. cmd_usage(cmdtp);
  2426. return 1;
  2427. }
  2428. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  2429.  
  2430. /***************************************************/
  2431. U_BOOT_CMD(
  2432. - fsload, 3, 0, do_jffs2_fsload,
  2433. - "load binary file from a filesystem image",
  2434. - "[ off ] [ filename ]\n"
  2435. - " - load binary file from flash bank\n"
  2436. - " with offset 'off'\n"
  2437. -);
  2438. -U_BOOT_CMD(
  2439. - ls, 2, 1, do_jffs2_ls,
  2440. - "list files in a directory (default /)",
  2441. - "[ directory ]\n"
  2442. - " - list files in a directory.\n"
  2443. -);
  2444. -
  2445. -U_BOOT_CMD(
  2446. - fsinfo, 1, 1, do_jffs2_fsinfo,
  2447. - "print information about filesystems",
  2448. - " - print information about filesystems\n"
  2449. -);
  2450. -
  2451. -#ifdef CONFIG_JFFS2_CMDLINE
  2452. -U_BOOT_CMD(
  2453. chpart, 2, 0, do_jffs2_chpart,
  2454. "change active partition",
  2455. "part-id\n"
  2456. @@ -2357,6 +1983,4 @@ U_BOOT_CMD(
  2457. "<name> := '(' NAME ')'\n"
  2458. "<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)\n"
  2459. );
  2460. -#endif /* #ifdef CONFIG_JFFS2_CMDLINE */
  2461. -
  2462. /***************************************************/
  2463. diff --git a/common/cmd_nand.c b/common/cmd_nand.c
  2464. index 11f9096..92cc940 100644
  2465. --- a/common/cmd_nand.c
  2466. +++ b/common/cmd_nand.c
  2467. @@ -29,7 +29,7 @@
  2468. #include <jffs2/jffs2.h>
  2469. #include <nand.h>
  2470.  
  2471. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  2472. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  2473.  
  2474. /* parition handling routines */
  2475. int mtdparts_init(void);
  2476. @@ -105,7 +105,7 @@ static int
  2477. arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size)
  2478. {
  2479. int idx = nand_curr_device;
  2480. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  2481. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  2482. struct mtd_device *dev;
  2483. struct part_info *part;
  2484. u8 pnum;
  2485. @@ -153,7 +153,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size
  2486. *size = nand->size - *off;
  2487. }
  2488.  
  2489. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  2490. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  2491. out:
  2492. #endif
  2493. printf("device %d ", idx);
  2494. @@ -590,7 +590,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
  2495. char *boot_device = NULL;
  2496. int idx;
  2497. ulong addr, offset = 0;
  2498. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  2499. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  2500. struct mtd_device *dev;
  2501. struct part_info *part;
  2502. u8 pnum;
  2503. @@ -635,7 +635,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
  2504. offset = simple_strtoul(argv[3], NULL, 16);
  2505. break;
  2506. default:
  2507. -#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
  2508. +#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
  2509. usage:
  2510. #endif
  2511. cmd_usage(cmdtp);
  2512. diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
  2513. index 205dd1f..4c6a4b1 100644
  2514. --- a/include/config_cmd_all.h
  2515. +++ b/include/config_cmd_all.h
  2516. @@ -62,6 +62,7 @@
  2517. #define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
  2518. #define CONFIG_CMD_NFS /* NFS support */
  2519. #define CONFIG_CMD_ONENAND /* OneNAND support */
  2520. +#define CONFIG_CMD_MTDPARTS /* mtd parts support */
  2521. #define CONFIG_CMD_PCI /* pciinfo */
  2522. #define CONFIG_CMD_PCMCIA /* PCMCIA support */
  2523. #define CONFIG_CMD_PING /* ping support */
  2524. diff --git a/include/configs/ADNPESC1.h b/include/configs/ADNPESC1.h
  2525. index e61a3e1..0977bee 100644
  2526. --- a/include/configs/ADNPESC1.h
  2527. +++ b/include/configs/ADNPESC1.h
  2528. @@ -673,14 +673,14 @@
  2529. *
  2530. */
  2531. /* No command line, one static partition */
  2532. -#undef CONFIG_JFFS2_CMDLINE
  2533. +#undef CONFIG_CMD_MTDPARTS
  2534. #define CONFIG_JFFS2_DEV "nor"
  2535. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2536. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2537.  
  2538. /* mtdparts command line support */
  2539. /*
  2540. -#define CONFIG_JFFS2_CMDLINE
  2541. +#define CONFIG_CMD_MTDPARTS
  2542. #define MTDIDS_DEFAULT ""
  2543. #define MTDPARTS_DEFAULT ""
  2544. */
  2545. diff --git a/include/configs/Alaska8220.h b/include/configs/Alaska8220.h
  2546. index 2581fdf..576aa74 100644
  2547. --- a/include/configs/Alaska8220.h
  2548. +++ b/include/configs/Alaska8220.h
  2549. @@ -320,7 +320,7 @@
  2550.  
  2551. /* No command line, one static partition */
  2552. /*
  2553. -#undef CONFIG_JFFS2_CMDLINE
  2554. +#undef CONFIG_CMD_MTDPARTS
  2555. #define CONFIG_JFFS2_DEV "nor0"
  2556. #define CONFIG_JFFS2_PART_SIZE 0x00400000
  2557. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2558. @@ -328,7 +328,7 @@
  2559.  
  2560. /* mtdparts command line support */
  2561. /*
  2562. -#define CONFIG_JFFS2_CMDLINE
  2563. +#define CONFIG_CMD_MTDPARTS
  2564. #define MTDIDS_DEFAULT "nor0=alaska-0"
  2565. #define MTDPARTS_DEFAULT "mtdparts=alaska-0:4m(user)"
  2566. */
  2567. diff --git a/include/configs/BAB7xx.h b/include/configs/BAB7xx.h
  2568. index 1910b34..40a1c40 100644
  2569. --- a/include/configs/BAB7xx.h
  2570. +++ b/include/configs/BAB7xx.h
  2571. @@ -219,7 +219,7 @@
  2572. *
  2573. */
  2574. /* No command line, one static partition */
  2575. -#undef CONFIG_JFFS2_CMDLINE
  2576. +#undef CONFIG_CMD_MTDPARTS
  2577. #define CONFIG_JFFS2_DEV "nor"
  2578. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2579. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2580. @@ -229,7 +229,7 @@
  2581. * Note: fake mtd_id used, no linux mtd map file
  2582. */
  2583. /*
  2584. -#define CONFIG_JFFS2_CMDLINE
  2585. +#define CONFIG_CMD_MTDPARTS
  2586. #define MTDIDS_DEFAULT "nor0=bab7xx-0"
  2587. #define MTDPARTS_DEFAULT "mtdparts=bab7xx-0:-(jffs2)"
  2588. */
  2589. diff --git a/include/configs/BC3450.h b/include/configs/BC3450.h
  2590. index bced118..9934f29 100644
  2591. --- a/include/configs/BC3450.h
  2592. +++ b/include/configs/BC3450.h
  2593. @@ -346,7 +346,7 @@
  2594. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  2595.  
  2596. /* Dynamic MTD partition support */
  2597. -#define CONFIG_JFFS2_CMDLINE
  2598. +#define CONFIG_CMD_MTDPARTS
  2599. #define MTDIDS_DEFAULT "nor0=TQM5200-0"
  2600. #define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:640k(firmware)," \
  2601. "1408k(kernel)," \
  2602. diff --git a/include/configs/CATcenter.h b/include/configs/CATcenter.h
  2603. index fa9fc23..39f41e6 100644
  2604. --- a/include/configs/CATcenter.h
  2605. +++ b/include/configs/CATcenter.h
  2606. @@ -781,7 +781,7 @@
  2607. *
  2608. */
  2609. /* No command line, one static partition */
  2610. -#undef CONFIG_JFFS2_CMDLINE
  2611. +#undef CONFIG_CMD_MTDPARTS
  2612. #define CONFIG_JFFS2_DEV "nand"
  2613. #define CONFIG_JFFS2_PART_SIZE 0x00200000
  2614. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2615. @@ -791,7 +791,7 @@
  2616. * Note: fake mtd_id used, no linux mtd map file
  2617. */
  2618. /*
  2619. -#define CONFIG_JFFS2_CMDLINE
  2620. +#define CONFIG_CMD_MTDPARTS
  2621. #define MTDIDS_DEFAULT "nand0=catcenter"
  2622. #define MTDPARTS_DEFAULT "mtdparts=catcenter:2m(nand)"
  2623. */
  2624. diff --git a/include/configs/DB64360.h b/include/configs/DB64360.h
  2625. index daed934..160871b 100644
  2626. --- a/include/configs/DB64360.h
  2627. +++ b/include/configs/DB64360.h
  2628. @@ -230,7 +230,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  2629. *
  2630. */
  2631. /* No command line, one static partition, whole device */
  2632. -#undef CONFIG_JFFS2_CMDLINE
  2633. +#undef CONFIG_CMD_MTDPARTS
  2634. #define CONFIG_JFFS2_DEV "nor1"
  2635. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2636. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2637. @@ -242,7 +242,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  2638. * Note: fake mtd_id's used, no linux mtd map file.
  2639. */
  2640. /*
  2641. -#define CONFIG_JFFS2_CMDLINE
  2642. +#define CONFIG_CMD_MTDPARTS
  2643. #define MTDIDS_DEFAULT "nor1=db64360-1"
  2644. #define MTDPARTS_DEFAULT "mtdparts=db64360-1:-(jffs2)"
  2645. */
  2646. diff --git a/include/configs/DB64460.h b/include/configs/DB64460.h
  2647. index 604fd45..06fd157 100644
  2648. --- a/include/configs/DB64460.h
  2649. +++ b/include/configs/DB64460.h
  2650. @@ -168,7 +168,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  2651. *
  2652. */
  2653. /* No command line, one static partition, whole device */
  2654. -#undef CONFIG_JFFS2_CMDLINE
  2655. +#undef CONFIG_CMD_MTDPARTS
  2656. #define CONFIG_JFFS2_DEV "nor1"
  2657. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2658. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2659. @@ -180,7 +180,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  2660. * Note: fake mtd_id's used, no linux mtd map file.
  2661. */
  2662. /*
  2663. -#define CONFIG_JFFS2_CMDLINE
  2664. +#define CONFIG_CMD_MTDPARTS
  2665. #define MTDIDS_DEFAULT "nor1=db64460-1"
  2666. #define MTDPARTS_DEFAULT "mtdparts=db64460-1:-(jffs2)"
  2667. */
  2668. diff --git a/include/configs/DK1C20.h b/include/configs/DK1C20.h
  2669. index 6fdc566..db9c17d 100644
  2670. --- a/include/configs/DK1C20.h
  2671. +++ b/include/configs/DK1C20.h
  2672. @@ -539,14 +539,14 @@
  2673. *
  2674. */
  2675. /* No command line, one static partition, whole device */
  2676. -#undef CONFIG_JFFS2_CMDLINE
  2677. +#undef CONFIG_CMD_MTDPARTS
  2678. #define CONFIG_JFFS2_DEV "nor0"
  2679. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2680. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2681.  
  2682. /* mtdparts command line support */
  2683. /*
  2684. -#define CONFIG_JFFS2_CMDLINE
  2685. +#define CONFIG_CMD_MTDPARTS
  2686. #define MTDIDS_DEFAULT ""
  2687. #define MTDPARTS_DEFAULT ""
  2688. */
  2689. diff --git a/include/configs/DK1S10.h b/include/configs/DK1S10.h
  2690. index 1d031f1..3bd270c 100644
  2691. --- a/include/configs/DK1S10.h
  2692. +++ b/include/configs/DK1S10.h
  2693. @@ -545,14 +545,14 @@
  2694. *
  2695. */
  2696. /* No command line, one static partition, whole device */
  2697. -#undef CONFIG_JFFS2_CMDLINE
  2698. +#undef CONFIG_CMD_MTDPARTS
  2699. #define CONFIG_JFFS2_DEV "nor0"
  2700. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2701. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2702.  
  2703. /* mtdparts command line support */
  2704. /*
  2705. -#define CONFIG_JFFS2_CMDLINE
  2706. +#define CONFIG_CMD_MTDPARTS
  2707. #define MTDIDS_DEFAULT ""
  2708. #define MTDPARTS_DEFAULT ""
  2709. */
  2710. diff --git a/include/configs/ELPPC.h b/include/configs/ELPPC.h
  2711. index 7939266..d2aa8b9 100644
  2712. --- a/include/configs/ELPPC.h
  2713. +++ b/include/configs/ELPPC.h
  2714. @@ -196,7 +196,7 @@
  2715. *
  2716. */
  2717. /* No command line, one static partition, whole device */
  2718. -#undef CONFIG_JFFS2_CMDLINE
  2719. +#undef CONFIG_CMD_MTDPARTS
  2720. #define CONFIG_JFFS2_DEV "nor0"
  2721. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2722. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2723. @@ -204,7 +204,7 @@
  2724. /* mtdparts command line support */
  2725. /* Note: fake mtd_id used, no linux mtd map file */
  2726. /*
  2727. -#define CONFIG_JFFS2_CMDLINE
  2728. +#define CONFIG_CMD_MTDPARTS
  2729. #define MTDIDS_DEFAULT "nor0=elppc-0,nor1=elppc-1"
  2730. #define MTDPARTS_DEFAULT "mtdparts=elppc-0:-(jffs2),elppc-1:-(user)"
  2731. */
  2732. diff --git a/include/configs/FPS850L.h b/include/configs/FPS850L.h
  2733. index 08408e2..f152230 100644
  2734. --- a/include/configs/FPS850L.h
  2735. +++ b/include/configs/FPS850L.h
  2736. @@ -216,7 +216,7 @@
  2737. /*-----------------------------------------------------------------------
  2738. * Dynamic MTD partition support
  2739. */
  2740. -#define CONFIG_JFFS2_CMDLINE
  2741. +#define CONFIG_CMD_MTDPARTS
  2742. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  2743.  
  2744. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  2745. diff --git a/include/configs/FPS860L.h b/include/configs/FPS860L.h
  2746. index e5f3b60..5eaed84 100644
  2747. --- a/include/configs/FPS860L.h
  2748. +++ b/include/configs/FPS860L.h
  2749. @@ -216,7 +216,7 @@
  2750. /*-----------------------------------------------------------------------
  2751. * Dynamic MTD partition support
  2752. */
  2753. -#define CONFIG_JFFS2_CMDLINE
  2754. +#define CONFIG_CMD_MTDPARTS
  2755. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  2756.  
  2757. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  2758. diff --git a/include/configs/LANTEC.h b/include/configs/LANTEC.h
  2759. index f14d945..6e8a4b8 100644
  2760. --- a/include/configs/LANTEC.h
  2761. +++ b/include/configs/LANTEC.h
  2762. @@ -352,14 +352,14 @@
  2763. *
  2764. */
  2765. /* No command line, one static partition, whole device */
  2766. -#undef CONFIG_JFFS2_CMDLINE
  2767. +#undef CONFIG_CMD_MTDPARTS
  2768. #define CONFIG_JFFS2_DEV "nor0"
  2769. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2770. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2771.  
  2772. /* mtdparts command line support */
  2773. /*
  2774. -#define CONFIG_JFFS2_CMDLINE
  2775. +#define CONFIG_CMD_MTDPARTS
  2776. #define MTDIDS_DEFAULT ""
  2777. #define MTDPARTS_DEFAULT ""
  2778. */
  2779. diff --git a/include/configs/MHPC.h b/include/configs/MHPC.h
  2780. index 8e7f9cd..19a288c 100644
  2781. --- a/include/configs/MHPC.h
  2782. +++ b/include/configs/MHPC.h
  2783. @@ -200,7 +200,7 @@
  2784. *
  2785. */
  2786. /* No command line, one static partition, whole device */
  2787. -#undef CONFIG_JFFS2_CMDLINE
  2788. +#undef CONFIG_CMD_MTDPARTS
  2789. #define CONFIG_JFFS2_DEV "nor0"
  2790. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2791. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2792. @@ -208,7 +208,7 @@
  2793. /* mtdparts command line support */
  2794. /* Note: fake mtd_id used, no linux mtd map file */
  2795. /*
  2796. -#define CONFIG_JFFS2_CMDLINE
  2797. +#define CONFIG_CMD_MTDPARTS
  2798. #define MTDIDS_DEFAULT "nor0=mhpc-0"
  2799. #define MTDPARTS_DEFAULT "mtdparts=mhpc-0:-(jffs2)"
  2800. */
  2801. diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h
  2802. index c58ce05..a3869c8 100644
  2803. --- a/include/configs/MIP405.h
  2804. +++ b/include/configs/MIP405.h
  2805. @@ -243,7 +243,7 @@
  2806. *
  2807. */
  2808. /* No command line, one static partition, whole device */
  2809. -#undef CONFIG_JFFS2_CMDLINE
  2810. +#undef CONFIG_CMD_MTDPARTS
  2811. #define CONFIG_JFFS2_DEV "nor0"
  2812. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2813. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2814. @@ -251,7 +251,7 @@
  2815. /* mtdparts command line support */
  2816. /* Note: fake mtd_id used, no linux mtd map file */
  2817. /*
  2818. -#define CONFIG_JFFS2_CMDLINE
  2819. +#define CONFIG_CMD_MTDPARTS
  2820. #define MTDIDS_DEFAULT "nor0=mip405-0"
  2821. #define MTDPARTS_DEFAULT "mtdparts=mip405-0:-(jffs2)"
  2822. */
  2823. diff --git a/include/configs/ML2.h b/include/configs/ML2.h
  2824. index 1902397..5fcc173 100644
  2825. --- a/include/configs/ML2.h
  2826. +++ b/include/configs/ML2.h
  2827. @@ -249,7 +249,7 @@
  2828. *
  2829. */
  2830. /* No command line, one static partition, whole device */
  2831. -#undef CONFIG_JFFS2_CMDLINE
  2832. +#undef CONFIG_CMD_MTDPARTS
  2833. #define CONFIG_JFFS2_DEV "nor0"
  2834. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2835. #define CONFIG_JFFS2_PART_OFFSET 0x00080000
  2836. @@ -257,7 +257,7 @@
  2837. /* mtdparts command line support */
  2838. /* Note: fake mtd_id used, no linux mtd map file */
  2839. /*
  2840. -#define CONFIG_JFFS2_CMDLINE
  2841. +#define CONFIG_CMD_MTDPARTS
  2842. #define MTDIDS_DEFAULT "nor0=ml2-0"
  2843. #define MTDPARTS_DEFAULT "mtdparts=ml2-0:-@512k(jffs2)"
  2844. */
  2845. diff --git a/include/configs/MPC8266ADS.h b/include/configs/MPC8266ADS.h
  2846. index fe1cc17..4fd86d3 100644
  2847. --- a/include/configs/MPC8266ADS.h
  2848. +++ b/include/configs/MPC8266ADS.h
  2849. @@ -563,14 +563,14 @@
  2850. *
  2851. */
  2852. /* No command line, one static partition, whole device */
  2853. -#undef CONFIG_JFFS2_CMDLINE
  2854. +#undef CONFIG_CMD_MTDPARTS
  2855. #define CONFIG_JFFS2_DEV "nor0"
  2856. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2857. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2858.  
  2859. /* mtdparts command line support */
  2860. /*
  2861. -#define CONFIG_JFFS2_CMDLINE
  2862. +#define CONFIG_CMD_MTDPARTS
  2863. #define MTDIDS_DEFAULT ""
  2864. #define MTDPARTS_DEFAULT ""
  2865. */
  2866. diff --git a/include/configs/NC650.h b/include/configs/NC650.h
  2867. index 0b97f0c..6343cfe 100644
  2868. --- a/include/configs/NC650.h
  2869. +++ b/include/configs/NC650.h
  2870. @@ -440,13 +440,13 @@
  2871. */
  2872.  
  2873. /* No command line, one static partition */
  2874. -#undef CONFIG_JFFS2_CMDLINE
  2875. +#undef CONFIG_CMD_MTDPARTS
  2876. #define CONFIG_JFFS2_DEV "nand0"
  2877. #define CONFIG_JFFS2_PART_SIZE 0x00400000
  2878. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2879.  
  2880. /* mtdparts command line support */
  2881. -#define CONFIG_JFFS2_CMDLINE
  2882. +#define CONFIG_CMD_MTDPARTS
  2883. #define MTDIDS_DEFAULT "nor0=nc650-0,nand0=nc650-nand"
  2884.  
  2885. #define MTDPARTS_DEFAULT "mtdparts=nc650-0:1m(kernel1),1m(kernel2)," \
  2886. diff --git a/include/configs/NETTA.h b/include/configs/NETTA.h
  2887. index 34fdba5..724e807 100644
  2888. --- a/include/configs/NETTA.h
  2889. +++ b/include/configs/NETTA.h
  2890. @@ -702,7 +702,7 @@
  2891. *
  2892. */
  2893. /* No command line, one static partition, whole device */
  2894. -#undef CONFIG_JFFS2_CMDLINE
  2895. +#undef CONFIG_CMD_MTDPARTS
  2896. #define CONFIG_JFFS2_DEV "nand0"
  2897. #define CONFIG_JFFS2_PART_SIZE 0x00100000
  2898. #define CONFIG_JFFS2_PART_OFFSET 0x00200000
  2899. @@ -710,7 +710,7 @@
  2900. /* mtdparts command line support */
  2901. /* Note: fake mtd_id used, no linux mtd map file */
  2902. /*
  2903. -#define CONFIG_JFFS2_CMDLINE
  2904. +#define CONFIG_CMD_MTDPARTS
  2905. #define MTDIDS_DEFAULT "nand0=netta-nand"
  2906. #define MTDPARTS_DEFAULT "mtdparts=netta-nand:1m@2m(jffs2)"
  2907. */
  2908. diff --git a/include/configs/PPChameleonEVB.h b/include/configs/PPChameleonEVB.h
  2909. index d2eae1d..16baf8c 100644
  2910. --- a/include/configs/PPChameleonEVB.h
  2911. +++ b/include/configs/PPChameleonEVB.h
  2912. @@ -804,14 +804,14 @@
  2913. */
  2914.  
  2915. /* No command line, one static partition */
  2916. -#undef CONFIG_JFFS2_CMDLINE
  2917. +#undef CONFIG_CMD_MTDPARTS
  2918. #define CONFIG_JFFS2_DEV "nand0"
  2919. #define CONFIG_JFFS2_PART_SIZE 0x00400000
  2920. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2921.  
  2922. /* mtdparts command line support */
  2923. /*
  2924. -#define CONFIG_JFFS2_CMDLINE
  2925. +#define CONFIG_CMD_MTDPARTS
  2926. #define MTDIDS_DEFAULT "nor0=PPChameleon-0,nand0=ppchameleonevb-nand"
  2927. */
  2928.  
  2929. diff --git a/include/configs/R360MPI.h b/include/configs/R360MPI.h
  2930. index bab4460..830f4bc 100644
  2931. --- a/include/configs/R360MPI.h
  2932. +++ b/include/configs/R360MPI.h
  2933. @@ -167,14 +167,14 @@
  2934. */
  2935. /* No command line, one static partition
  2936. * use all the space starting at offset 3MB*/
  2937. -#undef CONFIG_JFFS2_CMDLINE
  2938. +#undef CONFIG_CMD_MTDPARTS
  2939. #define CONFIG_JFFS2_DEV "nor0"
  2940. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2941. #define CONFIG_JFFS2_PART_OFFSET 0x00300000
  2942.  
  2943. /* mtdparts command line support */
  2944. /*
  2945. -#define CONFIG_JFFS2_CMDLINE
  2946. +#define CONFIG_CMD_MTDPARTS
  2947. #define MTDIDS_DEFAULT "nor0=r360-0"
  2948. #define MTDPARTS_DEFAULT "mtdparts=r360-0:-@3m(user)"
  2949. */
  2950. diff --git a/include/configs/RBC823.h b/include/configs/RBC823.h
  2951. index 280175a..f36244d 100644
  2952. --- a/include/configs/RBC823.h
  2953. +++ b/include/configs/RBC823.h
  2954. @@ -429,7 +429,7 @@
  2955. *
  2956. */
  2957. /* No command line, one static partition, whole device */
  2958. -#undef CONFIG_JFFS2_CMDLINE
  2959. +#undef CONFIG_CMD_MTDPARTS
  2960. #define CONFIG_JFFS2_DEV "nor0"
  2961. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2962. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  2963. @@ -437,7 +437,7 @@
  2964. /* mtdparts command line support */
  2965. /* Note: fake mtd_id used, no linux mtd map file */
  2966. /*
  2967. -#define CONFIG_JFFS2_CMDLINE
  2968. +#define CONFIG_CMD_MTDPARTS
  2969. #define MTDIDS_DEFAULT ""
  2970. #define MTDPARTS_DEFAULT ""
  2971. */
  2972. diff --git a/include/configs/Rattler.h b/include/configs/Rattler.h
  2973. index 01d0d5f..5b6f271 100644
  2974. --- a/include/configs/Rattler.h
  2975. +++ b/include/configs/Rattler.h
  2976. @@ -202,7 +202,7 @@
  2977. *
  2978. */
  2979. /* No command line, one static partition */
  2980. -#undef CONFIG_JFFS2_CMDLINE
  2981. +#undef CONFIG_CMD_MTDPARTS
  2982. #define CONFIG_JFFS2_DEV "nor0"
  2983. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  2984. #define CONFIG_JFFS2_PART_OFFSET 0x00100000
  2985. @@ -210,7 +210,7 @@
  2986. /* mtdparts command line support */
  2987. /* Note: fake mtd_id used, no linux mtd map file */
  2988. /*
  2989. -#define CONFIG_JFFS2_CMDLINE
  2990. +#define CONFIG_CMD_MTDPARTS
  2991. #define MTDIDS_DEFAULT "nor0=rattler-0"
  2992. #define MTDPARTS_DEFAULT "mtdparts=rattler-0:-@1m(jffs2)"
  2993. */
  2994. diff --git a/include/configs/SIMPC8313.h b/include/configs/SIMPC8313.h
  2995. index b939cfa..e20527e 100644
  2996. --- a/include/configs/SIMPC8313.h
  2997. +++ b/include/configs/SIMPC8313.h
  2998. @@ -189,7 +189,7 @@
  2999. #define CONFIG_JFFS2_DEV "nand0"
  3000.  
  3001. /* mtdparts command line support */
  3002. -#define CONFIG_JFFS2_CMDLINE
  3003. +#define CONFIG_CMD_MTDPARTS
  3004. #define MTDIDS_DEFAULT "nand0=nand0"
  3005. #define MTDPARTS_DEFAULT "mtdparts=nand0:2M(u-boot),6M(kernel),-(jffs2)"
  3006.  
  3007. diff --git a/include/configs/SXNI855T.h b/include/configs/SXNI855T.h
  3008. index 9857bf6..cac04b4 100644
  3009. --- a/include/configs/SXNI855T.h
  3010. +++ b/include/configs/SXNI855T.h
  3011. @@ -174,7 +174,7 @@
  3012. *
  3013. */
  3014. /* No command line, one static partition */
  3015. -#undef CONFIG_JFFS2_CMDLINE
  3016. +#undef CONFIG_CMD_MTDPARTS
  3017.  
  3018. /*
  3019. #define CONFIG_JFFS2_DEV "nor0"
  3020. @@ -189,7 +189,7 @@
  3021. /* mtdparts command line support */
  3022. /* Note: fake mtd_id used, no linux mtd map file */
  3023. /*
  3024. -#define CONFIG_JFFS2_CMDLINE
  3025. +#define CONFIG_CMD_MTDPARTS
  3026. #define MTDIDS_DEFAULT "nor0=sixnet-0,nand0=sixnet-nand"
  3027. #define MTDPARTS_DEFAULT "mtdparts=sixnet-0:7680k@512k();sixnet-nand:2m(jffs2-nand)"
  3028. */
  3029. diff --git a/include/configs/TB5200.h b/include/configs/TB5200.h
  3030. index b42d3d9..92b4fa5 100644
  3031. --- a/include/configs/TB5200.h
  3032. +++ b/include/configs/TB5200.h
  3033. @@ -275,7 +275,7 @@
  3034. (= chip selects) */
  3035.  
  3036. /* Dynamic MTD partition support */
  3037. -#define CONFIG_JFFS2_CMDLINE
  3038. +#define CONFIG_CMD_MTDPARTS
  3039. #define MTDIDS_DEFAULT "nor0=TQM5200-0"
  3040. #if defined(CONFIG_TQM5200_B)
  3041. #define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:768k(firmware)," \
  3042. diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h
  3043. index 6850eba..d374981 100644
  3044. --- a/include/configs/TQM5200.h
  3045. +++ b/include/configs/TQM5200.h
  3046. @@ -407,7 +407,7 @@
  3047. #endif
  3048.  
  3049. /* Dynamic MTD partition support */
  3050. -#define CONFIG_JFFS2_CMDLINE
  3051. +#define CONFIG_CMD_MTDPARTS
  3052. #define MTDIDS_DEFAULT "nor0=TQM5200-0"
  3053.  
  3054. #ifdef CONFIG_STK52XX
  3055. diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h
  3056. index 8934d51..87e5a65 100644
  3057. --- a/include/configs/TQM823L.h
  3058. +++ b/include/configs/TQM823L.h
  3059. @@ -231,7 +231,7 @@
  3060. /*-----------------------------------------------------------------------
  3061. * Dynamic MTD partition support
  3062. */
  3063. -#define CONFIG_JFFS2_CMDLINE
  3064. +#define CONFIG_CMD_MTDPARTS
  3065. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  3066.  
  3067. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  3068. diff --git a/include/configs/TQM823M.h b/include/configs/TQM823M.h
  3069. index fd41573..f666443 100644
  3070. --- a/include/configs/TQM823M.h
  3071. +++ b/include/configs/TQM823M.h
  3072. @@ -227,7 +227,7 @@
  3073. /*-----------------------------------------------------------------------
  3074. * Dynamic MTD partition support
  3075. */
  3076. -#define CONFIG_JFFS2_CMDLINE
  3077. +#define CONFIG_CMD_MTDPARTS
  3078. #define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
  3079.  
  3080. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
  3081. diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h
  3082. index e126dc3..b74b404 100644
  3083. --- a/include/configs/TQM834x.h
  3084. +++ b/include/configs/TQM834x.h
  3085. @@ -537,7 +537,7 @@ extern int tqm834x_num_flash_banks;
  3086. * JFFS2 partitions
  3087. */
  3088. /* mtdparts command line support */
  3089. -#define CONFIG_JFFS2_CMDLINE
  3090. +#define CONFIG_CMD_MTDPARTS
  3091. #define MTDIDS_DEFAULT "nor0=TQM834x-0"
  3092.  
  3093. /* default mtd partition table */
  3094. diff --git a/include/configs/TQM850L.h b/include/configs/TQM850L.h
  3095. index 77eb5a9..dc80b47 100644
  3096. --- a/include/configs/TQM850L.h
  3097. +++ b/include/configs/TQM850L.h
  3098. @@ -216,7 +216,7 @@
  3099. /*-----------------------------------------------------------------------
  3100. * Dynamic MTD partition support
  3101. */
  3102. -#define CONFIG_JFFS2_CMDLINE
  3103. +#define CONFIG_CMD_MTDPARTS
  3104. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  3105.  
  3106. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  3107. diff --git a/include/configs/TQM850M.h b/include/configs/TQM850M.h
  3108. index bb8825b..2289443 100644
  3109. --- a/include/configs/TQM850M.h
  3110. +++ b/include/configs/TQM850M.h
  3111. @@ -216,7 +216,7 @@
  3112. /*-----------------------------------------------------------------------
  3113. * Dynamic MTD partition support
  3114. */
  3115. -#define CONFIG_JFFS2_CMDLINE
  3116. +#define CONFIG_CMD_MTDPARTS
  3117. #define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
  3118.  
  3119. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
  3120. diff --git a/include/configs/TQM855L.h b/include/configs/TQM855L.h
  3121. index 2ccbaf8..999bdaa 100644
  3122. --- a/include/configs/TQM855L.h
  3123. +++ b/include/configs/TQM855L.h
  3124. @@ -221,7 +221,7 @@
  3125. /*-----------------------------------------------------------------------
  3126. * Dynamic MTD partition support
  3127. */
  3128. -#define CONFIG_JFFS2_CMDLINE
  3129. +#define CONFIG_CMD_MTDPARTS
  3130. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  3131.  
  3132. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  3133. diff --git a/include/configs/TQM855M.h b/include/configs/TQM855M.h
  3134. index 8a65183..b54967d 100644
  3135. --- a/include/configs/TQM855M.h
  3136. +++ b/include/configs/TQM855M.h
  3137. @@ -256,7 +256,7 @@
  3138. /*-----------------------------------------------------------------------
  3139. * Dynamic MTD partition support
  3140. */
  3141. -#define CONFIG_JFFS2_CMDLINE
  3142. +#define CONFIG_CMD_MTDPARTS
  3143. #define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
  3144.  
  3145. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
  3146. diff --git a/include/configs/TQM85xx.h b/include/configs/TQM85xx.h
  3147. index 3b2272c..72db26c 100644
  3148. --- a/include/configs/TQM85xx.h
  3149. +++ b/include/configs/TQM85xx.h
  3150. @@ -597,14 +597,14 @@
  3151.  
  3152. #define CONFIG_JFFS2_NAND 1
  3153.  
  3154. -#ifdef CONFIG_JFFS2_CMDLINE
  3155. +#ifdef CONFIG_CMD_MTDPARTS
  3156. #define MTDIDS_DEFAULT "nand0=TQM85xx-nand"
  3157. #define MTDPARTS_DEFAULT "mtdparts=TQM85xx-nand:-"
  3158. #else
  3159. #define CONFIG_JFFS2_DEV "nand0" /* NAND device jffs2 lives on */
  3160. #define CONFIG_JFFS2_PART_OFFSET 0 /* start of jffs2 partition */
  3161. #define CONFIG_JFFS2_PART_SIZE 0x200000 /* size of jffs2 partition */
  3162. -#endif /* CONFIG_JFFS2_CMDLINE */
  3163. +#endif /* CONFIG_CMD_MTDPARTS */
  3164.  
  3165. #endif /* CONFIG_NAND */
  3166.  
  3167. diff --git a/include/configs/TQM860L.h b/include/configs/TQM860L.h
  3168. index 8bd1fe0..2e2a165 100644
  3169. --- a/include/configs/TQM860L.h
  3170. +++ b/include/configs/TQM860L.h
  3171. @@ -220,7 +220,7 @@
  3172. /*-----------------------------------------------------------------------
  3173. * Dynamic MTD partition support
  3174. */
  3175. -#define CONFIG_JFFS2_CMDLINE
  3176. +#define CONFIG_CMD_MTDPARTS
  3177. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  3178.  
  3179. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  3180. diff --git a/include/configs/TQM860M.h b/include/configs/TQM860M.h
  3181. index ad2c71c..1148f2e 100644
  3182. --- a/include/configs/TQM860M.h
  3183. +++ b/include/configs/TQM860M.h
  3184. @@ -221,7 +221,7 @@
  3185. /*-----------------------------------------------------------------------
  3186. * Dynamic MTD partition support
  3187. */
  3188. -#define CONFIG_JFFS2_CMDLINE
  3189. +#define CONFIG_CMD_MTDPARTS
  3190. #define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
  3191.  
  3192. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
  3193. diff --git a/include/configs/TQM862L.h b/include/configs/TQM862L.h
  3194. index 0a5180e..577f982 100644
  3195. --- a/include/configs/TQM862L.h
  3196. +++ b/include/configs/TQM862L.h
  3197. @@ -224,7 +224,7 @@
  3198. /*-----------------------------------------------------------------------
  3199. * Dynamic MTD partition support
  3200. */
  3201. -#define CONFIG_JFFS2_CMDLINE
  3202. +#define CONFIG_CMD_MTDPARTS
  3203. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  3204.  
  3205. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  3206. diff --git a/include/configs/TQM862M.h b/include/configs/TQM862M.h
  3207. index ee6980c..69070e6 100644
  3208. --- a/include/configs/TQM862M.h
  3209. +++ b/include/configs/TQM862M.h
  3210. @@ -225,7 +225,7 @@
  3211. /*-----------------------------------------------------------------------
  3212. * Dynamic MTD partition support
  3213. */
  3214. -#define CONFIG_JFFS2_CMDLINE
  3215. +#define CONFIG_CMD_MTDPARTS
  3216. #define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
  3217.  
  3218. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
  3219. diff --git a/include/configs/TQM866M.h b/include/configs/TQM866M.h
  3220. index 421a2d8..bb68614 100644
  3221. --- a/include/configs/TQM866M.h
  3222. +++ b/include/configs/TQM866M.h
  3223. @@ -265,7 +265,7 @@
  3224. /*-----------------------------------------------------------------------
  3225. * Dynamic MTD partition support
  3226. */
  3227. -#define CONFIG_JFFS2_CMDLINE
  3228. +#define CONFIG_CMD_MTDPARTS
  3229. #define MTDIDS_DEFAULT "nor0=TQM8xxM-0"
  3230.  
  3231. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxM-0:512k(u-boot)," \
  3232. diff --git a/include/configs/ZUMA.h b/include/configs/ZUMA.h
  3233. index 08c4ced..b73aaa8 100644
  3234. --- a/include/configs/ZUMA.h
  3235. +++ b/include/configs/ZUMA.h
  3236. @@ -130,7 +130,7 @@
  3237. *
  3238. */
  3239. /* No command line, one static partition, whole device */
  3240. -#undef CONFIG_JFFS2_CMDLINE
  3241. +#undef CONFIG_CMD_MTDPARTS
  3242. #define CONFIG_JFFS2_DEV "nor0"
  3243. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3244. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3245. @@ -138,7 +138,7 @@
  3246. /* mtdparts command line support */
  3247. /* Note: fake mtd_id used, no linux mtd map file */
  3248. /*
  3249. -#define CONFIG_JFFS2_CMDLINE
  3250. +#define CONFIG_CMD_MTDPARTS
  3251. #define MTDIDS_DEFAULT "nor1=zuma-1,nor2=zuma-2"
  3252. #define MTDPARTS_DEFAULT "mtdparts=zuma-1:-(jffs2),zuma-2:-(user)"
  3253. */
  3254. diff --git a/include/configs/apollon.h b/include/configs/apollon.h
  3255. index dff47fc..f83dd9c 100644
  3256. --- a/include/configs/apollon.h
  3257. +++ b/include/configs/apollon.h
  3258. @@ -258,7 +258,7 @@
  3259. #define CONFIG_ENV_ADDR 0x00020000
  3260.  
  3261. #ifdef CONFIG_SYS_USE_UBI
  3262. -#define CONFIG_JFFS2_CMDLINE
  3263. +#define CONFIG_CMD_MTDPARTS
  3264. #define MTDIDS_DEFAULT "onenand0=onenand"
  3265. #define MTDPARTS_DEFAULT "mtdparts=onenand:128k(bootloader)," \
  3266. "128k(params)," \
  3267. diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h
  3268. index ddcc6aa..54cf40d 100644
  3269. --- a/include/configs/cm5200.h
  3270. +++ b/include/configs/cm5200.h
  3271. @@ -222,7 +222,7 @@
  3272. /*
  3273. * MTD configuration
  3274. */
  3275. -#define CONFIG_JFFS2_CMDLINE 1
  3276. +#define CONFIG_CMD_MTDPARTS 1
  3277. #define MTDIDS_DEFAULT "nor0=cm5200-0"
  3278. #define MTDPARTS_DEFAULT "mtdparts=cm5200-0:" \
  3279. "384k(uboot),128k(env)," \
  3280. diff --git a/include/configs/debris.h b/include/configs/debris.h
  3281. index 4d65f6a..dc59df9 100644
  3282. --- a/include/configs/debris.h
  3283. +++ b/include/configs/debris.h
  3284. @@ -234,7 +234,7 @@
  3285. *
  3286. */
  3287. /* No command line, one static partition, whole device */
  3288. -#undef CONFIG_JFFS2_CMDLINE
  3289. +#undef CONFIG_CMD_MTDPARTS
  3290. #define CONFIG_JFFS2_DEV "nor0"
  3291. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3292. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3293. @@ -246,7 +246,7 @@
  3294. * Note: fake mtd_id's used, no linux mtd map file.
  3295. */
  3296. /*
  3297. -#define CONFIG_JFFS2_CMDLINE
  3298. +#define CONFIG_CMD_MTDPARTS
  3299. #define MTDIDS_DEFAULT "nor0=debris-0"
  3300. #define MTDPARTS_DEFAULT "mtdparts=debris-0:-(jffs2)"
  3301. */
  3302. diff --git a/include/configs/ep7312.h b/include/configs/ep7312.h
  3303. index 0581842..322a3ca 100644
  3304. --- a/include/configs/ep7312.h
  3305. +++ b/include/configs/ep7312.h
  3306. @@ -158,7 +158,7 @@
  3307. *
  3308. */
  3309. /* No command line, one static partition, whole device */
  3310. -#undef CONFIG_JFFS2_CMDLINE
  3311. +#undef CONFIG_CMD_MTDPARTS
  3312. #define CONFIG_JFFS2_DEV "nor0"
  3313. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3314. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3315. @@ -166,7 +166,7 @@
  3316. /* mtdparts command line support */
  3317. /* Note: fake mtd_id used, no linux mtd map file */
  3318. /*
  3319. -#define CONFIG_JFFS2_CMDLINE
  3320. +#define CONFIG_CMD_MTDPARTS
  3321. #define MTDIDS_DEFAULT "nor0=ep7312-0"
  3322. #define MTDPARTS_DEFAULT "mtdparts=ep7312-0:-(jffs2)"
  3323. */
  3324. diff --git a/include/configs/ep8260.h b/include/configs/ep8260.h
  3325. index d49d02f..3f4425a 100644
  3326. --- a/include/configs/ep8260.h
  3327. +++ b/include/configs/ep8260.h
  3328. @@ -758,7 +758,7 @@
  3329. *
  3330. */
  3331. /* No command line, one static partition, whole device */
  3332. -#undef CONFIG_JFFS2_CMDLINE
  3333. +#undef CONFIG_CMD_MTDPARTS
  3334. #define CONFIG_JFFS2_DEV "nor0"
  3335. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3336. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3337. @@ -766,7 +766,7 @@
  3338. /* mtdparts command line support */
  3339. /* Note: fake mtd_id used, no linux mtd map file */
  3340. /*
  3341. -#define CONFIG_JFFS2_CMDLINE
  3342. +#define CONFIG_CMD_MTDPARTS
  3343. #define MTDIDS_DEFAULT ""
  3344. #define MTDPARTS_DEFAULT ""
  3345. */
  3346. diff --git a/include/configs/fx12mm.h b/include/configs/fx12mm.h
  3347. index 5844567..27c6e7d 100644
  3348. --- a/include/configs/fx12mm.h
  3349. +++ b/include/configs/fx12mm.h
  3350. @@ -37,7 +37,7 @@
  3351.  
  3352. /* cmd config */
  3353. #define CONFIG_CMD_JFFS2
  3354. -#define CONFIG_JFFS2_CMDLINE
  3355. +#define CONFIG_CMD_MTDPARTS
  3356. #undef CONFIG_CMD_NET
  3357.  
  3358. /* sdram */
  3359. diff --git a/include/configs/hymod.h b/include/configs/hymod.h
  3360. index 0fdcda2..2dacfb6 100644
  3361. --- a/include/configs/hymod.h
  3362. +++ b/include/configs/hymod.h
  3363. @@ -730,14 +730,14 @@
  3364. *
  3365. */
  3366. /* No command line, one static partition, whole device */
  3367. -#undef CONFIG_JFFS2_CMDLINE
  3368. +#undef CONFIG_CMD_MTDPARTS
  3369. #define CONFIG_JFFS2_DEV "nor0"
  3370. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3371. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3372.  
  3373. /* mtdparts command line support */
  3374. /*
  3375. -#define CONFIG_JFFS2_CMDLINE
  3376. +#define CONFIG_CMD_MTDPARTS
  3377. #define MTDIDS_DEFAULT ""
  3378. #define MTDPARTS_DEFAULT ""
  3379. */
  3380. diff --git a/include/configs/idmr.h b/include/configs/idmr.h
  3381. index 1dd89f9..944d06f 100644
  3382. --- a/include/configs/idmr.h
  3383. +++ b/include/configs/idmr.h
  3384. @@ -229,7 +229,7 @@
  3385.  
  3386.  
  3387. /* Dynamic MTD partition support */
  3388. -#define CONFIG_JFFS2_CMDLINE
  3389. +#define CONFIG_CMD_MTDPARTS
  3390. #define MTDIDS_DEFAULT "nor0=idmr-0"
  3391.  
  3392. #define MTDPARTS_DEFAULT "mtdparts=idmr-0:128k(u-boot)," \
  3393. diff --git a/include/configs/impa7.h b/include/configs/impa7.h
  3394. index bb3c02e..a3d023f 100644
  3395. --- a/include/configs/impa7.h
  3396. +++ b/include/configs/impa7.h
  3397. @@ -160,14 +160,14 @@
  3398. *
  3399. */
  3400. /* No command line, one static partition, whole device */
  3401. -#undef CONFIG_JFFS2_CMDLINE
  3402. +#undef CONFIG_CMD_MTDPARTS
  3403. #define CONFIG_JFFS2_DEV "nor0"
  3404. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3405. #define CONFIG_JFFS2_PART_OFFSET 0x00020000
  3406.  
  3407. /* mtdparts command line support */
  3408. /*
  3409. -#define CONFIG_JFFS2_CMDLINE
  3410. +#define CONFIG_CMD_MTDPARTS
  3411. #define MTDIDS_DEFAULT "nor0=impA7 NOR Flash Bank #0,nor1=impA7 NOR Flash Bank #1"
  3412. #define MTDPARTS_DEFAULT "mtdparts=impA7 NOR Flash Bank #0:-(FileSystem1);impA7 NOR Flash Bank #1:-(FileSystem2)"
  3413. */
  3414. diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h
  3415. index 6c150ae..9ac6eec 100644
  3416. --- a/include/configs/imx31_litekit.h
  3417. +++ b/include/configs/imx31_litekit.h
  3418. @@ -170,7 +170,7 @@
  3419. /*
  3420. * JFFS2 partitions
  3421. */
  3422. -#undef CONFIG_JFFS2_CMDLINE
  3423. +#undef CONFIG_CMD_MTDPARTS
  3424. #define CONFIG_JFFS2_DEV "nor0"
  3425.  
  3426. #endif /* __CONFIG_H */
  3427. diff --git a/include/configs/imx31_phycore.h b/include/configs/imx31_phycore.h
  3428. index 2dd9e92..cbc0b92 100644
  3429. --- a/include/configs/imx31_phycore.h
  3430. +++ b/include/configs/imx31_phycore.h
  3431. @@ -175,7 +175,7 @@
  3432. /*
  3433. * JFFS2 partitions
  3434. */
  3435. -#undef CONFIG_JFFS2_CMDLINE
  3436. +#undef CONFIG_CMD_MTDPARTS
  3437. #define CONFIG_JFFS2_DEV "nor0"
  3438.  
  3439. /* EET platform additions */
  3440. diff --git a/include/configs/incaip.h b/include/configs/incaip.h
  3441. index a18ba80..2129dfd 100644
  3442. --- a/include/configs/incaip.h
  3443. +++ b/include/configs/incaip.h
  3444. @@ -168,14 +168,14 @@
  3445. * JFFS2 partitions
  3446. */
  3447. /* No command line, one static partition, use all space on the device */
  3448. -#undef CONFIG_JFFS2_CMDLINE
  3449. +#undef CONFIG_CMD_MTDPARTS
  3450. #define CONFIG_JFFS2_DEV "nor1"
  3451. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3452. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3453.  
  3454. /* mtdparts command line support */
  3455. /*
  3456. -#define CONFIG_JFFS2_CMDLINE
  3457. +#define CONFIG_CMD_MTDPARTS
  3458. #define MTDIDS_DEFAULT "nor0=INCA-IP Bank 0"
  3459. #define MTDPARTS_DEFAULT "mtdparts=INCA-IP Bank 0:192k(uboot)," \
  3460. "64k(env)," \
  3461. diff --git a/include/configs/innokom.h b/include/configs/innokom.h
  3462. index d9b1555..043ae2f 100644
  3463. --- a/include/configs/innokom.h
  3464. +++ b/include/configs/innokom.h
  3465. @@ -203,7 +203,7 @@
  3466. */
  3467.  
  3468. /* No command line, one static partition, whole device */
  3469. -#undef CONFIG_JFFS2_CMDLINE
  3470. +#undef CONFIG_CMD_MTDPARTS
  3471. #define CONFIG_JFFS2_DEV "nor0"
  3472. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3473. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3474. @@ -211,7 +211,7 @@
  3475. /* mtdparts command line support */
  3476. /* Note: fake mtd_id used, no linux mtd map file */
  3477. /*
  3478. -#define CONFIG_JFFS2_CMDLINE
  3479. +#define CONFIG_CMD_MTDPARTS
  3480. #define MTDIDS_DEFAULT "nor0=innokom-0"
  3481. */
  3482.  
  3483. diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
  3484. index ac18c87..aa117c8 100644
  3485. --- a/include/configs/microblaze-generic.h
  3486. +++ b/include/configs/microblaze-generic.h
  3487. @@ -259,7 +259,7 @@
  3488.  
  3489. #if defined(CONFIG_CMD_JFFS2)
  3490. /* JFFS2 partitions */
  3491. -#define CONFIG_JFFS2_CMDLINE /* mtdparts command line support */
  3492. +#define CONFIG_CMD_MTDPARTS /* mtdparts command line support */
  3493. #define MTDIDS_DEFAULT "nor0=ml401-0"
  3494.  
  3495. /* default mtd partition table */
  3496. diff --git a/include/configs/modnet50.h b/include/configs/modnet50.h
  3497. index c4f5286..27213a8 100644
  3498. --- a/include/configs/modnet50.h
  3499. +++ b/include/configs/modnet50.h
  3500. @@ -182,7 +182,7 @@
  3501. *
  3502. */
  3503. /* No command line, one static partition, whole device */
  3504. -#undef CONFIG_JFFS2_CMDLINE
  3505. +#undef CONFIG_CMD_MTDPARTS
  3506. #define CONFIG_JFFS2_DEV "nor0"
  3507. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3508. #define CONFIG_JFFS2_PART_OFFSET 0x00080000
  3509. @@ -190,7 +190,7 @@
  3510. /* mtdparts command line support */
  3511. /* Note: fake mtd_id used, no linux mtd map file */
  3512. /*
  3513. -#define CONFIG_JFFS2_CMDLINE
  3514. +#define CONFIG_CMD_MTDPARTS
  3515. #define MTDIDS_DEFAULT "nor0=modnet50-0"
  3516. #define MTDPARTS_DEFAULT "mtdparts=modnet50-0:-@512k(jffs2)"
  3517. */
  3518. diff --git a/include/configs/motionpro.h b/include/configs/motionpro.h
  3519. index e6e3729..99a02cc 100644
  3520. --- a/include/configs/motionpro.h
  3521. +++ b/include/configs/motionpro.h
  3522. @@ -275,7 +275,7 @@
  3523. /*
  3524. * MTD configuration
  3525. */
  3526. -#define CONFIG_JFFS2_CMDLINE
  3527. +#define CONFIG_CMD_MTDPARTS
  3528. #define MTDIDS_DEFAULT "nor0=motionpro-0"
  3529. #define MTDPARTS_DEFAULT "mtdparts=motionpro-0:" \
  3530. "13m(fs),2m(kernel),256k(uboot)," \
  3531. diff --git a/include/configs/mx1fs2.h b/include/configs/mx1fs2.h
  3532. index aaa4e98..a19eb78 100644
  3533. --- a/include/configs/mx1fs2.h
  3534. +++ b/include/configs/mx1fs2.h
  3535. @@ -176,7 +176,7 @@
  3536. */
  3537. /* No command line, one static partition, whole device */
  3538. /*
  3539. -#undef CONFIG_JFFS2_CMDLINE
  3540. +#undef CONFIG_CMD_MTDPARTS
  3541. #define CONFIG_JFFS2_DEV "nor0"
  3542. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3543. #define CONFIG_JFFS2_PART_OFFSET 0x00050000
  3544. @@ -184,7 +184,7 @@
  3545.  
  3546. /* mtdparts command line support */
  3547. /* Note: fake mtd_id used, no linux mtd map file */
  3548. -#define CONFIG_JFFS2_CMDLINE
  3549. +#define CONFIG_CMD_MTDPARTS
  3550. #define MTDIDS_DEFAULT "nor0=mx1fs2-0"
  3551.  
  3552. #ifdef BUS32BIT_VERSION
  3553. diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h
  3554. index 1649f1f..c31c06a 100644
  3555. --- a/include/configs/mx31ads.h
  3556. +++ b/include/configs/mx31ads.h
  3557. @@ -194,7 +194,7 @@
  3558. /*
  3559. * JFFS2 partitions
  3560. */
  3561. -#undef CONFIG_JFFS2_CMDLINE
  3562. +#undef CONFIG_CMD_MTDPARTS
  3563. #define CONFIG_JFFS2_DEV "nor0"
  3564.  
  3565. #endif /* __CONFIG_H */
  3566. diff --git a/include/configs/netstar.h b/include/configs/netstar.h
  3567. index 2c90265..5294b2f 100644
  3568. --- a/include/configs/netstar.h
  3569. +++ b/include/configs/netstar.h
  3570. @@ -126,7 +126,7 @@
  3571. /*
  3572. * partitions (mtdparts command line support)
  3573. */
  3574. -#define CONFIG_JFFS2_CMDLINE
  3575. +#define CONFIG_CMD_MTDPARTS
  3576. #define MTDIDS_DEFAULT "nor0=omapflash.0,nand0=omapnand.0"
  3577. #define MTDPARTS_DEFAULT "mtdparts=" \
  3578. "omapflash.0:8k@16k(env),8k(r_env),448k@576k(u-boot);" \
  3579. diff --git a/include/configs/omap2420h4.h b/include/configs/omap2420h4.h
  3580. index 92df0b4..983b5f2 100644
  3581. --- a/include/configs/omap2420h4.h
  3582. +++ b/include/configs/omap2420h4.h
  3583. @@ -296,7 +296,7 @@
  3584. * JFFS2 partitions
  3585. */
  3586. /* No command line, one static partition, whole device */
  3587. -#undef CONFIG_JFFS2_CMDLINE
  3588. +#undef CONFIG_CMD_MTDPARTS
  3589. #define CONFIG_JFFS2_DEV "nor1"
  3590. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3591. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3592. @@ -304,7 +304,7 @@
  3593. /* mtdparts command line support */
  3594. /* Note: fake mtd_id used, no linux mtd map file */
  3595. /*
  3596. -#define CONFIG_JFFS2_CMDLINE
  3597. +#define CONFIG_CMD_MTDPARTS
  3598. #define MTDIDS_DEFAULT "nor1=omap2420-1"
  3599. #define MTDPARTS_DEFAULT "mtdparts=omap2420-1:-(jffs2)"
  3600. */
  3601. diff --git a/include/configs/qong.h b/include/configs/qong.h
  3602. index ccc2625..a67006a 100644
  3603. --- a/include/configs/qong.h
  3604. +++ b/include/configs/qong.h
  3605. @@ -212,7 +212,7 @@
  3606. /*
  3607. * JFFS2 partitions
  3608. */
  3609. -#define CONFIG_JFFS2_CMDLINE
  3610. +#define CONFIG_CMD_MTDPARTS
  3611. #define MTDIDS_DEFAULT "nor0=physmap-flash.0"
  3612. #define MTDPARTS_DEFAULT \
  3613. "mtdparts=physmap-flash.0:256k(U-Boot),128k(env1)," \
  3614. diff --git a/include/configs/sc3.h b/include/configs/sc3.h
  3615. index 515b097..5b68ef9 100644
  3616. --- a/include/configs/sc3.h
  3617. +++ b/include/configs/sc3.h
  3618. @@ -430,7 +430,7 @@ extern unsigned long offsetOfEnvironment;
  3619. #define CONFIG_JFFS2_NAND 1 /* jffs2 on nand support */
  3620.  
  3621. /* No command line, one static partition */
  3622. -#undef CONFIG_JFFS2_CMDLINE
  3623. +#undef CONFIG_CMD_MTDPARTS
  3624. #define CONFIG_JFFS2_DEV "nand0"
  3625. #define CONFIG_JFFS2_PART_SIZE 0x01000000
  3626. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3627. diff --git a/include/configs/sc520_cdp.h b/include/configs/sc520_cdp.h
  3628. index 9f2357b..854f619 100644
  3629. --- a/include/configs/sc520_cdp.h
  3630. +++ b/include/configs/sc520_cdp.h
  3631. @@ -155,14 +155,14 @@
  3632. * JFFS2 partitions
  3633. */
  3634. /* No command line, one static partition, whole device */
  3635. -#undef CONFIG_JFFS2_CMDLINE
  3636. +#undef CONFIG_CMD_MTDPARTS
  3637. #define CONFIG_JFFS2_DEV "nor0"
  3638. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3639. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3640.  
  3641. /* mtdparts command line support */
  3642. /*
  3643. -#define CONFIG_JFFS2_CMDLINE
  3644. +#define CONFIG_CMD_MTDPARTS
  3645. #define MTDIDS_DEFAULT "nor0=SC520CDP Flash Bank #0"
  3646. #define MTDPARTS_DEFAULT "mtdparts=SC520CDP Flash Bank #0:-(jffs2)"
  3647. */
  3648. diff --git a/include/configs/sc520_spunk.h b/include/configs/sc520_spunk.h
  3649. index 50af732..43dcb85 100644
  3650. --- a/include/configs/sc520_spunk.h
  3651. +++ b/include/configs/sc520_spunk.h
  3652. @@ -173,7 +173,7 @@
  3653. *
  3654. */
  3655. /* No command line, one static partition, whole device */
  3656. -#undef CONFIG_JFFS2_CMDLINE
  3657. +#undef CONFIG_CMD_MTDPARTS
  3658. #define CONFIG_JFFS2_DEV "nor0"
  3659. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3660. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3661. @@ -181,7 +181,7 @@
  3662. /* mtdparts command line support */
  3663. /* Note: fake mtd_id used, no linux mtd map file */
  3664. /*
  3665. -#define CONFIG_JFFS2_CMDLINE
  3666. +#define CONFIG_CMD_MTDPARTS
  3667. #define MTDIDS_DEFAULT "nor0=sc520_spunk-0"
  3668. #define MTDPARTS_DEFAULT "mtdparts=sc520_spunk-0:-(jffs2)"
  3669. */
  3670. diff --git a/include/configs/smmaco4.h b/include/configs/smmaco4.h
  3671. index a3f2677..35f3e3a 100644
  3672. --- a/include/configs/smmaco4.h
  3673. +++ b/include/configs/smmaco4.h
  3674. @@ -214,7 +214,7 @@
  3675. #define CONFIG_SYS_FLASH_WRITE_TOUT 500 /* Flash Write Timeout (in ms) */
  3676.  
  3677. /* Dynamic MTD partition support */
  3678. -#define CONFIG_JFFS2_CMDLINE
  3679. +#define CONFIG_CMD_MTDPARTS
  3680. #define MTDIDS_DEFAULT "nor0=TQM5200-0"
  3681. #define MTDPARTS_DEFAULT "mtdparts=TQM5200-0:640k(firmware)," \
  3682. "1408k(kernel)," \
  3683. diff --git a/include/configs/trab.h b/include/configs/trab.h
  3684. index 0a7a73d..8f13c35 100644
  3685. --- a/include/configs/trab.h
  3686. +++ b/include/configs/trab.h
  3687. @@ -375,7 +375,7 @@
  3688. #define CONFIG_SYS_MONITOR_LEN (256 << 10)
  3689.  
  3690. /* Dynamic MTD partition support */
  3691. -#define CONFIG_JFFS2_CMDLINE
  3692. +#define CONFIG_CMD_MTDPARTS
  3693. #define MTDIDS_DEFAULT "nor0=0"
  3694.  
  3695. /* production flash layout */
  3696. diff --git a/include/configs/v37.h b/include/configs/v37.h
  3697. index a6b0f0d..7f1670e 100644
  3698. --- a/include/configs/v37.h
  3699. +++ b/include/configs/v37.h
  3700. @@ -106,7 +106,7 @@
  3701. *
  3702. */
  3703. /* No command line, one static partition, whole device */
  3704. -#undef CONFIG_JFFS2_CMDLINE
  3705. +#undef CONFIG_CMD_MTDPARTS
  3706. #define CONFIG_JFFS2_DEV "nor1"
  3707. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3708. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3709. @@ -114,7 +114,7 @@
  3710. /* mtdparts command line support */
  3711. /* Note: fake mtd_id used, no linux mtd map file */
  3712. /*
  3713. -#define CONFIG_JFFS2_CMDLINE
  3714. +#define CONFIG_CMD_MTDPARTS
  3715. #define MTDIDS_DEFAULT "nor1=v37-1"
  3716. #define MTDPARTS_DEFAULT "mtdparts=v37-1:-(jffs2)"
  3717. */
  3718. diff --git a/include/configs/vct.h b/include/configs/vct.h
  3719. index 391535e..5371e2d 100644
  3720. --- a/include/configs/vct.h
  3721. +++ b/include/configs/vct.h
  3722. @@ -286,7 +286,7 @@ int vct_gpio_get(int pin);
  3723. #define CONFIG_CMD_UBI
  3724. #define CONFIG_RBTREE
  3725. #define CONFIG_MTD_PARTITIONS
  3726. -#define CONFIG_JFFS2_CMDLINE
  3727. +#define CONFIG_CMD_MTDPARTS
  3728.  
  3729. #define MTDIDS_DEFAULT "onenand0=onenand"
  3730. #define MTDPARTS_DEFAULT "mtdparts=onenand:128k(u-boot)," \
  3731. diff --git a/include/configs/virtlab2.h b/include/configs/virtlab2.h
  3732. index 7b61c82..021012d 100644
  3733. --- a/include/configs/virtlab2.h
  3734. +++ b/include/configs/virtlab2.h
  3735. @@ -225,7 +225,7 @@
  3736. /*-----------------------------------------------------------------------
  3737. * Dynamic MTD partition support
  3738. */
  3739. -#define CONFIG_JFFS2_CMDLINE
  3740. +#define CONFIG_CMD_MTDPARTS
  3741. #define MTDIDS_DEFAULT "nor0=TQM8xxL-0"
  3742.  
  3743. #define MTDPARTS_DEFAULT "mtdparts=TQM8xxL-0:256k(u-boot)," \
  3744. diff --git a/include/configs/voiceblue.h b/include/configs/voiceblue.h
  3745. index f460610..cadd906 100644
  3746. --- a/include/configs/voiceblue.h
  3747. +++ b/include/configs/voiceblue.h
  3748. @@ -189,7 +189,7 @@
  3749. /*
  3750. * JFFS2 partitions (mtdparts command line support)
  3751. */
  3752. -#define CONFIG_JFFS2_CMDLINE
  3753. +#define CONFIG_CMD_MTDPARTS
  3754. #define MTDIDS_DEFAULT "nor0=omapflash.0"
  3755. #define MTDPARTS_DEFAULT "mtdparts=omapflash.0:256k(u-boot),64k(env),64k(r_env),16192k(data0),-(data1)"
  3756.  
  3757. diff --git a/include/configs/xilinx-ppc.h b/include/configs/xilinx-ppc.h
  3758. index e7daa07..e3ea84b 100644
  3759. --- a/include/configs/xilinx-ppc.h
  3760. +++ b/include/configs/xilinx-ppc.h
  3761. @@ -41,7 +41,7 @@
  3762. #define CONFIG_CMD_IRQ
  3763. #define CONFIG_CMD_REGINFO
  3764. #undef CONFIG_CMD_JFFS2
  3765. -#undef CONFIG_JFFS2_CMDLINE
  3766. +#undef CONFIG_CMD_MTDPARTS
  3767. #undef CONFIG_CMD_SPI
  3768. #undef CONFIG_CMD_I2C
  3769. #undef CONFIG_CMD_DTT
  3770. @@ -108,7 +108,7 @@
  3771. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  3772. #define CONFIG_SYS_FLASH_PROTECTION
  3773. #define CONFIG_CMD_JFFS2
  3774. -#define CONFIG_JFFS2_CMDLINE
  3775. +#define CONFIG_CMD_MTDPARTS
  3776. #else
  3777. #define CONFIG_ENV_IS_NOWHERE
  3778. #define CONFIG_SYS_NO_FLASH
  3779. diff --git a/include/configs/xsengine.h b/include/configs/xsengine.h
  3780. index 6761438..5d13f96 100644
  3781. --- a/include/configs/xsengine.h
  3782. +++ b/include/configs/xsengine.h
  3783. @@ -62,7 +62,7 @@
  3784. * JFFS2 partitions
  3785. */
  3786. /* No command line, one static partition, whole device */
  3787. -#undef CONFIG_JFFS2_CMDLINE
  3788. +#undef CONFIG_CMD_MTDPARTS
  3789. #define CONFIG_JFFS2_DEV "nor0"
  3790. #define CONFIG_JFFS2_PART_SIZE 0xFFFFFFFF
  3791. #define CONFIG_JFFS2_PART_OFFSET 0x00000000
  3792. @@ -70,7 +70,7 @@
  3793. /* mtdparts command line support */
  3794. /* Note: fake mtd_id used, no linux mtd map file */
  3795. /*
  3796. -#define CONFIG_JFFS2_CMDLINE
  3797. +#define CONFIG_CMD_MTDPARTS
  3798. #define MTDIDS_DEFAULT "nor0=xsengine-0"
  3799. #define MTDPARTS_DEFAULT "mtdparts=xsengine-0:256k(uboot),1m(kernel1),8m(kernel2)"
  3800. */
  3801. --
  3802. 1.6.1.3
  3803.  
  3804.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement