public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7 21/21] sf: Add SPI NOR protection mechanism
Date: Tue, 10 Nov 2015 19:29:57 -0500	[thread overview]
Message-ID: <20151111002957.GI8060@bill-the-cat> (raw)
In-Reply-To: <CAPnjgZ1Ex5FQhtvhrqVLosSAiopK6N16mwa1CkhTdc_h2bhNyw@mail.gmail.com>

On Tue, Nov 10, 2015 at 04:09:52PM -0800, Simon Glass wrote:
> Hi Fabio,
> 
> On 6 November 2015 at 04:24, Tom Rini <trini@konsulko.com> wrote:
> > On Thu, Nov 05, 2015 at 12:43:42PM -0200, 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 skipped.
> >>
> >> Tested on a mx6qsabresd:
> >>
> >> => sf probe
> >> SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB
> >> => sf protect lock  0x3f0000 0x10000
> >> => sf erase 0x3f0000 0x10000
> >> offset 0x3f0000 is protected and cannot be erased
> >> SF: 65536 bytes @ 0x3f0000 Erased: ERROR
> >> => sf protect unlock  0x3f0000 0x10000
> >> => sf erase 0x3f0000 0x10000
> >> SF: 65536 bytes @ 0x3f0000 Erased: OK
> >>
> >> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> >> [re-worked to fit the lock common to dm and non-dm]
> >> Signed-off-by: Jagan Teki <jteki@openedev.com>
> >> Reviewed-by: Tom Rini <trini@konsulko.com>
> >> Reviewed-by: Heiko Schocher <hs@denx.de>
> >> Reviewed-by: Jagan Teki <jteki@openedev.com>
> >
> > Applied to u-boot/master, thanks!
> 
> This patch breaks chromebook_link - I think because it adds a new
> operation which is not supported by all flash chips. Those that are
> not supported (i.e that don't have the 'flash_is_locked' method)
> should still work.
> 
> Also I don't like the way this adds new operations to struct
> spi_flash. These should go in struct dm_spi_flash_ops for driver
> model, and be compatible with the driver-model way of doing things.
> 
> Can you please take a look?

I think it's a bit more complex, I thought we had covered the not
supported case.  I wonder if it's the same chip family and thus thought
to be, but not in this case, supported?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151110/b86d48f8/attachment.sig>

  reply	other threads:[~2015-11-11  0:29 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 14:43 [U-Boot] [PATCH v7 01/21] include: Add log2 header from the kernel Fabio Estevam
2015-11-05 14:43 ` [U-Boot] [PATCH v7 02/21] include: Add generic bitops headers Fabio Estevam
2015-11-06 12:22   ` Tom Rini
2015-12-01 17:26   ` York Sun
2015-12-01 20:01     ` Simon Glass
2015-11-05 14:43 ` [U-Boot] [PATCH v7 03/21] ARM: Use the " Fabio Estevam
2015-11-06 12:22   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 04/21] x86: " Fabio Estevam
2015-11-06 12:22   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 05/21] m68k: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 06/21] blackfin: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 07/21] sh: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 08/21] microblaze: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 09/21] sandbox: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 10/21] sparc: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 11/21] openrisc: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 12/21] nds32: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 13/21] nios2: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 14/21] mips: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 15/21] arc: " Fabio Estevam
2015-11-06 12:23   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 16/21] avr32: " Fabio Estevam
2015-11-06 12:24   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 17/21] bitops: Add fls_long and __ffs64 Fabio Estevam
2015-11-06 12:24   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 18/21] compat: Remove is_power_of_2() definition Fabio Estevam
2015-11-06 12:24   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 19/21] powerpc: Remove __ilog2_u64 and ffs4 from bitops Fabio Estevam
2015-11-06 12:24   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 20/21] sf: Add SPI protection mechanism from the kernel Fabio Estevam
2015-11-06 12:24   ` Tom Rini
2015-11-05 14:43 ` [U-Boot] [PATCH v7 21/21] sf: Add SPI NOR protection mechanism Fabio Estevam
2015-11-06 12:24   ` Tom Rini
2015-11-11  0:09     ` Simon Glass
2015-11-11  0:29       ` Tom Rini [this message]
2015-11-11  0:51       ` Fabio Estevam
2015-11-11  2:56         ` Simon Glass
2015-11-11  9:43           ` Fabio Estevam
2015-11-11 16:25             ` Jagan Teki
2015-11-13  9:20               ` Bin Meng
2015-11-11 14:04           ` Fabio Estevam
2015-11-13 10:41             ` Bin Meng
2015-11-16  1:34               ` Simon Glass
2015-11-16  1:58                 ` Tom Rini
2015-11-16 21:07                   ` Simon Glass
2015-11-17  6:43                     ` Jagan Teki
2015-11-16 20:57                 ` Fabio Estevam
2015-11-05 15:51 ` [U-Boot] [PATCH v7 01/21] include: Add log2 header from the kernel Tom Rini
2015-11-05 15:51   ` Fabio Estevam
2015-11-05 16:35     ` Tom Rini
2015-11-05 17:53       ` Fabio Estevam
2015-11-05 19:10         ` Tom Rini
2015-11-05 20:07           ` Fabio Estevam
2015-11-06  1:40             ` Tom Rini
2015-11-06 11:08               ` Fabio Estevam
2015-11-06 12:22 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151111002957.GI8060@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox