From ff414fcc44b8b385600df54f5a7dc0719cec106f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 4 Dec 2022 16:33:07 +0100 Subject: cmd: fix long text for sound command Make it clear that if only 1 parameter is provided this is the duration. The ISO symbol for hertz is Hz. Fixes: c0c88533fffd ("Sound: Add command for audio playback") Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- cmd/sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/sound.c b/cmd/sound.c index f82f2aa6708..20ac3f758e3 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" ); -- cgit v1.3.1 From 308bd746639a7d144a9cf563ac7449312841386d Mon Sep 17 00:00:00 2001 From: Michael Trimarchi Date: Thu, 22 Sep 2022 15:39:37 +0200 Subject: cmd: nand: Extend nand info to print ecc information Extract the information about ecc strength and ecc step size from mtd controller. This information is usefull to check if what we think as ecc is what we really configured. Signed-off-by: Michael Trimarchi Reviewed-by: Dario Binacchi Link: https://lore.kernel.org/all/20220922133937.277463-1-michael@amarulasolutions.com Signed-off-by: Dario Binacchi --- cmd/nand.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'cmd') diff --git a/cmd/nand.c b/cmd/nand.c index 5bb43794e90..9a723f57579 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); -- cgit v1.3.1 From d09807ad144cb2fe3745a58caadf9a4192038839 Mon Sep 17 00:00:00 2001 From: Dario Binacchi Date: Sun, 30 Oct 2022 15:14:13 +0100 Subject: cmd: mtd: check if a block has to be skipped or erased As reported by patch [1], the `mtd erase' command should not erase bad blocks. To force bad block erasing you have to use the `mtd erase.dontskipbad' command. This patch tries to fix the same issue without modifying code taken from the linux kernel, in order to make further upgrades easier. [1] https://lore.kernel.org/all/20221006031501.110290-2-mikhail.kshevetskiy@iopsys.eu/ Suggested-by: Michael Trimarchi Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Co-developed-by: Mikhail Kshevetskiy Signed-off-by: Mikhail Kshevetskiy Tested-by: Mikhail Kshevetskiy Signed-off-by: Dario Binacchi --- cmd/mtd.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'cmd') diff --git a/cmd/mtd.c b/cmd/mtd.c index ad5cc9827d5..eb6e2d6892f 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; } -- cgit v1.3.1