printf(" - driver: %s\n", mtd->dev->driver->name);
}
#endif
+ if (IS_ENABLED(CONFIG_OF_CONTROL) && mtd->dev) {
+ char buf[256];
+ int res;
+
+ res = ofnode_get_path(mtd_get_ofnode(mtd), buf, 256);
+ printf(" - path: %s\n", res == 0 ? buf : "unavailable");
+ }
/* MTD device information */
printf(" - type: ");
goto out_put_mtd;
}
- user_addr = simple_strtoul(argv[0], NULL, 16);
+ user_addr = hextoul(argv[0], NULL);
argc--;
argv++;
}
- start_off = argc > 0 ? simple_strtoul(argv[0], NULL, 16) : 0;
+ start_off = argc > 0 ? hextoul(argv[0], NULL) : 0;
if (!mtd_is_aligned_with_min_io_size(mtd, start_off)) {
printf("Offset not aligned with a page (0x%x)\n",
mtd->writesize);
}
default_len = dump ? mtd->writesize : mtd->size;
- len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : default_len;
+ len = argc > 1 ? hextoul(argv[1], NULL) : default_len;
if (!mtd_is_aligned_with_min_io_size(mtd, len)) {
len = round_up(len, mtd->writesize);
printf("Size not on a page boundary (0x%x), rounding to 0x%llx\n",
argc -= 2;
argv += 2;
- off = argc > 0 ? simple_strtoul(argv[0], NULL, 16) : 0;
- len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : mtd->size;
+ off = argc > 0 ? hextoul(argv[0], NULL) : 0;
+ len = argc > 1 ? hextoul(argv[1], NULL) : mtd->size;
if (!mtd_is_aligned_with_block_size(mtd, off)) {
printf("Offset not aligned with a block (0x%x)\n",
"mtd bad <name>\n"
"\n"
"With:\n"
- "\t<name>: NAND partition/chip name\n"
+ "\t<name>: NAND partition/chip name (or corresponding DM device name or OF path)\n"
"\t<addr>: user address from/to which data will be retrieved/stored\n"
"\t<off>: offset in <name> in bytes (default: start of the part)\n"
"\t\t* must be block-aligned for erase\n"