summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-12-19 17:29:55 +0300
committerTom Rini <trini@konsulko.com>2022-12-21 21:09:01 +0300
commit14f43797d0a696248c09d298e2f2809dded345ba (patch)
tree23fc5bc462689f07f389cc0b8e7f7bedd35253ff /cmd
parent9c955393f7a27ded250fef7688e0065b44a3343f (diff)
parent2243922edca9f56a9d5519b9d6e36f5d7a18434d (diff)
downloadu-boot-14f43797d0a696248c09d298e2f2809dded345ba.tar.xz
Merge tag 'v2023.01-rc4' into next
Prepare v2023.01-rc4 Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mtd.c28
-rw-r--r--cmd/nand.c14
-rw-r--r--cmd/sound.c2
3 files changed, 29 insertions, 15 deletions
diff --git a/cmd/mtd.c b/cmd/mtd.c
index ad5cc9827d..eb6e2d6892 100644
--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -434,19 +434,31 @@ static int do_mtd_erase(struct cmd_tbl *cmdtp, int flag, int argc,
erase_op.mtd = mtd;
erase_op.addr = off;
erase_op.len = mtd->erasesize;
- erase_op.scrub = scrub;
while (len) {
- ret = mtd_erase(mtd, &erase_op);
+ if (!scrub) {
+ ret = mtd_block_isbad(mtd, erase_op.addr);
+ if (ret < 0) {
+ printf("Failed to get bad block at 0x%08llx\n",
+ erase_op.addr);
+ ret = CMD_RET_FAILURE;
+ goto out_put_mtd;
+ }
- if (ret) {
- /* Abort if its not a bad block error */
- if (ret != -EIO)
- break;
- printf("Skipping bad block at 0x%08llx\n",
- erase_op.addr);
+ if (ret > 0) {
+ printf("Skipping bad block at 0x%08llx\n",
+ erase_op.addr);
+ ret = 0;
+ len -= mtd->erasesize;
+ erase_op.addr += mtd->erasesize;
+ continue;
+ }
}
+ ret = mtd_erase(mtd, &erase_op);
+ if (ret && ret != -EIO)
+ break;
+
len -= mtd->erasesize;
erase_op.addr += mtd->erasesize;
}
diff --git a/cmd/nand.c b/cmd/nand.c
index 5bb43794e9..9a723f5757 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -417,12 +417,14 @@ static void nand_print_and_set_info(int idx)
printf("%dx ", chip->numchips);
printf("%s, sector size %u KiB\n",
mtd->name, mtd->erasesize >> 10);
- printf(" Page size %8d b\n", mtd->writesize);
- printf(" OOB size %8d b\n", mtd->oobsize);
- printf(" Erase size %8d b\n", mtd->erasesize);
- printf(" subpagesize %8d b\n", chip->subpagesize);
- printf(" options 0x%08x\n", chip->options);
- printf(" bbt options 0x%08x\n", chip->bbt_options);
+ printf(" Page size %8d b\n", mtd->writesize);
+ printf(" OOB size %8d b\n", mtd->oobsize);
+ printf(" Erase size %8d b\n", mtd->erasesize);
+ printf(" ecc strength %8d bits\n", mtd->ecc_strength);
+ printf(" ecc step size %8d b\n", mtd->ecc_step_size);
+ printf(" subpagesize %8d b\n", chip->subpagesize);
+ printf(" options 0x%08x\n", chip->options);
+ printf(" bbt options 0x%08x\n", chip->bbt_options);
/* Set geometry info */
env_set_hex("nand_writesize", mtd->writesize);
diff --git a/cmd/sound.c b/cmd/sound.c
index f82f2aa670..20ac3f758e 100644
--- a/cmd/sound.c
+++ b/cmd/sound.c
@@ -86,5 +86,5 @@ U_BOOT_CMD(
sound, 4, 1, do_sound,
"sound sub-system",
"init - initialise the sound driver\n"
- "sound play [len] [freq] - play a sound for len ms at freq hz\n"
+ "sound play [len [freq]] - play a sound for len ms at freq Hz\n"
);