From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giuseppe CAVALLARO Subject: Re: [PATCH] mmc-utils: add the way to enable boot-partition Date: Fri, 20 Apr 2012 06:36:42 +0200 Message-ID: <4F90E7DA.4010703@st.com> References: <1334825917-2146-1-git-send-email-peppe.cavallaro@st.com> <87aa27k5bb.fsf@laptop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eu1sys200aog101.obsmtp.com ([207.126.144.111]:58977 "EHLO eu1sys200aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103Ab2DTEik (ORCPT ); Fri, 20 Apr 2012 00:38:40 -0400 In-Reply-To: <87aa27k5bb.fsf@laptop.org> Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Chris Ball Cc: linux-mmc@vger.kernel.org Hi Chris On 4/19/2012 7:19 PM, Chris Ball wrote: > Hi Giuseppe, > > On Thu, Apr 19 2012, Giuseppe CAVALLARO wrote: >> This adds a new option to enable the boot from eMMC >> by writing to the 179 ext_csd register. >> >> The example below shows as to enable the mmcblk0boot0 >> partition and also set/reset the ACK bit). >> >> $ ./mmc booten 1 1 /dev/mmcblk0boot0 >> $ ./mmc extcsd read /dev/mmcblk0boot0 | grep PARTITION_CON >> Boot configuration bytes [PARTITION_CONFIG: 0x49] >> >> Reported-by: Youssef TRIKI >> Signed-off-by: Giuseppe Cavallaro > > Looks good, thanks -- do you mind if I make the following changes for > readability (and are they correct)? I can update the commit message too: your changes are fine for me thanks a lot Regards Peppe > > diff --git a/mmc.c b/mmc.c > index c295885..6927b70 100644 > --- a/mmc.c > +++ b/mmc.c > @@ -66,8 +66,8 @@ static struct Command commands[] = { > NULL > }, > { do_write_boot_en, -3, > - "booten", " " " " "\n" > - "Enable the boot partition for the .", > + "bootpart enable", " " " " "\n" > + "Enable the boot partition for the .\nTo receive acknowledgment of boot from the card set \nto 1, else set it to 0.", > NULL > }, > { 0, 0, 0, 0 } > diff --git a/mmc_cmds.c b/mmc_cmds.c > index f588b17..2ab4185 100644 > --- a/mmc_cmds.c > +++ b/mmc_cmds.c > @@ -174,13 +174,18 @@ int do_write_boot_en(int nargs, char **argv) > __u8 value = 0; > int fd, ret; > char *device; > - int boot_area, ack; > + int boot_area, send_ack; > > - CHECK(nargs != 4, "Usage: mmc booten " > - " \n", exit(1)); > + CHECK(nargs != 4, "Usage: mmc bootpart enable " > + " \n", exit(1)); > > + /* > + * If is 1, the device will send acknowledgment > + * pattern "010" to the host when boot operation begins. > + * If is 0, it won't. > + */ > boot_area = strtol(argv[1], NULL, 10); > - ack = strtol(argv[2], NULL, 10); > + send_ack = strtol(argv[2], NULL, 10); > device = argv[3]; > > fd = open(device, O_RDWR); > @@ -214,7 +219,7 @@ int do_write_boot_en(int nargs, char **argv) > fprintf(stderr, "Cannot enable the boot area\n"); > exit(1); > } > - if (ack) > + if (send_ack) > value |= EXT_CSD_PART_CONFIG_ACC_ACK; > else > value &= ~EXT_CSD_PART_CONFIG_ACC_ACK; >