[U-Boot] [PATCH] mmc: add mmc partconf read capability
Andreas Färber
afaerber at suse.de
Wed Apr 13 20:49:55 CEST 2016
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 at 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)
More information about the U-Boot
mailing list