return part_validate_eraseblock(id, part);
}
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/**
* Delete selected partition from the partion list of the specified device.
*
return 0;
}
+#endif
/**
* Delete all partitions from parts head list, free memory.
return 0;
}
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/**
* Add provided partition to the partition list of a given device.
*
return 0;
}
+#endif
/**
* Parse one partition definition, allocate memory and return pointer to this
return NULL;
}
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/**
* Add specified device to the global device list.
*
else
index_partitions();
}
+#endif
/**
* Parse device type, name and mtd-id. If syntax is ok allocate memory and
return device_delall(&devices);
}
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/*
* Search global mtdids list and find id of requested type and number.
*
return NULL;
}
+#endif
/**
* Search global mtdids list and find id of a requested mtd_id.
return 0;
}
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/**
* Process all devices and generate corresponding mtdparts string describing
* all partitions on all devices.
return ret;
}
+#endif
/**
* Format and print out a partition list for each device from global device
return 0;
}
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/**
* Find and delete partition. For partition id format see find_dev_and_part().
*
printf("partition %s not found\n", id);
return 1;
}
+#endif
/**
* Accept character string describing mtd partitions and call device_parse()
/* U-boot commands */
/***************************************************/
/* command line only */
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/**
* Routine implementing u-boot chpart command. Sets new current partition based
* on the user supplied partition id. For partition id format see find_dev_and_part().
return 0;
}
+#endif
/**
* Routine implementing u-boot mtdparts command. Initialize/update default global
*/
int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
+#ifndef CONFIG_CMD_MTDPARTS_LITE
if (argc == 2) {
if (strcmp(argv[1], "default") == 0) {
setenv("mtdids", (char *)mtdids_default);
return mtd_devices_init();
}
}
+#endif
/* make sure we are in sync with env variables */
if (mtdparts_init() != 0)
return 0;
}
+#ifndef CONFIG_CMD_MTDPARTS_LITE
/* mtdparts add <mtd-dev> <size>[@<offset>] <name> [ro] */
if (((argc == 5) || (argc == 6)) && (strcmp(argv[1], "add") == 0)) {
#define PART_ADD_DESC_MAXLEN 64
return delete_partition(argv[2]);
}
+#endif
cmd_usage(cmdtp);
return 1;
}
/***************************************************/
+#ifndef CONFIG_CMD_MTDPARTS_LITE
U_BOOT_CMD(
chpart, 2, 0, do_chpart,
"change active partition",
"<name> := '(' NAME ')'\n"
"<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)"
);
+#else
+U_BOOT_CMD(
+ mtdparts, 1, 0, do_mtdparts,
+ "define flash/nand partitions",
+ "\n"
+ " - list partition table\n"
+);
+#endif
/***************************************************/