Re: [U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-10-16 Thread Jagan Teki
On 16 October 2015 at 19:20, Otavio Salvador wrote: > On Fri, Oct 16, 2015 at 10:40 AM, Fabio Estevam wrote: >> On Tue, Sep 29, 2015 at 10:54 AM, Jagan Teki wrote: >> Based on the implementation from Brian Norris for the Linux kernel: https://patchwork.ozlabs.org/patch/513041/ >>

Re: [U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-10-16 Thread Otavio Salvador
On Fri, Oct 16, 2015 at 10:40 AM, Fabio Estevam wrote: > On Tue, Sep 29, 2015 at 10:54 AM, Jagan Teki wrote: > >>> Based on the implementation from Brian Norris >>> for the Linux kernel: >>> https://patchwork.ozlabs.org/patch/513041/ >> >> This patch is still under review, will see how it moves.

Re: [U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-10-16 Thread Fabio Estevam
Hi Jagan, On Tue, Sep 29, 2015 at 10:54 AM, Jagan Teki wrote: >> Based on the implementation from Brian Norris >> for the Linux kernel: >> https://patchwork.ozlabs.org/patch/513041/ > > This patch is still under review, will see how it moves. Brian's patch is in linux-next now: https://git.ker

Re: [U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-09-30 Thread Fabio Estevam
On Tue, Sep 29, 2015 at 6:12 PM, Jagan Teki wrote: >> +#ifdef CONFIG_SPI_FLASH_STM_PROTECT > > Drop this vendor specific macro on command code (usually command code > deals generic-ness) Ok > >> +static int do_spi_protect(int argc, char * const argv[]) >> +{ >> + int start, len, ret = 0;

Re: [U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-09-29 Thread Jagan Teki
On 29 September 2015 at 17:37, Fabio Estevam wrote: > Many SPI flashes have protection bits (BP2, BP1 and BP0) in the > status register that can protect selected regions of the SPI NOR. > > Take these bits into account when performing erase operations, > making sure that the protected areas are sk

[U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-09-29 Thread Fabio Estevam
Many SPI flashes have protection bits (BP2, BP1 and BP0) in the status register that can protect selected regions of the SPI NOR. Take these bits into account when performing erase operations, making sure that the protected areas are skipped. Introduce the CONFIG_SPI_FLASH_STM_PROTECT option that

Re: [U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-09-29 Thread Fabio Estevam
On Tue, Sep 29, 2015 at 10:54 AM, Jagan Teki wrote: > What if sf erase 0x3f 0x2 - it should skip first 0x1 from > 0x3f and then erase next 0x1 from (0x3f+0x1) did you > verify this? On my case (M25P32) the 0x3f is the last sector (sector size is 0x1), so we ca

Re: [U-Boot] [PATCH v2 2/2] spi: Add SPI NOR protection mechanism

2015-09-29 Thread Jagan Teki
On 29 September 2015 at 17:37, Fabio Estevam wrote: > Many SPI flashes have protection bits (BP2, BP1 and BP0) in the > status register that can protect selected regions of the SPI NOR. > > Take these bits into account when performing erase operations, > making sure that the protected areas are sk