From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Date: Wed, 13 Apr 2016 20:49:55 +0200 Subject: [U-Boot] [PATCH] mmc: add mmc partconf read capability In-Reply-To: <1460567281-21124-1-git-send-email-angelo@sysam.it> References: <1460567281-21124-1-git-send-email-angelo@sysam.it> Message-ID: <570E94D3.1080808@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > 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 \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)