[U-Boot] [PATCH] mmc: Add an mmcsilent option

When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.
Signed-off-by: Pantelis Antoniou panto@antoniou-consulting.com --- common/cmd_mmc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index 4c19df7..73383f3 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -278,8 +278,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; }
- printf("\nMMC %s: dev # %d, block # %d, count %d ... ", - argv[1], curr_device, blk, cnt); + if (getenv("mmcsilent") == NULL) + printf("\nMMC %s: dev # %d, block # %d, count %d ... ", + argv[1], curr_device, blk, cnt);
mmc_init(mmc);
@@ -301,8 +302,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) BUG(); }
- printf("%d blocks %s: %s\n", - n, argv[1], (n == cnt) ? "OK" : "ERROR"); + if (getenv("mmcsilent") == NULL) + printf("%d blocks %s: %s\n", + n, argv[1], (n == cnt) ? "OK" : "ERROR"); return (n == cnt) ? 0 : 1; }

Dear Pantelis Antoniou,
In message 1354174469-5625-1-git-send-email-panto@antoniou-consulting.com you wrote:
When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.
Signed-off-by: Pantelis Antoniou panto@antoniou-consulting.com
common/cmd_mmc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index 4c19df7..73383f3 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -278,8 +278,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; }
printf("\nMMC %s: dev # %d, block # %d, count %d ... ",
argv[1], curr_device, blk, cnt);
if (getenv("mmcsilent") == NULL)
printf("\nMMC %s: dev # %d, block # %d, count %d ... ",
argv[1], curr_device, blk, cnt);
mmc_init(mmc);
@@ -301,8 +302,9 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) BUG(); }
printf("%d blocks %s: %s\n",
n, argv[1], (n == cnt) ? "OK" : "ERROR");
if (getenv("mmcsilent") == NULL)
printf("%d blocks %s: %s\n",
return (n == cnt) ? 0 : 1;n, argv[1], (n == cnt) ? "OK" : "ERROR");
Do we need these messages at all? Or should we not just turn these printf() into debug() ?
If not, the "mmcsilent" variable needs to be documented.
Best regards,
Wolfgang Denk

On Thu, Nov 29, 2012 at 1:34 AM, Pantelis Antoniou < panto@antoniou-consulting.com> wrote:
When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.
Signed-off-by: Pantelis Antoniou panto@antoniou-consulting.com
I'm not familiar with DFU mode, but is there a reason it's invoking the command line call, rather than accessing the card programmatically? The reason that printf is there is because it's a user-facing interface, rather than a software-facing interface.
Andy

Hi Andy,
On Nov 28, 2012, at 6:49 PM, Andy Fleming wrote:
On Thu, Nov 29, 2012 at 1:34 AM, Pantelis Antoniou panto@antoniou-consulting.com wrote: When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.
Signed-off-by: Pantelis Antoniou panto@antoniou-consulting.com
I'm not familiar with DFU mode, but is there a reason it's invoking the command line call, rather than accessing the card programmatically? The reason that printf is there is because it's a user-facing interface, rather than a software-facing interface.
No there is not. It's just what was there and the messages were irritating. I would prefer a software interface TBH.
Andy
Regards
-- Pantelis

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 11/28/12 11:50, Pantelis Antoniou wrote:
Hi Andy,
On Nov 28, 2012, at 6:49 PM, Andy Fleming wrote:
On Thu, Nov 29, 2012 at 1:34 AM, Pantelis Antoniou panto@antoniou-consulting.com wrote: When using MMC commands for dfu there is considerable noise. Suppress mmc messages when mmcsilent is set.
Signed-off-by: Pantelis Antoniou panto@antoniou-consulting.com
I'm not familiar with DFU mode, but is there a reason it's invoking the command line call, rather than accessing the card programmatically? The reason that printf is there is because it's a user-facing interface, rather than a software-facing interface.
No there is not. It's just what was there and the messages were irritating. I would prefer a software interface TBH.
I'm trying to recall. Part of the issue was that, I believe, there wasn't an easy software interface to all of the MMC commands that we needed to use here. It might however have boiled down to as a future clean-up, abstract things so that cmd_mmc and cmd_dfu could make use of the same lower level code.
- -- Tom
participants (4)
-
Andy Fleming
-
Pantelis Antoniou
-
Tom Rini
-
Wolfgang Denk