public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mmc: add mmc partconf read capability
Date: Wed, 13 Apr 2016 20:49:55 +0200	[thread overview]
Message-ID: <570E94D3.1080808@suse.de> (raw)
In-Reply-To: <1460567281-21124-1-git-send-email-angelo@sysam.it>

Hi,

Am 13.04.2016 um 19:08 schrieb Angelo Dureghello:
> This patch allows to read back the EXT_CSD[179] partition_config
> register, just specifiing the dev param:

"specifying"

> 
> linkmotion> mmc partconf 0
> EXT_CSD[179], PARTITION_CONFIG register:
> BOOT_ACK: 0
> BOOT_PARTITION_ENABLE: 0
> PARTITION_ACCESS: 0
> 
> Signed-off-by: Angelo Dureghello <angelo@sysam.it>
> ---
>  cmd/mmc.c         | 30 +++++++++++++++++++++++++-----
>  drivers/mmc/mmc.c | 33 +++++++++++++++++++++++++++++++++
>  include/mmc.h     |  6 ++++++
>  3 files changed, 64 insertions(+), 5 deletions(-)
> 
> diff --git a/cmd/mmc.c b/cmd/mmc.c
> index 39ef072..055ab2a 100644
> --- a/cmd/mmc.c
> +++ b/cmd/mmc.c
> @@ -697,6 +697,22 @@ static int do_mmc_boot_resize(cmd_tbl_t *cmdtp, int flag,
>  	printf("EMMC RPMB partition Size %d MB\n", rpmbsize);
>  	return CMD_RET_SUCCESS;
>  }

Add a white line for spacing here and below?

> +static int do_mmc_partconf_read(struct mmc *mmc)
> +{
> +	int err;
> +	u8 ack, part_num, access;
> +
> +	err = mmc_get_part_conf(mmc, &ack, &part_num, &access);
> +	if (err)
> +		return CMD_RET_FAILURE;
> +
> +	puts("EXT_CSD[179], PARTITION_CONFIG register:\n");
> +	printf("BOOT_ACK: %d\n", ack);
> +	printf("BOOT_PARTITION_ENABLE: %d\n", part_num);
> +	printf("PARTITION_ACCESS: %d\n", access);
> +
> +	return 0;
> +}
>  static int do_mmc_partconf(cmd_tbl_t *cmdtp, int flag,
>  			   int argc, char * const argv[])
>  {
> @@ -704,13 +720,10 @@ static int do_mmc_partconf(cmd_tbl_t *cmdtp, int flag,
>  	struct mmc *mmc;
>  	u8 ack, part_num, access;
>  
> -	if (argc != 5)
> +	if (argc != 2 && argc != 5)
>  		return CMD_RET_USAGE;
[...]
> @@ -858,7 +878,7 @@ U_BOOT_CMD(
>  	" - Set the BOOT_BUS_WIDTH field of the specified device\n"
>  	"mmc bootpart-resize <dev> <boot part size MB> <RPMB part size MB>\n"
>  	" - Change sizes of boot and RPMB partitions of specified device\n"
> -	"mmc partconf dev boot_ack boot_partition partition_access\n"
> +	"mmc partconf dev [boot_ack] [boot_partition] [partition_access]\n"

Reads weird. Your implementation actual seems to be [ boot_ack
boot_partition partition_access ], i.e. 2 or 5 args but not random
permutations of optional args.

>  	" - Change the bits of the PARTITION_CONFIG field of the specified device\n"
>  	"mmc rst-function dev value\n"
>  	" - Change the RST_n_FUNCTION field of the specified device\n"

Maybe update the textual explanation as well?

Regards,
Andreas

[snip]

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)

      reply	other threads:[~2016-04-13 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 17:08 [U-Boot] [PATCH] mmc: add mmc partconf read capability Angelo Dureghello
2016-04-13 18:49 ` Andreas Färber [this message]

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=570E94D3.1080808@suse.de \
    --to=afaerber@suse.de \
    --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