From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Fri, 30 Oct 2015 23:53:38 +0530 Subject: [U-Boot] [PATCH v4 16/16] spi: Add SPI NOR protection mechanism In-Reply-To: References: <1445875918-14777-1-git-send-email-fabio.estevam@freescale.com> <1445875918-14777-16-git-send-email-fabio.estevam@freescale.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Fabio, On 30 October 2015 at 22:21, Fabio Estevam wrote: > Hi Jagan, > > On Fri, Oct 30, 2015 at 2:28 PM, Jagan Teki wrote: > >>> +static int do_spi_protect(int argc, char * const argv[]) >>> +{ >>> + int ret = 0; >>> + loff_t start, len; >>> + bool prot = false; >>> + >>> + if (argc != 4) >>> + return -1; >>> + >>> + if (!str2off(argv[2], &start)) { >>> + puts("start sector is not a valid number\n"); >>> + return 1; >>> + } >>> + >>> + if (!str2off(argv[3], &len)) { >>> + puts("len is not a valid number\n"); >>> + return 1; >>> + } >>> + >>> + if (strcmp(argv[1], "lock") == 0) >>> + prot = true; >>> + else if (strcmp(argv[1], "unlock") == 0) >>> + prot = false; >>> + else >> >> Don't we have is_locked command from user? may be we can all this one as well. > > Sorry, I did not understand the suggestion here. > > Looks like you are happy with patches 1 to 15 of this series. > > Could you please apply patches 1 to 15 and then I rework only this last one? I will pick the entire series once, since 15/16 and 16/16 are same feature set. My questions with 16/16 is 1. We need to check the idcode as well because if we compile other flash vendor with micron, non micron flash got initialized with these lock ops' and also assign stm_* calls if the idcode is micro. > +#if defined(CONFIG_SPI_FLASH_STMICRO) > + flash->lock = spi_flash_cmd_lock_ops; > + flash->unlock = spi_flash_cmd_unlock_ops; > + flash->is_locked = spi_flash_cmd_is_locked_ops; > +#endif 2. Do the 1 for dm as well, probably in probe. 3. What about adding 'sf protect is_locked' since we have code already? thanks! -- Jagan | openedev.