From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH] cmd: part: Add 'block' sub-command
Date: Fri, 24 Apr 2020 11:28:22 -0400 [thread overview]
Message-ID: <20200424152822.GP4555@bill-the-cat> (raw)
In-Reply-To: <CAJAoKi9bfH80Dnqu3+gJp45q+BtKxghKwwOGiUbUwKd3M4LtGA@mail.gmail.com>
On Wed, Apr 22, 2020 at 01:13:06AM +0300, razvan becheriu wrote:
> From 4376dc705acefb5b5281d32dcc1cb5084c61f99c Mon Sep 17 00:00:00 2001
> From: Razvan Becheriu <razvan@gmail.com>
> Date: Wed, 22 Apr 2020 00:17:33 +0300
> Subject: [PATCH] cmd: part: Add 'block' sub-command
>
> Add part block sub-command which returns partition block size.
>
> e.g.:
> part block mmc $mmcdev system_a system_a_index
> ---
> cmd/part.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/cmd/part.c b/cmd/part.c
> index 5e4e45ca6d..d78d914e7a 100644
> --- a/cmd/part.c
> +++ b/cmd/part.c
> @@ -25,6 +25,7 @@
> enum cmd_part_info {
> CMD_PART_INFO_START = 0,
> CMD_PART_INFO_SIZE,
> + CMD_PART_INFO_BLOCK,
> CMD_PART_INFO_NUMBER
> };
>
> @@ -151,6 +152,9 @@ static int do_part_info(int argc, char * const
> argv[], enum cmd_part_info param)
> case CMD_PART_INFO_SIZE:
> snprintf(buf, sizeof(buf), LBAF, info.size);
> break;
> + case CMD_PART_INFO_BLOCK:
> + snprintf(buf, sizeof(buf), LBAF, info.blksz);
> + break;
> case CMD_PART_INFO_NUMBER:
> snprintf(buf, sizeof(buf), "0x%x", part);
> break;
> @@ -177,6 +181,11 @@ static int do_part_size(int argc, char * const argv[])
> return do_part_info(argc, argv, CMD_PART_INFO_SIZE);
> }
>
> +static int do_part_block(int argc, char * const argv[])
> +{
> + return do_part_info(argc, argv, CMD_PART_INFO_BLOCK);
> +}
> +
> static int do_part_number(int argc, char * const argv[])
> {
> return do_part_info(argc, argv, CMD_PART_INFO_NUMBER);
> @@ -195,6 +204,8 @@ static int do_part(cmd_tbl_t *cmdtp, int flag, int
> argc, char * const argv[])
> return do_part_start(argc - 2, argv + 2);
> else if (!strcmp(argv[1], "size"))
> return do_part_size(argc - 2, argv + 2);
> + else if (!strcmp(argv[1], "block"))
> + return do_part_block(argc - 2, argv + 2);
> else if (!strcmp(argv[1], "number"))
> return do_part_number(argc - 2, argv + 2);
>
> @@ -219,6 +230,9 @@ U_BOOT_CMD(
> "part size <interface> <dev> <part> <varname>\n"
> " - set environment variable to the size of the partition (in blocks)\n"
> " part can be either partition number or partition name\n"
> + "part block <interface> <dev> <part> <varname>\n"
> + " - set environment variable to the size of the partition block\n"
> + " part can be either partition number or partition name\n"
> "part number <interface> <dev> <part> <varname>\n"
> " - set environment variable to the partition number using the
> partition name\n"
> " part must be specified as partition name"
Please re-send this via git send-email as this is totally mangled. Also
please explain the use case for this command as it's going to
unconditionally grow a lot of platforms. Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200424/9003287d/attachment.sig>
next prev parent reply other threads:[~2020-04-24 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 22:13 [PATCH] cmd: part: Add 'block' sub-command razvan becheriu
2020-04-24 15:28 ` Tom Rini [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-01 10:20 [PATCH]: cmd: part: add part block command razvan.becheriu at gmail.com
2020-06-01 10:20 ` [PATCH] cmd: part: Add 'block' sub-command razvan.becheriu at gmail.com
2020-06-02 17:55 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200424152822.GP4555@bill-the-cat \
--to=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox